-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsD-verboseDiagnostics: Too much output caused by a single piece of incorrect code.Diagnostics: Too much output caused by a single piece of incorrect code.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
$ cargo script -e 'trait Trait {} impl<T: Trait> Drop for T { fn drop(&mut self) { } }'
Compiling expr v0.1.0 (file:///Users/alex/.multirust/toolchains/beta/cargo/.cargo/script-cache/expr-223e68b0943558e6)
error[E0120]: the Drop trait may only be implemented on structures
--> /Users/alex/.multirust/toolchains/beta/cargo/.cargo/script-cache/expr-223e68b0943558e6/expr.rs:5:41
|
5 | {trait Trait {} impl<T: Trait> Drop for T { fn drop(&mut self) { } }}
| ^ implementing Drop requires a struct
error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g. `MyStruct<T>`); only traits defined in the current crate can be implemented for a type parameter
--> /Users/alex/.multirust/toolchains/beta/cargo/.cargo/script-cache/expr-223e68b0943558e6/expr.rs:5:17
|
5 | {trait Trait {} impl<T: Trait> Drop for T { fn drop(&mut self) { } }}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to 2 previous errors
error: Could not compile `expr`.
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsD-verboseDiagnostics: Too much output caused by a single piece of incorrect code.Diagnostics: Too much output caused by a single piece of incorrect code.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.