-
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-bugCategory: This is a bug.Category: This is a bug.P-highHigh priorityHigh priorityT-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.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.Performance or correctness regression from stable to beta.
Milestone
Description
Meta
This occurs in 539f208 (from 13-09) and 1.21 beta, but not on stable
STR
#[derive(Debug)]
pub struct X;
impl Add for X {} // trigger unused import
fn main() {}
Expected result
On stable, you get a correct candidate suggestion:
Compiling playground v0.0.1 (file:///playground)
error[E0405]: cannot find trait `Add` in this scope
--> src/main.rs:4:6
|
4 | impl Add for X {} // trigger unused import
| ^^^ not found in this scope
|
help: possible candidate is found in another module, you can import it into scope
|
1 | use std::ops::Add;
|
Actual Result
The suggestion contains a stray derive
:
Compiling playground v0.0.1 (file:///playground)
error[E0405]: cannot find trait `Add` in this scope
--> src/main.rs:4:6
|
4 | impl Add for X {} // trigger unused import
| ^^^ not found in this scope
|
help: possible candidate is found in another module, you can import it into scope
|
1 | #[derive(use std::ops::Add; <--- STRAY DERIVE IN SUGGESTION
|
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-bugCategory: This is a bug.Category: This is a bug.P-highHigh priorityHigh priorityT-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.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.Performance or correctness regression from stable to beta.