rust/tests/ui/const-generics
bors f361413cbf Auto merge of #106399 - estebank:type-err-span-label, r=nagisa
Modify primary span label for E0308

Looking at the reactions to https://hachyderm.io/`@ekuber/109622160673605438,` a lot of people seem to have trouble understanding the current output, where the primary span label on type errors talks about the specific types that diverged, but these can be deeply nested type parameters. Because of that we could see "expected i32, found u32" in the label while the note said "expected Vec<i32>, found Vec<u32>". This understandably confuses people. I believe that once people learn to read these errors it starts to make more sense, but this PR changes the output to be more in line with what people might expect, without sacrificing terseness.

Fix #68220.
2023-01-31 13:53:40 +00:00
..
array-impls Move /src/test to /tests 2023-01-11 09:32:08 +00:00
auxiliary Move /src/test to /tests 2023-01-11 09:32:08 +00:00
backcompat Move /src/test to /tests 2023-01-11 09:32:08 +00:00
defaults Modify primary span label for E0308 2023-01-30 20:12:19 +00:00
early Move /src/test to /tests 2023-01-11 09:32:08 +00:00
generic_arg_infer Move /src/test to /tests 2023-01-11 09:32:08 +00:00
generic_const_exprs Auto merge of #106399 - estebank:type-err-span-label, r=nagisa 2023-01-31 13:53:40 +00:00
infer Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issues Modify primary span label for E0308 2023-01-30 20:12:19 +00:00
late-bound-vars Move /src/test to /tests 2023-01-11 09:32:08 +00:00
min_const_generics preserve delim spans during macro_rules! expansion if able 2023-01-20 20:16:37 +01:00
occurs-check Move /src/test to /tests 2023-01-11 09:32:08 +00:00
parser-error-recovery Move /src/test to /tests 2023-01-11 09:32:08 +00:00
std Move /src/test to /tests 2023-01-11 09:32:08 +00:00
type-dependent Move /src/test to /tests 2023-01-11 09:32:08 +00:00
apit-with-const-param.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
arg-in-pat-1.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
arg-in-pat-2.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
arg-in-pat-3.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
argument_order.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
argument_order.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
array-wrapper-struct-ctor.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
assoc_const_eq_diagnostic.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
assoc_const_eq_diagnostic.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
associated-type-bound-fail.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
associated-type-bound-fail.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
associated-type-bound.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
bad-const-generic-exprs.rs recover more unbraced const args 2023-01-27 19:26:04 +01:00
bad-const-generic-exprs.stderr recover more unbraced const args 2023-01-27 19:26:04 +01:00
broken-mir-1.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
broken-mir-2.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
cannot-infer-type-for-const-param.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
coerce_unsized_array.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
concrete-const-as-fn-arg.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
concrete-const-impl-method.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
condition-in-trait-const-arg.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
const_trait_fn-issue-88433.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
const-arg-in-const-arg.full.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
const-arg-in-const-arg.min.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
const-arg-in-const-arg.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
const-arg-in-fn.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
const-arg-type-arg-misordered.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
const-arg-type-arg-misordered.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
const-argument-cross-crate-mismatch.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
const-argument-cross-crate-mismatch.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
const-argument-cross-crate.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
const-argument-if-length.full.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
const-argument-if-length.min.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
const-argument-if-length.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
const-argument-non-static-lifetime.min.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
const-argument-non-static-lifetime.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
const-fn-with-const-param.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
const-generic-default-wont-borrowck.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
const-generic-default-wont-borrowck.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
const-generic-function.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
const-generic-function.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
const-generic-type_name.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
const-param-after-const-literal-arg.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
const-param-before-other-params.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
const-param-before-other-params.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
const-param-elided-lifetime.full.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
const-param-elided-lifetime.min.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
const-param-elided-lifetime.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
const-param-in-async.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
const-param-type-depends-on-const-param.full.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
const-param-type-depends-on-const-param.min.stderr defer array len printing to const arg printing 2023-01-18 04:07:39 +00:00
const-param-type-depends-on-const-param.rs defer array len printing to const arg printing 2023-01-18 04:07:39 +00:00
const-param-type-depends-on-type-param-ungated.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
const-param-type-depends-on-type-param-ungated.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
const-param-type-depends-on-type-param.full.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
const-param-type-depends-on-type-param.min.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
const-param-type-depends-on-type-param.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
const-parameter-uppercase-lint.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
const-parameter-uppercase-lint.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
core-types.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
cross_crate_complex.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
deref-into-array-generic.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
different_generic_args_array.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
different_generic_args_array.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
different_generic_args.full.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
different_generic_args.min.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
different_generic_args.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
dont-evaluate-array-len-on-err-1.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
dont-evaluate-array-len-on-err-1.stderr defer array len printing to const arg printing 2023-01-18 04:07:39 +00:00
dyn-supertraits.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
ensure_is_evaluatable.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
ensure_is_evaluatable.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
enum-variants.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
exhaustive-value.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
exhaustive-value.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
expose-default-substs-param-env.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
float-generic.adt_const_params.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
float-generic.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
float-generic.simple.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
fn_with_two_const_inputs.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
fn_with_two_const_inputs.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
fn_with_two_same_const_inputs.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
fn-const-param-call.full.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
fn-const-param-call.min.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
fn-const-param-call.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
fn-const-param-infer.full.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
fn-const-param-infer.min.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
fn-const-param-infer.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
forbid-non-structural_match-types.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
forbid-non-structural_match-types.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
foreign-item-const-parameter.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
foreign-item-const-parameter.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
generic-param-mismatch.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
generic-param-mismatch.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
ice-68875.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
ice-68875.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
ice-const-generic-function-return-ty.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
ice-const-generic-function-return-ty.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
impl-const-generic-struct.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
incorrect-number-of-const-args.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
incorrect-number-of-const-args.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
infer_arg_from_pat.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
infer_arr_len_from_pat.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
inhabited-assoc-ty-ice-1.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
inhabited-assoc-ty-ice-2.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
integer-literal-generic-arg-in-where-clause.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
intrinsics-type_name-as-const-argument.min.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
intrinsics-type_name-as-const-argument.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
invalid-const-arg-for-type-param.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
invalid-const-arg-for-type-param.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
invalid-constant-in-args.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
invalid-constant-in-args.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
invalid-enum.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
invalid-enum.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
invariant.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
invariant.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-46511.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-46511.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-66451.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-66451.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-70408.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-80471.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-80471.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-93647.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-93647.stderr fix fmt and bless 2023-01-12 02:28:38 +00:00
issue-97007.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-102124.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-105689.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-106419-struct-with-multiple-const-params.rs Added UI test case for issue #106419 2023-01-19 15:39:05 +01:00
legacy-const-generics-bad.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
legacy-const-generics-bad.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
legacy-const-generics.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
nested-type.full.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
nested-type.min.stderr defer array len printing to const arg printing 2023-01-18 04:07:39 +00:00
nested-type.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
outer-lifetime-in-const-generic-default.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
outer-lifetime-in-const-generic-default.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
overlapping_impls.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
params-in-ct-in-ty-param-lazy-norm.full.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
params-in-ct-in-ty-param-lazy-norm.min.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
params-in-ct-in-ty-param-lazy-norm.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
parent_generics_of_encoding_impl_trait.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
parent_generics_of_encoding_impl_trait.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
parent_generics_of_encoding.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
projection-as-arg-const.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
projection-as-arg-const.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
promotion.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
raw-ptr-const-param-deref.full.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
raw-ptr-const-param-deref.min.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
raw-ptr-const-param-deref.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
raw-ptr-const-param.full.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
raw-ptr-const-param.min.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
raw-ptr-const-param.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
slice-const-param-mismatch.full.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
slice-const-param-mismatch.min.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
slice-const-param-mismatch.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
slice-const-param.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
sneaky-array-repeat-expr.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
sneaky-array-repeat-expr.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
struct-with-invalid-const-param.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
struct-with-invalid-const-param.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
suggest_const_for_array.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
suggest_const_for_array.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
trait-const-args.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
transmute-const-param-static-reference.min.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
transmute-const-param-static-reference.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
transparent-maybeunit-array-wrapper.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
try_unify_ignore_lifetimes.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
two_matching_preds.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
type_mismatch.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
type_mismatch.stderr Modify primary span label for E0308 2023-01-30 20:12:19 +00:00
type_not_in_scope.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
type_not_in_scope.stderr Modify primary span label for E0308 2023-01-30 20:12:19 +00:00
type_of_anon_const.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
type-after-const-ok.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
types-mismatch-const-args.full.stderr Modify primary span label for E0308 2023-01-30 20:12:19 +00:00
types-mismatch-const-args.min.stderr Modify primary span label for E0308 2023-01-30 20:12:19 +00:00
types-mismatch-const-args.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
unify_with_nested_expr.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
unify_with_nested_expr.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
uninferred-consts-during-codegen-1.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
uninferred-consts-during-codegen-2.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
unknown_adt.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
unknown_adt.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
unused_braces.fixed Fix unused_braces on generic const expr macro call 2023-01-14 15:49:08 +00:00
unused_braces.full.fixed Move /src/test to /tests 2023-01-11 09:32:08 +00:00
unused_braces.min.fixed Move /src/test to /tests 2023-01-11 09:32:08 +00:00
unused_braces.rs Fix unused_braces on generic const expr macro call 2023-01-14 15:49:08 +00:00
unused_braces.stderr Fix unused_braces on generic const expr macro call 2023-01-14 15:49:08 +00:00
unused-const-param.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
unused-type-param-suggestion.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
unused-type-param-suggestion.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
where-clauses.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00