rust/tests/ui/const-generics/issues
bors 94bc9c737e Auto merge of #114811 - estebank:impl-ambiguity, r=wesleywiser
Show more information when multiple `impl`s apply

- When there are `impl`s without type params, show only those (to avoid showing overly generic `impl`s).
```
error[E0283]: type annotations needed
  --> $DIR/multiple-impl-apply.rs:34:9
   |
LL |     let y = x.into();
   |         ^     ---- type must be known at this point
   |
note: multiple `impl`s satisfying `_: From<Baz>` found
  --> $DIR/multiple-impl-apply.rs:14:1
   |
LL | impl From<Baz> for Bar {
   | ^^^^^^^^^^^^^^^^^^^^^^
...
LL | impl From<Baz> for Foo {
   | ^^^^^^^^^^^^^^^^^^^^^^
   = note: required for `Baz` to implement `Into<_>`
help: consider giving `y` an explicit type
   |
LL |     let y: /* Type */ = x.into();
   |          ++++++++++++
```

- Lower the importance of `T: Sized`, `T: WellFormed` and coercion errors, to prioritize more relevant errors. The pre-existing deduplication logic deals with hiding redundant errors better that way, and we show errors with more metadata that is useful to the user.

- Show `<SelfTy as Trait>::assoc_fn` suggestion in more cases.
```
error[E0790]: cannot call associated function on trait without specifying the corresponding `impl` type
  --> $DIR/cross-return-site-inference.rs:38:16
   |
LL |     return Err(From::from("foo"));
   |                ^^^^^^^^^^ cannot call associated function of trait
   |
help: use a fully-qualified path to a specific available implementation
   |
LL |     return Err(</* self type */ as From>::from("foo"));
   |                +++++++++++++++++++     +
```

