Skip to content

Commit 8c1f9ef

Browse files
committed
Merge cfail and ui tests into ui tests
1 parent 36066d8 commit 8c1f9ef

File tree

670 files changed

+2181
-2112
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

670 files changed

+2181
-2112
lines changed

Diff for: src/librustc/session/mod.rs

+5-8
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,11 @@ impl Session {
359359
diag_builder: &'b mut DiagnosticBuilder<'a>,
360360
method: DiagnosticBuilderMethod,
361361
lint: &'static lint::Lint, message: &str, span: Option<Span>) {
362-
let mut do_method = || {
362+
363+
let lint_id = DiagnosticMessageId::LintId(lint::LintId::of(lint));
364+
let id_span_message = (lint_id, span, message.to_owned());
365+
let fresh = self.one_time_diagnostics.borrow_mut().insert(id_span_message);
366+
if fresh {
363367
match method {
364368
DiagnosticBuilderMethod::Note => {
365369
diag_builder.note(message);
@@ -368,13 +372,6 @@ impl Session {
368372
diag_builder.span_note(span.expect("span_note expects a span"), message);
369373
}
370374
}
371-
};
372-
373-
let lint_id = DiagnosticMessageId::LintId(lint::LintId::of(lint));
374-
let id_span_message = (lint_id, span, message.to_owned());
375-
let fresh = self.one_time_diagnostics.borrow_mut().insert(id_span_message);
376-
if fresh {
377-
do_method()
378375
}
379376
}
380377

Diff for: src/test/compile-fail/issue-31221.rs

-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
#![allow(non_snake_case)]
1414
#![deny(unreachable_patterns)]
1515
//~^ NOTE lint level defined here
16-
//~^^ NOTE lint level defined here
17-
//~^^^ NOTE lint level defined here
1816

1917
#[derive(Clone, Copy)]
2018
enum Enum {

Diff for: src/test/compile-fail/lint-output-format-2.rs

-1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,5 @@ use lint_output_format::{foo, bar};
2525
fn main() { //~ ERROR: compilation successful
2626
let _x = foo();
2727
//~^ WARNING use of deprecated item 'lint_output_format::foo': text
28-
//~| NOTE #[warn(deprecated)] on by default
2928
let _y = bar();
3029
}

Diff for: src/test/compile-fail/lint-unconditional-recursion.rs

+1-13
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,7 @@
1010

1111
#![deny(unconditional_recursion)]
1212
//~^ NOTE lint level defined here
13-
//~| NOTE lint level defined here
14-
//~| NOTE lint level defined here
15-
//~| NOTE lint level defined here
16-
//~| NOTE lint level defined here
17-
//~| NOTE lint level defined here
18-
//~| NOTE lint level defined here
19-
//~| NOTE lint level defined here
20-
//~| NOTE lint level defined here
21-
//~| NOTE lint level defined here
22-
//~| NOTE lint level defined here
23-
//~| NOTE lint level defined here
24-
//~| NOTE lint level defined here
25-
//~| NOTE lint level defined here
13+
2614
#![allow(dead_code)]
2715
fn foo() { //~ ERROR function cannot return without recurring
2816
foo(); //~ NOTE recursive call site

Diff for: src/test/ui-fulldeps/custom-derive/issue-36935.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
#[macro_use] extern crate plugin;
1717

18-
#[derive(Foo, Bar)]
18+
#[derive(Foo, Bar)] //~ ERROR proc-macro derive panicked
1919
struct Baz {
2020
a: i32,
2121
b: i32,

Diff for: src/test/ui-fulldeps/custom-derive/issue-36935.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
error: proc-macro derive panicked
22
--> $DIR/issue-36935.rs:18:15
33
|
4-
18 | #[derive(Foo, Bar)]
4+
18 | #[derive(Foo, Bar)] //~ ERROR proc-macro derive panicked
55
| ^^^
66
|
77
= help: message: lolnope

Diff for: src/test/ui-fulldeps/issue-44953/issue-44953.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#![feature(proc_macro)]
1414
#![allow(unused_macros)]
1515

16-
#[macro_use] extern crate log;
16+
#[macro_use] extern crate log; //~ ERROR use of unstable library feature
1717

1818
pub fn main() {
1919
info!("This is a log message.");

Diff for: src/test/ui-fulldeps/issue-44953/issue-44953.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
error: use of unstable library feature 'rustc_private': this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via `Cargo.toml` instead? (see issue #27812)
22
--> $DIR/issue-44953.rs:16:14
33
|
4-
16 | #[macro_use] extern crate log;
4+
16 | #[macro_use] extern crate log; //~ ERROR use of unstable library feature
55
| ^^^^^^^^^^^^^^^^^
66
|
77
= help: add #![feature(rustc_private)] to the crate attributes to enable

Diff for: src/test/ui-fulldeps/proc-macro/three-equals.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,17 @@ fn main() {
2222
three_equals!(===);
2323

2424
// Need exactly three equals.
25-
three_equals!(==);
25+
three_equals!(==); //~ ERROR found 2 equal signs, need exactly 3
2626

2727
// Need exactly three equals.
28-
three_equals!(=====);
28+
three_equals!(=====); //~ ERROR expected EOF
2929

3030
// Only equals accepted.
31-
three_equals!(abc);
31+
three_equals!(abc); //~ ERROR expected `=`
3232

3333
// Only equals accepted.
34-
three_equals!(!!);
34+
three_equals!(!!); //~ ERROR expected `=`
3535

3636
// Only three characters expected.
37-
three_equals!(===a);
37+
three_equals!(===a); //~ ERROR expected EOF
3838
}

Diff for: src/test/ui-fulldeps/proc-macro/three-equals.stderr

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,46 @@
11
error: found 2 equal signs, need exactly 3
22
--> $DIR/three-equals.rs:25:5
33
|
4-
25 | three_equals!(==);
4+
25 | three_equals!(==); //~ ERROR found 2 equal signs, need exactly 3
55
| ^^^^^^^^^^^^^^^^^^
66
|
77
= help: input must be: `===`
88

99
error: expected EOF, found `=`.
1010
--> $DIR/three-equals.rs:28:21
1111
|
12-
28 | three_equals!(=====);
12+
28 | three_equals!(=====); //~ ERROR expected EOF
1313
| ^^
1414
|
1515
note: last good input was here
1616
--> $DIR/three-equals.rs:28:21
1717
|
18-
28 | three_equals!(=====);
18+
28 | three_equals!(=====); //~ ERROR expected EOF
1919
| ^^
2020
= help: input must be: `===`
2121

2222
error: expected `=`, found `abc`.
2323
--> $DIR/three-equals.rs:31:19
2424
|
25-
31 | three_equals!(abc);
25+
31 | three_equals!(abc); //~ ERROR expected `=`
2626
| ^^^
2727

2828
error: expected `=`, found `!`.
2929
--> $DIR/three-equals.rs:34:19
3030
|
31-
34 | three_equals!(!!);
31+
34 | three_equals!(!!); //~ ERROR expected `=`
3232
| ^
3333

3434
error: expected EOF, found `a`.
3535
--> $DIR/three-equals.rs:37:22
3636
|
37-
37 | three_equals!(===a);
37+
37 | three_equals!(===a); //~ ERROR expected EOF
3838
| ^
3939
|
4040
note: last good input was here
4141
--> $DIR/three-equals.rs:37:21
4242
|
43-
37 | three_equals!(===a);
43+
37 | three_equals!(===a); //~ ERROR expected EOF
4444
| ^
4545
= help: input must be: `===`
4646

Diff for: src/test/ui-fulldeps/resolve-error.rs

+10
Original file line numberDiff line numberDiff line change
@@ -35,29 +35,39 @@ macro_rules! attr_proc_mac {
3535
}
3636

3737
#[derive(FooWithLongNan)]
38+
//~^ ERROR cannot find
3839
struct Foo;
3940

4041
#[attr_proc_macra]
42+
//~^ ERROR cannot find
4143
struct Bar;
4244

4345
#[FooWithLongNan]
46+
//~^ ERROR cannot find
4447
struct Asdf;
4548

4649
#[derive(Dlone)]
50+
//~^ ERROR cannot find
4751
struct A;
4852

4953
#[derive(Dlona)]
54+
//~^ ERROR cannot find
5055
struct B;
5156

5257
#[derive(attr_proc_macra)]
58+
//~^ ERROR cannot find
5359
struct C;
5460

5561
fn main() {
5662
FooWithLongNama!();
63+
//~^ ERROR cannot find
5764

5865
attr_proc_macra!();
66+
//~^ ERROR cannot find
5967

6068
Dlona!();
69+
//~^ ERROR cannot find
6170

6271
bang_proc_macrp!();
72+
//~^ ERROR cannot find
6373
}

Diff for: src/test/ui-fulldeps/resolve-error.stderr

+18-18
Original file line numberDiff line numberDiff line change
@@ -5,57 +5,57 @@ error: cannot find derive macro `FooWithLongNan` in this scope
55
| ^^^^^^^^^^^^^^ help: try: `FooWithLongName`
66

77
error: cannot find attribute macro `attr_proc_macra` in this scope
8-
--> $DIR/resolve-error.rs:40:3
8+
--> $DIR/resolve-error.rs:41:3
99
|
10-
40 | #[attr_proc_macra]
10+
41 | #[attr_proc_macra]
1111
| ^^^^^^^^^^^^^^^ help: try: `attr_proc_macro`
1212

1313
error: cannot find attribute macro `FooWithLongNan` in this scope
14-
--> $DIR/resolve-error.rs:43:3
14+
--> $DIR/resolve-error.rs:45:3
1515
|
16-
43 | #[FooWithLongNan]
16+
45 | #[FooWithLongNan]
1717
| ^^^^^^^^^^^^^^
1818

1919
error: cannot find derive macro `Dlone` in this scope
20-
--> $DIR/resolve-error.rs:46:10
20+
--> $DIR/resolve-error.rs:49:10
2121
|
22-
46 | #[derive(Dlone)]
22+
49 | #[derive(Dlone)]
2323
| ^^^^^ help: try: `Clone`
2424

2525
error: cannot find derive macro `Dlona` in this scope
26-
--> $DIR/resolve-error.rs:49:10
26+
--> $DIR/resolve-error.rs:53:10
2727
|
28-
49 | #[derive(Dlona)]
28+
53 | #[derive(Dlona)]
2929
| ^^^^^ help: try: `Clona`
3030

3131
error: cannot find derive macro `attr_proc_macra` in this scope
32-
--> $DIR/resolve-error.rs:52:10
32+
--> $DIR/resolve-error.rs:57:10
3333
|
34-
52 | #[derive(attr_proc_macra)]
34+
57 | #[derive(attr_proc_macra)]
3535
| ^^^^^^^^^^^^^^^
3636

3737
error: cannot find macro `FooWithLongNama!` in this scope
38-
--> $DIR/resolve-error.rs:56:5
38+
--> $DIR/resolve-error.rs:62:5
3939
|
40-
56 | FooWithLongNama!();
40+
62 | FooWithLongNama!();
4141
| ^^^^^^^^^^^^^^^ help: you could try the macro: `FooWithLongNam!`
4242

4343
error: cannot find macro `attr_proc_macra!` in this scope
44-
--> $DIR/resolve-error.rs:58:5
44+
--> $DIR/resolve-error.rs:65:5
4545
|
46-
58 | attr_proc_macra!();
46+
65 | attr_proc_macra!();
4747
| ^^^^^^^^^^^^^^^ help: you could try the macro: `attr_proc_mac!`
4848

4949
error: cannot find macro `Dlona!` in this scope
50-
--> $DIR/resolve-error.rs:60:5
50+
--> $DIR/resolve-error.rs:68:5
5151
|
52-
60 | Dlona!();
52+
68 | Dlona!();
5353
| ^^^^^
5454

5555
error: cannot find macro `bang_proc_macrp!` in this scope
56-
--> $DIR/resolve-error.rs:62:5
56+
--> $DIR/resolve-error.rs:71:5
5757
|
58-
62 | bang_proc_macrp!();
58+
71 | bang_proc_macrp!();
5959
| ^^^^^^^^^^^^^^^ help: you could try the macro: `bang_proc_macro!`
6060

6161
error: aborting due to 10 previous errors

Diff for: src/test/ui/anonymous-higher-ranked-lifetime.rs

+11-11
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,17 @@
99
// except according to those terms.
1010

1111
fn main() {
12-
f1(|_: (), _: ()| {});
13-
f2(|_: (), _: ()| {});
14-
f3(|_: (), _: ()| {});
15-
f4(|_: (), _: ()| {});
16-
f5(|_: (), _: ()| {});
17-
g1(|_: (), _: ()| {});
18-
g2(|_: (), _: ()| {});
19-
g3(|_: (), _: ()| {});
20-
g4(|_: (), _: ()| {});
21-
h1(|_: (), _: (), _: (), _: ()| {});
22-
h2(|_: (), _: (), _: (), _: ()| {});
12+
f1(|_: (), _: ()| {}); //~ ERROR type mismatch
13+
f2(|_: (), _: ()| {}); //~ ERROR type mismatch
14+
f3(|_: (), _: ()| {}); //~ ERROR type mismatch
15+
f4(|_: (), _: ()| {}); //~ ERROR type mismatch
16+
f5(|_: (), _: ()| {}); //~ ERROR type mismatch
17+
g1(|_: (), _: ()| {}); //~ ERROR type mismatch
18+
g2(|_: (), _: ()| {}); //~ ERROR type mismatch
19+
g3(|_: (), _: ()| {}); //~ ERROR type mismatch
20+
g4(|_: (), _: ()| {}); //~ ERROR type mismatch
21+
h1(|_: (), _: (), _: (), _: ()| {}); //~ ERROR type mismatch
22+
h2(|_: (), _: (), _: (), _: ()| {}); //~ ERROR type mismatch
2323
}
2424

2525
// Basic

0 commit comments

Comments
 (0)