rust/compiler/rustc_resolve/src
Michael Goulet 484d8dd5b4
Rollup merge of #137825 - estebank:rtn-sugg-2, r=compiler-errors
Provide more context on resolve error caused from incorrect RTN

When encountering a resolve E0575 error for an associated method (when a type was expected), see if it could have been an intended return type notation bound.

```
error[E0575]: expected associated type, found associated function `Trait::method`
  --> $DIR/bad-inputs-and-output.rs:31:36
   |
LL | fn foo_qualified<T: Trait>() where <T as Trait>::method(i32): Send {}
   |                                    ^^^^^^^^^^^^^^^^^^^^^^^^^ not a associated type
   |
help: you might have meant to use the return type notation syntax
   |
LL - fn foo_qualified<T: Trait>() where <T as Trait>::method(i32): Send {}
LL + fn foo_qualified<T: Trait>() where T::method(..): Send {}
   |
```

Built on top of #137824, only second commit is relevant for review.

r? ````````@compiler-errors````````
2025-03-06 12:22:21 -05:00
..
late Rollup merge of #137825 - estebank:rtn-sugg-2, r=compiler-errors 2025-03-06 12:22:21 -05:00
build_reduced_graph.rs Implment #[cfg] and #[cfg_attr] in where clauses 2025-03-01 22:02:46 +08:00
check_unused.rs Run clippy --fix for unnecessary_map_or lint 2025-01-19 19:15:00 +00:00
def_collector.rs Rollup merge of #132388 - frank-king:feature/where-cfg, r=petrochenkov 2025-03-03 10:40:56 +01:00
diagnostics.rs Introduce feature(generic_const_parameter_types) 2025-02-28 20:43:15 +00:00
effective_visibilities.rs rustc_resolve: reduce rightwards drift with let..else 👉💨 2025-01-21 13:42:32 +00:00
errors.rs Introduce feature(generic_const_parameter_types) 2025-02-28 20:43:15 +00:00
ident.rs Introduce feature(generic_const_parameter_types) 2025-02-28 20:43:15 +00:00
imports.rs Rollup merge of #137529 - klensy:unused3, r=lcnr 2025-02-26 04:15:04 +01:00
late.rs Rollup merge of #137825 - estebank:rtn-sugg-2, r=compiler-errors 2025-03-06 12:22:21 -05:00
lib.rs Introduce feature(generic_const_parameter_types) 2025-02-28 20:43:15 +00:00
macros.rs Introduce new-style attribute parsers for several attributes 2025-02-24 14:31:17 +01:00
rustdoc.rs rustdoc: improve refdef handling in the unresolved link lint 2025-02-15 12:21:35 -07:00