-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
I tried this code:
struct S {}
impl S {
fn new() -> Self {
S {}
}
}
fn main() {
<S as NonExistingTrait>::method_of_non_existing_trait();
}
I would expect the error message to be something like "cannot find trait NonExistingTrait
in this scope" like I would have for
fn f<T : NonExistingTrait>(){}
Instead the error message is
error[E0433]: failed to resolve: use of undeclared type `NonExistingTrait`
--> example.rs:12:11
|
12 | <S as NonExistingTrait>::method_of_non_existing_trait();
| ^^^^^^^^^^^^^^^^ use of undeclared type `NonExistingTrait`
Meta
rustc --version --verbose
:
rustc 1.70.0-dev
binary: rustc
commit-hash: unknown
commit-date: unknown
host: x86_64-unknown-linux-gnu
release: 1.70.0-dev
LLVM version: 16.0.0
@rustbot claim
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.