Michael Goulet
56f5704ff8
Implement lint against coinductive impl overlap
2023-08-15 03:40:19 +00:00
bors
7455aa5395
Auto merge of #114457 - lcnr:trait_ref_is_knowable-normalize, r=compiler-errors
...
normalize in `trait_ref_is_knowable` in new solver
fixes https://github.com/rust-lang/trait-system-refactor-initiative/issues/51
Alternatively we could avoid normalizing the self type and do this at the end of the `assemble_candidates_via_self_ty` stack by splitting candidates into:
- applicable without normalizing self type
- applicable for aliases, even if they can be normalized
- applicable for stuff which cannot get normalized further
I don't think this would have any significant benefits and it also seems non-trivial to avoid normalizing only the self type in `trait_ref_is_knowable`.
r? `@compiler-errors`
2023-08-13 05:18:27 +00:00
lcnr
9eeaf1fd13
normalize in trait_ref_is_knowable
in new solver
2023-08-12 20:37:53 +02:00
lcnr
bb76fde734
remove builtin impl for float and int infer
2023-08-11 19:08:11 +02:00
Michael Goulet
540afe202f
Comment nits
2023-08-10 23:22:03 +00:00
Michael Goulet
7c942ccb0c
Don't be incomplete
2023-08-03 18:21:11 +00:00
Deadbeef
4fec845c3f
Remove constness from TraitPredicate
2023-08-02 15:38:00 +00:00
Nilstrieb
46f6b05eb7
Rollup merge of #114079 - compiler-errors:closure-upvars, r=oli-obk
...
Use `upvar_tys` in more places, make it return a list
Just a cleanup that fell out of a PR that I was gonna write, but that PR kinda got stuck.
2023-08-02 13:46:54 +02:00
Michael Goulet
99969d282b
Use upvar_tys in more places, make it a list
2023-08-01 23:19:31 +00:00
Michael Goulet
8696fa71b3
Convert adt_sized_constraint to early-binder, use list
2023-08-01 23:10:38 +00:00
Matthias Krüger
3ce90b1649
inline format!() args up to and including rustc_codegen_llvm
2023-07-30 14:22:50 +02:00
bors
e4c98caffe
Auto merge of #113312 - Ddystopia:auto-trait-fun, r=lcnr
...
discard default auto trait impls if explicit ones exist (rebase of #85048 )
Rebase of #85048
2023-07-28 10:41:00 +00:00
bors
aafd75a9c5
Auto merge of #114134 - fee1-dead-contrib:rm-constness-from-param-env, r=oli-obk
...
Remove `constness` from `ParamEnv`
This should be replaced by keyword generics/effects. cc #110395
r? `@oli-obk`
2023-07-28 08:53:12 +00:00
Deadbeef
e6b423aebb
Remove constness
from ParamEnv
2023-07-27 15:50:42 +00:00
Michael Goulet
808e174dfc
Don't treat negative trait predicates as always knowable
2023-07-26 01:35:51 +00:00
Michael Goulet
05f6890b3e
Rename arg_iter to iter_instantiated
2023-07-17 21:04:12 +00:00
Mahdi Dibaiee
e55583c4b8
refactor(rustc_middle): Substs -> GenericArg
2023-07-14 13:27:35 +01:00
Michael Goulet
52f7384995
Separate select calls that don't need a binder
2023-07-06 16:50:12 +00:00
Michael Goulet
36453456cb
TraitObligation -> PolyTraitObligation
2023-07-06 16:30:11 +00:00
lcnr
3adedc93a9
update auto trait handling
2023-07-06 11:37:19 +02:00
Boxy
12138b8e5e
Move TyCtxt::mk_x
to Ty::new_x
where applicable
2023-07-05 20:27:07 +01:00
Michael Goulet
b2b1a50751
Rollup merge of #113321 - BoxyUwU:move_constkind_to_typeir, r=oli-obk
...
Move `ty::ConstKind` to `rustc_type_ir`
Needed this in another PR for custom debug impls, and this will also be required to move the new solver into a separate crate that does not use `TyCtxt` so that r-a and friends can depend on the trait solver.
Rebased on top of #113325 , only the second and third commits needs reviewing
2023-07-05 08:45:45 -07:00
Michael Goulet
0334b64cbb
Rollup merge of #113320 - oli-obk:eval_obligation_query, r=petrochenkov,BoxyUwU
...
Add some extra information to opaque type cycle errors
Plus a bunch of cleanups.
This should help users debug query cycles due to auto trait checking. We'll probably want to fix cycle errors in most (or all?) cases by looking at the current item's hidden types (new solver does this), and by delaying the auto trait checks to after typeck.
2023-07-05 08:45:44 -07:00
Michael Goulet
a1f8edb5d5
Rollup merge of #113317 - lcnr:sketchy-new-select, r=oli-obk
...
-Ztrait-solver=next: stop depending on old solver
removes the final dependencies on the old solver when `-Ztrait-solver=next` is enabled.
2023-07-05 08:45:43 -07:00
Boxy
62174bfe72
Deal with fallout
2023-07-05 09:46:30 +01:00
Oli Scherer
9e98feb84c
Add some extra information to opaque type cycle errors
2023-07-05 07:43:35 +00:00
lcnr
b468bfb361
-Ztrait-solver=next: stop depending on old solver
2023-07-04 10:06:39 +02:00
Michael Goulet
0c73b41cd6
remove TypeWellFormedFromEnv
2023-07-03 21:40:04 +00:00
Michael Goulet
298c0d1a62
Implement selection in new trait solver
2023-07-03 15:53:27 +00:00
bors
7383ab7378
Auto merge of #113154 - lcnr:better-probe-check, r=compiler-errors
...
change snapshot tracking in fulfillment contexts
use the exact snapshot number to prevent misuse even when created inside of a snapshot
2023-07-01 01:53:10 +00:00
lcnr
d04775d739
change snapshot tracking in fulfillment contexts
2023-06-29 10:02:26 +02:00
Michael Goulet
374173cd99
TypeWellFormedInEnv
2023-06-26 23:12:04 +00:00
Michael Goulet
fbdef58414
Migrate predicates_of and caller_bounds to Clause
2023-06-26 23:12:03 +00:00
Michael Goulet
46a650f4e0
Migrate item_bounds to ty::Clause
2023-06-22 18:34:23 +00:00
Michael Goulet
fca56a8d2c
s/Clause/ClauseKind
2023-06-19 14:57:42 +00:00
Michael Goulet
6594c75449
Move ConstEvaluatable to Clause
2023-06-17 21:27:13 +00:00
Michael Goulet
52d3fc93f2
Move WF goal to clause
2023-06-17 21:20:20 +00:00
Oli Scherer
f3b7dd6388
Add AliasKind::Weak
for type aliases.
...
Only use it when the type alias contains an opaque type.
Also does wf-checking on such type aliases.
2023-06-16 19:39:48 +00:00
bohan
b7921981d5
fix: inline predicate_may_hold_fatal
2023-06-16 11:09:53 +08:00
Michael Goulet
9e210522bc
Improve docs/clean up negative overlap functions
2023-06-14 02:18:30 +00:00
Michael Goulet
e0acff796a
New trait solver is a property of inference context
2023-06-06 18:43:06 +00:00
lcnr
a0245bb3cb
rework the leak_check to take the outer_universe
...
clean up coherence to not rely on probes anymore
2023-05-30 13:03:38 +02:00
lcnr
200ed9f8cd
leak_check: remove unused codepath
2023-05-30 12:40:35 +02:00
Maybe Waffle
e33e20824f
Rename tcx.mk_re_*
=> Region::new_*
2023-05-29 17:54:53 +00:00
Kyle Matsuda
c40e9cc7ca
Make EarlyBinder's inner value private; and fix all of the resulting errors
2023-05-28 10:44:53 -06:00
Maybe Waffle
fb0f74a8c9
Use Option::is_some_and
and Result::is_ok_and
in the compiler
2023-05-24 14:20:41 +00:00
bors
19ca5692f6
Auto merge of #110100 - compiler-errors:no-infer-pred-must-hold, r=jackh726
...
do not allow inference in `predicate_must_hold` (alternative approach)
See the FCP description for more info, but tl;dr is that we should not return `EvaluatedToOkModuloRegions` if an obligation may hold only with some choice of inference vars being constrained.
Attempts to solve this in the approach laid out by lcnr here: https://github.com/rust-lang/rust/pull/109558#discussion_r1147318134 , rather than by eagerly replacing infer vars with placeholders which is a bit too restrictive.
r? `@ghost`
2023-05-19 03:36:37 +00:00
León Orell Valerian Liehr
434f08884e
Exclude inherent projections from some alias ty matches
2023-05-17 23:53:58 +02:00
Michael Goulet
c06e61151c
do not allow inference in pred_known_to_hold_modulo_regions
2023-05-12 18:47:45 +00:00
Michael Goulet
dbbb42442c
EvaluateToAmbig if evaluate_root_obligation does inference
2023-05-12 18:40:28 +00:00