Auto merge of #46640 - tommyip:ui_tests, r=estebank

Enforce successful ui tests to have must-compile-successfully flag.

r? @nikomatsakis
cc @oli-obk

Fixes #46587
This commit is contained in:
bors 2017-12-11 06:54:24 +00:00
commit 33245fe682
51 changed files with 283 additions and 233 deletions

View File

@ -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)]

View File

@ -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 => {},
| ^^^^^

View File

@ -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);

View File

@ -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`

View File

@ -9,3 +9,4 @@
// except according to those terms.
// compile-flags: --explain E0591
// must-compile-successfully

View File

@ -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() {

View File

@ -9,6 +9,7 @@
// except according to those terms.
// compile-flags: -A bad-style
// must-compile-successfully
fn main() {
let _InappropriateCamelCasing = true;

View File

@ -9,6 +9,7 @@
// except according to those terms.
// compile-flags: -W bad-style
// must-compile-successfully
fn main() {
let _InappropriateCamelCasing = true;

View File

@ -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`

View File

@ -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

View File

@ -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`

View File

@ -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)]

View File

@ -1,22 +1,22 @@
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)`
@ -24,46 +24,26 @@ warning: unreachable `pub` item
= 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
|
38 | 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
|
39 | 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
|
40 | pub fn beryllium() {}
| ---^^^^^^^^^^^^^^^
40 | pub enum Helium {}
| ---^^^^^^^^^^^^
| |
| help: consider restricting its visibility: `pub(crate)`
|
@ -72,8 +52,8 @@ warning: unreachable `pub` item
warning: unreachable `pub` item
--> $DIR/unreachable_pub-pub_crate.rs:41:5
|
41 | pub trait Boron {}
| ---^^^^^^^^^^^^
41 | pub union Lithium { c1: usize, c2: u8 }
| ---^^^^^^^^^^^^^^
| |
| help: consider restricting its visibility: `pub(crate)`
|
@ -82,8 +62,8 @@ warning: unreachable `pub` item
warning: unreachable `pub` item
--> $DIR/unreachable_pub-pub_crate.rs:42:5
|
42 | pub const CARBON: usize = 1;
| ---^^^^^^^^^^^^^^^^^^^^^^^^^
42 | pub fn beryllium() {}
| ---^^^^^^^^^^^^^^^
| |
| help: consider restricting its visibility: `pub(crate)`
|
@ -92,8 +72,8 @@ warning: unreachable `pub` item
warning: unreachable `pub` item
--> $DIR/unreachable_pub-pub_crate.rs:43:5
|
43 | pub static NITROGEN: usize = 2;
| ---^^^^^^^^^^^^^^^^^^^^^^^^^^^^
43 | pub trait Boron {}
| ---^^^^^^^^^^^^
| |
| help: consider restricting its visibility: `pub(crate)`
|
@ -102,7 +82,27 @@ warning: unreachable `pub` item
warning: unreachable `pub` item
--> $DIR/unreachable_pub-pub_crate.rs:44:5
|
44 | pub type Oxygen = bool;
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:45:5
|
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:46:5
|
46 | pub type Oxygen = bool;
| ---^^^^^^^^^^^^^^^^^^^^
| |
| help: consider restricting its visibility: `pub(crate)`
@ -110,22 +110,22 @@ warning: unreachable `pub` item
= 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)`

View File

@ -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)]

View File

@ -1,22 +1,22 @@
warning: unreachable `pub` item
--> $DIR/unreachable_pub.rs:19:5
--> $DIR/unreachable_pub.rs:21:5
|
19 | pub use std::fmt;
21 | pub use std::fmt;
| ---^^^^^^^^^^^^^^
| |
| help: consider restricting its visibility: `crate`
|
note: lint level defined here
--> $DIR/unreachable_pub.rs:15:9
--> $DIR/unreachable_pub.rs:17:9
|
15 | #![warn(unreachable_pub)]
17 | #![warn(unreachable_pub)]
| ^^^^^^^^^^^^^^^
= help: or consider exporting it for use by other crates
warning: unreachable `pub` item
--> $DIR/unreachable_pub.rs:21:5
--> $DIR/unreachable_pub.rs:23:5
|
21 | pub struct Hydrogen {
23 | pub struct Hydrogen {
| ---^^^^^^^^^^^^^^^^
| |
| help: consider restricting its visibility: `crate`
@ -24,46 +24,26 @@ warning: unreachable `pub` item
= help: or consider exporting it for use by other crates
warning: unreachable `pub` field
--> $DIR/unreachable_pub.rs:23:9
--> $DIR/unreachable_pub.rs:25:9
|
23 | pub neutrons: usize,
25 | pub neutrons: usize,
| ---^^^^^^^^^^^^^^^^
| |
| help: consider restricting its visibility: `crate`
warning: unreachable `pub` item
--> $DIR/unreachable_pub.rs:29:9
--> $DIR/unreachable_pub.rs:31:9
|
29 | pub fn count_neutrons(&self) -> usize { self.neutrons }
31 | pub fn count_neutrons(&self) -> usize { self.neutrons }
| ---^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| help: consider restricting its visibility: `crate`
warning: unreachable `pub` item
--> $DIR/unreachable_pub.rs:33:5
|
33 | pub enum Helium {}
| ---^^^^^^^^^^^^
| |
| help: consider restricting its visibility: `crate`
|
= help: or consider exporting it for use by other crates
warning: unreachable `pub` item
--> $DIR/unreachable_pub.rs:34:5
|
34 | pub union Lithium { c1: usize, c2: u8 }
| ---^^^^^^^^^^^^^^
| |
| help: consider restricting its visibility: `crate`
|
= help: or consider exporting it for use by other crates
warning: unreachable `pub` item
--> $DIR/unreachable_pub.rs:35:5
|
35 | pub fn beryllium() {}
| ---^^^^^^^^^^^^^^^
35 | pub enum Helium {}
| ---^^^^^^^^^^^^
| |
| help: consider restricting its visibility: `crate`
|
@ -72,8 +52,8 @@ warning: unreachable `pub` item
warning: unreachable `pub` item
--> $DIR/unreachable_pub.rs:36:5
|
36 | pub trait Boron {}
| ---^^^^^^^^^^^^
36 | pub union Lithium { c1: usize, c2: u8 }
| ---^^^^^^^^^^^^^^
| |
| help: consider restricting its visibility: `crate`
|
@ -82,8 +62,8 @@ warning: unreachable `pub` item
warning: unreachable `pub` item
--> $DIR/unreachable_pub.rs:37:5
|
37 | pub const CARBON: usize = 1;
| ---^^^^^^^^^^^^^^^^^^^^^^^^^
37 | pub fn beryllium() {}
| ---^^^^^^^^^^^^^^^
| |
| help: consider restricting its visibility: `crate`
|
@ -92,8 +72,8 @@ warning: unreachable `pub` item
warning: unreachable `pub` item
--> $DIR/unreachable_pub.rs:38:5
|
38 | pub static NITROGEN: usize = 2;
| ---^^^^^^^^^^^^^^^^^^^^^^^^^^^^
38 | pub trait Boron {}
| ---^^^^^^^^^^^^
| |
| help: consider restricting its visibility: `crate`
|
@ -102,7 +82,27 @@ warning: unreachable `pub` item
warning: unreachable `pub` item
--> $DIR/unreachable_pub.rs:39:5
|
39 | pub type Oxygen = bool;
39 | pub const CARBON: usize = 1;
| ---^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| help: consider restricting its visibility: `crate`
|
= help: or consider exporting it for use by other crates
warning: unreachable `pub` item
--> $DIR/unreachable_pub.rs:40:5
|
40 | pub static NITROGEN: usize = 2;
| ---^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| help: consider restricting its visibility: `crate`
|
= help: or consider exporting it for use by other crates
warning: unreachable `pub` item
--> $DIR/unreachable_pub.rs:41:5
|
41 | pub type Oxygen = bool;
| ---^^^^^^^^^^^^^^^^^^^^
| |
| help: consider restricting its visibility: `crate`
@ -110,22 +110,22 @@ warning: unreachable `pub` item
= help: or consider exporting it for use by other crates
warning: unreachable `pub` item
--> $DIR/unreachable_pub.rs:42:47
--> $DIR/unreachable_pub.rs:44:47
|
42 | ($visibility: vis, $name: ident) => { $visibility struct $name {} }
44 | ($visibility: vis, $name: ident) => { $visibility struct $name {} }
| -----------^^^^^^^^^^^^^
| |
| help: consider restricting its visibility: `crate`
43 | }
44 | define_empty_struct_with_visibility!(pub, Fluorine);
45 | }
46 | 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.rs:47:9
--> $DIR/unreachable_pub.rs:49:9
|
47 | pub fn catalyze() -> bool;
49 | pub fn catalyze() -> bool;
| ---^^^^^^^^^^^^^^^^^^^^^^^
| |
| help: consider restricting its visibility: `crate`

View File

@ -9,6 +9,7 @@
// except according to those terms.
// compile-flags: --error-format pretty-json -Zunstable-options
// must-compile-successfully
// The output for humans should just highlight the whole span without showing
// the suggested replacement, but we also want to test that suggested

View File

@ -8,10 +8,10 @@
"spans": [
{
"file_name": "$DIR/unused_parens_json_suggestion.rs",
"byte_start": 1027,
"byte_end": 1040,
"line_start": 24,
"line_end": 24,
"byte_start": 1056,
"byte_end": 1069,
"line_start": 25,
"line_end": 25,
"column_start": 14,
"column_end": 27,
"is_primary": true,
@ -35,10 +35,10 @@
"spans": [
{
"file_name": "$DIR/unused_parens_json_suggestion.rs",
"byte_start": 873,
"byte_end": 886,
"line_start": 19,
"line_end": 19,
"byte_start": 902,
"byte_end": 915,
"line_start": 20,
"line_end": 20,
"column_start": 9,
"column_end": 22,
"is_primary": true,
@ -64,10 +64,10 @@
"spans": [
{
"file_name": "$DIR/unused_parens_json_suggestion.rs",
"byte_start": 1027,
"byte_end": 1040,
"line_start": 24,
"line_end": 24,
"byte_start": 1056,
"byte_end": 1069,
"line_start": 25,
"line_end": 25,
"column_start": 14,
"column_end": 27,
"is_primary": true,
@ -88,15 +88,15 @@
}
],
"rendered": "warning: unnecessary parentheses around assigned value
--> $DIR/unused_parens_json_suggestion.rs:24:14
--> $DIR/unused_parens_json_suggestion.rs:25:14
|
24 | let _a = (1 / (2 + 3));
25 | let _a = (1 / (2 + 3));
| ^^^^^^^^^^^^^ help: remove these parentheses
|
note: lint level defined here
--> $DIR/unused_parens_json_suggestion.rs:19:9
--> $DIR/unused_parens_json_suggestion.rs:20:9
|
19 | #![warn(unused_parens)]
20 | #![warn(unused_parens)]
| ^^^^^^^^^^^^^
"

View File

@ -9,6 +9,7 @@
// except according to those terms.
// compile-flags: -Z trace-macros
// must-compile-successfully
fn main() {
println!("Hello, World!");

View File

@ -1,7 +1,7 @@
note: trace_macro
--> $DIR/trace-macro.rs:14:5
--> $DIR/trace-macro.rs:15:5
|
14 | println!("Hello, World!");
15 | println!("Hello, World!");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: expanding `println! { "Hello, World!" }`

View File

@ -28,6 +28,7 @@
// requirement, as you can see from the `#[rustc_regions]` output.
// compile-flags:-Znll -Zborrowck=mir -Zverbose
// must-compile-successfully
#![feature(rustc_attrs)]

