rust/src/test/ui/traits
Yuki Okushi d44cec3453
Rollup merge of #90819 - JakobDegen:issue-90804, r=petrochenkov
Fixes incorrect handling of TraitRefs when emitting suggestions.

Closes #90804 , although there were more issues here that were hidden by the thing that caused this ICE.

Underlying problem was that substitutions were being thrown out, which not only leads to an ICE but also incorrect diagnostics. On top of that, in some cases the self types from the root obligations were being mixed in with those from derived obligations.

This makes a couple diagnostics arguable worse ("`B<C>` does not implement `Copy`" instead of "`C` does not implement `Copy`") but the worse diagnostics are at least still correct and that downside is in my opinion clearly outweighed by the benefits of fixing the ICE and unambiguously wrong diagnostics.
2021-11-16 15:59:40 +09:00
..
alias no overlap errors after failing the orphan check 2021-11-10 15:10:19 +01:00
associated_type_bound Use note to point at bound introducing requirement 2021-08-16 17:47:22 +00:00
auxiliary add regression test for issue 89119 2021-09-30 22:55:05 +02:00
bound Remove box syntax from most places in src/test outside of the issues dir 2021-09-26 04:07:44 +02:00
default-method Organize trait test files 2021-02-09 14:19:35 +01:00
inductive-overflow Deny where clauses on auto traits 2021-10-03 18:06:21 +02:00
inheritance Modify structured suggestion output 2021-08-11 09:46:24 +00:00
negative-impls Fix handling of substitutions and binders when deciding whether to suggest references 2021-11-13 16:28:41 -05:00
object Remove box syntax from most places in src/test outside of the issues dir 2021-09-26 04:07:44 +02:00
reservation-impl Point at call span that introduced obligation for the arg 2021-09-16 12:12:27 +00:00
suggest-deferences Point at call span that introduced obligation for the arg 2021-09-16 12:12:27 +00:00
trait-upcasting Remove textual span from diagnostic string 2021-10-13 10:53:44 +00:00
vtable Practice diagnostic message convention 2021-10-03 16:16:28 +09:00
wf-object Consistently use 'supertrait'. 2021-10-02 08:05:44 +07:00
anon-static-method.rs Organize trait test files 2021-02-09 14:19:35 +01:00
anon_trait_static_method_exe.rs
as-struct-constructor.rs Organize trait test files 2021-02-09 14:19:35 +01:00
as-struct-constructor.stderr Organize trait test files 2021-02-09 14:19:35 +01:00
assignability-trait.rs
assoc-type-in-superbad.rs Organize trait test files 2021-02-09 14:19:35 +01:00
assoc-type-in-superbad.stderr Organize trait test files 2021-02-09 14:19:35 +01:00
assoc-type-in-supertrait.rs Organize trait test files 2021-02-09 14:19:35 +01:00
astconv-cycle-between-and-type.rs Organize trait test files 2021-02-09 14:19:35 +01:00
augmented-assignments-trait.rs
bad-method-typaram-kind.rs Move some tests to more reasonable directories - 6 2021-04-17 18:53:54 -03:00
bad-method-typaram-kind.stderr Modify structured suggestion output 2021-08-11 09:46:24 +00:00
bad-sized.rs Move some tests to more reasonable directories - 6 2021-04-17 18:53:54 -03:00
bad-sized.stderr Consistently use 'supertrait'. 2021-10-02 08:05:44 +07:00
bug-7183-generics.rs Move some tests to more reasonable directories 2021-09-15 14:03:27 -03:00
bug-7295.rs Move some tests to more reasonable directories 2021-11-14 14:38:42 -03:00
cache-issue-18209.rs Organize trait test files 2021-02-09 14:19:35 +01:00
cache-reached-depth-ice.rs Only assemble_candidates_from_impls for polarity Negative 2021-10-20 12:10:46 -03:00
cache-reached-depth-ice.stderr Only assemble_candidates_from_impls for polarity Negative 2021-10-20 12:10:46 -03:00
coercion-generic-bad.rs Organize trait test files 2021-02-09 14:19:35 +01:00
coercion-generic-bad.stderr Organize trait test files 2021-02-09 14:19:35 +01:00
coercion-generic-regions.rs Organize trait test files 2021-02-09 14:19:35 +01:00
coercion-generic-regions.stderr Organize trait test files 2021-02-09 14:19:35 +01:00
coercion-generic.rs Organize trait test files 2021-02-09 14:19:35 +01:00
coercion.rs Remove box syntax from most places in src/test outside of the issues dir 2021-09-26 04:07:44 +02:00
composition-trivial.rs Organize trait test files 2021-02-09 14:19:35 +01:00
conditional-dispatch.rs Remove box syntax from most places in src/test outside of the issues dir 2021-09-26 04:07:44 +02:00
conditional-model-fn.rs Organize trait test files 2021-02-09 14:19:35 +01:00
conservative_impl_trait.rs
copy-guessing.rs Organize trait test files 2021-02-09 14:19:35 +01:00
cycle-cache-err-60010.rs Report cycle error using 'deepest' obligation in the cycle 2021-09-02 11:49:32 -05:00
cycle-cache-err-60010.stderr Report cycle error using 'deepest' obligation in the cycle 2021-09-02 11:49:32 -05:00
cycle-type-trait.rs Organize trait test files 2021-02-09 14:19:35 +01:00
duplicate-methods.rs Organize trait test files 2021-02-09 14:19:35 +01:00
duplicate-methods.stderr Organize trait test files 2021-02-09 14:19:35 +01:00
dyn-trait.rs
elaborate-type-region.rs Organize trait test files 2021-02-09 14:19:35 +01:00
false-ambiguity-where-clause-builtin-bound.rs Organize trait test files 2021-02-09 14:19:35 +01:00
fmt-pointer-trait.rs
generic.rs Organize trait test files 2021-02-09 14:19:35 +01:00
impl-1.rs Organize trait test files 2021-02-09 14:19:35 +01:00
impl-1.stderr Organize trait test files 2021-02-09 14:19:35 +01:00
impl-2.rs Organize trait test files 2021-02-09 14:19:35 +01:00
impl-bounds-checking.rs Move some tests to more suitable subdirs 2021-03-06 18:24:53 +09:00
impl-bounds-checking.stderr Use note to point at bound introducing requirement 2021-08-16 17:47:22 +00:00
impl-can-not-have-untraitful-items.rs Organize trait test files 2021-02-09 14:19:35 +01:00
impl-can-not-have-untraitful-items.stderr Organize trait test files 2021-02-09 14:19:35 +01:00
impl-different-num-params.rs Organize trait test files 2021-02-09 14:19:35 +01:00
impl-different-num-params.stderr Organize trait test files 2021-02-09 14:19:35 +01:00
impl-evaluation-order.rs Revert change to evaluation order 2020-12-17 20:16:10 +00:00
impl-for-module.rs Organize trait test files 2021-02-09 14:19:35 +01:00
impl-for-module.stderr Organize trait test files 2021-02-09 14:19:35 +01:00
impl-implicit-trait.rs
impl-inherent-prefer-over-trait.rs
impl-method-mismatch.rs Organize trait test files 2021-02-09 14:19:35 +01:00
impl-method-mismatch.stderr Organize trait test files 2021-02-09 14:19:35 +01:00
impl-object-overlap-issue-23853.rs Organize trait test files 2021-02-09 14:19:35 +01:00
impl-of-supertrait-has-wrong-lifetime-parameters.rs Organize trait test files 2021-02-09 14:19:35 +01:00
impl-of-supertrait-has-wrong-lifetime-parameters.stderr Remove textual span from diagnostic string 2021-10-13 10:53:44 +00:00
impl.rs Fix use of bare trait objects everywhere 2021-03-18 02:18:58 +03:00
impl_trait_as_trait_return_position.rs Add test for #59023 2020-04-03 18:31:04 +02:00
infer-from-object-issue-26952.rs Organize trait test files 2021-02-09 14:19:35 +01:00
inherent-method-order.rs Organize trait test files 2021-02-09 14:19:35 +01:00
issue-3683.rs Move some tests to more reasonable directories 2021-01-31 19:46:46 -03:00
issue-3973.rs Move some tests to more reasonable directories 2021-11-06 15:35:20 -03:00
issue-3973.stderr Move some tests to more reasonable directories 2021-11-06 15:35:20 -03:00
issue-6128.rs Remove box syntax from most places in src/test outside of the issues dir 2021-09-26 04:07:44 +02:00
issue-6334.rs Move some tests to more reasonable directories - 2 2021-01-16 19:46:54 -03:00
issue-9394-inherited-calls.rs Organize trait test files 2021-02-09 14:19:35 +01:00
issue-20692.rs Move some tests to more reasonable directories 2021-09-15 14:03:27 -03:00
issue-20692.stderr Move some tests to more reasonable directories 2021-09-15 14:03:27 -03:00
issue-22019.rs Organize trait test files 2021-02-09 14:19:35 +01:00
issue-22110.rs Organize trait test files 2021-02-09 14:19:35 +01:00
issue-22655.rs Organize trait test files 2021-02-09 14:19:35 +01:00
issue-23003-overflow.rs Organize trait test files 2021-02-09 14:19:35 +01:00
issue-23003.rs Organize trait test files 2021-02-09 14:19:35 +01:00
issue-23825.rs Move some tests to more reasonable directories 2021-09-15 14:03:27 -03:00
issue-24010.rs Move some tests to more reasonable directories 2021-11-06 15:35:20 -03:00
issue-26339.rs Organize trait test files 2021-02-09 14:19:35 +01:00
issue-28576.rs Move some tests to more suitable subdirs 2021-03-06 18:24:53 +09:00
issue-28576.stderr Move some tests to more suitable subdirs 2021-03-06 18:24:53 +09:00
issue-33140-hack-boundaries.rs Move some tests to more reasonable directories 2021-01-31 19:46:46 -03:00
issue-33140-hack-boundaries.stderr Remove trailing : from E0119 message 2021-04-06 18:16:11 -07:00
issue-33140.rs Move some tests to more suitable subdirs 2021-03-06 18:24:53 +09:00
issue-33140.stderr Remove trailing : from E0119 message 2021-04-06 18:16:11 -07:00
issue-38604.rs Move some tests to more reasonable directories 2021-11-06 15:35:20 -03:00
issue-38604.stderr Move some tests to more reasonable directories 2021-11-06 15:35:20 -03:00
issue-52893.rs add some more testcases 2021-10-12 08:56:05 +02:00
issue-52893.stderr add some more testcases 2021-10-12 08:56:05 +02:00
issue-56202.rs Move some tests to more reasonable directories 2021-01-31 19:46:46 -03:00
issue-56488.rs Move some tests to more reasonable directories 2021-01-31 19:46:46 -03:00
issue-59029-1.rs Move some tests to more reasonable directories 2021-11-06 15:35:20 -03:00
issue-59029-1.stderr Move some tests to more reasonable directories 2021-11-06 15:35:20 -03:00
issue-59029-2.rs Move some tests to more reasonable directories 2021-01-31 19:46:46 -03:00
issue-65284-suggest-generic-trait-bound.rs Move some tests to more reasonable directories 2021-01-31 19:46:46 -03:00
issue-65284-suggest-generic-trait-bound.stderr Modify structured suggestion output 2021-08-11 09:46:24 +00:00
issue-65673.rs Move some tests to more reasonable directories - 2 2021-01-16 19:46:54 -03:00
issue-65673.stderr Use note to point at bound introducing requirement 2021-08-16 17:47:22 +00:00
issue-68295.rs add some more testcases 2021-10-12 08:56:05 +02:00
issue-68295.stderr add some more testcases 2021-10-12 08:56:05 +02:00
issue-70944.rs Add test for issue-70944 2020-10-18 07:57:24 +09:00
issue-71136.rs Organize trait test files 2021-02-09 14:19:35 +01:00
issue-71136.stderr fix(rustc_typeck): report function argument errors on matching type 2021-10-25 12:23:52 -07:00
issue-72410.rs Fix debug assertion in typeck 2020-07-18 12:20:51 +09:00
issue-72410.stderr Modify structured suggestion output 2021-08-11 09:46:24 +00:00
issue-72455.rs Move some tests to more reasonable directories 2021-11-06 15:35:20 -03:00
issue-75627.rs Remove error message in specific case 2020-08-30 19:39:51 +00:00
issue-75627.stderr Suggest adding a type parameter for impls 2021-05-05 18:59:37 +02:00
issue-77982.rs Point at overlapping impls when type annotations are needed 2021-10-24 18:33:04 +00:00
issue-77982.stderr Always sort suggestions before emitting them 2021-10-24 20:28:44 +00:00
issue-78372.rs Move some tests to more reasonable directories - 5 2021-03-20 11:41:24 -03:00
issue-78372.stderr no overlap errors after failing the orphan check 2021-11-10 15:10:19 +01:00
issue-78632.rs add regression test for issue #78632 2021-06-15 21:32:13 -07:00
issue-79458.rs Add regression test for #79458 2020-12-01 13:30:09 -06:00
issue-79458.stderr Various diagnostics clean ups/tweaks 2021-07-19 08:43:35 -07:00
issue-83538-tainted-cache-after-cycle.rs Only assemble_candidates_from_impls for polarity Negative 2021-10-20 12:10:46 -03:00
issue-83538-tainted-cache-after-cycle.stderr Only assemble_candidates_from_impls for polarity Negative 2021-10-20 12:10:46 -03:00
issue-84399-bad-fresh-caching.rs Add regression test 2021-05-01 17:55:19 -04:00
issue-85735.rs Remove invalid suggestion involving Fn trait bound 2021-08-03 21:31:34 +02:00
issue-85735.stderr Don't use guess_head_span in predicates_of for foreign span 2021-08-27 23:19:49 -05:00
issue-89119.rs add regression test for issue 89119 2021-09-30 22:55:05 +02:00
issue-90195-2.rs Add test cases 2021-10-28 14:25:46 +00:00
issue-90195.rs Add test cases 2021-10-28 14:25:46 +00:00
item-inside-macro.rs Organize trait test files 2021-02-09 14:19:35 +01:00
item-privacy.rs Fix use of bare trait objects everywhere 2021-03-18 02:18:58 +03:00
item-privacy.stderr Move object safety suggestions to the end of the error 2021-09-15 14:48:53 +00:00
kindck-owned-contains-1.rs Remove box syntax from most places in src/test outside of the issues dir 2021-09-26 04:07:44 +02:00
matching-lifetimes.rs Organize trait test files 2021-02-09 14:19:35 +01:00
matching-lifetimes.stderr Remove textual span from diagnostic string 2021-10-13 10:53:44 +00:00
method-private.rs Organize trait test files 2021-02-09 14:19:35 +01:00
method-private.stderr Various diagnostics clean ups/tweaks 2021-07-19 08:43:35 -07:00
monad.rs Move some tests to more reasonable directories 2021-11-14 14:38:42 -03:00
monomorphized-callees-with-ty-params-3314.rs Move some tests to more reasonable directories 2021-11-14 14:38:42 -03:00
multidispatch-bad.rs Organize trait test files 2021-02-09 14:19:35 +01:00
multidispatch-bad.stderr Use smaller spans for some structured suggestions 2021-08-12 09:52:38 +00:00
multidispatch-conditional-impl-not-considered.rs Move some tests to more reasonable directories 2021-11-14 14:38:42 -03:00
multidispatch-convert-ambig-dest.rs Point at overlapping impls when type annotations are needed 2021-10-24 18:33:04 +00:00
multidispatch-convert-ambig-dest.stderr Point at overlapping impls when type annotations are needed 2021-10-24 18:33:04 +00:00
multidispatch-infer-convert-target.rs Organize trait test files 2021-02-09 14:19:35 +01:00
multidispatch1.rs Move some tests to more reasonable directories 2021-11-14 14:38:42 -03:00
multidispatch2.rs Move some tests to more reasonable directories 2021-11-14 14:38:42 -03:00
mutual-recursion-issue-75860.rs Add regr. test for mutual recursion 2020-12-29 05:22:25 +00:00
mutual-recursion-issue-75860.stderr Improve help for recursion limit errors 2021-09-28 22:17:13 +02:00
normalize-supertrait.rs Consistently use 'supertrait'. 2021-10-02 08:05:44 +07:00
object-does-not-impl-trait.rs Move some tests to more reasonable directories 2021-11-06 15:35:20 -03:00
object-does-not-impl-trait.stderr Move some tests to more reasonable directories 2021-11-06 15:35:20 -03:00
object-one-type-two-traits.rs Remove box syntax from most places in src/test outside of the issues dir 2021-09-26 04:07:44 +02:00
objects-owned-object-borrowed-method-headerless.rs Move some tests to more reasonable directories 2021-11-14 14:38:42 -03:00
operator-overloading-issue-52025.rs add regression test for issue #52025 2021-06-22 02:03:52 -07:00
overlap-not-permitted-for-builtin-trait.rs introduce negative_impls feature gate and document 2020-03-26 06:52:55 -04:00
overlap-not-permitted-for-builtin-trait.stderr Remove trailing : from E0119 message 2021-04-06 18:16:11 -07:00
overlap-permitted-for-marker-traits.rs introduce negative_impls feature gate and document 2020-03-26 06:52:55 -04:00
param-without-lifetime-constraint.rs Organize trait test files 2021-02-09 14:19:35 +01:00
param-without-lifetime-constraint.stderr nice_region_error: Include lifetime placeholders in error output 2021-10-22 15:26:20 -07:00
parameterized-with-bounds.rs Organize trait test files 2021-02-09 14:19:35 +01:00
principal-less-objects.rs Organize trait test files 2021-02-09 14:19:35 +01:00
privacy.rs Organize trait test files 2021-02-09 14:19:35 +01:00
region-pointer-simple.rs Organize trait test files 2021-02-09 14:19:35 +01:00
resolution-in-overloaded-op.rs Organize trait test files 2021-02-09 14:19:35 +01:00
resolution-in-overloaded-op.stderr Modify structured suggestion output 2021-08-11 09:46:24 +00:00
safety-fn-body.mir.stderr Check for raw pointer dereference in THIR unsafeck 2021-05-20 00:01:05 +02:00
safety-fn-body.rs Check for raw pointer dereference in THIR unsafeck 2021-05-20 00:01:05 +02:00
safety-fn-body.thir.stderr Replace more "NULL" with "null" 2021-05-24 12:59:33 +02:00
safety-inherent-impl.rs Organize trait test files 2021-02-09 14:19:35 +01:00
safety-inherent-impl.stderr Organize trait test files 2021-02-09 14:19:35 +01:00
safety-ok-cc.rs Organize trait test files 2021-02-09 14:19:35 +01:00
safety-ok.rs Organize trait test files 2021-02-09 14:19:35 +01:00
safety-trait-impl-cc.rs Organize trait test files 2021-02-09 14:19:35 +01:00
safety-trait-impl-cc.stderr Organize trait test files 2021-02-09 14:19:35 +01:00
safety-trait-impl.rs Organize trait test files 2021-02-09 14:19:35 +01:00
safety-trait-impl.stderr Organize trait test files 2021-02-09 14:19:35 +01:00
self-without-lifetime-constraint.rs Account for Self as a type param 2020-05-28 10:36:21 -07:00
self-without-lifetime-constraint.stderr nice_region_error: Include lifetime placeholders in error output 2021-10-22 15:26:20 -07:00
static-method-generic-inference.rs Organize trait test files 2021-02-09 14:19:35 +01:00
static-method-generic-inference.stderr Various diagnostics clean ups/tweaks 2021-07-19 08:43:35 -07:00
static-method-overwriting.rs Organize trait test files 2021-02-09 14:19:35 +01:00
static-outlives-a-where-clause.rs Organize trait test files 2021-02-09 14:19:35 +01:00
staticness-mismatch.rs Move some tests to more reasonable directories 2021-11-14 14:38:42 -03:00
staticness-mismatch.stderr Move some tests to more reasonable directories 2021-11-14 14:38:42 -03:00
suggest-where-clause.rs Organize trait test files 2021-02-09 14:19:35 +01:00
suggest-where-clause.stderr Use note to point at bound introducing requirement 2021-08-16 17:47:22 +00:00
superdefault-generics.rs Organize trait test files 2021-02-09 14:19:35 +01:00
syntax-polarity.rs Organize trait test files 2021-02-09 14:19:35 +01:00
syntax-trait-polarity.rs Move some tests to more reasonable directories 2021-11-06 15:35:20 -03:00
syntax-trait-polarity.stderr Move some tests to more reasonable directories 2021-11-06 15:35:20 -03:00
test-2.rs Point at overlapping impls when type annotations are needed 2021-10-24 18:33:04 +00:00
test-2.stderr Point at overlapping impls when type annotations are needed 2021-10-24 18:33:04 +00:00
test.rs Organize trait test files 2021-02-09 14:19:35 +01:00
test.stderr Organize trait test files 2021-02-09 14:19:35 +01:00
to-str.rs Organize trait test files 2021-02-09 14:19:35 +01:00
trait-or-new-type-instead.rs
trait-or-new-type-instead.stderr
typeclasses-eq-example-static.rs Move some tests to more reasonable directories 2021-11-14 14:38:42 -03:00
typeclasses-eq-example.rs Move some tests to more reasonable directories 2021-11-14 14:38:42 -03:00
ufcs-object.rs Organize trait test files 2021-02-09 14:19:35 +01:00
use-before-def.rs Organize trait test files 2021-02-09 14:19:35 +01:00
vtable-res-trait-param.rs Move some tests to more reasonable directories 2021-11-14 14:38:42 -03:00
vtable-res-trait-param.stderr Move some tests to more reasonable directories 2021-11-14 14:38:42 -03:00
where-clause-vs-impl.rs Organize trait test files 2021-02-09 14:19:35 +01:00
with-bounds-default.rs Organize trait test files 2021-02-09 14:19:35 +01:00
with-dst.rs Organize trait test files 2021-02-09 14:19:35 +01:00