Skip to content

[Invalid accepted] E0568 can be bypassed by where Self #84075

Closed
@codehz

Description

@codehz

I tried this code:

#![feature(auto_traits)]

auto trait CanCopy where Self: Copy {}

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:

1.53.0-nightly

(2021-04-09 dae9d6ac3e9a8fb389cf)
(rust playground)

nightly feature tracking issue: #13231

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-trait-systemArea: Trait systemC-bugCategory: This is a bug.F-auto_traits`#![feature(auto_traits)]`I-unsoundIssue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/SoundnessP-highHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.requires-nightlyThis issue requires a nightly compiler in some way.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions