Scott McMurray
4abb455529
Update ty::VariantDef
to use IndexVec<FieldIdx, FieldDef>
...
And while doing the updates for that, also uses `FieldIdx` in `ProjectionKind::Field` and `TypeckResults::field_indices`.
There's more places that could use it (like `rustc_const_eval` and `LayoutS`), but I tried to keep this PR from exploding to *even more* places.
Part 2/? of https://github.com/rust-lang/compiler-team/issues/606
2023-03-30 09:23:40 -07:00
bors
9bdb4881c7
Auto merge of #109119 - lcnr:trait-system-cleanup, r=compiler-errors
...
a general type system cleanup
removes the helper functions `traits::fully_solve_X` as they add more complexity then they are worth. It's confusing which of these helpers should be used in which context.
changes the way we deal with overflow to always add depth in `evaluate_predicates_recursively`. It may make sense to actually fully transition to not have `recursion_depth` on obligations but that's probably a bit too much for this PR.
also removes some other small - and imo unnecessary - helpers.
r? types
2023-03-22 05:33:18 +00:00
Michael Goulet
2eb1c08e43
Use local key in providers
2023-03-21 15:38:51 +00:00
lcnr
791ce0b7b5
remove some trait solver helpers
...
they add more complexity then they are worth. It's confusing
which of these helpers should be used in which context.
2023-03-21 09:57:20 +01:00
lcnr
d2b7604db9
always make define_opaque_types
explicit
2023-03-15 14:00:15 +01:00
Michael Goulet
fd34549686
Remove body_def_id from Inherited
2023-03-09 23:25:23 +00:00
Michael Goulet
0f4255ece2
Dedup copy field errors for identical types
2023-03-08 00:00:19 +00:00
Michael Goulet
a439c0293c
may not => cannot
2023-03-08 00:00:18 +00:00
est31
6df5ae4fb0
Match unmatched backticks in comments in compiler/
2023-03-03 08:39:00 +01:00
Alan Egerton
695072daa6
Remove type-traversal trait aliases
2023-02-22 17:04:58 +00:00
Kyle Matsuda
c183110cc2
remove bound_type_of query; make type_of return EarlyBinder; change type_of in metadata
2023-02-16 17:05:56 -07:00
Kyle Matsuda
d822b97a27
change usages of type_of to bound_type_of
2023-02-16 17:01:52 -07:00
Camille GILLOT
40cb4d1bc7
Even less HIR.
2023-02-14 20:27:38 +00:00
Edward Shen
af5a37e844
Modify existing bounds if they exist
2023-02-06 11:26:36 -08:00
Matthias Krüger
4ac1796267
Rollup merge of #107125 - WaffleLapkin:expect_an_item_in_your_hir_by_the_next_morning, r=Nilstrieb
...
Add and use expect methods to hir.
[The future has come](https://github.com/rust-lang/rust/pull/106090/files#r1070062462 ).
r? `@Nilstrieb`
tbh I'm not even sure if it's worth it
2023-01-30 17:50:08 +01:00
Vincenzo Palazzo
7d2c1103d7
fix: use LocalDefId instead of HirId in trait res
...
use LocalDefId instead of HirId in trait resolution to simplify
the obligation clause resolution
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2023-01-23 11:42:18 +00:00
bors
94a300b9b8
Auto merge of #105102 - compiler-errors:copy-impl-considering-regions, r=lcnr
...
Check ADT fields for copy implementations considering regions
Fixes #88901
r? `@ghost`
2023-01-20 21:29:52 +00:00
Maybe Waffle
70f9d52079
Add and use expect methods to hir.
2023-01-20 17:40:50 +00:00
bors
56ee85274e
Auto merge of #106090 - WaffleLapkin:dereffffffffff, r=Nilstrieb
...
Remove some `ref` patterns from the compiler
Previous PR: https://github.com/rust-lang/rust/pull/105368
r? `@Nilstrieb`
2023-01-20 04:52:28 +00:00
Matthias Krüger
68f12338af
Rollup merge of #104505 - WaffleLapkin:no-double-spaces-in-comments, r=jackh726
...
Remove double spaces after dots in comments
Most of the comments do not have double spaces, so I assume these are typos.
2023-01-17 20:21:25 +01:00
Maybe Waffle
6a28fb42a8
Remove double spaces after dots in comments
2023-01-17 08:09:33 +00:00
Maybe Waffle
09485eaae1
rustc_hir_analysis
: remove ref
patterns
2023-01-17 07:48:19 +00:00
Maybe Waffle
d60e772e14
rustc_hir_analysis
: some general code improvements
2023-01-17 07:48:19 +00:00
Kyle Matsuda
f29a334c90
change impl_trait_ref query to return EarlyBinder; remove bound_impl_trait_ref query; add EarlyBinder to impl_trait_ref in metadata
2023-01-14 00:29:56 -07:00
Kyle Matsuda
be130b57d4
change usages of impl_trait_ref to bound_impl_trait_ref
2023-01-14 00:23:32 -07:00
Michael Goulet
16cfadbfe8
Suggest lifetime bound in illegal Copy impl
2023-01-13 23:06:29 +00:00
Michael Goulet
8cf7f40a89
Check ADT fields for copy implementations considering regions
2023-01-13 23:06:29 +00:00
Michael Goulet
c104ee9f6d
Move check_region_obligations_and_report_errors to TypeErrCtxt
2023-01-03 23:58:12 +00:00
Michael Goulet
8973b3e3cc
Bubble up ErrorGuaranteed from region constraints in method item compare
2022-12-24 21:37:00 +00:00
Jeremy Stucki
3dde32ca97
rustc: Remove needless lifetimes
2022-12-20 22:10:40 +01:00
Guillaume Gomez
a2e485c25c
Rollup merge of #104786 - WaffleLapkin:amp-mut-help, r=compiler-errors
...
Use the power of adding helper function to simplify code w/ `Mutability`
r? `@compiler-errors`
2022-11-26 17:47:23 +01:00
Santiago Pastorino
974e2837bb
Introduce PredicateKind::Clause
2022-11-25 00:04:54 -03:00
Maybe Waffle
9b9c7d0ecc
Depend on Mutability
ordering
2022-11-23 20:26:31 +00:00
Maybe Waffle
b80356a5ab
Use tcx.require_lang_item
instead of unwrapping
2022-11-22 17:19:19 +00:00
Oli Scherer
7658e0fccf
Stop passing the self-type as a separate argument.
2022-11-21 20:39:46 +00:00
Oli Scherer
9e4c3f41c1
Use iterators instead of slices at more sites
2022-11-21 20:34:28 +00:00
Michael Goulet
bc345d7bd0
Move fallback_has_occurred to FnCtxt
2022-11-06 02:40:25 +00:00
Cameron Steffen
283abbf0e7
Change InferCtxtBuilder from enter to build
2022-10-07 07:10:40 -05:00
Cameron Steffen
4a68373217
Introduce TypeErrCtxt
...
TypeErrCtxt optionally has a TypeckResults so that InferCtxt doesn't
need to.
2022-10-07 07:06:16 -05:00
lcnr
1fc86a63f4
rustc_typeck to rustc_hir_analysis
2022-09-27 10:37:23 +02:00