1
Fork 0
rust/compiler/rustc_hir_analysis/src
Esteban Küber e057c43382 Account for impl Trait { when impl Trait for Type { was intended
On editions where bare traits are never allowed, detect if the user has
written `impl Trait` with no type, silence any dyn-compatibility errors,
and provide a structured suggestion for the potentially missing type:

```
error[E0782]: trait objects must include the `dyn` keyword
  --> $DIR/missing-for-type-in-impl.rs:8:6
   |
LL | impl Foo<i64> {
   |      ^^^^^^^^
   |
help: add `dyn` keyword before this trait
   |
LL | impl dyn Foo<i64> {
   |      +++
help: you might have intended to implement this trait for a given type
   |
LL | impl Foo<i64> for /* Type */ {
   |               ++++++++++++++
```
2024-10-04 22:59:03 +00:00
..
check Rollup merge of #131202 - Urgau:wide-ptrs-compiler, r=jieyouxu 2024-10-04 15:42:54 +02:00
coherence Use wide pointers consistenly across the compiler 2024-10-04 14:06:48 +02:00
collect Move in_trait into OpaqueTyOrigin 2024-10-02 22:48:26 -04:00
errors Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
hir_ty_lowering Account for impl Trait { when impl Trait for Type { was intended 2024-10-04 22:59:03 +00:00
impl_wf_check Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
outlives Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
variance Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
autoderef.rs Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
bounds.rs properly elaborate effects implied bounds for super traits 2024-09-27 22:36:46 +08:00
check_unused.rs Remove #[macro_use] extern crate tracing from rustc_hir_analysis. 2024-08-30 17:14:59 +10:00
collect.rs Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
constrained_generic_params.rs Remove #[macro_use] extern crate tracing from rustc_hir_analysis. 2024-08-30 17:14:59 +10:00
delegation.rs Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
errors.rs Add missing diagnostics and flesh out tests 2024-09-20 22:18:57 -04:00
hir_wf_check.rs Remove #[macro_use] extern crate tracing from rustc_hir_analysis. 2024-08-30 17:14:59 +10:00
impl_wf_check.rs Add warn(unreachable_pub) to rustc_hir_analysis. 2024-08-27 13:14:50 +10:00
lib.rs Handle rustc-hir-analysis cases of rustc::potential_query_instability lint 2024-10-02 08:28:45 +03:00