Commit Graph

261 Commits

Author SHA1 Message Date
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
Nicholas Nethercote
cef9004f5a Add specialized variants of mk_region.
Much like there are specialized variants of `mk_ty`. This will enable
some optimization in the next commit.

Also rename the existing `re_error*` functions as `mk_re_error*`, for
consistency.
2023-02-15 09:02:44 +11:00
Alan Egerton
63ad5d0522
Rename folder traits' tcx method to interner 2023-02-13 10:24:51 +00:00
Alan Egerton
9783fcc13b
Make folding traits generic over the Interner 2023-02-13 10:24:49 +00:00
Alan Egerton
dea342d861
Make visiting traits generic over the Interner 2023-02-13 10:24:49 +00:00
Alan Egerton
ba55a453eb
Alias folding/visiting traits instead of re-export 2023-02-13 10:24:46 +00:00
Nicholas Nethercote
7a72560154 Reduce direct mk_ty usage.
We use more specific `mk_*` functions in most places, might as well use
them as much as possible.
2023-02-13 09:32:48 +11:00
bors
1623ab0246 Auto merge of #107507 - BoxyUwU:deferred_projection_equality, r=lcnr
Implement `deferred_projection_equality` for erica solver

Somewhat of a revival of #96912. When relating projections now emit an `AliasEq` obligation instead of attempting to determine equality of projections that may not be as normalized as possible (i.e. because of lazy norm, or just containing inference variables that prevent us from resolving an impl). Only do this when the new solver is enabled
2023-02-11 05:46:24 +00:00
Boxy
23ab2464be add AliasEq to PredicateKind 2023-02-10 13:44:46 +00:00
bors
d1ac43a9b9 Auto merge of #107652 - estebank:re_error, r=oli-obk
Introduce `ReError`

CC #69314

r? `@nagisa`
2023-02-10 10:10:12 +00:00
Jack Huey
0637b6b471 Update implied_outlives_bounds to properly register implied bounds behind normalization 2023-02-09 21:08:11 -05:00
Jack Huey
1a663c0f53 Cleanup free_region_relations a bit 2023-02-09 20:38:27 -05:00
Esteban Küber
861f451235 Change to ReError(ErrorGuaranteed) 2023-02-09 10:26:49 +00:00
Esteban Küber
30cf7a3f51 Introduce ReError
CC #69314
2023-02-09 10:26:49 +00:00
klensy
4f5f9f0a13 remove unused imports 2023-02-06 17:40:18 +03:00
Michael Goulet
0e98a162c8 Track bound types like bound regions 2023-01-30 22:18:20 +00:00
bors
d117135f5a Auto merge of #106253 - nbdd0121:upcast, r=compiler-errors
Skip possible where_clause_object_safety lints when checking `multiple_supertrait_upcastable`

Fix #106247

To achieve this, I lifted the `WhereClauseReferencesSelf` out from `object_safety_violations` and move it into `is_object_safe` (which is changed to a new query).

cc `@dtolnay`
r? `@compiler-errors`
2023-01-29 10:20:25 +00:00
bors
1e225413a2 Auto merge of #107303 - compiler-errors:intern-canonical-var-values, r=lcnr
Intern `CanonicalVarValues`

So that they are copy 
2023-01-28 19:41:21 +00:00
Gary Guo
94e59cb6e2 Rename is_object_safe to check_is_object_safe to hint side effects 2023-01-28 15:07:57 +00:00
Camille GILLOT
1974b6b68d Introduce GeneratorWitnessMIR. 2023-01-27 18:58:44 +00:00
Camille GILLOT
cb873b2d93 Separate trait selection from ambiguity reporting. 2023-01-27 18:57:10 +00:00
Kyle Matsuda
c2414dfaa4 change fn_sig query to use EarlyBinder; remove bound_fn_sig query; add EarlyBinder to fn_sig in metadata 2023-01-26 20:28:25 -07:00
Michael Goulet
4ff674f942 Intern CanonicalVarValues 2023-01-26 20:33:40 +00: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
Ali MJ Al-Nasrawy
a7a842027c even more unify Projection/Opaque in outlives code 2023-01-19 15:31:53 +03: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
Matthias Krüger
6b49435480
Rollup merge of #106829 - compiler-errors:more-alias-combine, r=spastorino
Unify `Opaque`/`Projection` handling in region outlives code

