Skip to content

Commit

Permalink
Auto merge of #46640 - tommyip:ui_tests, r=estebank
Browse files Browse the repository at this point in the history
Enforce successful ui tests to have must-compile-successfully flag.

r? @nikomatsakis
cc @oli-obk

Fixes #46587
  • Loading branch information
bors committed Dec 11, 2017
2 parents 5f3bd73 + 2ad5bf0 commit 33245fe
Show file tree
Hide file tree
Showing 51 changed files with 253 additions and 203 deletions.
2 changes: 2 additions & 0 deletions src/test/ui/check_match/issue-43253.rs
Expand Up @@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

// must-compile-successfully

#![feature(exclusive_range_pattern)]
#![warn(unreachable_patterns)]

Expand Down
16 changes: 8 additions & 8 deletions src/test/ui/check_match/issue-43253.stderr
@@ -1,24 +1,24 @@
warning: unreachable pattern
--> $DIR/issue-43253.rs:37:9
--> $DIR/issue-43253.rs:39:9
|
37 | 9 => {},
39 | 9 => {},
| ^
|
note: lint level defined here
--> $DIR/issue-43253.rs:12:9
--> $DIR/issue-43253.rs:14:9
|
12 | #![warn(unreachable_patterns)]
14 | #![warn(unreachable_patterns)]
| ^^^^^^^^^^^^^^^^^^^^

warning: unreachable pattern
--> $DIR/issue-43253.rs:43:9
--> $DIR/issue-43253.rs:45:9
|
43 | 8...9 => {},
45 | 8...9 => {},
| ^^^^^

warning: unreachable pattern
--> $DIR/issue-43253.rs:49:9
--> $DIR/issue-43253.rs:51:9
|
49 | 9...9 => {},
51 | 9...9 => {},
| ^^^^^

2 changes: 2 additions & 0 deletions src/test/ui/codemap_tests/unicode_3.rs
Expand Up @@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

// must-compile-successfully

