diff --git a/src/test/compile-fail/E0365.rs b/src/test/compile-fail/E0365.rs new file mode 100644 index 000000000000..7b0fbcc6203d --- /dev/null +++ b/src/test/compile-fail/E0365.rs @@ -0,0 +1,17 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +mod foo { + pub const X: u32 = 1; +} + +pub use foo as foo2; //~ ERROR E0365 + +fn main() {} diff --git a/src/test/compile-fail/E0370.rs b/src/test/compile-fail/E0370.rs new file mode 100644 index 000000000000..cafe26c65ada --- /dev/null +++ b/src/test/compile-fail/E0370.rs @@ -0,0 +1,20 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![allow(dead_code)] + +#[deny(overflowing_literals)] +#[repr(i64)] +enum Foo { + X = 0x7fffffffffffffff, + Y, //~ ERROR E0370 +} + +fn main() {} diff --git a/src/test/compile-fail/E0374.rs b/src/test/compile-fail/E0374.rs new file mode 100644 index 000000000000..6c4782d230dd --- /dev/null +++ b/src/test/compile-fail/E0374.rs @@ -0,0 +1,21 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(coerce_unsized)] +use std::ops::CoerceUnsized; + +struct Foo { + a: i32, +} + +impl CoerceUnsized> for Foo //~ ERROR E0374 + where T: CoerceUnsized {} + +fn main() {} diff --git a/src/test/compile-fail/E0375.rs b/src/test/compile-fail/E0375.rs new file mode 100644 index 000000000000..c6db7b8b64e6 --- /dev/null +++ b/src/test/compile-fail/E0375.rs @@ -0,0 +1,22 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(coerce_unsized)] +use std::ops::CoerceUnsized; + +struct Foo { + a: i32, + b: T, + c: U, +} + +impl CoerceUnsized> for Foo {} //~ ERROR E0375 + +fn main() {} diff --git a/src/test/compile-fail/E0376.rs b/src/test/compile-fail/E0376.rs new file mode 100644 index 000000000000..65be358cc5fe --- /dev/null +++ b/src/test/compile-fail/E0376.rs @@ -0,0 +1,20 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(coerce_unsized)] +use std::ops::CoerceUnsized; + +struct Foo { + a: T, +} + +impl CoerceUnsized for Foo {} //~ ERROR E0376 + +fn main() {} diff --git a/src/test/compile-fail/E0388.rs b/src/test/compile-fail/E0388.rs new file mode 100644 index 000000000000..13f2c23d8c4a --- /dev/null +++ b/src/test/compile-fail/E0388.rs @@ -0,0 +1,22 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +static X: i32 = 1; +const C: i32 = 2; + +const CR: &'static mut i32 = &mut C; //~ ERROR E0017 + //~| ERROR E0017 +static STATIC_REF: &'static mut i32 = &mut X; //~ ERROR E0017 + //~| ERROR E0017 + //~| ERROR E0388 +static CONST_REF: &'static mut i32 = &mut C; //~ ERROR E0017 + //~| ERROR E0017 + +fn main() {} diff --git a/src/test/compile-fail/E0389.rs b/src/test/compile-fail/E0389.rs new file mode 100644 index 000000000000..445831bf8d7f --- /dev/null +++ b/src/test/compile-fail/E0389.rs @@ -0,0 +1,20 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +struct FancyNum { + num: u8, +} + +fn main() { + let mut fancy = FancyNum{ num: 5 }; + let fancy_ref = &(&mut fancy); + fancy_ref.num = 6; //~ ERROR E0389 + println!("{}", fancy_ref.num); +} diff --git a/src/test/compile-fail/E0390.rs b/src/test/compile-fail/E0390.rs new file mode 100644 index 000000000000..cd530dbd6b46 --- /dev/null +++ b/src/test/compile-fail/E0390.rs @@ -0,0 +1,18 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +struct Foo { + x: i32 +} + +impl *mut Foo {} //~ ERROR E0390 + +fn main() { +} diff --git a/src/test/compile-fail/E0392.rs b/src/test/compile-fail/E0392.rs new file mode 100644 index 000000000000..4c3efcf4e8d7 --- /dev/null +++ b/src/test/compile-fail/E0392.rs @@ -0,0 +1,14 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +enum Foo { Bar } //~ ERROR E0392 + +fn main() { +} diff --git a/src/test/compile-fail/E0393.rs b/src/test/compile-fail/E0393.rs new file mode 100644 index 000000000000..1b89555c8ced --- /dev/null +++ b/src/test/compile-fail/E0393.rs @@ -0,0 +1,16 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +trait A {} + +fn together_we_will_rule_the_galaxy(son: &A) {} //~ ERROR E0393 + +fn main() { +}