Skip to content

Commit b3c6265

Browse files
committed
Fix fallout in tests
1 parent 65ec4df commit b3c6265

22 files changed

+71
-70
lines changed

src/test/compile-fail/blind-item-block-item-shadow.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ fn main() {
1414
{
1515
struct Bar;
1616
use foo::Bar;
17-
//~^ ERROR import `Bar` conflicts with type in this module
18-
//~^^ ERROR import `Bar` conflicts with value in this module
17+
//~^ ERROR a type named `Bar` has already been defined in this block
18+
//~^^ ERROR a value named `Bar` has already been defined in this block
1919
}
2020
}

src/test/compile-fail/blind-item-item-shadow.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
mod foo { pub mod foo { } }
11+
mod foo { pub mod foo { } } //~ NOTE previous definition of `foo` here
1212

13-
use foo::foo; //~ ERROR import `foo` conflicts with existing submodule
13+
use foo::foo; //~ ERROR a module named `foo` has already been defined in this module
1414

1515
fn main() {}

src/test/compile-fail/enum-and-module-in-same-scope.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
enum Foo {
11+
enum Foo { //~ NOTE previous definition
1212
X
1313
}
1414

15-
mod Foo { //~ ERROR duplicate definition of type or module `Foo`
15+
mod Foo { //~ ERROR a type named `Foo` has already been defined
1616
pub static X: isize = 42;
1717
fn f() { f() } // Check that this does not result in a resolution error
1818
}

src/test/compile-fail/issue-19498.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
use self::A; //~ ERROR import `A` conflicts with existing submodule
12-
use self::B; //~ ERROR import `B` conflicts with existing submodule
13-
mod A {}
14-
pub mod B {}
11+
use self::A; //~ NOTE previous import of `A` here
12+
use self::B; //~ NOTE previous import of `B` here
13+
mod A {} //~ ERROR a module named `A` has already been imported in this module
14+
pub mod B {} //~ ERROR a module named `B` has already been imported in this module
1515

1616
mod C {
17-
use C::D; //~ ERROR import `D` conflicts with existing submodule
18-
mod D {}
17+
use C::D; //~ NOTE previous import of `D` here
18+
mod D {} //~ ERROR a module named `D` has already been imported in this module
1919
}
2020

2121
fn main() {}

src/test/compile-fail/issue-21546.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,54 +12,54 @@
1212

1313
#[allow(non_snake_case)]
1414
mod Foo { }
15-
//~^ NOTE first definition of type or module `Foo`
15+
//~^ NOTE previous definition of `Foo` here
1616

1717
#[allow(dead_code)]
1818
struct Foo;
19-
//~^ ERROR duplicate definition of type or module `Foo`
20-
19+
//~^ ERROR a module named `Foo` has already been defined in this module
2120

2221
#[allow(non_snake_case)]
2322
mod Bar { }
24-
//~^ NOTE first definition of type or module `Bar`
23+
//~^ NOTE previous definition of `Bar` here
2524

2625
#[allow(dead_code)]
2726
struct Bar(i32);
28-
//~^ ERROR duplicate definition of type or module `Bar`
27+
//~^ ERROR a module named `Bar` has already been defined
2928

3029

3130
#[allow(dead_code)]
3231
struct Baz(i32);
33-
//~^ NOTE first definition of type or module
32+
//~^ NOTE previous definition
3433

3534
#[allow(non_snake_case)]
3635
mod Baz { }
37-
//~^ ERROR duplicate definition of type or module `Baz`
36+
//~^ ERROR a type named `Baz` has already been defined
3837

3938

4039
#[allow(dead_code)]
4140
struct Qux { x: bool }
42-
//~^ NOTE first definition of type or module
41+
//~^ NOTE previous definition
4342

4443
#[allow(non_snake_case)]
4544
mod Qux { }
46-
//~^ ERROR duplicate definition of type or module `Qux`
45+
//~^ ERROR a type named `Qux` has already been defined
4746

4847

4948
#[allow(dead_code)]
5049
struct Quux;
51-
//~^ NOTE first definition of type or module
50+
//~^ NOTE previous definition
5251

5352
#[allow(non_snake_case)]
5453
mod Quux { }
55-
//~^ ERROR duplicate definition of type or module `Quux`
54+
//~^ ERROR a type named `Quux` has already been defined
5655

5756

5857
#[allow(dead_code)]
5958
enum Corge { A, B }
59+
//~^ NOTE previous definition
6060

6161
#[allow(non_snake_case)]
6262
mod Corge { }
63-
//~^ ERROR duplicate definition of type or module `Corge`
63+
//~^ ERROR a type named `Corge` has already been defined
6464

6565
fn main() { }

src/test/compile-fail/issue-24081.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
use std::ops::Add; //~ ERROR import `Add` conflicts with type in this module
12-
use std::ops::Sub; //~ ERROR import `Sub` conflicts with type in this module
13-
use std::ops::Mul; //~ ERROR import `Mul` conflicts with type in this module
14-
use std::ops::Div; //~ ERROR import `Div` conflicts with existing submodule
15-
use std::ops::Rem; //~ ERROR import `Rem` conflicts with trait in this module
11+
use std::ops::Add; //~ NOTE previous import
12+
use std::ops::Sub; //~ NOTE previous import
13+
use std::ops::Mul; //~ NOTE previous import
14+
use std::ops::Div; //~ NOTE previous import
15+
use std::ops::Rem; //~ NOTE previous import
1616

17-
type Add = bool;
18-
struct Sub { x: f32 }
19-
enum Mul { A, B }
20-
mod Div { }
21-
trait Rem { }
17+
type Add = bool; //~ ERROR a trait named `Add` has already been imported in this module
18+
struct Sub { x: f32 } //~ ERROR a trait named `Sub` has already been imported in this module
19+
enum Mul { A, B } //~ ERROR a trait named `Mul` has already been imported in this module
20+
mod Div { } //~ ERROR a trait named `Div` has already been imported in this module
21+
trait Rem { } //~ ERROR a trait named `Rem` has already been imported in this module
2222

2323
fn main() {}

src/test/compile-fail/issue-28472.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313
extern {
1414
fn foo();
1515

16-
pub //~ ERROR duplicate definition
16+
pub //~ ERROR a value named `foo` has already been defined
1717
fn foo();
1818

19-
pub //~ ERROR duplicate definition
19+
pub //~ ERROR a value named `foo` has already been defined
2020
static mut foo: u32;
2121
}
2222

src/test/compile-fail/issue-3099-a.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@
1010

1111
enum a { b, c }
1212

13-
enum a { d, e } //~ ERROR duplicate definition of type or module `a`
13+
enum a { d, e } //~ ERROR a type named `a` has already been defined in this module
1414

1515
fn main() {}

src/test/compile-fail/issue-3099-b.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@
1010

1111
pub mod a {}
1212

13-
pub mod a {} //~ ERROR duplicate definition of type or module `a`
13+
pub mod a {} //~ ERROR a module named `a` has already been defined in this module
1414

1515
fn main() {}

src/test/compile-fail/issue-3099.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ fn a(x: String) -> String {
1212
format!("First function with {}", x)
1313
}
1414

15-
fn a(x: String, y: String) -> String { //~ ERROR duplicate definition of value `a`
15+
fn a(x: String, y: String) -> String { //~ ERROR a value named `a` has already been defined
1616
format!("Second function with {} and {}", x, y)
1717
}
1818

src/test/compile-fail/issue-6936.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,17 @@ struct T;
1212

1313
mod t1 {
1414
type Foo = ::T;
15-
mod Foo {} //~ ERROR: duplicate definition of type or module `Foo`
15+
mod Foo {} //~ ERROR: `Foo` has already been defined
1616
}
1717

1818
mod t2 {
1919
type Foo = ::T;
20-
struct Foo; //~ ERROR: duplicate definition of type or module `Foo`
20+
struct Foo; //~ ERROR: `Foo` has already been defined
2121
}
2222

2323
mod t3 {
2424
type Foo = ::T;
25-
enum Foo {} //~ ERROR: duplicate definition of type or module `Foo`
25+
enum Foo {} //~ ERROR: `Foo` has already been defined
2626
}
2727

2828
mod t4 {
@@ -32,7 +32,7 @@ mod t4 {
3232

3333
mod t5 {
3434
type Bar<T> = T;
35-
mod Bar {} //~ ERROR: duplicate definition of type or module `Bar`
35+
mod Bar {} //~ ERROR: `Bar` has already been defined
3636
}
3737

3838
mod t6 {

src/test/compile-fail/issue-7044.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99
// except according to those terms.
1010

1111
static X: isize = 0;
12-
struct X; //~ ERROR error: duplicate definition of value `X`
12+
struct X; //~ ERROR `X` has already been defined
1313

1414
fn main() {}

src/test/compile-fail/issue-8640.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212

1313
mod foo {
1414
use baz::bar;
15-
//~^ ERROR import `bar` conflicts with existing submodule
1615
mod bar {}
16+
//~^ ERROR a module named `bar` has already been imported
1717
}
1818
mod baz { pub mod bar {} }
1919

src/test/compile-fail/no-std-inject.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
#![no_std]
1212

13-
extern crate core; //~ ERROR: an external crate named `core` has already
13+
extern crate core; //~ ERROR: an extern crate named `core` has already
1414
extern crate std;
1515

1616
fn main() {}

src/test/compile-fail/resolve-conflict-extern-crate-vs-extern-crate.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99
// except according to those terms.
1010

1111
extern crate std;
12-
//~^ ERROR an external crate named `std` has already been imported
12+
//~^ ERROR an extern crate named `std` has already been imported
1313

1414
fn main(){}

src/test/compile-fail/resolve-conflict-import-vs-extern-crate.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
use std::slice as std; //~ ERROR import `std` conflicts with imported crate
11+
use std::slice as std; //~ ERROR an extern crate named `std` has already been imported
1212

1313
fn main() {
1414
}

src/test/compile-fail/resolve-conflict-item-vs-extern-crate.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// except according to those terms.
1010

1111
fn std() {}
12-
mod std {} //~ ERROR the name `std` conflicts with an external crate
12+
mod std {} //~ ERROR an extern crate named `std` has already been imported
1313

1414
fn main() {
1515
}

src/test/compile-fail/resolve-conflict-item-vs-import.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@
99
// except according to those terms.
1010

1111
use std::mem::transmute;
12-
//~^ ERROR import `transmute` conflicts with value in this module
12+
//~^ NOTE previous import of `transmute` here
1313

1414
fn transmute() {}
15+
//~^ ERROR a value named `transmute` has already been imported in this module
1516

1617
fn main() {
1718
}

src/test/compile-fail/resolve-conflict-type-vs-import.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
// except according to those terms.
1010

1111
use std::slice::Iter;
12-
//~^ ERROR import `Iter` conflicts with type in this module
1312

1413
struct Iter;
14+
//~^ ERROR a type named `Iter` has already been imported in this module
1515

1616
fn main() {
1717
}

src/test/compile-fail/trait-duplicate-methods.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
// except according to those terms.
1010

1111
trait Foo {
12-
fn orange(&self);
13-
fn orange(&self); //~ ERROR error: duplicate definition of value `orange`
12+
fn orange(&self); //~ NOTE previous definition of `orange` here
13+
fn orange(&self); //~ ERROR a value named `orange` has already been defined in this trait
1414
}
1515

1616
fn main() {}

src/test/compile-fail/unresolved-extern-mod-suggestion.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@
1010

1111
extern crate core;
1212
use core;
13-
//~^ ERROR import `core` conflicts with imported crate in this module
13+
//~^ ERROR an extern crate named `core` has already been imported in this module
1414

1515
fn main() {}

src/test/compile-fail/variant-namespacing.rs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,6 @@
1010

1111
// aux-build:variant-namespacing.rs
1212

13-
extern crate variant_namespacing;
14-
pub use variant_namespacing::XE::*;
15-
//~^ ERROR import `XStruct` conflicts with type in this module
16-
//~| ERROR import `XStruct` conflicts with value in this module
17-
//~| ERROR import `XTuple` conflicts with type in this module
18-
//~| ERROR import `XTuple` conflicts with value in this module
19-
//~| ERROR import `XUnit` conflicts with type in this module
20-
//~| ERROR import `XUnit` conflicts with value in this module
21-
pub use E::*;
22-
//~^ ERROR import `Struct` conflicts with type in this module
23-
//~| ERROR import `Struct` conflicts with value in this module
24-
//~| ERROR import `Tuple` conflicts with type in this module
25-
//~| ERROR import `Tuple` conflicts with value in this module
26-
//~| ERROR import `Unit` conflicts with type in this module
27-
//~| ERROR import `Unit` conflicts with value in this module
28-
2913
enum E {
3014
Struct { a: u8 },
3115
Tuple(u8),
@@ -46,4 +30,20 @@ const XStruct: u8 = 0;
4630
const XTuple: u8 = 0;
4731
const XUnit: u8 = 0;
4832

33+
extern crate variant_namespacing;
34+
pub use variant_namespacing::XE::*;
35+
//~^ ERROR `XStruct` has already been defined
36+
//~| ERROR `XStruct` has already been defined
37+
//~| ERROR `XTuple` has already been defined
38+
//~| ERROR `XTuple` has already been defined
39+
//~| ERROR `XUnit` has already been defined
40+
//~| ERROR `XUnit` has already been defined
41+
pub use E::*;
42+
//~^ ERROR `Struct` has already been defined
43+
//~| ERROR `Struct` has already been defined
44+
//~| ERROR `Tuple` has already been defined
45+
//~| ERROR `Tuple` has already been defined
46+
//~| ERROR `Unit` has already been defined
47+
//~| ERROR `Unit` has already been defined
48+
4949
fn main() {}

0 commit comments

Comments
 (0)