Using an out-of-scope trait item on a boxed trait object should suggest use-ing the trait #105159
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Given the following code:
The current output is:
Ideally the output should suggest
use
-ing the out-of-scope trait, similar to E0599:Someone tried to do dynamic dispatch between two underlying
BufReaders
used a boxed trait object (with the type spelledBox<dyn io::BufRead>
, soBufRead
wasn't in scope) and call thelines
method on the boxed reader, and it was unclear from the error why the method wasn't accessible:https://mastodon.social/@mcc/109441482880682856
This is reproducible on nightly (rustc 1.67.0-nightly (c090c68 2022-12-01)).
The text was updated successfully, but these errors were encountered: