Skip to content
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

Negative blanket OIBIT impl treated as positive #28475

Open
bluss opened this Issue Sep 17, 2015 · 2 comments

Comments

Projects
None yet
6 participants
@bluss
Copy link
Contributor

bluss commented Sep 17, 2015

impl !Pod for .. {} looks like it produces a positive impl.

(playpen)

#![feature(optin_builtin_traits)]

unsafe trait Pod {}

unsafe impl !Pod for .. {}

struct Foo<X, Y>(X, Y);

fn is_pod<T: Pod>(_: &T) { }

fn main() {
    is_pod(&Foo(0, 0));
}

cc @nikomatsakis

OIBIT tracker issue: #13231

@arielb1

This comment has been minimized.

Copy link
Contributor

arielb1 commented Sep 17, 2015

Negative impls are only supposed to work if they are nominal (impl<U,V,W> !Foo for Bar<U,V,W>). We should however decide what this means.

@nikomatsakis

This comment has been minimized.

Copy link
Contributor

nikomatsakis commented Sep 18, 2015

impl !Pod for .. is certainly not legal, in any case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.