rust/tests/ui/traits
Matthias Krüger 44db7c3b5a
Rollup merge of #110180 - lcnr:canonicalize, r=compiler-errors
don't uniquify regions when canonicalizing

uniquifying causes a bunch of issues, most notably it causes `AliasEq(<?x as Trait<'a>>::Assoc, <?x as Trait<'a>>::Assoc)` to result in ambiguity because both `normalizes-to` paths result in ambiguity and substs equate should trivially succeed but doesn't because we uniquified `'a` to two different regions.

I originally added uniquification to make it easier to deal with requirement 6 from the dev-guide: https://rustc-dev-guide.rust-lang.org/solve/trait-solving.html#requirements

> ### 6. Trait solving must be (free) lifetime agnostic
>
> Trait solving during codegen should have the same result as during typeck. As we erase
> all free regions during codegen we must not rely on them during typeck. A noteworthy example
> is special behavior for `'static`.

cc https://github.com/rust-lang/rustc-dev-guide/pull/1671

Relying on regions being identical may cause ICE during MIR typeck, but even without this PR we can end up relying on that as type inference vars can resolve to types which contain an identical region. Let's land this and deal with any ICE that crop up as we go. Will look at this issue again before stabilization.

r? ```@compiler-errors```
2023-04-14 07:58:40 +02:00
..
alias Allow the elaborator to only filter to real supertraits 2023-04-11 17:45:42 +00:00
associated_type_bound Use smart-resolve when checking for trait in RHS of UFCS 2023-04-07 05:33:52 +00:00
auxiliary
bound Only point at impl self ty in WF if trait predicate shares self ty 2023-01-12 22:25:30 +00:00
default-method
inductive-overflow Tweak output for 'add line' suggestion 2023-04-12 22:50:10 +00:00
inheritance
negative-impls Fetch less HIR in signature check. 2023-02-14 20:26:03 +00:00
new-solver Rollup merge of #110180 - lcnr:canonicalize, r=compiler-errors 2023-04-14 07:58:40 +02:00
non_lifetime_binders Erase lifetimes above ty::INNERMOST when probing ambiguous types 2023-04-11 17:17:32 +00:00
object diagnostics: remove inconsistent English article "this" from E0107 2023-02-23 10:27:06 -07:00
reservation-impl new solver cleanup + coherence 2023-03-21 16:27:25 +01:00
solver-cycles
suggest-deferences Refine error span for trait error into borrowed expression 2023-02-19 21:27:04 -08:00
trait-upcasting Allow the elaborator to only filter to real supertraits 2023-04-11 17:45:42 +00:00
vtable Tweak E0597 2023-01-15 19:46:20 +00:00
wf-object
alignment-gep-tup-like-1.rs
anon_trait_static_method_exe.rs
anon-static-method.rs
as-struct-constructor.rs
as-struct-constructor.stderr
assignability-trait.rs
assoc-type-in-superbad.rs
assoc-type-in-superbad.stderr
assoc-type-in-supertrait.rs
astconv-cycle-between-and-type.rs
augmented-assignments-trait.rs
bad-method-typaram-kind.rs
bad-method-typaram-kind.stderr
bad-sized.rs
bad-sized.stderr
bug-7183-generics.rs
bug-7295.rs
cache-issue-18209.rs
cache-reached-depth-ice.rs
cache-reached-depth-ice.stderr
coercion-generic-bad.rs
coercion-generic-bad.stderr
coercion-generic-regions.rs
coercion-generic-regions.stderr Tweak E0597 2023-01-15 19:46:20 +00:00
coercion-generic.rs
coercion.rs
composition-trivial.rs
conditional-dispatch.rs
conditional-model-fn.rs
conservative_impl_trait.rs
copy-guessing.rs
copy-impl-cannot-normalize.rs
copy-impl-cannot-normalize.stderr Delay normalization bugs instead of reporting them 2023-01-13 23:19:36 +00:00
copy-is-not-modulo-regions.not_static.stderr may not => cannot 2023-03-08 00:00:18 +00:00
copy-is-not-modulo-regions.rs may not => cannot 2023-03-08 00:00:18 +00:00
copy-requires-self-wf.rs Rebase and move UI tests 2023-01-13 23:06:29 +00:00
cycle-cache-err-60010.rs
cycle-cache-err-60010.stderr evaluate: improve and fix recursion depth handling 2023-03-21 09:57:22 +01:00
cycle-generic-bound.rs
cycle-type-trait.rs
do-not-mention-type-params-by-name-in-suggestion-issue-96292.rs
do-not-mention-type-params-by-name-in-suggestion-issue-96292.stderr
duplicate-methods.rs
duplicate-methods.stderr
dyn-trait.rs remove invalid ignore-pretty 2023-04-03 09:24:11 +02:00
early-vtbl-resolution.rs
elaborate-type-region.rs
false-ambiguity-where-clause-builtin-bound.rs
fmt-pointer-trait.rs
fn-trait-cast-diagnostic.rs Add note when FnPtr vs. FnDef impl trait 2023-01-14 10:37:56 +00:00
fn-trait-cast-diagnostic.stderr Add note when FnPtr vs. FnDef impl trait 2023-01-14 10:37:56 +00:00
generic.rs
ignore-err-impls.rs Filter impl and where-clause candidates that reference errors 2023-01-11 20:03:29 +00:00
ignore-err-impls.stderr Render missing generics suggestion verbosely 2023-01-12 22:04:30 +00:00
impl_trait_as_trait_return_position.rs
impl-1.rs
impl-1.stderr
impl-2.rs
impl-bounds-checking.rs
impl-bounds-checking.stderr Point at impl self type for impl wf obligations 2023-01-12 20:44:47 +00:00
impl-can-not-have-untraitful-items.rs
impl-can-not-have-untraitful-items.stderr
impl-different-num-params.rs
impl-different-num-params.stderr
impl-evaluation-order.rs
impl-for-module.rs
impl-for-module.stderr
impl-implicit-trait.rs
impl-inherent-prefer-over-trait.rs
impl-method-mismatch.rs
impl-method-mismatch.stderr
impl-object-overlap-issue-23853.rs
impl-of-supertrait-has-wrong-lifetime-parameters.rs
impl-of-supertrait-has-wrong-lifetime-parameters.stderr Point at impl self type for impl wf obligations 2023-01-12 20:44:47 +00:00
impl.rs
infer-from-object-issue-26952.rs
inherent-method-order.rs
invalid_operator_trait.rs
invalid_operator_trait.stderr
issue-3683.rs
issue-3973.rs
issue-3973.stderr
issue-4107.rs
issue-6128.rs
issue-6334.rs
issue-7013.rs
issue-7013.stderr
issue-8153.rs
issue-8153.stderr
issue-9394-inherited-calls.rs
issue-18400.rs
issue-18400.stderr
issue-18412.rs
issue-20692.rs
issue-20692.stderr
issue-22019.rs
issue-22110.rs
issue-22655.rs
issue-23003-overflow.rs
issue-23003.rs
issue-23825.rs
issue-24010.rs
issue-26339.rs
issue-28576.rs
issue-28576.stderr
issue-32963.rs
issue-32963.stderr
issue-33140-hack-boundaries.rs
issue-33140-hack-boundaries.stderr
issue-33140.rs
issue-33140.stderr
issue-35869.rs
issue-35869.stderr
issue-38033.rs
issue-38404.rs
issue-38404.stderr
issue-38604.rs
issue-38604.stderr
issue-43132.rs
issue-43784-supertrait.rs
issue-43784-supertrait.stderr Keep obligation chain when elaborating obligations 2023-01-13 18:20:23 +00:00
issue-50480.rs may not => cannot 2023-03-08 00:00:18 +00:00
issue-50480.stderr may not => cannot 2023-03-08 00:00:18 +00:00
issue-52893.rs
issue-52893.stderr diagnostics: update test cases to refer to assoc fn with self as method 2023-02-22 08:40:47 -07:00
issue-56202.rs
issue-56488.rs
issue-59029-1.rs
issue-59029-1.stderr
issue-59029-2.rs
issue-65284-suggest-generic-trait-bound.rs
issue-65284-suggest-generic-trait-bound.stderr
issue-65673.rs
issue-65673.stderr
issue-68295.rs
issue-68295.stderr Modify primary span label for E0308 2023-01-30 20:12:19 +00:00
issue-70944.rs
issue-71036.rs
issue-71036.stderr
issue-71136.rs
issue-71136.stderr Tweak output for 'add line' suggestion 2023-04-12 22:50:10 +00:00
issue-72410.rs
issue-72410.stderr
issue-72455.rs
issue-75627.rs
issue-75627.stderr Render missing generics suggestion verbosely 2023-01-12 22:04:30 +00:00
issue-77982.rs
issue-77982.stderr Adapt issue-77982.stderr to new rustc error 2023-02-26 13:50:10 +01:00
issue-78372.rs
issue-78372.stderr Special-case item attributes in the suggestion output 2023-04-12 22:50:10 +00:00
issue-78632.rs
issue-79458.rs
issue-79458.stderr
issue-82830.rs
issue-83538-tainted-cache-after-cycle.rs
issue-83538-tainted-cache-after-cycle.stderr
issue-84399-bad-fresh-caching.rs
issue-85360-eval-obligation-ice.rs
issue-85360-eval-obligation-ice.stderr
issue-85735.rs
issue-85735.stderr
issue-87558.rs
issue-87558.stderr feat: implement better error for manual impl of Fn* traits 2023-03-10 20:32:24 +13:00
issue-89119.rs
issue-90195-2.rs
issue-90195.rs
issue-90662-projection-caching.rs
issue-91594.rs
issue-91594.stderr Point at HIR types when impl trait ref doesn't normalize 2023-01-12 20:44:47 +00:00
issue-91949-hangs-on-recursion.rs evaluate: improve and fix recursion depth handling 2023-03-21 09:57:22 +01:00
issue-91949-hangs-on-recursion.stderr evaluate: improve and fix recursion depth handling 2023-03-21 09:57:22 +01:00
issue-92292.rs
issue-95311.rs
issue-95898.rs
issue-95898.stderr
issue-96664.rs
issue-96665.rs
issue-97576.rs
issue-97576.stderr
issue-97695-double-trivial-bound.rs
issue-99875.rs
issue-99875.stderr Add note when FnPtr vs. FnDef impl trait 2023-01-14 10:37:56 +00:00
issue-102989.rs
issue-102989.stderr
issue-103563.rs fix: Unexpected trait bound not satisfied in HRTB 2023-02-13 19:39:44 +08:00
issue-104322.rs
issue-106072.rs fix: misleading add dyn to derive macro suggestion 2023-01-14 12:14:06 +00:00
issue-106072.stderr fix: misleading add dyn to derive macro suggestion 2023-01-14 12:14:06 +00:00
item-inside-macro.rs
item-privacy.rs diagnostics: update test cases to refer to assoc fn with self as method 2023-02-22 08:40:47 -07:00
item-privacy.stderr Special-case item attributes in the suggestion output 2023-04-12 22:50:10 +00:00
kindck-owned-contains-1.rs
map-types.rs
map-types.stderr
matching-lifetimes.rs
matching-lifetimes.stderr
method-private.rs
method-private.stderr Special-case item attributes in the suggestion output 2023-04-12 22:50:10 +00:00
monad.rs
monomorphized-callees-with-ty-params-3314.rs
multidispatch1.rs
multidispatch2.rs
multidispatch-bad.rs
multidispatch-bad.stderr
multidispatch-conditional-impl-not-considered.rs
multidispatch-convert-ambig-dest.rs
multidispatch-convert-ambig-dest.stderr Specify what 'this' actually is 2023-02-21 05:21:07 +00:00
multidispatch-infer-convert-target.rs
mutual-recursion-issue-75860.rs
mutual-recursion-issue-75860.stderr
no_send-struct.rs
no_send-struct.stderr
no-fallback-multiple-impls.rs
no-fallback-multiple-impls.stderr
normalize-supertrait.rs
not-suggest-non-existing-fully-qualified-path.rs
not-suggest-non-existing-fully-qualified-path.stderr
object-does-not-impl-trait.rs
object-does-not-impl-trait.stderr
object-one-type-two-traits.rs
objects-owned-object-borrowed-method-headerless.rs
operator-overloading-issue-52025.rs
overlap-not-permitted-for-builtin-trait.rs
overlap-not-permitted-for-builtin-trait.stderr
overlap-permitted-for-marker-traits.rs
param-without-lifetime-constraint.rs
param-without-lifetime-constraint.stderr
parameterized-with-bounds.rs
pointee-deduction.rs
pointee-tail-is-generic-errors.rs
pointee-tail-is-generic-errors.stderr
pointee-tail-is-generic.rs
principal-less-objects.rs
privacy.rs
project-modulo-regions.rs
project-modulo-regions.with_clause.stderr
project-modulo-regions.without_clause.stderr
region-pointer-simple.rs
resolution-in-overloaded-op.rs
resolution-in-overloaded-op.stderr
safety-fn-body.mir.stderr
safety-fn-body.rs
safety-fn-body.thir.stderr
safety-inherent-impl.rs
safety-inherent-impl.stderr
safety-ok-cc.rs
safety-ok.rs
safety-trait-impl-cc.rs
safety-trait-impl-cc.stderr
safety-trait-impl.rs
safety-trait-impl.stderr
self-without-lifetime-constraint.rs
self-without-lifetime-constraint.stderr
static-method-generic-inference.rs
static-method-generic-inference.stderr
static-method-overwriting.rs
static-outlives-a-where-clause.rs
staticness-mismatch.rs
staticness-mismatch.stderr
suggest-fully-qualified-closure.rs
suggest-fully-qualified-closure.stderr
suggest-fully-qualified-path-with-adjustment.rs
suggest-fully-qualified-path-with-adjustment.stderr
suggest-fully-qualified-path-without-adjustment.rs
suggest-fully-qualified-path-without-adjustment.stderr
suggest-where-clause.rs
suggest-where-clause.stderr
superdefault-generics.rs
syntax-polarity.rs
syntax-trait-polarity.rs
syntax-trait-polarity.stderr
test-2.rs diagnostics: remove inconsistent English article "this" from E0107 2023-02-23 10:27:06 -07:00
test-2.stderr diagnostics: remove inconsistent English article "this" from E0107 2023-02-23 10:27:06 -07:00
test.rs
test.stderr
to-str.rs
track-obligations.rs Add tests 2023-01-13 18:20:24 +00:00
track-obligations.stderr Add tests 2023-01-13 18:20:24 +00:00
trait-or-new-type-instead.rs
trait-or-new-type-instead.stderr Tighter spans for bad inherent impl types 2023-02-13 18:41:18 +00:00
typeclasses-eq-example-static.rs
typeclasses-eq-example.rs
ufcs-object.rs
unsend-future.rs fix: evaluate with wrong obligation stack 2023-03-08 20:12:46 +08:00
unsend-future.stderr fix: evaluate with wrong obligation stack 2023-03-08 20:12:46 +08:00
unspecified-self-in-trait-ref.rs
unspecified-self-in-trait-ref.stderr
use-before-def.rs
vtable-res-trait-param.rs
vtable-res-trait-param.stderr
where-clause-vs-impl.rs
with-bounds-default.rs
with-dst.rs
wrong-mul-method-signature.rs Move some UI tests into subdirectories 2023-04-02 19:42:30 -04:00
wrong-mul-method-signature.stderr Move some UI tests into subdirectories 2023-04-02 19:42:30 -04:00