View File

@ -1,17 +1,17 @@
warning: not reporting region error due to -Znll
--> $DIR/propagate-approximated-ref.rs:60:9
--> $DIR/propagate-approximated-ref.rs:61:9
|
60 | demand_y(x, y, x.get())
61 | demand_y(x, y, x.get())
| ^^^^^^^^^^^^^^^^^^^^^^^
note: External requirements
--> $DIR/propagate-approximated-ref.rs:58:47
--> $DIR/propagate-approximated-ref.rs:59:47
|
58 | establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {
59 | establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {
| _______________________________________________^
59 | | // Only works if 'x: 'y:
60 | | demand_y(x, y, x.get())
61 | | });
60 | | // Only works if 'x: 'y:
61 | | demand_y(x, y, x.get())
62 | | });
| |_____^
|
= note: defining type: DefId(0/1:18 ~ propagate_approximated_ref[317d]::supply[0]::{{closure}}[0]) with closure substs [
@ -22,14 +22,14 @@ note: External requirements
= note: where '_#1r: '_#2r
note: No external requirements
--> $DIR/propagate-approximated-ref.rs:57:1
--> $DIR/propagate-approximated-ref.rs:58:1
|
57 | / fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
58 | | establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {
59 | | // Only works if 'x: 'y:
60 | | demand_y(x, y, x.get())
61 | | });
62 | | }
58 | / fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
59 | | establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {
60 | | // Only works if 'x: 'y:
61 | | demand_y(x, y, x.get())
62 | | });
63 | | }
| |_^
|
= note: defining type: DefId(0/0:6 ~ propagate_approximated_ref[317d]::supply[0]) with substs []

