Closed as not planned
Description
Beginning with issue #21405, Rust combines multiple identical candidates into one (in some way). Since crates typically pub use
the traits on the outermost level (e.g. module::TheTrait
instead of module::inner::detail::TheTrait
), the outermost candidate should be displayed as suggestion.
Here's a real-life example:
main.rs:44:21: 44:62 error: no method named `json_as` found for type `&'r mut nickel::request::Request<'mw, 'conn, _>` in the current scope
main.rs:44 let dir = request.json_as::<BlaBla>().unwrap().dir;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<nickel macros>:24:12: 24:42 note: in this expansion of as_block! (defined in <nickel macros>)
<nickel macros>:10:1: 10:60 note: in this expansion of _middleware_inner! (defined in <nickel macros>)
main.rs:43:47: 48:3 note: in this expansion of middleware! (defined in <nickel macros>)
main.rs:44:21: 44:62 help: items from traits can only be used if the trait is in scope; the following trait is implemented but not in scope, perhaps add a `use` for it:
main.rs:44:21: 44:62 help: candidate #1: use `nickel::json_body_parser::JsonBody`
However the trait "JsonBody" can be imported with just use nickel::JsonBody
.