-
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 lintsA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.
Description
Here is an example. The error message only tells me that Send
is required but not present. The Send
bound is implicit though, and is missing due to something in my code. It would be nice if the compiler could tell me what is preventing the Send
bound.
Error
bounds.rs:8:1: 9:2 error: the trait `core::kinds::Send` is not implemented for the type `MyFoo`
bounds.rs:8 impl Foo for MyFoo {
bounds.rs:9 }
bounds.rs:8:1: 9:2 note: the trait `core::kinds::Send` must be implemented because it is required by `Foo`
bounds.rs:8 impl Foo for MyFoo {
bounds.rs:9 }
error: aborting due to previous error
➜ rust-exp rustc bounds.rs
bounds.rs:5:5: 5:33 warning: struct field is never used: `children`, #[warn(dead_code)] on by default
bounds.rs:5 children: Vec<Box<Foo+Send>>,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
Code
pub trait Foo : Send {
}
pub struct MyFoo {
children: Vec<Box<Foo>>,
}
impl Foo for MyFoo {
}
pub fn main() {
}
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.