Fix #88284.
2023-10-06 18:44:32 +00:00
..
auxiliary
issue-56445-1.full.stderr improve diagnostics and bless tests 2023-05-05 21:42:54 +01:00
issue-56445-1.min.stderr make adt_const_params feature suggestion more consistent with others and only suggest it when the type can probably work 2023-09-28 23:10:04 +00:00
issue-56445-1.rs improve diagnostics and bless tests 2023-05-05 21:42:54 +01:00
issue-56445-2.rs
issue-56445-2.stderr
issue-56445-3.rs
issue-56445-3.stderr
issue-60818-struct-constructors.rs
issue-61336-1.rs
issue-61336-2.rs
issue-61336-2.stderr
issue-61336.rs
issue-61336.stderr
issue-61422.rs
issue-61432.rs
issue-62187-encountered-polymorphic-const.rs
issue-62878.full.stderr improve diagnostics and bless tests 2023-05-05 21:42:54 +01:00
issue-62878.min.stderr make adt_const_params feature suggestion more consistent with others and only suggest it when the type can probably work 2023-09-28 23:10:04 +00:00
issue-62878.rs defer array len printing to const arg printing 2023-01-18 04:07:39 +00:00
issue-63322-forbid-dyn.full.stderr Implement custom diagnostic for ConstParamTy 2023-06-01 18:21:42 +00:00
issue-63322-forbid-dyn.min.stderr make adt_const_params feature suggestion more consistent with others and only suggest it when the type can probably work 2023-09-28 23:10:04 +00:00
issue-63322-forbid-dyn.rs Implement custom diagnostic for ConstParamTy 2023-06-01 18:21:42 +00:00
issue-64519.rs
issue-66596-impl-trait-for-str-const-arg.rs
issue-66906.rs
issue-67185-1.rs
issue-67185-2.rs
issue-67185-2.stderr Don't sort strings right after we just sorted by types 2023-06-27 23:31:06 +00:00
issue-67375.full.stderr Do not set up wrong span for adjustments 2023-07-10 20:09:26 +00:00
issue-67375.min.stderr
issue-67375.rs
issue-67739.full.stderr
issue-67739.min.stderr
issue-67739.rs
issue-67945-1.full.stderr Modify primary span label for E0308 2023-01-30 20:12:19 +00:00
issue-67945-1.min.stderr
issue-67945-1.rs
issue-67945-2.full.stderr
issue-67945-2.min.stderr
issue-67945-2.rs
issue-67945-3.full.stderr
issue-67945-3.min.stderr
issue-67945-3.rs
issue-67945-4.full.stderr
issue-67945-4.min.stderr
issue-67945-4.rs
issue-68104-print-stack-overflow.rs
issue-68366.full.stderr
issue-68366.min.stderr
issue-68366.rs
issue-68596.rs
issue-68615-adt.min.stderr make adt_const_params feature suggestion more consistent with others and only suggest it when the type can probably work 2023-09-28 23:10:04 +00:00
issue-68615-adt.rs
issue-68615-array.min.stderr make adt_const_params feature suggestion more consistent with others and only suggest it when the type can probably work 2023-09-28 23:10:04 +00:00
issue-68615-array.rs
issue-69654-run-pass.rs
issue-70125-1.rs
issue-70125-2.rs
issue-70167.rs
issue-70180-1-stalled_on.rs
issue-70180-2-stalled_on.rs
issue-70225.rs
issue-70273-assoc-fn.rs Adjust UI tests for unit_bindings 2023-06-12 20:24:48 +08:00
issue-71169.full.stderr improve diagnostics and bless tests 2023-05-05 21:42:54 +01:00
issue-71169.min.stderr make adt_const_params feature suggestion more consistent with others and only suggest it when the type can probably work 2023-09-28 23:10:04 +00:00
issue-71169.rs defer array len printing to const arg printing 2023-01-18 04:07:39 +00:00
issue-71202.rs
issue-71202.stderr
issue-71381.full.stderr Implement custom diagnostic for ConstParamTy 2023-06-01 18:21:42 +00:00
issue-71381.min.stderr make adt_const_params feature suggestion more consistent with others and only suggest it when the type can probably work 2023-09-28 23:10:04 +00:00
issue-71381.rs Implement custom diagnostic for ConstParamTy 2023-06-01 18:21:42 +00:00
issue-71382.full.stderr
issue-71382.min.stderr make adt_const_params feature suggestion more consistent with others and only suggest it when the type can probably work 2023-09-28 23:10:04 +00:00
issue-71382.rs
issue-71547.rs
issue-71611.full.stderr Implement custom diagnostic for ConstParamTy 2023-06-01 18:21:42 +00:00
issue-71611.min.stderr make adt_const_params feature suggestion more consistent with others and only suggest it when the type can probably work 2023-09-28 23:10:04 +00:00
issue-71611.rs Implement custom diagnostic for ConstParamTy 2023-06-01 18:21:42 +00:00
issue-71986.rs
issue-72352.full.stderr
issue-72352.min.stderr make adt_const_params feature suggestion more consistent with others and only suggest it when the type can probably work 2023-09-28 23:10:04 +00:00
issue-72352.rs
issue-72845.rs
issue-72845.stderr
issue-73120.rs
issue-73260.rs Remove save-analysis. 2023-02-16 15:14:45 +11:00
issue-73260.stderr Specify what 'this' actually is 2023-02-21 05:21:07 +00:00
issue-73491.min.stderr make adt_const_params feature suggestion more consistent with others and only suggest it when the type can probably work 2023-09-28 23:10:04 +00:00
issue-73491.rs defer array len printing to const arg printing 2023-01-18 04:07:39 +00:00
issue-73727-static-reference-array-const-param.min.stderr make adt_const_params feature suggestion more consistent with others and only suggest it when the type can probably work 2023-09-28 23:10:04 +00:00
issue-73727-static-reference-array-const-param.rs
issue-74101.min.stderr make adt_const_params feature suggestion more consistent with others and only suggest it when the type can probably work 2023-09-28 23:10:04 +00:00
issue-74101.rs defer array len printing to const arg printing 2023-01-18 04:07:39 +00:00
issue-74255.min.stderr make adt_const_params feature suggestion more consistent with others and only suggest it when the type can probably work 2023-09-28 23:10:04 +00:00
issue-74255.rs Implement custom diagnostic for ConstParamTy 2023-06-01 18:21:42 +00:00
issue-74906.rs
issue-74950.min.stderr Add a note to duplicate diagnostics 2023-10-05 01:04:41 +00:00
issue-74950.rs Implement custom diagnostic for ConstParamTy 2023-06-01 18:21:42 +00:00
issue-75047.min.stderr make adt_const_params feature suggestion more consistent with others and only suggest it when the type can probably work 2023-09-28 23:10:04 +00:00
issue-75047.rs defer array len printing to const arg printing 2023-01-18 04:07:39 +00:00
issue-75299.rs
issue-76701-ty-param-in-const.rs
issue-76701-ty-param-in-const.stderr
issue-79674.rs
issue-79674.stderr Specify what 'this' actually is 2023-02-21 05:21:07 +00:00
issue-80062.rs
issue-80062.stderr
issue-80375.rs
issue-80375.stderr
issue-82956.rs
issue-82956.stderr Special-case item attributes in the suggestion output 2023-04-12 22:50:10 +00:00
issue-83249.rs
issue-83249.stderr Reorder fullfillment errors to keep more interesting ones first 2023-10-04 02:04:14 +00:00
issue-83288.rs
issue-83466.rs
issue-83466.stderr
issue-83765.rs
issue-83765.stderr moved note as unspanned note, moved note to the bottom of the msg 2023-07-18 21:53:34 -04:00
issue-84659.rs
issue-84659.stderr
issue-85031-2.rs Fix known-bug, silence ICE stderr 2023-01-19 20:20:58 +00:00
issue-85031-2.stderr Fix known-bug, silence ICE stderr 2023-01-19 20:20:58 +00:00
issue-86033.rs
issue-86530.rs
issue-86530.stderr Point out if a local trait has no implementations 2023-09-10 21:20:36 +00:00
issue-86535-2.rs
issue-86535.rs
issue-86820.rs
issue-86820.stderr
issue-87076.rs Implement custom diagnostic for ConstParamTy 2023-06-01 18:21:42 +00:00
issue-87470.rs
issue-87493.rs diagnostics: remove inconsistent English article "this" from E0107 2023-02-23 10:27:06 -07:00
issue-87493.stderr diagnostics: remove inconsistent English article "this" from E0107 2023-02-23 10:27:06 -07:00
issue-87964.rs
issue-88119.rs
issue-88468.rs
issue-88997.rs
issue-88997.stderr improve diagnostics and bless tests 2023-05-05 21:42:54 +01:00
issue-89146.rs
issue-89304.rs
issue-89320.rs
issue-89334.rs
issue-90318.rs Constify TypeId ordering impls 2023-01-16 21:26:03 +01:00
issue-90318.stderr Constify TypeId ordering impls 2023-01-16 21:26:03 +01:00
issue-90364.rs
issue-90364.stderr improve diagnostics and bless tests 2023-05-05 21:42:54 +01:00
issue-90455.rs
issue-90455.stderr
issue-92186.rs
issue-96654.rs
issue-97278.rs Implement custom diagnostic for ConstParamTy 2023-06-01 18:21:42 +00:00
issue-97278.stderr Implement custom diagnostic for ConstParamTy 2023-06-01 18:21:42 +00:00
issue-97634.rs
issue-98629.rs
issue-98629.stderr
issue-99641.rs Implement custom diagnostic for ConstParamTy 2023-06-01 18:21:42 +00:00
issue-99641.stderr Implement custom diagnostic for ConstParamTy 2023-06-01 18:21:42 +00:00
issue-100313.rs Adjust some tests for invalid_reference_casting improvements 2023-07-29 12:20:59 +02:00
issue-100313.stderr Improve note for the invalid_reference_casting lint 2023-08-23 11:27:33 +02:00
issue-105037.rs
issue-105821.rs Stabilize const_ptr_read 2023-05-05 20:36:21 +02:00