View File

@ -17,6 +17,7 @@
// these errors are not (yet) reported.
// compile-flags:-Znll -Zborrowck=mir -Zverbose
// must-compile-successfully
#![feature(rustc_attrs)]

View File

@ -1,17 +1,17 @@
warning: not reporting region error due to -Znll
--> $DIR/propagate-approximated-shorter-to-static-no-bound.rs:47:9
--> $DIR/propagate-approximated-shorter-to-static-no-bound.rs:48:9
|
47 | demand_y(x, y, x.get())
48 | demand_y(x, y, x.get())
| ^^^^^^^^^^^^^^^^^^^^^^^
note: External requirements
--> $DIR/propagate-approximated-shorter-to-static-no-bound.rs:45:47
--> $DIR/propagate-approximated-shorter-to-static-no-bound.rs:46:47
|
45 | establish_relationships(&cell_a, &cell_b, |_outlives, x, y| {
46 | establish_relationships(&cell_a, &cell_b, |_outlives, x, y| {
| _______________________________________________^
46 | | // Only works if 'x: 'y:
47 | | demand_y(x, y, x.get())
48 | | });
47 | | // Only works if 'x: 'y:
48 | | demand_y(x, y, x.get())
49 | | });
| |_____^
|
= note: defining type: DefId(0/1:18 ~ propagate_approximated_shorter_to_static_no_bound[317d]::supply[0]::{{closure}}[0]) with closure substs [
@ -22,14 +22,14 @@ note: External requirements
= note: where '_#1r: '_#0r
note: No external requirements
--> $DIR/propagate-approximated-shorter-to-static-no-bound.rs:44:1
--> $DIR/propagate-approximated-shorter-to-static-no-bound.rs:45:1
|
44 | / fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
45 | | establish_relationships(&cell_a, &cell_b, |_outlives, x, y| {
46 | | // Only works if 'x: 'y:
47 | | demand_y(x, y, x.get())
48 | | });
49 | | }
45 | / fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
46 | | establish_relationships(&cell_a, &cell_b, |_outlives, x, y| {
47 | | // Only works if 'x: 'y:
48 | | demand_y(x, y, x.get())
49 | | });
50 | | }
| |_^
|
= note: defining type: DefId(0/0:6 ~ propagate_approximated_shorter_to_static_no_bound[317d]::supply[0]) with substs []

