Camille GILLOT
caefec955f
Do not abort compilation when failing to normalize opaque types.
2023-01-27 18:55:58 +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
Scott McMurray
925dc37313
Stop using BREAK
& CONTINUE
in compiler
...
Switching them to `Break(())` and `Continue(())` instead.
libs-api would like to remove these constants, so stop using them in compiler to make the removal PR later smaller.
2023-01-17 23:17:51 -08:00
Maybe Waffle
8d3c90ae13
Review suggestions
2023-01-17 07:48:20 +00:00
Maybe Waffle
360e978437
Don't call closures immediately, use try{}
blocks
2023-01-17 07:48:19 +00:00
Michael Goulet
50ab306015
Simplify some canonical type alias names
2023-01-03 01:16:10 +00:00
Oli Scherer
a5cd3bde95
Ensure no one constructs AliasTy
s themselves
2022-12-14 15:36:39 +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
7f3af72606
Use ty::OpaqueTy everywhere
2022-12-13 17:29:26 +00:00
Michael Goulet
d2a80c1571
Avoid noting cause code (which is usually misc, b/c codegen) for opaque type reveal overflow
2022-12-06 00:19:55 +00:00
Michael Goulet
02b64c5d26
Document normalization methods on At
2022-12-01 19:00:09 +00:00
Michael Goulet
fc710832ea
partially_normalize_... -> At::normalize
2022-11-28 17:35:39 +00:00
Michael Goulet
f12e772b83
Rename At::normalize to At::query_normalize
2022-11-28 17:32:35 +00:00
Santiago Pastorino
974e2837bb
Introduce PredicateKind::Clause
2022-11-25 00:04:54 -03:00
Santiago Pastorino
66b4b8b907
with_query_mode -> new
2022-11-24 09:36:17 -03:00
Michael Goulet
b8a92c1dd6
Revert "Normalize opaques with escaping bound vars"
...
This reverts commit 43119d6438
.
2022-11-18 17:40:14 +00:00
Oli Scherer
4f11f3b257
Convert predicates into Predicate in the Obligation constructor
2022-11-16 09:25:19 +00:00
Michael Goulet
152646f23f
Don't normalize constants unless they need normalization
2022-11-07 00:30:56 +00:00
Michael Goulet
9f6b9dd644
Delay ambiguity span bug in normalize query iff not rustdoc
2022-10-21 18:53:16 +00:00
lcnr
e8150fa60c
mir constants: type traversing bye bye
2022-10-17 10:54:01 +02:00
Cameron Steffen
349415d1c6
Remove TypeckResults from InferCtxt
2022-10-07 07:06:19 -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
Matthias Krüger
3a8bad98d7
Rollup merge of #102137 - b-naber:lazy-const-val-conversion, r=lcnr
...
Don't convert valtree to constvalue during normalization
r? ``@lcnr``
2022-09-23 15:40:22 +02:00
b-naber
a9e657dbfc
don't convert valtree to constvalue during normalization
2022-09-22 14:46:14 +02:00
Michael Goulet
43119d6438
Normalize opaques with escaping bound vars
2022-09-22 02:17:39 +00:00
lcnr
647052fc04
remove the Subst
trait, always use EarlyBinder
2022-09-19 11:37:27 +02:00
bors
efa717bc2d
Auto merge of #101924 - jackh726:revert-static-hrtb-error, r=compiler-errors
...
Re-add HRTB implied static bug note
r? `@compiler-errors` since you reviewed it previously
I deleted a `normalize` call and forgot about it. Whoops.
2022-09-19 04:56:14 +00:00
Jack Huey
e7ca6e1b47
Use Predicate ConstraintCategory when normalizing
2022-09-17 11:46:05 -04:00
Jack Huey
e09242d5b8
Final bits
2022-09-16 17:47:53 -04:00
Jack Huey
92b759f517
Revert "Better errors for implied static bound"
...
This reverts commit c75817b0a7
.
2022-09-16 09:47:07 -04:00
Jack Huey
bba514b7b4
Revert "Use Predicate ConstraintCategory when normalizing"
...
This reverts commit aae37f8763
.
2022-09-16 09:01:28 -04:00
Jack Huey
aae37f8763
Use Predicate ConstraintCategory when normalizing
2022-09-13 20:18:49 -04:00
Jack Huey
c75817b0a7
Better errors for implied static bound
2022-09-13 20:18:04 -04:00
b-naber
a4bbb8db5c
use ty::Unevaluated<'tcx, ()> in type system
2022-09-13 17:40:59 +02:00
lcnr
d15b00af48
don't evaluate with escaping bound vars
2022-09-08 11:41:00 +02:00
bors
aeb5067967
Auto merge of #100315 - compiler-errors:norm-ct-in-proj, r=lcnr
...
Keep going if normalized projection has unevaluated consts in `QueryNormalizer`
#100312 was the wrong approach, I think this is the right one.
When normalizing a type, if we see that it's a projection, we currently defer to `tcx.normalize_projection_ty`, which normalizes the projections away but doesn't touch the unevaluated constants. So now we just continue to fold the type if it has unevaluated constants so we make sure to evaluate those too, if we can.
Fixes #100217
Fixes #83972
Fixes #84669
Fixes #86710
Fixes #82268
Fixes #73298
2022-08-11 10:47:48 +00:00
Michael Goulet
d2667e4b71
Move folding into just projection cases
2022-08-09 18:19:58 +00:00
lcnr
f25cb83296
don't normalize wf predicates
...
this allows us to soundly use unnormalized projections for wf
2022-08-09 12:54:32 +02:00
Michael Goulet
ca7e3c4a83
Keep going if normalized projection has unevaluated consts in QueryNormalizer
2022-08-09 09:41:28 +00:00
Michael Goulet
fe894756f8
Add traits::fully_solve_obligation
that acts like traits::fully_normalize
...
It spawns up a trait engine, registers the single obligation, then fully
solves it
2022-08-04 13:50:56 +00:00
bors
880416180b
Auto merge of #99181 - lcnr:arenaGTrc, r=wesleywiser
...
`arena > Rc` for query results
The `Rc`s have to live for the whole duration as their count cannot go below 1 while stored as part of the query results.
By storing them in an arena we should save a bit of memory because we don't have as many independent allocations and also don't have to clone the `Rc` anymore.
2022-07-18 05:50:54 +00:00
lcnr
7808f69ad7
QueryNormalizer
bug on ambiguity
2022-07-15 16:40:39 +02:00
Michael Goulet
78efaf43e4
remove tcx from ObligationCauseCode::span
2022-07-15 03:17:20 +00:00
lcnr
0fc5296876
remove outdated comment
2022-07-12 15:29:32 +02:00
lcnr
baefd42861
arena > Rc for query results
2022-07-12 15:27:24 +02:00
Alan Egerton
4f0a64736b
Update TypeVisitor paths
2022-07-06 06:41:53 +01:00
Alan Egerton
e9e5d0685b
Relax constrained generics to TypeVisitable
2022-07-05 22:25:43 +01:00
Alan Egerton
e4b9625b87
Add #[derive(TypeVisitable)]
2022-07-05 22:25:15 +01:00