Commit Graph

22 Commits

Author SHA1 Message Date
Michael Goulet
14bf909e71 Note base types of coercion 2023-05-12 00:10:52 +00:00
Michael Goulet
9d44f9b4e2 Add test for #110557 2023-05-04 18:06:07 +00:00
Michael Goulet
5eb0528483 Erase lifetimes above ty::INNERMOST when probing ambiguous types 2023-04-11 17:17:32 +00:00
Matthias Krüger
4e165c1c99
Rollup merge of #108843 - compiler-errors:non_lifetime_binders-method-probe, r=jackh726
Instantiate instead of erasing binder when probing param methods

Fixes #108836

There is a really old comment saying that a `WhereClauseCandidate` probe candidate "should not contain any inference variables", but I'm not really confident that that comment applies anymore. In contrast, other candidates that we assemble during method probe contain inference variables in their substitutions (e.g. `InherentImplCandidate`)...

Since this change is made only to support a nightly feature, I'm happy to gate the new behavior behind this feature flag or discuss it further.

r? types
2023-04-09 23:40:03 +02:00
Michael Goulet
720cc40fa7 Enforce non-lifetime-binders in supertrait preds are not object safe 2023-03-20 22:38:57 +00:00
Michael Goulet
79ad7cca45 Erase escaping late-bound regions when probing for ambiguous associated types 2023-03-17 15:33:24 +00:00
Michael Goulet
8a53570008 Don't ICE for late-bound consts across AnonConstBoundary 2023-03-13 22:38:37 +00:00
Michael Goulet
b7a5f3a41c Instantiate instead of erasing binder when probing param methods 2023-03-07 05:41:08 +00:00
Matthias Krüger
ec162703dc
Rollup merge of #108744 - compiler-errors:non_lifetime_binders-bad-copy-clone, r=jackh726
Don't ICE when encountering bound var in builtin copy/clone bounds

Fixes #108742
2023-03-05 14:29:10 +01:00
Michael Goulet
32f1f01499 Don't ICE when encountering bound var in builtin copy/clone bounds 2023-03-04 17:53:51 +00:00
Matthias Krüger
44e794f8ab
Rollup merge of #108553 - compiler-errors:non-lt-late-bound-in-anon-ct, r=petrochenkov
Deny capturing late-bound non-lifetime param in anon const

Introduce a new AnonConstBoundary so we can detect when we capture a late-bound non-lifetime param with `non_lifetime_binders` enabled.

In the future, we could technically do something like introduce an early-bound parameter on the anon const, and stick the late-bound param in its substs (kinda like how we turn late-bound lifetimes in opaques into early-bound ones). But for now, just deny it so we don't ICE.

Fixes #108191
2023-03-03 20:06:27 +01:00
Michael Goulet
f851a8aefa Only look for param in generics if it actually comes from generics 2023-02-28 06:27:56 +00:00
Michael Goulet
cbf4d4e3a5 Deny capturing late-bound non-lifetime param in anon const 2023-02-28 05:59:54 +00:00
Matthias Krüger
ae01430078
Rollup merge of #108295 - compiler-errors:wtf-is-this, r=cjgillot
Use DefKind to give more item kind information during BindingObligation note

The current label says "required by a bound in this". When I see that label, my immediate impression is "this... **what**?". It feels like it was cut short.

Alternative to this would be saying "in this item", but adding the item kind is strictly more informational and adds very little overhead to the existing error presentation.
2023-02-21 23:02:00 +01:00
Matthias Krüger
8a5843f07f
Rollup merge of #108202 - compiler-errors:non_lifetime_binders-type-match-ice, r=davidtwco
Make sure `test_type_match` doesn't ICE with late-bound types

Fixes #108190 (in a kind of hacky way, anyways doesn't really matter)
2023-02-21 23:01:59 +01:00
Michael Goulet
a58682d7cc Specify what 'this' actually is 2023-02-21 05:21:07 +00:00
Michael Goulet
c13d5f1aeb Make sure test_type_match doesn't ICE with late-bound types 2023-02-18 20:16:51 +00:00
Michael Goulet
6f3706ea71 Pretty placeholders using their names 2023-02-18 19:49:40 +00:00
Michael Goulet
ec40b1a393 Collapse placeholders to root universe in canonicalizer if not preserving universes 2023-02-18 19:49:40 +00:00
Michael Goulet
f4a4a31479 Don't ICE on bound types in sized conditions 2023-02-18 19:49:40 +00:00
Michael Goulet
fded2e95ab Adjust tracking issue for non_lifetime_binders 2023-02-18 02:42:43 +00:00
Michael Goulet
95f35fe443 Deny some late-bound ty/ct in some positions, add tests 2023-02-16 03:39:59 +00:00