They share basically identical paths in most places which are even easier to unify now that they're both `ty::Alias`

r? types
2023-01-17 05:25:22 +01:00
Michael Goulet
90df86f474 Remove bound_{explicit,}_item_bounds 2023-01-15 15:36:06 +00:00
Michael Goulet
9b28edb6d7 Make InstantiatedPredicates impl IntoIterator 2023-01-15 15:36:06 +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
1ea6862db3 Unify Opaque/Projection handling in region outlives code 2023-01-13 23:53:28 +00:00
Yuki Okushi
e5e116dca9
Rollup merge of #106204 - compiler-errors:no-take-opaques-in-compare, r=oli-obk
No need to take opaques in `check_type_bounds`

`InferCtxt` already has its defining use anchor set to err

r? ``@oli-obk``
2023-01-10 08:05:34 +09:00
Michael Goulet
f769d34291 Assert defining anchor is set in take_opaque_types 2023-01-09 18:14:28 +00:00
Ali MJ Al-Nasrawy
c6a17bf8bc make ascribe_user_type a TypeOp
Projection types in user annotations may contain inference variables.
This makes the normalization depend on the unification with the actual
type and thus requires a separate TypeOp to track the obligations.
Otherwise simply calling `TypeChecker::normalize` would ICE with
"unexpected ambiguity"
2023-01-07 13:41:41 +03:00
Ali MJ Al-Nasrawy
d227506683 don't normalize in astconv
We delay projection normalization to further stages in order to
register user type annotations before normalization in HIR typeck.

There are two consumers of astconv: ItemCtxt and FnCtxt.
The former already expects unnormalized types from astconv, see its
AstConv trait impl.
The latter needs `RawTy` for a cleaner interface.

Unfortunately astconv still needs the normalization machinery in
order to resolve enum variants that have projections in the self type,
e.g. `<<T as Trait>::Assoc>::StructVariant {}`.
This is why `AstConv::normalize_ty_2` is necessary.
2023-01-07 13:38:38 +03:00
nils
fd7a159710 Fix uninlined_format_args for some compiler crates
Convert all the crates that have had their diagnostic migration
completed (except save_analysis because that will be deleted soon and
apfloat because of the licensing problem).
2023-01-05 19:01:12 +01:00
Jeremy Stucki
3dde32ca97
rustc: Remove needless lifetimes 2022-12-20 22:10:40 +01:00
Oli Scherer
a5cd3bde95 Ensure no one constructs AliasTys themselves 2022-12-14 15:36:39 +00:00
Michael Goulet
7196973c3e Remove chalk lowering for AliasTy 2022-12-13 17:48:55 +00:00
Michael Goulet
96cb18e864 Combine identical alias arms 2022-12-13 17:48:55 +00:00
Michael Goulet
61adaf8187 Combine projection and opaque into alias 2022-12-13 17:48:55 +00:00
Michael Goulet
c13bd83528 squash OpaqueTy and ProjectionTy into AliasTy 2022-12-13 17:40:27 +00:00
Michael Goulet
5c6afb850c ProjectionTy.item_def_id -> ProjectionTy.def_id 2022-12-13 17:34:44 +00:00
Michael Goulet
7f3af72606 Use ty::OpaqueTy everywhere 2022-12-13 17:29:26 +00:00
Michael Goulet
3b9daac6a2 Move some suggestions from error_reporting to error_reporting::suggest 2022-12-08 05:58:30 +00:00
Michael Goulet
25a6daccab Move codegen_select_candidate to a rustc_traits 2022-12-08 05:16:57 +00:00
Michael Goulet
1e236acd05 Make ObligationCtxt::normalize take cause by borrow 2022-11-28 17:35:40 +00:00