Skip to content

Commit 9f9183d

Browse files
committed
Fix rebase
1 parent 7ba5fd1 commit 9f9183d

39 files changed

+243
-240
lines changed

src/librustc/session/mod.rs

+6-5
Original file line numberDiff line numberDiff line change
@@ -909,13 +909,14 @@ pub fn build_session_with_codemap(sopts: config::Options,
909909

910910
let emitter: Box<Emitter> = match (sopts.error_format, emitter_dest) {
911911
(config::ErrorOutputType::HumanReadable(color_config), None) => {
912-
Box::new(EmitterWriter::stderr(color_config,
913-
Some(codemap.clone()),
914-
false,
915-
sopts.debugging_opts.teach))
912+
Box::new(EmitterWriter::stderr(color_config, Some(codemap.clone()),
913+
false, sopts.debugging_opts.teach)
914+
.ui_testing(sopts.debugging_opts.ui_testing))
916915
}
917916
(config::ErrorOutputType::HumanReadable(_), Some(dst)) => {
918-
Box::new(EmitterWriter::new(dst, Some(codemap.clone()), false, false))
917+
Box::new(EmitterWriter::new(dst, Some(codemap.clone()),
918+
false, false)
919+
.ui_testing(sopts.debugging_opts.ui_testing))
919920
}
920921
(config::ErrorOutputType::Json(pretty), None) => {
921922
Box::new(JsonEmitter::stderr(Some(registry), codemap.clone(),

src/librustc_errors/emitter.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,9 @@ impl EmitterWriter {
189189
}
190190
}
191191

192-
pub fn ui_testing(self, ui_testing: bool) -> Self {
193-
Self { ui_testing, ..self }
192+
pub fn ui_testing(mut self, ui_testing: bool) -> Self {
193+
self.ui_testing = ui_testing;
194+
self
194195
}
195196

196197
fn maybe_anonymized(&self, line_num: usize) -> String {

src/test/ui-fulldeps/proc-macro/load-panic.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
error: proc-macro derive panicked
22
--> $DIR/load-panic.rs:17:10
33
|
4-
17 | #[derive(A)]
4+
LL | #[derive(A)]
55
| ^
66
|
77
= help: message: nope!

src/test/ui/command-line-diagnostics.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
error[E0384]: cannot assign twice to immutable variable `x`
22
--> $DIR/command-line-diagnostics.rs:16:5
33
|
4-
15 | let x = 42;
4+
LL | let x = 42;
55
| - first assignment to `x`
6-
16 | x = 43;
6+
LL | x = 43;
77
| ^^^^^^ cannot assign twice to immutable variable
88

99
error: aborting due to previous error

src/test/ui/did_you_mean/issue-42599_available_fields_note.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
error[E0560]: struct `submodule::Demo` has no field named `inocently_mispellable`
22
--> $DIR/issue-42599_available_fields_note.rs:26:39
33
|
4-
26 | Self { secret_integer: 2, inocently_mispellable: () }
4+
LL | Self { secret_integer: 2, inocently_mispellable: () }
55
| ^^^^^^^^^^^^^^^^^^^^^ field does not exist - did you mean `innocently_misspellable`?
66

77
error[E0560]: struct `submodule::Demo` has no field named `egregiously_nonexistent_field`
88
--> $DIR/issue-42599_available_fields_note.rs:31:39
99
|
10-
31 | Self { secret_integer: 3, egregiously_nonexistent_field: () }
10+
LL | Self { secret_integer: 3, egregiously_nonexistent_field: () }
1111
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `submodule::Demo` does not have this field
1212
|
1313
= note: available fields are: `favorite_integer`, `secret_integer`, `innocently_misspellable`, `another_field`, `yet_another_field` ... and 2 others

src/test/ui/error-codes/E0062.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ error[E0062]: field `x` specified more than once
33
|
44
LL | x: 0,
55
| ---- first use of `x`
6-
18 | x: 0,
6+
LL | x: 0,
77
| ^ used more than once
88

99
error: aborting due to previous error

src/test/ui/error-codes/E0559.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
error[E0559]: variant `Field::Fool` has no field named `joke`
22
--> $DIR/E0559.rs:16:27
33
|
4-
16 | let s = Field::Fool { joke: 0 };
4+
LL | let s = Field::Fool { joke: 0 };
55
| ^^^^ `Field::Fool` does not have this field
66
|
77
= note: available fields are: `x`

src/test/ui/error-codes/E0560.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
error[E0560]: struct `Simba` has no field named `father`
22
--> $DIR/E0560.rs:16:32
33
|
4-
16 | let s = Simba { mother: 1, father: 0 };
4+
LL | let s = Simba { mother: 1, father: 0 };
55
| ^^^^^^ `Simba` does not have this field
66
|
77
= note: available fields are: `mother`

src/test/ui/error-codes/E0657.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
error[E0657]: `impl Trait` can only capture lifetimes bound at the fn or impl level
22
--> $DIR/E0657.rs:20:31
33
|
4-
LL | -> impl for<'a> Id<impl Lt<'a>>
5-
| ^^
4+
LL | -> Box<for<'a> Id<impl Lt<'a>>>
5+
| ^^
66

77
error[E0657]: `impl Trait` can only capture lifetimes bound at the fn or impl level
88
--> $DIR/E0657.rs:29:35
99
|
10-
LL | -> impl for<'a> Id<impl Lt<'a>>
11-
| ^^
10+
LL | -> Box<for<'a> Id<impl Lt<'a>>>
11+
| ^^
1212

1313
error: aborting due to 2 previous errors
1414

src/test/ui/error-festival.stderr

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,73 @@
11
error[E0425]: cannot find value `y` in this scope
22
--> $DIR/error-festival.rs:24:5
33
|
4-
24 | y = 2;
4+
LL | y = 2;
55
| ^ did you mean `x`?
66

77
error[E0603]: constant `FOO` is private
88
--> $DIR/error-festival.rs:32:5
99
|
10-
32 | foo::FOO;
10+
LL | foo::FOO;
1111
| ^^^^^^^^
1212

1313
error[E0368]: binary assignment operation `+=` cannot be applied to type `&str`
1414
--> $DIR/error-festival.rs:22:5
1515
|
16-
22 | x += 2;
16+
LL | x += 2;
1717
| -^^^^^
1818
| |
1919
| cannot use `+=` on type `&str`
2020

2121
error[E0599]: no method named `z` found for type `&str` in the current scope
2222
--> $DIR/error-festival.rs:26:7
2323
|
24-
26 | x.z();
24+
LL | x.z();
2525
| ^
2626

2727
error[E0600]: cannot apply unary operator `!` to type `Question`
2828
--> $DIR/error-festival.rs:29:5
2929
|
30-
29 | !Question::Yes;
30+
LL | !Question::Yes;
3131
| ^^^^^^^^^^^^^^
3232

3333
error[E0604]: only `u8` can be cast as `char`, not `u32`
3434
--> $DIR/error-festival.rs:35:5
3535
|
36-
35 | 0u32 as char;
36+
LL | 0u32 as char;
3737
| ^^^^^^^^^^^^
3838

3939
error[E0605]: non-primitive cast: `u8` as `std::vec::Vec<u8>`
4040
--> $DIR/error-festival.rs:39:5
4141
|
42-
39 | x as Vec<u8>;
42+
LL | x as Vec<u8>;
4343
| ^^^^^^^^^^^^
4444
|
4545
= note: an `as` expression can only be used to convert between primitive types. Consider using the `From` trait
4646

4747
error[E0054]: cannot cast as `bool`
4848
--> $DIR/error-festival.rs:43:24
4949
|
50-
43 | let x_is_nonzero = x as bool;
50+
LL | let x_is_nonzero = x as bool;
5151
| ^^^^^^^^^ unsupported cast
5252
|
5353
= help: compare with zero instead
5454

5555
error[E0606]: casting `&u8` as `u32` is invalid
5656
--> $DIR/error-festival.rs:47:18
5757
|
58-
47 | let y: u32 = x as u32;
58+
LL | let y: u32 = x as u32;
5959
| ^^^^^^^^ cannot cast `&u8` as `u32`
6060
|
6161
help: did you mean `*x`?
6262
--> $DIR/error-festival.rs:47:18
6363
|
64-
47 | let y: u32 = x as u32;
64+
LL | let y: u32 = x as u32;
6565
| ^
6666

6767
error[E0607]: cannot cast thin pointer `*const u8` to fat pointer `*const [u8]`
6868
--> $DIR/error-festival.rs:51:5
6969
|
70-
51 | v as *const [u8];
70+
LL | v as *const [u8];
7171
| ^^^^^^^^^^^^^^^^
7272

7373
error: aborting due to 10 previous errors

src/test/ui/feature-gate-if_while_or_patterns.stderr

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
error[E0658]: multiple patterns in `if let` and `while let` are unstable (see issue #48215)
22
--> $DIR/feature-gate-if_while_or_patterns.rs:12:5
33
|
4-
12 | / if let 0 | 1 = 0 { //~ ERROR multiple patterns in `if let` and `while let` are unstable
5-
13 | | ;
6-
14 | | }
4+
LL | / if let 0 | 1 = 0 { //~ ERROR multiple patterns in `if let` and `while let` are unstable
5+
LL | | ;
6+
LL | | }
77
| |_____^
88
|
99
= help: add #![feature(if_while_or_patterns)] to the crate attributes to enable
1010

1111
error[E0658]: multiple patterns in `if let` and `while let` are unstable (see issue #48215)
1212
--> $DIR/feature-gate-if_while_or_patterns.rs:15:5
1313
|
14-
15 | / while let 0 | 1 = 1 { //~ ERROR multiple patterns in `if let` and `while let` are unstable
15-
16 | | break;
16-
17 | | }
14+
LL | / while let 0 | 1 = 1 { //~ ERROR multiple patterns in `if let` and `while let` are unstable
15+
LL | | break;
16+
LL | | }
1717
| |_____^
1818
|
1919
= help: add #![feature(if_while_or_patterns)] to the crate attributes to enable

src/test/ui/impl_trait_projections.stderr

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
11
error[E0667]: `impl Trait` is not allowed in path parameters
22
--> $DIR/impl_trait_projections.rs:23:51
33
|
4-
23 | fn projection_is_disallowed(x: impl Iterator) -> <impl Iterator>::Item {
4+
LL | fn projection_is_disallowed(x: impl Iterator) -> <impl Iterator>::Item {
55
| ^^^^^^^^^^^^^
66

77
error[E0667]: `impl Trait` is not allowed in path parameters
88
--> $DIR/impl_trait_projections.rs:30:9
99
|
10-
30 | -> <impl Iterator as Iterator>::Item
10+
LL | -> <impl Iterator as Iterator>::Item
1111
| ^^^^^^^^^^^^^
1212

1313
error[E0667]: `impl Trait` is not allowed in path parameters
1414
--> $DIR/impl_trait_projections.rs:37:27
1515
|
16-
37 | -> <::std::ops::Range<impl Debug> as Iterator>::Item
16+
LL | -> <::std::ops::Range<impl Debug> as Iterator>::Item
1717
| ^^^^^^^^^^
1818

1919
error[E0667]: `impl Trait` is not allowed in path parameters
2020
--> $DIR/impl_trait_projections.rs:44:29
2121
|
22-
44 | -> <dyn Iterator<Item = impl Debug> as Iterator>::Item
22+
LL | -> <dyn Iterator<Item = impl Debug> as Iterator>::Item
2323
| ^^^^^^^^^^
2424

2525
error[E0223]: ambiguous associated type
2626
--> $DIR/impl_trait_projections.rs:23:50
2727
|
28-
23 | fn projection_is_disallowed(x: impl Iterator) -> <impl Iterator>::Item {
28+
LL | fn projection_is_disallowed(x: impl Iterator) -> <impl Iterator>::Item {
2929
| ^^^^^^^^^^^^^^^^^^^^^ ambiguous associated type
3030
|
3131
= note: specify the type using the syntax `<impl std::iter::Iterator as Trait>::Item`

src/test/ui/issue-19922.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
error[E0559]: variant `Homura::Akemi` has no field named `kaname`
22
--> $DIR/issue-19922.rs:16:34
33
|
4-
16 | let homura = Homura::Akemi { kaname: () };
4+
LL | let homura = Homura::Akemi { kaname: () };
55
| ^^^^^^ `Homura::Akemi` does not have this field
66
|
77
= note: available fields are: `madoka`

src/test/ui/issue-23302-1.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
error[E0391]: cyclic dependency detected
22
--> $DIR/issue-23302-1.rs:14:9
33
|
4-
14 | A = X::A as isize, //~ ERROR E0391
4+
LL | A = X::A as isize, //~ ERROR E0391
55
| ^^^^^^^^^^^^^ cyclic reference
66
|
77
note: the cycle begins when const-evaluating `X::A::{{initializer}}`...
88
--> $DIR/issue-23302-1.rs:14:5
99
|
10-
14 | A = X::A as isize, //~ ERROR E0391
10+
LL | A = X::A as isize, //~ ERROR E0391
1111
| ^^^^^^^^^^^^^^^^^
1212
= note: ...which then again requires const-evaluating `X::A::{{initializer}}`, completing the cycle.
1313

src/test/ui/issue-23302-2.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
error[E0391]: cyclic dependency detected
22
--> $DIR/issue-23302-2.rs:14:9
33
|
4-
14 | A = Y::B as isize, //~ ERROR E0391
4+
LL | A = Y::B as isize, //~ ERROR E0391
55
| ^^^^^^^^^^^^^ cyclic reference
66
|
77
note: the cycle begins when const-evaluating `Y::A::{{initializer}}`...
88
--> $DIR/issue-23302-2.rs:14:5
99
|
10-
14 | A = Y::B as isize, //~ ERROR E0391
10+
LL | A = Y::B as isize, //~ ERROR E0391
1111
| ^^^^^^^^^^^^^^^^^
1212
= note: ...which then again requires const-evaluating `Y::A::{{initializer}}`, completing the cycle.
1313

src/test/ui/issue-23302-3.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
error[E0391]: cyclic dependency detected
22
--> $DIR/issue-23302-3.rs:11:16
33
|
4-
11 | const A: i32 = B; //~ ERROR E0391
4+
LL | const A: i32 = B; //~ ERROR E0391
55
| ^ cyclic reference
66
|
77
note: the cycle begins when processing `B`...
88
--> $DIR/issue-23302-3.rs:13:1
99
|
10-
13 | const B: i32 = A;
10+
LL | const B: i32 = A;
1111
| ^^^^^^^^^^^^^^^^^
1212
note: ...which then requires processing `A`...
1313
--> $DIR/issue-23302-3.rs:13:16
1414
|
15-
13 | const B: i32 = A;
15+
LL | const B: i32 = A;
1616
| ^
1717
= note: ...which then again requires processing `B`, completing the cycle.
1818

src/test/ui/issue-36163.stderr

+14-14
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
error[E0265]: recursive constant
2-
--> $DIR/issue-36163.rs:11:1
3-
|
4-
LL | const A: i32 = Foo::B; //~ ERROR E0265
5-
| ^^^^^^^^^^^^^^^^^^^^^^ recursion not allowed in constant
6-
7-
error[E0265]: recursive constant
1+
error[E0391]: cyclic dependency detected
82
--> $DIR/issue-36163.rs:14:9
93
|
10-
LL | B = A, //~ ERROR E0265
11-
| ^ recursion not allowed in constant
12-
13-
error[E0265]: recursive constant
14-
--> $DIR/issue-36163.rs:18:9
4+
LL | B = A, //~ ERROR E0391
5+
| ^ cyclic reference
6+
|
7+
note: the cycle begins when const-evaluating `Foo::B::{{initializer}}`...
8+
--> $DIR/issue-36163.rs:14:5
9+
|
10+
LL | B = A, //~ ERROR E0391
11+
| ^^^^^
12+
note: ...which then requires const-evaluating `A`...
13+
--> $DIR/issue-36163.rs:14:9
1514
|
16-
LL | C = Bar::C, //~ ERROR E0265
17-
| ^^^^^^ recursion not allowed in constant
15+
LL | B = A, //~ ERROR E0391
16+
| ^
17+
= note: ...which then again requires const-evaluating `Foo::B::{{initializer}}`, completing the cycle.
1818

1919
error: aborting due to previous error
2020

src/test/ui/issue-45157.stderr

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
error[E0502]: cannot borrow `u.z.c` as immutable because it is also borrowed as mutable
22
--> $DIR/issue-45157.rs:37:20
33
|
4-
34 | let mref = &mut u.s.a;
4+
LL | let mref = &mut u.s.a;
55
| ---------- mutable borrow occurs here
66
...
7-
37 | let nref = &u.z.c;
7+
LL | let nref = &u.z.c;
88
| ^^^^^^ immutable borrow occurs here
99

1010
error[E0502]: cannot borrow `u.s.a` as mutable because it is also borrowed as immutable
1111
--> $DIR/issue-45157.rs:39:27
1212
|
13-
37 | let nref = &u.z.c;
13+
LL | let nref = &u.z.c;
1414
| ------ immutable borrow occurs here
15-
38 | //~^ ERROR cannot borrow `u.z.c` as immutable because it is also borrowed as mutable [E0502]
16-
39 | println!("{} {}", mref, nref)
15+
LL | //~^ ERROR cannot borrow `u.z.c` as immutable because it is also borrowed as mutable [E0502]
16+
LL | println!("{} {}", mref, nref)
1717
| ^^^^ mutable borrow occurs here
1818

1919
error: aborting due to 2 previous errors

0 commit comments

Comments
 (0)