View File

@ -18,6 +18,7 @@
// these errors are not (yet) reported.
// compile-flags:-Znll -Zborrowck=mir -Zverbose
// must-compile-successfully
#![feature(rustc_attrs)]

View File

@ -1,17 +1,17 @@
warning: not reporting region error due to -Znll
--> $DIR/propagate-approximated-shorter-to-static-wrong-bound.rs:50:9
--> $DIR/propagate-approximated-shorter-to-static-wrong-bound.rs:51:9
|
50 | demand_y(x, y, x.get())
51 | demand_y(x, y, x.get())
| ^^^^^^^^^^^^^^^^^^^^^^^
note: External requirements
--> $DIR/propagate-approximated-shorter-to-static-wrong-bound.rs:48:47
--> $DIR/propagate-approximated-shorter-to-static-wrong-bound.rs:49:47
|
48 | establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {
49 | establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {
| _______________________________________________^
49 | | // Only works if 'x: 'y:
50 | | demand_y(x, y, x.get())
51 | | });
50 | | // Only works if 'x: 'y:
51 | | demand_y(x, y, x.get())
52 | | });
| |_____^
|
= note: defining type: DefId(0/1:18 ~ propagate_approximated_shorter_to_static_wrong_bound[317d]::supply[0]::{{closure}}[0]) with closure substs [
@ -22,14 +22,14 @@ note: External requirements
= note: where '_#1r: '_#0r
note: No external requirements
--> $DIR/propagate-approximated-shorter-to-static-wrong-bound.rs:47:1
--> $DIR/propagate-approximated-shorter-to-static-wrong-bound.rs:48:1
|
47 | / fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
48 | | establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {
49 | | // Only works if 'x: 'y:
50 | | demand_y(x, y, x.get())
51 | | });
52 | | }
48 | / fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
49 | | establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {
50 | | // Only works if 'x: 'y:
51 | | demand_y(x, y, x.get())
52 | | });
53 | | }
| |_^
|
= note: defining type: DefId(0/0:6 ~ propagate_approximated_shorter_to_static_wrong_bound[317d]::supply[0]) with substs []

