summaryrefslogtreecommitdiffstats
path: root/tests/ui/auto-traits/suspicious-negative-impls-lint.rs
blob: 34842e5944b463c4003104d7c130b0351f68c638 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#![feature(negative_impls)]
#![deny(suspicious_auto_trait_impls)]

use std::marker::PhantomData;

struct ContainsVec<T>(Vec<T>);
impl !Send for ContainsVec<u32> {}
//~^ ERROR
//~| WARNING this will change its meaning

pub struct WithPhantomDataSend<T, U>(PhantomData<T>, U);
impl<T> !Send for WithPhantomDataSend<*const T, u8> {}
//~^ ERROR
//~| WARNING this will change its meaning

pub struct WithLifetime<'a, T>(&'a (), T);
impl<T> !Sync for WithLifetime<'static, Option<T>> {}
//~^ ERROR
//~| WARNING this will change its meaning

fn main() {}