os-rust/tests/ui/span
Matthias Krüger 48a0d038fa
Rollup merge of #113005 - compiler-errors:dont-query-normalize, r=cjgillot
Don't call `query_normalize` when reporting similar impls

Firstly, It's sketchy to be using `query_normalize` at all during HIR typeck -- it's asking for an ICE 😅. Secondly, we're normalizing an impl trait ref that potentially has parameter types in `ty::ParamEnv::empty()`, which is kinda sketchy as well.

The only UI test change from removing this normalization is that we don't evaluate anonymous constants in impls, which end up giving us really ugly suggestions:

```
error[E0277]: the trait bound `[X; 35]: Default` is not satisfied
 --> /home/gh-compiler-errors/test.rs:4:5
  |
4 |     <[X; 35] as Default>::default();
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Default` is not implemented for `[X; 35]`
  |
  = help: the following other types implement trait `Default`:
            &[T]
            &mut [T]
            [T; 32]
            [T; core::::array::{impl#30}::{constant#0}]
            [T; core::::array::{impl#31}::{constant#0}]
            [T; core::::array::{impl#32}::{constant#0}]
            [T; core::::array::{impl#33}::{constant#0}]
            [T; core::::array::{impl#34}::{constant#0}]
          and 27 others
```

So just fold the impls with a `BottomUpFolder` that calls `ty::Const::eval`. This doesn't work totally correctly with generic-const-exprs, but it's fine for stable code, and this is error reporting after all.
2023-07-08 20:53:27 +02:00
..
auxiliary Move /src/test to /tests 2023-01-11 09:32:08 +00:00
borrowck-borrow-overloaded-auto-deref-mut.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
borrowck-borrow-overloaded-auto-deref-mut.stderr tweak "make mut" spans (No. 3) 2023-05-05 22:40:05 +12:00
borrowck-borrow-overloaded-deref-mut.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
borrowck-borrow-overloaded-deref-mut.stderr tweak "make mut" spans (No. 2) 2023-05-05 22:40:05 +12:00
borrowck-call-is-borrow-issue-12224.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
borrowck-call-is-borrow-issue-12224.stderr tweak "make mut" spans (No. 3) 2023-05-05 22:40:05 +12:00
borrowck-call-method-from-mut-aliasable.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
borrowck-call-method-from-mut-aliasable.stderr tweak "make mut" spans (No. 3) 2023-05-05 22:40:05 +12:00
borrowck-fn-in-const-b.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
borrowck-fn-in-const-b.stderr tweak "make mut" spans (No. 3) 2023-05-05 22:40:05 +12:00
borrowck-let-suggestion-suffixes.rs Account for method call and indexing when looking for inner-most path in expression 2023-01-17 02:52:43 +00:00
borrowck-let-suggestion-suffixes.stderr Account for method call and indexing when looking for inner-most path in expression 2023-01-17 02:52:43 +00:00
borrowck-object-mutability.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
borrowck-object-mutability.stderr tweak "make mut" spans (No. 3) 2023-05-05 22:40:05 +12:00
borrowck-ref-into-rvalue.fixed Move /src/test to /tests 2023-01-11 09:32:08 +00:00
borrowck-ref-into-rvalue.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
borrowck-ref-into-rvalue.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
coerce-suggestions.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
coerce-suggestions.stderr Tweak borrow suggestion 2023-05-08 03:36:30 +00:00
destructor-restrictions.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
destructor-restrictions.stderr Account for method call and indexing when looking for inner-most path in expression 2023-01-17 02:52:43 +00:00
drop-location-span-error-rust-2021-incompatible-closure-captures-93117.rs Exit when there are unmatched delims to avoid noisy diagnostics 2023-02-28 07:55:19 +00:00
drop-location-span-error-rust-2021-incompatible-closure-captures-93117.stderr Exit when there are unmatched delims to avoid noisy diagnostics 2023-02-28 07:55:19 +00:00
drop-location-span-error-rust-2021-incompatible-closure-captures-96258.rs fix test 2023-06-24 21:49:38 -04:00
drop-location-span-error-rust-2021-incompatible-closure-captures-96258.stderr fix test 2023-06-24 21:49:38 -04:00
dropck-object-cycle.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
dropck-object-cycle.stderr Account for * when looking for inner-most path in expression 2023-01-17 02:45:11 +00:00
dropck_arr_cycle_checked.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
dropck_arr_cycle_checked.stderr Tweak E0597 2023-01-15 19:46:20 +00:00
dropck_direct_cycle_with_drop.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
dropck_direct_cycle_with_drop.stderr Tweak E0597 2023-01-15 19:46:20 +00:00
dropck_misc_variants.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
dropck_misc_variants.stderr Tweak E0597 2023-01-15 19:46:20 +00:00
dropck_vec_cycle_checked.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
dropck_vec_cycle_checked.stderr Tweak E0597 2023-01-15 19:46:20 +00:00
E0046.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
E0046.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
E0072.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
E0072.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
E0204.rs may not => cannot 2023-03-08 00:00:18 +00:00
E0204.stderr may not => cannot 2023-03-08 00:00:18 +00:00
E0493.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
E0493.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
E0535.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
E0535.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
E0536.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
E0536.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
E0537.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
E0537.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
gated-features-attr-spans.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
gated-features-attr-spans.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
impl-wrong-item-for-trait.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
impl-wrong-item-for-trait.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
import-ty-params.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
import-ty-params.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-11925.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-11925.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-15480.fixed Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-15480.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-15480.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-23338-locals-die-before-temps-of-body.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-23338-locals-die-before-temps-of-body.stderr Account for method call and indexing when looking for inner-most path in expression 2023-01-17 02:52:43 +00:00
issue-23729.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-23729.stderr Make missing impl item suggestions more obvious that they're missing 2023-04-19 17:57:37 +00:00
issue-23827.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-23827.stderr Make missing impl item suggestions more obvious that they're missing 2023-04-19 17:57:37 +00:00
issue-24356.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-24356.stderr Make missing impl item suggestions more obvious that they're missing 2023-04-19 17:57:37 +00:00
issue-24690.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-24690.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-24805-dropck-child-has-items-via-parent.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-24805-dropck-child-has-items-via-parent.stderr Tweak E0597 2023-01-15 19:46:20 +00:00
issue-24805-dropck-trait-has-items.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-24805-dropck-trait-has-items.stderr Tweak E0597 2023-01-15 19:46:20 +00:00
issue-24895-copy-clone-dropck.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-24895-copy-clone-dropck.stderr Tweak E0597 2023-01-15 19:46:20 +00:00
issue-25199.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-25199.stderr Tweak E0597 2023-01-15 19:46:20 +00:00
issue-26656.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-26656.stderr Tweak E0597 2023-01-15 19:46:20 +00:00
issue-27522.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-27522.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-29106.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-29106.stderr Tweak E0597 2023-01-15 19:46:20 +00:00
issue-29595.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-29595.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-33884.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-33884.stderr Modify primary span label for E0308 2023-01-30 20:12:19 +00:00
issue-34264.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-34264.stderr Make removal suggestion not verbose 2023-02-14 20:22:10 +00:00
issue-35987.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-35987.stderr Special-case item attributes in the suggestion output 2023-04-12 22:50:10 +00:00
issue-36537.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-36537.stderr Tweak E0597 2023-01-15 19:46:20 +00:00
issue-37767.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-37767.stderr diagnostics: update test cases to refer to assoc fn with self as method 2023-02-22 08:40:47 -07:00
issue-39018.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-39018.stderr Tweak borrow suggestion 2023-05-08 03:36:30 +00:00
issue-39698.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-39698.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-40157.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-40157.stderr Account for method call and indexing when looking for inner-most path in expression 2023-01-17 02:52:43 +00:00
issue-42234-unknown-receiver-type.full.stderr diagnostics: update test cases to refer to assoc fn with self as method 2023-02-22 08:40:47 -07:00
issue-42234-unknown-receiver-type.generic_arg.stderr diagnostics: update test cases to refer to assoc fn with self as method 2023-02-22 08:40:47 -07:00
issue-42234-unknown-receiver-type.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-43927-non-ADT-derive.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-43927-non-ADT-derive.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-71363.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-71363.stderr Tweak output for 'add line' suggestion 2023-04-12 22:50:10 +00:00
issue-81800.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-81800.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-107353.rs Pacify tidy. 2023-02-11 18:07:06 +00:00
issue28498-reject-ex1.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue28498-reject-ex1.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue28498-reject-lifetime-param.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue28498-reject-lifetime-param.stderr Tweak E0597 2023-01-15 19:46:20 +00:00
issue28498-reject-passed-to-fn.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue28498-reject-passed-to-fn.stderr Tweak E0597 2023-01-15 19:46:20 +00:00
issue28498-reject-trait-bound.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue28498-reject-trait-bound.stderr Tweak E0597 2023-01-15 19:46:20 +00:00
lint-unused-unsafe-thir.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
lint-unused-unsafe-thir.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
lint-unused-unsafe.mir.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
lint-unused-unsafe.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
macro-span-replacement.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
macro-span-replacement.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
macro-ty-params.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
macro-ty-params.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
method-and-field-eager-resolution.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
method-and-field-eager-resolution.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
missing-unit-argument.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
missing-unit-argument.stderr diagnostics: update test cases to refer to assoc fn with self as method 2023-02-22 08:40:47 -07:00
move-closure.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
move-closure.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
multiline-span-E0072.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
multiline-span-E0072.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
multiline-span-simple.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
multiline-span-simple.stderr Don't sort strings right after we just sorted by types 2023-06-27 23:31:06 +00:00
multispan-import-lint.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
multispan-import-lint.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
mut-arg-hint.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
mut-arg-hint.stderr tweak "make mut" spans (No. 3) 2023-05-05 22:40:05 +12:00
mut-ptr-cant-outlive-ref.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
mut-ptr-cant-outlive-ref.stderr Tweak E0597 2023-01-15 19:46:20 +00:00
non-existing-module-import.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
non-existing-module-import.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
pub-struct-field.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
pub-struct-field.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
range-2.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
range-2.stderr Tweak E0597 2023-01-15 19:46:20 +00:00
recursive-type-field.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
recursive-type-field.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
regionck-unboxed-closure-lifetimes.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
regionck-unboxed-closure-lifetimes.stderr Tweak E0597 2023-01-15 19:46:20 +00:00
regions-close-over-borrowed-ref-in-obj.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
regions-close-over-borrowed-ref-in-obj.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
regions-close-over-type-parameter-2.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
regions-close-over-type-parameter-2.stderr Tweak E0597 2023-01-15 19:46:20 +00:00
regions-escape-loop-via-variable.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
regions-escape-loop-via-variable.stderr Tweak E0597 2023-01-15 19:46:20 +00:00
regions-escape-loop-via-vec.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
regions-escape-loop-via-vec.stderr Tweak E0597 2023-01-15 19:46:20 +00:00
regions-infer-borrow-scope-within-loop.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
regions-infer-borrow-scope-within-loop.stderr Account for * when looking for inner-most path in expression 2023-01-17 02:45:11 +00:00
send-is-not-static-ensures-scoping.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
send-is-not-static-ensures-scoping.stderr Tweak E0597 2023-01-15 19:46:20 +00:00
send-is-not-static-std-sync-2.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
send-is-not-static-std-sync-2.stderr Evaluate place expression in PlaceMention. 2023-04-21 21:34:59 +00:00
send-is-not-static-std-sync.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
send-is-not-static-std-sync.stderr Account for * when looking for inner-most path in expression 2023-01-17 02:45:11 +00:00
slice-borrow.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
slice-borrow.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
suggestion-non-ascii.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
suggestion-non-ascii.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
transitive-dep-span.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
transitive-dep-span.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
type-annotations-needed-expr.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
type-annotations-needed-expr.stderr diagnostics: update test cases to refer to assoc fn with self as method 2023-02-22 08:40:47 -07:00
type-binding.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
type-binding.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
typo-suggestion.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
typo-suggestion.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
unused-warning-point-at-identifier.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
unused-warning-point-at-identifier.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
vec-must-not-hide-type-from-dropck.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
vec-must-not-hide-type-from-dropck.stderr Tweak E0597 2023-01-15 19:46:20 +00:00
vec_refs_data_with_early_death.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
vec_refs_data_with_early_death.stderr Tweak E0597 2023-01-15 19:46:20 +00:00
visibility-ty-params.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
visibility-ty-params.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
wf-method-late-bound-regions.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
wf-method-late-bound-regions.stderr Tweak E0597 2023-01-15 19:46:20 +00:00