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.0 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 unnecessary visibility qualifier
pub fn f() {} //~ ERROR unnecessary visibility qualifier
pub const C: u8 = 0; //~ ERROR unnecessary visibility qualifier
pub type T = u8; //~ ERROR unnecessary visibility qualifier
}
pub impl S { //~ ERROR unnecessary visibility qualifier
pub fn f() {}
pub const C: u8 = 0;
// pub type T = u8;
}
pub extern "C" { //~ ERROR unnecessary visibility qualifier
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 unnecessary visibility qualifier
pub fn f() {} //~ ERROR unnecessary visibility qualifier
pub const C: u8 = 0; //~ ERROR unnecessary visibility qualifier
pub type T = u8; //~ ERROR unnecessary visibility qualifier
}
pub impl S { //~ ERROR unnecessary visibility qualifier
2016-02-26 18:20:56 +00:00
pub fn f() {}
pub const C: u8 = 0;
// pub type T = u8;
}
pub extern "C" { //~ ERROR unnecessary visibility qualifier
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 unnecessary visibility qualifier
pub fn f() {} //~ ERROR unnecessary visibility qualifier
pub const C: u8 = 0; //~ ERROR unnecessary visibility qualifier
pub type T = u8; //~ ERROR unnecessary visibility qualifier
}
pub impl S { //~ ERROR unnecessary visibility qualifier
2016-02-26 18:20:56 +00:00
pub fn f() {}
pub const C: u8 = 0;
// pub type T = u8;
}
pub extern "C" { //~ ERROR unnecessary visibility qualifier
2016-02-26 18:20:56 +00:00
pub fn f();
pub static St: u8;
}
}