From: David Wood Date: Thu, 9 Aug 2018 16:11:35 +0000 (+0200) Subject: Moved tests back to compile-test if they don't work on ui. X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=a92264245521fea1b1c5e4cd4ce168432bec3d5a;p=rust.git Moved tests back to compile-test if they don't work on ui. --- diff --git a/src/test/compile-fail/coerce-unsafe-to-closure.rs b/src/test/compile-fail/coerce-unsafe-to-closure.rs new file mode 100644 index 00000000000..90cbbf242aa --- /dev/null +++ b/src/test/compile-fail/coerce-unsafe-to-closure.rs @@ -0,0 +1,14 @@ +// Copyright 2014 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. + +fn main() { + let x: Option<&[u8]> = Some("foo").map(std::mem::transmute); + //~^ ERROR E0277 +} diff --git a/src/test/compile-fail/issue-46209-private-enum-variant-reexport.rs b/src/test/compile-fail/issue-46209-private-enum-variant-reexport.rs new file mode 100644 index 00000000000..f5a20dd96dc --- /dev/null +++ b/src/test/compile-fail/issue-46209-private-enum-variant-reexport.rs @@ -0,0 +1,51 @@ +// Copyright 2017 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(crate_visibility_modifier)] + +mod rank { + pub use self::Professor::*; + //~^ ERROR enum is private and its variants cannot be re-exported + pub use self::Lieutenant::{JuniorGrade, Full}; + //~^ ERROR variant `JuniorGrade` is private and cannot be re-exported + //~| ERROR variant `Full` is private and cannot be re-exported + pub use self::PettyOfficer::*; + //~^ ERROR enum is private and its variants cannot be re-exported + pub use self::Crewman::*; + //~^ ERROR enum is private and its variants cannot be re-exported + + enum Professor { + Adjunct, + Assistant, + Associate, + Full + } + + enum Lieutenant { + JuniorGrade, + Full, + } + + pub(in rank) enum PettyOfficer { + SecondClass, + FirstClass, + Chief, + MasterChief + } + + crate enum Crewman { + Recruit, + Apprentice, + Full + } + +} + +fn main() {} diff --git a/src/test/compile-fail/meta-expected-error-wrong-rev.rs b/src/test/compile-fail/meta-expected-error-wrong-rev.rs new file mode 100644 index 00000000000..8869e950b3a --- /dev/null +++ b/src/test/compile-fail/meta-expected-error-wrong-rev.rs @@ -0,0 +1,26 @@ +// Copyright 2014 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. + +// ignore-compare-mode-nll + +// revisions: a +// should-fail + +// This is a "meta-test" of the compilertest framework itself. In +// particular, it includes the right error message, but the message +// targets the wrong revision, so we expect the execution to fail. +// See also `meta-expected-error-correct-rev.rs`. + +#[cfg(a)] +fn foo() { + let x: u32 = 22_usize; //[b]~ ERROR mismatched types +} + +fn main() { } diff --git a/src/test/ui/coercion/coerce-unsafe-to-closure.rs b/src/test/ui/coercion/coerce-unsafe-to-closure.rs deleted file mode 100644 index 90cbbf242aa..00000000000 --- a/src/test/ui/coercion/coerce-unsafe-to-closure.rs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2014 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. - -fn main() { - let x: Option<&[u8]> = Some("foo").map(std::mem::transmute); - //~^ ERROR E0277 -} diff --git a/src/test/ui/coercion/coerce-unsafe-to-closure.stderr b/src/test/ui/coercion/coerce-unsafe-to-closure.stderr deleted file mode 100644 index bf355b4e9d9..00000000000 --- a/src/test/ui/coercion/coerce-unsafe-to-closure.stderr +++ /dev/null @@ -1,9 +0,0 @@ -error[E0277]: the trait bound `unsafe extern "rust-intrinsic" fn(_) -> _ {std::mem::transmute::<_, _>}: std::ops::FnOnce<(&str,)>` is not satisfied - --> $DIR/coerce-unsafe-to-closure.rs:12:40 - | -LL | let x: Option<&[u8]> = Some("foo").map(std::mem::transmute); - | ^^^ the trait `std::ops::FnOnce<(&str,)>` is not implemented for `unsafe extern "rust-intrinsic" fn(_) -> _ {std::mem::transmute::<_, _>}` - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/invalid-module-declaration/invalid-module-declaration.rs b/src/test/ui/invalid-module-declaration/invalid-module-declaration.rs index 18ca5d09798..c0a10fe3e60 100644 --- a/src/test/ui/invalid-module-declaration/invalid-module-declaration.rs +++ b/src/test/ui/invalid-module-declaration/invalid-module-declaration.rs @@ -11,9 +11,6 @@ // ignore-tidy-linelength // ignore-windows -// error-pattern: cannot declare a new module at this location -// error-pattern: maybe move this module - mod auxiliary { mod foo; } diff --git a/src/test/ui/issues/issue-46209-private-enum-variant-reexport.rs b/src/test/ui/issues/issue-46209-private-enum-variant-reexport.rs deleted file mode 100644 index f5a20dd96dc..00000000000 --- a/src/test/ui/issues/issue-46209-private-enum-variant-reexport.rs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2017 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(crate_visibility_modifier)] - -mod rank { - pub use self::Professor::*; - //~^ ERROR enum is private and its variants cannot be re-exported - pub use self::Lieutenant::{JuniorGrade, Full}; - //~^ ERROR variant `JuniorGrade` is private and cannot be re-exported - //~| ERROR variant `Full` is private and cannot be re-exported - pub use self::PettyOfficer::*; - //~^ ERROR enum is private and its variants cannot be re-exported - pub use self::Crewman::*; - //~^ ERROR enum is private and its variants cannot be re-exported - - enum Professor { - Adjunct, - Assistant, - Associate, - Full - } - - enum Lieutenant { - JuniorGrade, - Full, - } - - pub(in rank) enum PettyOfficer { - SecondClass, - FirstClass, - Chief, - MasterChief - } - - crate enum Crewman { - Recruit, - Apprentice, - Full - } - -} - -fn main() {} diff --git a/src/test/ui/issues/issue-46209-private-enum-variant-reexport.stderr b/src/test/ui/issues/issue-46209-private-enum-variant-reexport.stderr deleted file mode 100644 index 9e5abdeaa43..00000000000 --- a/src/test/ui/issues/issue-46209-private-enum-variant-reexport.stderr +++ /dev/null @@ -1,44 +0,0 @@ -error: enum is private and its variants cannot be re-exported - --> $DIR/issue-46209-private-enum-variant-reexport.rs:19:13 - | -LL | pub use self::PettyOfficer::*; - | ^^^^^^^^^^^^^^^^^^^^^ -... -LL | pub(in rank) enum PettyOfficer { - | ------------------------------ help: consider making the enum public: `pub enum PettyOfficer` - -error: enum is private and its variants cannot be re-exported - --> $DIR/issue-46209-private-enum-variant-reexport.rs:21:13 - | -LL | pub use self::Crewman::*; - | ^^^^^^^^^^^^^^^^ -... -LL | crate enum Crewman { - | ------------------ help: consider making the enum public: `pub enum Crewman` - -error: enum is private and its variants cannot be re-exported - --> $DIR/issue-46209-private-enum-variant-reexport.rs:14:13 - | -LL | pub use self::Professor::*; - | ^^^^^^^^^^^^^^^^^^ -... -LL | enum Professor { - | -------------- help: consider making the enum public: `pub enum Professor` - -error: variant `JuniorGrade` is private and cannot be re-exported - --> $DIR/issue-46209-private-enum-variant-reexport.rs:16:32 - | -LL | pub use self::Lieutenant::{JuniorGrade, Full}; - | ^^^^^^^^^^^ -... -LL | enum Lieutenant { - | --------------- help: consider making the enum public: `pub enum Lieutenant` - -error: variant `Full` is private and cannot be re-exported - --> $DIR/issue-46209-private-enum-variant-reexport.rs:16:45 - | -LL | pub use self::Lieutenant::{JuniorGrade, Full}; - | ^^^^ - -error: aborting due to 5 previous errors - diff --git a/src/test/ui/meta-expected-error-wrong-rev.a.stderr b/src/test/ui/meta-expected-error-wrong-rev.a.stderr deleted file mode 100644 index c3c39183c9a..00000000000 --- a/src/test/ui/meta-expected-error-wrong-rev.a.stderr +++ /dev/null @@ -1,9 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/meta-expected-error-wrong-rev.rs:23:18 - | -LL | let x: u32 = 22_usize; //[b]~ ERROR mismatched types - | ^^^^^^^^ expected u32, found usize - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/meta-expected-error-wrong-rev.rs b/src/test/ui/meta-expected-error-wrong-rev.rs deleted file mode 100644 index 8869e950b3a..00000000000 --- a/src/test/ui/meta-expected-error-wrong-rev.rs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2014 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. - -// ignore-compare-mode-nll - -// revisions: a -// should-fail - -// This is a "meta-test" of the compilertest framework itself. In -// particular, it includes the right error message, but the message -// targets the wrong revision, so we expect the execution to fail. -// See also `meta-expected-error-correct-rev.rs`. - -#[cfg(a)] -fn foo() { - let x: u32 = 22_usize; //[b]~ ERROR mismatched types -} - -fn main() { }