Skip to content

Commit

Permalink
Fix rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
petrochenkov committed Feb 26, 2018
1 parent 7ba5fd1 commit 9f9183d
Show file tree
Hide file tree
Showing 39 changed files with 243 additions and 240 deletions.
11 changes: 6 additions & 5 deletions src/librustc/session/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -909,13 +909,14 @@ pub fn build_session_with_codemap(sopts: config::Options,

let emitter: Box<Emitter> = match (sopts.error_format, emitter_dest) {
(config::ErrorOutputType::HumanReadable(color_config), None) => {
Box::new(EmitterWriter::stderr(color_config,
Some(codemap.clone()),
false,
sopts.debugging_opts.teach))
Box::new(EmitterWriter::stderr(color_config, Some(codemap.clone()),
false, sopts.debugging_opts.teach)
.ui_testing(sopts.debugging_opts.ui_testing))
}
(config::ErrorOutputType::HumanReadable(_), Some(dst)) => {
Box::new(EmitterWriter::new(dst, Some(codemap.clone()), false, false))
Box::new(EmitterWriter::new(dst, Some(codemap.clone()),
false, false)
.ui_testing(sopts.debugging_opts.ui_testing))
}
(config::ErrorOutputType::Json(pretty), None) => {
Box::new(JsonEmitter::stderr(Some(registry), codemap.clone(),
Expand Down
5 changes: 3 additions & 2 deletions src/librustc_errors/emitter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,9 @@ impl EmitterWriter {
}
}

pub fn ui_testing(self, ui_testing: bool) -> Self {
Self { ui_testing, ..self }
pub fn ui_testing(mut self, ui_testing: bool) -> Self {
self.ui_testing = ui_testing;
self
}

fn maybe_anonymized(&self, line_num: usize) -> String {
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui-fulldeps/proc-macro/load-panic.stderr
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
error: proc-macro derive panicked
--> $DIR/load-panic.rs:17:10
|
17 | #[derive(A)]
LL | #[derive(A)]
| ^
|
= help: message: nope!
Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/command-line-diagnostics.stderr
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
error[E0384]: cannot assign twice to immutable variable `x`
--> $DIR/command-line-diagnostics.rs:16:5
|
15 | let x = 42;
LL | let x = 42;
| - first assignment to `x`
16 | x = 43;
LL | x = 43;
| ^^^^^^ cannot assign twice to immutable variable

error: aborting due to previous error
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
error[E0560]: struct `submodule::Demo` has no field named `inocently_mispellable`
--> $DIR/issue-42599_available_fields_note.rs:26:39
|
26 | Self { secret_integer: 2, inocently_mispellable: () }
LL | Self { secret_integer: 2, inocently_mispellable: () }
| ^^^^^^^^^^^^^^^^^^^^^ field does not exist - did you mean `innocently_misspellable`?

error[E0560]: struct `submodule::Demo` has no field named `egregiously_nonexistent_field`
--> $DIR/issue-42599_available_fields_note.rs:31:39
|
31 | Self { secret_integer: 3, egregiously_nonexistent_field: () }
LL | Self { secret_integer: 3, egregiously_nonexistent_field: () }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `submodule::Demo` does not have this field
|
= note: available fields are: `favorite_integer`, `secret_integer`, `innocently_misspellable`, `another_field`, `yet_another_field` ... and 2 others
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/error-codes/E0062.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ error[E0062]: field `x` specified more than once
|
LL | x: 0,
| ---- first use of `x`
18 | x: 0,
LL | x: 0,
| ^ used more than once

error: aborting due to previous error
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/error-codes/E0559.stderr
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
error[E0559]: variant `Field::Fool` has no field named `joke`
--> $DIR/E0559.rs:16:27
|
16 | let s = Field::Fool { joke: 0 };
LL | let s = Field::Fool { joke: 0 };
| ^^^^ `Field::Fool` does not have this field
|
= note: available fields are: `x`
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/error-codes/E0560.stderr
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
error[E0560]: struct `Simba` has no field named `father`
--> $DIR/E0560.rs:16:32
|
16 | let s = Simba { mother: 1, father: 0 };
LL | let s = Simba { mother: 1, father: 0 };
| ^^^^^^ `Simba` does not have this field
|
= note: available fields are: `mother`
Expand Down
8 changes: 4 additions & 4 deletions src/test/ui/error-codes/E0657.stderr
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
error[E0657]: `impl Trait` can only capture lifetimes bound at the fn or impl level
--> $DIR/E0657.rs:20:31
|
LL | -> impl for<'a> Id<impl Lt<'a>>
| ^^
LL | -> Box<for<'a> Id<impl Lt<'a>>>
| ^^

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

error: aborting due to 2 previous errors

Expand Down
22 changes: 11 additions & 11 deletions src/test/ui/error-festival.stderr
Original file line number Diff line number Diff line change
@@ -1,73 +1,73 @@
error[E0425]: cannot find value `y` in this scope
--> $DIR/error-festival.rs:24:5
|
24 | y = 2;
LL | y = 2;
| ^ did you mean `x`?

error[E0603]: constant `FOO` is private
--> $DIR/error-festival.rs:32:5
|
32 | foo::FOO;
LL | foo::FOO;
| ^^^^^^^^

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

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

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

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

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

error[E0054]: cannot cast as `bool`
--> $DIR/error-festival.rs:43:24
|
43 | let x_is_nonzero = x as bool;
LL | let x_is_nonzero = x as bool;
| ^^^^^^^^^ unsupported cast
|
= help: compare with zero instead

error[E0606]: casting `&u8` as `u32` is invalid
--> $DIR/error-festival.rs:47:18
|
47 | let y: u32 = x as u32;
LL | let y: u32 = x as u32;
| ^^^^^^^^ cannot cast `&u8` as `u32`
|
help: did you mean `*x`?
--> $DIR/error-festival.rs:47:18
|
47 | let y: u32 = x as u32;
LL | let y: u32 = x as u32;
| ^

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

error: aborting due to 10 previous errors
Expand Down
12 changes: 6 additions & 6 deletions src/test/ui/feature-gate-if_while_or_patterns.stderr
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
error[E0658]: multiple patterns in `if let` and `while let` are unstable (see issue #48215)
--> $DIR/feature-gate-if_while_or_patterns.rs:12:5
|
12 | / if let 0 | 1 = 0 { //~ ERROR multiple patterns in `if let` and `while let` are unstable
13 | | ;
14 | | }
LL | / if let 0 | 1 = 0 { //~ ERROR multiple patterns in `if let` and `while let` are unstable
LL | | ;
LL | | }
| |_____^
|
= help: add #![feature(if_while_or_patterns)] to the crate attributes to enable

error[E0658]: multiple patterns in `if let` and `while let` are unstable (see issue #48215)
--> $DIR/feature-gate-if_while_or_patterns.rs:15:5
|
15 | / while let 0 | 1 = 1 { //~ ERROR multiple patterns in `if let` and `while let` are unstable
16 | | break;
17 | | }
LL | / while let 0 | 1 = 1 { //~ ERROR multiple patterns in `if let` and `while let` are unstable
LL | | break;
LL | | }
| |_____^
|
= help: add #![feature(if_while_or_patterns)] to the crate attributes to enable
Expand Down
10 changes: 5 additions & 5 deletions src/test/ui/impl_trait_projections.stderr
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
error[E0667]: `impl Trait` is not allowed in path parameters
--> $DIR/impl_trait_projections.rs:23:51
|
23 | fn projection_is_disallowed(x: impl Iterator) -> <impl Iterator>::Item {
LL | fn projection_is_disallowed(x: impl Iterator) -> <impl Iterator>::Item {
| ^^^^^^^^^^^^^

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

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

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

error[E0223]: ambiguous associated type
--> $DIR/impl_trait_projections.rs:23:50
|
23 | fn projection_is_disallowed(x: impl Iterator) -> <impl Iterator>::Item {
LL | fn projection_is_disallowed(x: impl Iterator) -> <impl Iterator>::Item {
| ^^^^^^^^^^^^^^^^^^^^^ ambiguous associated type
|
= note: specify the type using the syntax `<impl std::iter::Iterator as Trait>::Item`
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/issue-19922.stderr
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
error[E0559]: variant `Homura::Akemi` has no field named `kaname`
--> $DIR/issue-19922.rs:16:34
|
16 | let homura = Homura::Akemi { kaname: () };
LL | let homura = Homura::Akemi { kaname: () };
| ^^^^^^ `Homura::Akemi` does not have this field
|
= note: available fields are: `madoka`
Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/issue-23302-1.stderr
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
error[E0391]: cyclic dependency detected
--> $DIR/issue-23302-1.rs:14:9
|
14 | A = X::A as isize, //~ ERROR E0391
LL | A = X::A as isize, //~ ERROR E0391
| ^^^^^^^^^^^^^ cyclic reference
|
note: the cycle begins when const-evaluating `X::A::{{initializer}}`...
--> $DIR/issue-23302-1.rs:14:5
|
14 | A = X::A as isize, //~ ERROR E0391
LL | A = X::A as isize, //~ ERROR E0391
| ^^^^^^^^^^^^^^^^^
= note: ...which then again requires const-evaluating `X::A::{{initializer}}`, completing the cycle.

Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/issue-23302-2.stderr
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
error[E0391]: cyclic dependency detected
--> $DIR/issue-23302-2.rs:14:9
|
14 | A = Y::B as isize, //~ ERROR E0391
LL | A = Y::B as isize, //~ ERROR E0391
| ^^^^^^^^^^^^^ cyclic reference
|
note: the cycle begins when const-evaluating `Y::A::{{initializer}}`...
--> $DIR/issue-23302-2.rs:14:5
|
14 | A = Y::B as isize, //~ ERROR E0391
LL | A = Y::B as isize, //~ ERROR E0391
| ^^^^^^^^^^^^^^^^^
= note: ...which then again requires const-evaluating `Y::A::{{initializer}}`, completing the cycle.

Expand Down
6 changes: 3 additions & 3 deletions src/test/ui/issue-23302-3.stderr
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
error[E0391]: cyclic dependency detected
--> $DIR/issue-23302-3.rs:11:16
|
11 | const A: i32 = B; //~ ERROR E0391
LL | const A: i32 = B; //~ ERROR E0391
| ^ cyclic reference
|
note: the cycle begins when processing `B`...
--> $DIR/issue-23302-3.rs:13:1
|
13 | const B: i32 = A;
LL | const B: i32 = A;
| ^^^^^^^^^^^^^^^^^
note: ...which then requires processing `A`...
--> $DIR/issue-23302-3.rs:13:16
|
13 | const B: i32 = A;
LL | const B: i32 = A;
| ^
= note: ...which then again requires processing `B`, completing the cycle.

Expand Down
28 changes: 14 additions & 14 deletions src/test/ui/issue-36163.stderr
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
error[E0265]: recursive constant
--> $DIR/issue-36163.rs:11:1
|
LL | const A: i32 = Foo::B; //~ ERROR E0265
| ^^^^^^^^^^^^^^^^^^^^^^ recursion not allowed in constant

error[E0265]: recursive constant
error[E0391]: cyclic dependency detected
--> $DIR/issue-36163.rs:14:9
|
LL | B = A, //~ ERROR E0265
| ^ recursion not allowed in constant

error[E0265]: recursive constant
--> $DIR/issue-36163.rs:18:9
LL | B = A, //~ ERROR E0391
| ^ cyclic reference
|
note: the cycle begins when const-evaluating `Foo::B::{{initializer}}`...
--> $DIR/issue-36163.rs:14:5
|
LL | B = A, //~ ERROR E0391
| ^^^^^
note: ...which then requires const-evaluating `A`...
--> $DIR/issue-36163.rs:14:9
|
LL | C = Bar::C, //~ ERROR E0265
| ^^^^^^ recursion not allowed in constant
LL | B = A, //~ ERROR E0391
| ^
= note: ...which then again requires const-evaluating `Foo::B::{{initializer}}`, completing the cycle.

error: aborting due to previous error

Expand Down
10 changes: 5 additions & 5 deletions src/test/ui/issue-45157.stderr
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
error[E0502]: cannot borrow `u.z.c` as immutable because it is also borrowed as mutable
--> $DIR/issue-45157.rs:37:20
|
34 | let mref = &mut u.s.a;
LL | let mref = &mut u.s.a;
| ---------- mutable borrow occurs here
...
37 | let nref = &u.z.c;
LL | let nref = &u.z.c;
| ^^^^^^ immutable borrow occurs here

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

error: aborting due to 2 previous errors
Expand Down
Loading

0 comments on commit 9f9183d

Please sign in to comment.