fn main() {
let s = "ZͨA͑ͦ͒͋ͤ͑̚L̄͑͋Ĝͨͥ̿͒̽̈́Oͥ͛ͭ!̏"; while true { break; }
println!("{}", s);
Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/codemap_tests/unicode_3.stderr
@@ -1,7 +1,7 @@
warning: denote infinite loops with `loop { ... }`
--> $DIR/unicode_3.rs:12:45
--> $DIR/unicode_3.rs:14:45
|
12 | let s = "ZͨA͑ͦ͒͋ͤ͑̚L̄͑͋Ĝͨͥ̿͒̽̈́Oͥ͛ͭ!̏"; while true { break; }
14 | let s = "ZͨA͑ͦ͒͋ͤ͑̚L̄͑͋Ĝͨͥ̿͒̽̈́Oͥ͛ͭ!̏"; while true { break; }
| ----------^^^^^^^^^^^
| |
| help: use `loop`
Expand Down
1 change: 1 addition & 0 deletions src/test/ui/explain.rs
Expand Up @@ -9,3 +9,4 @@
// except according to those terms.

// compile-flags: --explain E0591
// must-compile-successfully
2 changes: 2 additions & 0 deletions src/test/ui/hello_world/main.rs
Expand Up @@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

// must-compile-successfully

// Test that compiling hello world succeeds with no output of any kind.

fn main() {
Expand Down
1 change: 1 addition & 0 deletions src/test/ui/lint/command-line-lint-group-allow.rs
Expand Up @@ -9,6 +9,7 @@
// except according to those terms.

// compile-flags: -A bad-style
// must-compile-successfully

fn main() {
let _InappropriateCamelCasing = true;
Expand Down
1 change: 1 addition & 0 deletions src/test/ui/lint/command-line-lint-group-warn.rs
Expand Up @@ -9,6 +9,7 @@
// except according to those terms.

// compile-flags: -W bad-style
// must-compile-successfully

fn main() {
let _InappropriateCamelCasing = true;
Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/lint/command-line-lint-group-warn.stderr
@@ -1,7 +1,7 @@
warning: variable `_InappropriateCamelCasing` should have a snake case name such as `_inappropriate_camel_casing`
--> $DIR/command-line-lint-group-warn.rs:14:9
--> $DIR/command-line-lint-group-warn.rs:15:9
|
14 | let _InappropriateCamelCasing = true;
15 | let _InappropriateCamelCasing = true;
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `-W non-snake-case` implied by `-W bad-style`
Expand Down
2 changes: 2 additions & 0 deletions src/test/ui/lint/not_found.rs
Expand Up @@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

// must-compile-successfully

// this tests the `unknown_lint` lint, especially the suggestions

// the suggestion only appears if a lint with the lowercase name exists
Expand Down
12 changes: 6 additions & 6 deletions src/test/ui/lint/not_found.stderr
@@ -1,20 +1,20 @@
warning: unknown lint: `FOO_BAR`
--> $DIR/not_found.rs:14:9
--> $DIR/not_found.rs:16:9
|
14 | #[allow(FOO_BAR)]
16 | #[allow(FOO_BAR)]
| ^^^^^^^
|
= note: #[warn(unknown_lints)] on by default

warning: unknown lint: `DEAD_CODE`
--> $DIR/not_found.rs:16:8
--> $DIR/not_found.rs:18:8
|
16 | #[warn(DEAD_CODE)]
18 | #[warn(DEAD_CODE)]
| ^^^^^^^^^ help: lowercase the lint name: `dead_code`

warning: unknown lint: `Warnings`
--> $DIR/not_found.rs:18:8
--> $DIR/not_found.rs:20:8
|
18 | #[deny(Warnings)]
20 | #[deny(Warnings)]
| ^^^^^^^^ help: lowercase the lint name: `warnings`

2 changes: 2 additions & 0 deletions src/test/ui/lint/unreachable_pub-pub_crate.rs
Expand Up @@ -14,6 +14,8 @@
// suggestions to use `crate` given when it is on). When that feature becomes
// stable, this test can be deleted.

// must-compile-successfully

#![feature(macro_vis_matcher)]

#![allow(unused)]
Expand Down
60 changes: 30 additions & 30 deletions src/test/ui/lint/unreachable_pub-pub_crate.stderr
@@ -1,131 +1,131 @@
warning: unreachable `pub` item
--> $DIR/unreachable_pub-pub_crate.rs:24:5
--> $DIR/unreachable_pub-pub_crate.rs:26:5
|
24 | pub use std::fmt;
26 | pub use std::fmt;
| ---^^^^^^^^^^^^^^
| |
| help: consider restricting its visibility: `pub(crate)`
|
note: lint level defined here
--> $DIR/unreachable_pub-pub_crate.rs:20:9
--> $DIR/unreachable_pub-pub_crate.rs:22:9
|
20 | #![warn(unreachable_pub)]
22 | #![warn(unreachable_pub)]
| ^^^^^^^^^^^^^^^
= help: or consider exporting it for use by other crates

warning: unreachable `pub` item
--> $DIR/unreachable_pub-pub_crate.rs:26:5
--> $DIR/unreachable_pub-pub_crate.rs:28:5
|
26 | pub struct Hydrogen {
28 | pub struct Hydrogen {
| ---^^^^^^^^^^^^^^^^
| |
| help: consider restricting its visibility: `pub(crate)`
|
= help: or consider exporting it for use by other crates

warning: unreachable `pub` field
--> $DIR/unreachable_pub-pub_crate.rs:28:9
--> $DIR/unreachable_pub-pub_crate.rs:30:9
|
28 | pub neutrons: usize,
30 | pub neutrons: usize,
| ---^^^^^^^^^^^^^^^^
| |
| help: consider restricting its visibility: `pub(crate)`

warning: unreachable `pub` item
--> $DIR/unreachable_pub-pub_crate.rs:34:9
--> $DIR/unreachable_pub-pub_crate.rs:36:9
|
34 | pub fn count_neutrons(&self) -> usize { self.neutrons }
36 | pub fn count_neutrons(&self) -> usize { self.neutrons }
| ---^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| help: consider restricting its visibility: `pub(crate)`

warning: unreachable `pub` item
--> $DIR/unreachable_pub-pub_crate.rs:38:5
--> $DIR/unreachable_pub-pub_crate.rs:40:5
|
38 | pub enum Helium {}
40 | pub enum Helium {}
| ---^^^^^^^^^^^^
| |
| help: consider restricting its visibility: `pub(crate)`
|
= help: or consider exporting it for use by other crates

warning: unreachable `pub` item
--> $DIR/unreachable_pub-pub_crate.rs:39:5
--> $DIR/unreachable_pub-pub_crate.rs:41:5
|
39 | pub union Lithium { c1: usize, c2: u8 }
41 | pub union Lithium { c1: usize, c2: u8 }
| ---^^^^^^^^^^^^^^
| |
| help: consider restricting its visibility: `pub(crate)`
|
= help: or consider exporting it for use by other crates

warning: unreachable `pub` item
--> $DIR/unreachable_pub-pub_crate.rs:40:5
--> $DIR/unreachable_pub-pub_crate.rs:42:5
|
40 | pub fn beryllium() {}
42 | pub fn beryllium() {}
| ---^^^^^^^^^^^^^^^
| |
| help: consider restricting its visibility: `pub(crate)`
|
= help: or consider exporting it for use by other crates

warning: unreachable `pub` item
--> $DIR/unreachable_pub-pub_crate.rs:41:5
--> $DIR/unreachable_pub-pub_crate.rs:43:5
|
41 | pub trait Boron {}
43 | pub trait Boron {}
| ---^^^^^^^^^^^^
| |
| help: consider restricting its visibility: `pub(crate)`
|
= help: or consider exporting it for use by other crates

warning: unreachable `pub` item
--> $DIR/unreachable_pub-pub_crate.rs:42:5
--> $DIR/unreachable_pub-pub_crate.rs:44:5
|
42 | pub const CARBON: usize = 1;
44 | pub const CARBON: usize = 1;
| ---^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| help: consider restricting its visibility: `pub(crate)`
|
= help: or consider exporting it for use by other crates

warning: unreachable `pub` item
--> $DIR/unreachable_pub-pub_crate.rs:43:5
--> $DIR/unreachable_pub-pub_crate.rs:45:5
|
43 | pub static NITROGEN: usize = 2;
45 | pub static NITROGEN: usize = 2;
| ---^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| help: consider restricting its visibility: `pub(crate)`
|
= help: or consider exporting it for use by other crates

warning: unreachable `pub` item
--> $DIR/unreachable_pub-pub_crate.rs:44:5
--> $DIR/unreachable_pub-pub_crate.rs:46:5
|
44 | pub type Oxygen = bool;
46 | pub type Oxygen = bool;
| ---^^^^^^^^^^^^^^^^^^^^
| |
| help: consider restricting its visibility: `pub(crate)`
|
= help: or consider exporting it for use by other crates

warning: unreachable `pub` item
--> $DIR/unreachable_pub-pub_crate.rs:47:47
--> $DIR/unreachable_pub-pub_crate.rs:49:47
|
47 | ($visibility: vis, $name: ident) => { $visibility struct $name {} }
49 | ($visibility: vis, $name: ident) => { $visibility struct $name {} }
| -----------^^^^^^^^^^^^^
| |
| help: consider restricting its visibility: `pub(crate)`
48 | }
49 | define_empty_struct_with_visibility!(pub, Fluorine);
50 | }
51 | define_empty_struct_with_visibility!(pub, Fluorine);
| ---------------------------------------------------- in this macro invocation
|
= help: or consider exporting it for use by other crates

warning: unreachable `pub` item
--> $DIR/unreachable_pub-pub_crate.rs:52:9
--> $DIR/unreachable_pub-pub_crate.rs:54:9
|
52 | pub fn catalyze() -> bool;
54 | pub fn catalyze() -> bool;
| ---^^^^^^^^^^^^^^^^^^^^^^^
| |
| help: consider restricting its visibility: `pub(crate)`
Expand Down
2 changes: 2 additions & 0 deletions src/test/ui/lint/unreachable_pub.rs
Expand Up @@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

// must-compile-successfully

#![feature(crate_visibility_modifier)]
#![feature(macro_vis_matcher)]

Expand Down

0 comments on commit 33245fe

Please sign in to comment.