View File

@ -16,6 +16,7 @@
// anonymous regions as well.
// compile-flags:-Znll -Zborrowck=mir -Zverbose
// must-compile-successfully
#![feature(rustc_attrs)]

View File

@ -1,17 +1,17 @@
warning: not reporting region error due to -Znll
--> $DIR/propagate-approximated-val.rs:48:9
--> $DIR/propagate-approximated-val.rs:49:9
|
48 | demand_y(outlives1, outlives2, x.get())
49 | demand_y(outlives1, outlives2, x.get())
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: External requirements
--> $DIR/propagate-approximated-val.rs:46:45
--> $DIR/propagate-approximated-val.rs:47:45
|
46 | establish_relationships(cell_a, cell_b, |outlives1, outlives2, x, y| {
47 | establish_relationships(cell_a, cell_b, |outlives1, outlives2, x, y| {
| _____________________________________________^
47 | | // Only works if 'x: 'y:
48 | | demand_y(outlives1, outlives2, x.get())
49 | | });
48 | | // Only works if 'x: 'y:
49 | | demand_y(outlives1, outlives2, x.get())
50 | | });
| |_____^
|
= note: defining type: DefId(0/1:18 ~ propagate_approximated_val[317d]::test[0]::{{closure}}[0]) with closure substs [
@ -22,14 +22,14 @@ note: External requirements
= note: where '_#1r: '_#2r
note: No external requirements
--> $DIR/propagate-approximated-val.rs:45:1
--> $DIR/propagate-approximated-val.rs:46:1
|
45 | / fn test<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
46 | | establish_relationships(cell_a, cell_b, |outlives1, outlives2, x, y| {
47 | | // Only works if 'x: 'y:
48 | | demand_y(outlives1, outlives2, x.get())
49 | | });
50 | | }
46 | / fn test<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
47 | | establish_relationships(cell_a, cell_b, |outlives1, outlives2, x, y| {
48 | | // Only works if 'x: 'y:
49 | | demand_y(outlives1, outlives2, x.get())
50 | | });
51 | | }
| |_^
|
= note: defining type: DefId(0/0:6 ~ propagate_approximated_val[317d]::test[0]) with substs []

