-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Invalid accepted] E0568 can be bypassed by where Self
#84075
Comments
A slight tweak with the example in #29859, this is indeed unsound. #![feature(auto_traits)]
auto trait Magic where Self: Copy {}
impl<T: Magic> Magic for T {}
fn copy<T: Magic>(x: T) -> (T, T) { (x, x) }
#[derive(Debug)]
struct NoClone;
fn main() {
let (a, b) = copy(NoClone);
println!("{:?} {:?}", a, b);
} This compiles while it shouldn't. @rustbot label: +requires-nightly |
Error: Label 💥 can only be set by Rust team members Please let |
Assigning priority as discussed as part of the Prioritization Working Group procedure and removing edit: upgrading to p-high because by looking at the code samples, the unsoundness looks easy to trigger @rustbot label -I-prioritize +P-high |
Deny `where` clauses on `auto` traits Fixes rust-lang#84075.
Deny `where` clauses on `auto` traits Fixes rust-lang#84075.
Deny `where` clauses on `auto` traits Fixes rust-lang#84075.
Deny `where` clauses on `auto` traits Fixes rust-lang#84075.
I tried this code:
I expected to see this happen: got E0568 because the unstable book say supertraits for auto trait are unsound
Instead, this happened: Compiler accepted those code
Playground link:
https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=57126ad5d71bd5bbaa913416b70fae67
Meta
rustc --version --verbose
:nightly feature tracking issue: #13231
The text was updated successfully, but these errors were encountered: