Skip to content

Commit dfa69be

Browse files
committed
Fix fallout in tests.
1 parent d854c36 commit dfa69be

File tree

5 files changed

+23
-18
lines changed

5 files changed

+23
-18
lines changed

src/librustc_metadata/diagnostics.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,10 @@ Erroneous code examples:
9898
9999
```compile_fail,E0466
100100
#[macro_use(a_macro(another_macro))] // error: invalid import declaration
101-
extern crate some_crate;
101+
extern crate core as some_crate;
102102
103103
#[macro_use(i_want = "some_macros")] // error: invalid import declaration
104-
extern crate another_crate;
104+
extern crate core as another_crate;
105105
```
106106
107107
This is a syntax error at the level of attribute declarations. The proper
@@ -135,10 +135,10 @@ Erroneous code examples:
135135
136136
```compile_fail,E0467
137137
#[macro_reexport] // error: no macros listed for export
138-
extern crate macros_for_good;
138+
extern crate core as macros_for_good;
139139
140140
#[macro_reexport(fun_macro = "foo")] // error: not a macro identifier
141-
extern crate other_macros_for_good;
141+
extern crate core as other_macros_for_good;
142142
```
143143
144144
This is a syntax error at the level of attribute declarations.
@@ -165,8 +165,8 @@ Example of erroneous code:
165165
```compile_fail,E0468
166166
mod foo {
167167
#[macro_use(helpful_macro)] // error: must be at crate root to import
168-
extern crate some_crate; // macros from another crate
169-
helpful_macro!(...)
168+
extern crate core; // macros from another crate
169+
helpful_macro!(...);
170170
}
171171
```
172172

src/test/codegen-units/item-collection/overloaded-operators.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,16 @@ impl IndexMut<usize> for Indexable {
4545
}
4646

4747

48-
//~ TRANS_ITEM fn overloaded_operators::{{impl}}[2]::eq[0]
49-
//~ TRANS_ITEM fn overloaded_operators::{{impl}}[2]::ne[0]
48+
//~ TRANS_ITEM fn overloaded_operators::{{impl}}[4]::eq[0]
49+
//~ TRANS_ITEM fn overloaded_operators::{{impl}}[4]::ne[0]
5050
#[derive(PartialEq)]
5151
pub struct Equatable(u32);
5252

5353

5454
impl Add<u32> for Equatable {
5555
type Output = u32;
5656

57-
//~ TRANS_ITEM fn overloaded_operators::{{impl}}[3]::add[0]
57+
//~ TRANS_ITEM fn overloaded_operators::{{impl}}[2]::add[0]
5858
fn add(self, rhs: u32) -> u32 {
5959
self.0 + rhs
6060
}
@@ -63,7 +63,7 @@ impl Add<u32> for Equatable {
6363
impl Deref for Equatable {
6464
type Target = u32;
6565

66-
//~ TRANS_ITEM fn overloaded_operators::{{impl}}[4]::deref[0]
66+
//~ TRANS_ITEM fn overloaded_operators::{{impl}}[3]::deref[0]
6767
fn deref(&self) -> &Self::Target {
6868
&self.0
6969
}

src/test/compile-fail-fulldeps/derive-no-std-not-supported.rs

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

1111
#![no_std]
1212

13-
extern crate core;
1413
extern crate rand;
1514
extern crate serialize as rustc_serialize;
1615

src/test/compile-fail/gated-non-ascii-idents.rs

+1-1
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-
extern crate bäz; //~ ERROR non-ascii idents
11+
extern crate core as bäz; //~ ERROR non-ascii idents
1212

1313
use föö::bar; //~ ERROR non-ascii idents
1414

src/test/compile-fail/self_type_keyword.rs

+12-6
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,17 @@ pub fn main() {
3939
}
4040
}
4141

42-
use std::option::Option as Self;
43-
//~^ ERROR expected identifier, found keyword `Self`
42+
mod m1 {
43+
extern crate core as Self;
44+
//~^ ERROR expected identifier, found keyword `Self`
45+
}
4446

45-
extern crate Self;
46-
//~^ ERROR expected identifier, found keyword `Self`
47+
mod m2 {
48+
use std::option::Option as Self;
49+
//~^ ERROR expected identifier, found keyword `Self`
50+
}
4751

48-
trait Self {}
49-
//~^ ERROR expected identifier, found keyword `Self`
52+
mod m3 {
53+
trait Self {}
54+
//~^ ERROR expected identifier, found keyword `Self`
55+
}

0 commit comments

Comments
 (0)