rust/tests/ui/privacy/privacy-sanity.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

83 lines
2.2 KiB
Rust
Raw Normal View History

#![feature(negative_impls)]
pub trait Tr {
fn f();
const C: u8;
type T;
}
pub struct S {
pub a: u8
}
struct Ts(pub u8);
pub impl Tr for S { //~ ERROR visibility qualifiers are not permitted here
pub fn f() {} //~ ERROR visibility qualifiers are not permitted here
pub const C: u8 = 0; //~ ERROR visibility qualifiers are not permitted here
pub type T = u8; //~ ERROR visibility qualifiers are not permitted here
}
pub impl S { //~ ERROR visibility qualifiers are not permitted here
pub fn f() {}
pub const C: u8 = 0;
// pub type T = u8;
}
pub extern "C" { //~ ERROR visibility qualifiers are not permitted here
pub fn f();
pub static St: u8;
}
const MAIN: u8 = {
2016-02-26 18:20:56 +00:00
pub trait Tr {
fn f();
const C: u8;
type T;
}
2016-02-26 18:20:56 +00:00
pub struct S {
pub a: u8
}
2016-02-26 18:20:56 +00:00
struct Ts(pub u8);
pub impl Tr for S { //~ ERROR visibility qualifiers are not permitted here
pub fn f() {} //~ ERROR visibility qualifiers are not permitted here
pub const C: u8 = 0; //~ ERROR visibility qualifiers are not permitted here
pub type T = u8; //~ ERROR visibility qualifiers are not permitted here
}
pub impl S { //~ ERROR visibility qualifiers are not permitted here
2016-02-26 18:20:56 +00:00
pub fn f() {}
pub const C: u8 = 0;
// pub type T = u8;
}
pub extern "C" { //~ ERROR visibility qualifiers are not permitted here
2016-02-26 18:20:56 +00:00
pub fn f();
pub static St: u8;
}
0
};
fn main() {
2016-02-26 18:20:56 +00:00
pub trait Tr {
fn f();
const C: u8;
type T;
}
2016-02-26 18:20:56 +00:00
pub struct S {
pub a: u8
}
2016-02-26 18:20:56 +00:00
struct Ts(pub u8);
pub impl Tr for S { //~ ERROR visibility qualifiers are not permitted here
pub fn f() {} //~ ERROR visibility qualifiers are not permitted here
pub const C: u8 = 0; //~ ERROR visibility qualifiers are not permitted here
pub type T = u8; //~ ERROR visibility qualifiers are not permitted here
}
pub impl S { //~ ERROR visibility qualifiers are not permitted here
2016-02-26 18:20:56 +00:00
pub fn f() {}
pub const C: u8 = 0;
// pub type T = u8;
}
pub extern "C" { //~ ERROR visibility qualifiers are not permitted here
2016-02-26 18:20:56 +00:00
pub fn f();
pub static St: u8;
}
}