View File

@ -14,6 +14,7 @@
// regions is erased.
// compile-flags:-Znll -Zborrowck=mir -Zverbose
// must-compile-successfully
#![feature(rustc_attrs)]

View File

@ -1,17 +1,17 @@
warning: not reporting region error due to -Znll
--> $DIR/propagate-despite-same-free-region.rs:53:21
--> $DIR/propagate-despite-same-free-region.rs:54:21
|
53 | let p = x.get();
54 | let p = x.get();
| ^^^^^^^
note: External requirements
--> $DIR/propagate-despite-same-free-region.rs:51:9
--> $DIR/propagate-despite-same-free-region.rs:52:9
|
51 | / |_outlives1, _outlives2, x, y| {
52 | | // Only works if 'x: 'y:
53 | | let p = x.get();
54 | | demand_y(x, y, p)
55 | | },
52 | / |_outlives1, _outlives2, x, y| {
53 | | // Only works if 'x: 'y:
54 | | let p = x.get();
55 | | demand_y(x, y, p)
56 | | },
| |_________^
|
= note: defining type: DefId(0/1:16 ~ propagate_despite_same_free_region[317d]::supply[0]::{{closure}}[0]) with closure substs [
@ -22,15 +22,15 @@ note: External requirements
= note: where '_#1r: '_#2r
note: No external requirements
--> $DIR/propagate-despite-same-free-region.rs:48:1
--> $DIR/propagate-despite-same-free-region.rs:49:1
|
48 | / fn supply<'a>(cell_a: Cell<&'a u32>) {
49 | | establish_relationships(
50 | | cell_a,
51 | | |_outlives1, _outlives2, x, y| {
49 | / fn supply<'a>(cell_a: Cell<&'a u32>) {
50 | | establish_relationships(
51 | | cell_a,
52 | | |_outlives1, _outlives2, x, y| {
... |
56 | | );
57 | | }
57 | | );
58 | | }
| |_^
|
= note: defining type: DefId(0/0:6 ~ propagate_despite_same_free_region[317d]::supply[0]) with substs []

View File

@ -9,6 +9,7 @@
// except according to those terms.
//compile-flags: -Z emit-end-regions -Zborrowck=mir -Z nll
// must-compile-successfully
#![allow(warnings)]

View File

@ -12,6 +12,7 @@
#![allow(dead_code)]
// compile-flags: -Z print-fuel=foo
// must-compile-successfully
struct S1(u8, u16, u8);
struct S2(u8, u16, u8);

View File

@ -9,6 +9,7 @@
// except according to those terms.
// compile-flags: -Z print-type-sizes
// must-compile-successfully
// All of the types that occur in this function are uninteresting, in
// that one cannot control the sizes of these types with the same sort

View File

@ -9,6 +9,7 @@
// except according to those terms.
// compile-flags: -Z print-type-sizes
// must-compile-successfully
// This file illustrates how generics are handled: types have to be
// monomorphized, in the MIR of the original function in which they

View File

@ -9,6 +9,7 @@
// except according to those terms.
// compile-flags: -Z print-type-sizes
// must-compile-successfully
// This file illustrates that when multiple structural types occur in
// a function, every one of them is included in the output.

View File

@ -9,6 +9,7 @@
// except according to those terms.
// compile-flags: -Z print-type-sizes
// must-compile-successfully
// This file illustrates how niche-filling enums are handled,
// modelled after cases like `Option<&u32>`, `Option<bool>` and such.

View File

@ -9,6 +9,7 @@
// except according to those terms.
// compile-flags: -Z print-type-sizes
// must-compile-successfully
// This file illustrates that when the same type occurs repeatedly
// (even if multiple functions), it is only printed once in the

View File

@ -9,6 +9,7 @@
// except according to those terms.
// compile-flags: -Z print-type-sizes
// must-compile-successfully
// This file illustrates how packing is handled; it should cause
// the elimination of padding that would normally be introduced

View File

@ -9,6 +9,7 @@
// except according to those terms.
// compile-flags: -Z print-type-sizes
// must-compile-successfully
// This file illustrates how padding is handled: alignment
// requirements can lead to the introduction of padding, either before

View File

@ -9,6 +9,7 @@
// except according to those terms.
// compile-flags: -Z print-type-sizes
// must-compile-successfully
// This file illustrates how padding is handled: alignment
// requirements can lead to the introduction of padding, either before

View File

@ -9,6 +9,7 @@
// except according to those terms.
// compile-flags: -Z print-type-sizes
// must-compile-successfully
#![feature(never_type)]

View File

@ -9,6 +9,7 @@
// except according to those terms.
// compile-flags: -Z print-type-sizes
// must-compile-successfully
// This file illustrates two things:
//

View File

@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// must-compile-successfully
#![allow(unused_variables)]
#![allow(dead_code)]
#![deny(unreachable_code)]

View File

@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// must-compile-successfully
#![allow(unused_variables)]
#![allow(dead_code)]
#![deny(unreachable_code)]

View File

@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// must-compile-successfully
#![feature(fn_must_use)]
#![warn(unused_must_use)]

View File

@ -1,48 +1,48 @@
warning: unused return value of `need_to_use_this_value` which must be used: it's important
--> $DIR/fn_must_use.rs:59:5
--> $DIR/fn_must_use.rs:61:5
|
59 | need_to_use_this_value(); //~ WARN unused return value
61 | need_to_use_this_value(); //~ WARN unused return value
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: lint level defined here
--> $DIR/fn_must_use.rs:12:9
--> $DIR/fn_must_use.rs:14:9
|
12 | #![warn(unused_must_use)]
14 | #![warn(unused_must_use)]
| ^^^^^^^^^^^^^^^
warning: unused return value of `MyStruct::need_to_use_this_method_value` which must be used
--> $DIR/fn_must_use.rs:64:5
--> $DIR/fn_must_use.rs:66:5
|
64 | m.need_to_use_this_method_value(); //~ WARN unused return value
66 | m.need_to_use_this_method_value(); //~ WARN unused return value
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused return value of `EvenNature::is_even` which must be used: no side effects
--> $DIR/fn_must_use.rs:65:5
--> $DIR/fn_must_use.rs:67:5
|
65 | m.is_even(); // trait method!
67 | m.is_even(); // trait method!
| ^^^^^^^^^^^^
warning: unused return value of `std::cmp::PartialEq::eq` which must be used
--> $DIR/fn_must_use.rs:71:5
--> $DIR/fn_must_use.rs:73:5
|
71 | 2.eq(&3); //~ WARN unused return value
73 | 2.eq(&3); //~ WARN unused return value
| ^^^^^^^^^
warning: unused return value of `std::cmp::PartialEq::eq` which must be used
--> $DIR/fn_must_use.rs:72:5
--> $DIR/fn_must_use.rs:74:5
|
72 | m.eq(&n); //~ WARN unused return value
74 | m.eq(&n); //~ WARN unused return value
| ^^^^^^^^^
warning: unused comparison which must be used
--> $DIR/fn_must_use.rs:75:5
--> $DIR/fn_must_use.rs:77:5
|
75 | 2 == 3; //~ WARN unused comparison
77 | 2 == 3; //~ WARN unused comparison
| ^^^^^^
warning: unused comparison which must be used
--> $DIR/fn_must_use.rs:76:5
--> $DIR/fn_must_use.rs:78:5
|
76 | m == n; //~ WARN unused comparison
78 | m == n; //~ WARN unused comparison
| ^^^^^^

View File

@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// must-compile-successfully
#![warn(unused)]
macro_rules! m {

View File

@ -1,16 +1,16 @@
warning: struct is never used: `S`
--> $DIR/macro-span-replacement.rs:15:9
--> $DIR/macro-span-replacement.rs:17:9
|
15 | $b $a; //~ WARN struct is never used
17 | $b $a; //~ WARN struct is never used
| ^^^^^^
...
20 | m!(S struct);
22 | m!(S struct);
| ------------- in this macro invocation
|
note: lint level defined here
--> $DIR/macro-span-replacement.rs:11:9
--> $DIR/macro-span-replacement.rs:13:9
|
11 | #![warn(unused)]
13 | #![warn(unused)]
| ^^^^^^
= note: #[warn(dead_code)] implied by #[warn(unused)]

View File

@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// must-compile-successfully
#![warn(unused)]
use std::cmp::{Eq, Ord, min, PartialEq, PartialOrd};

View File

@ -1,13 +1,13 @@
warning: unused imports: `Eq`, `Ord`, `PartialEq`, `PartialOrd`
--> $DIR/multispan-import-lint.rs:13:16
--> $DIR/multispan-import-lint.rs:15:16
|
13 | use std::cmp::{Eq, Ord, min, PartialEq, PartialOrd};
15 | use std::cmp::{Eq, Ord, min, PartialEq, PartialOrd};
| ^^ ^^^ ^^^^^^^^^ ^^^^^^^^^^
|
note: lint level defined here
--> $DIR/multispan-import-lint.rs:11:9
--> $DIR/multispan-import-lint.rs:13:9
|
11 | #![warn(unused)]
13 | #![warn(unused)]
| ^^^^^^
= note: #[warn(unused_imports)] implied by #[warn(unused)]

View File

@ -218,7 +218,7 @@ pub struct TestProps {
// testing harness and used when generating compilation
// arguments. (In particular, it propagates to the aux-builds.)
pub incremental_dir: Option<PathBuf>,
// Specifies that a cfail test must actually compile without errors.
// Specifies that a test must actually compile without errors.
pub must_compile_successfully: bool,
// rustdoc will test the output of the `--test` option
pub check_test_line_numbers_match: bool,
@ -359,10 +359,6 @@ impl TestProps {
self.forbid_output.push(of);
}
if !self.must_compile_successfully {
self.must_compile_successfully = config.parse_must_compile_successfully(ln);
}
if !self.check_test_line_numbers_match {
self.check_test_line_numbers_match = config.parse_check_test_line_numbers_match(ln);
}
@ -371,6 +367,12 @@ impl TestProps {
self.run_pass = config.parse_run_pass(ln);
}
if !self.must_compile_successfully {
// run-pass implies must_compile_sucessfully
self.must_compile_successfully =
config.parse_must_compile_successfully(ln) || self.run_pass;
}
if let Some(rule) = config.parse_custom_normalization(ln, "normalize-stdout") {
self.normalize_stdout.push(rule);
}

View File

@ -147,23 +147,26 @@ impl<'test> TestCx<'test> {
assert!(self.revision.is_none(), "init_all invoked for a revision");
}
fn run_cfail_test(&self) {
let proc_res = self.compile_test();
fn check_if_test_should_compile(&self, proc_res: &ProcRes) {
if self.props.must_compile_successfully {
if !proc_res.status.success() {
self.fatal_proc_rec("test compilation failed although it shouldn't!", &proc_res);
self.fatal_proc_rec("test compilation failed although it shouldn't!", proc_res);
}
} else {
if proc_res.status.success() {
self.fatal_proc_rec(
&format!("{} test compiled successfully!", self.config.mode)[..],
&proc_res,
proc_res,
);
}
self.check_correct_failure_status(&proc_res);
self.check_correct_failure_status(proc_res);
}
}
fn run_cfail_test(&self) {
let proc_res = self.compile_test();
self.check_if_test_should_compile(&proc_res);
let output_to_check = self.get_output(&proc_res);
let expected_errors = errors::load_errors(&self.testpaths.file, self.revision);
@ -2388,6 +2391,7 @@ impl<'test> TestCx<'test> {
.any(|s| s.contains("--error-format"));
let proc_res = self.compile_test();
self.check_if_test_should_compile(&proc_res);
let expected_stderr_path = self.expected_output_path(UI_STDERR);
let expected_stderr = self.load_expected_output(&expected_stderr_path);