File tree 5 files changed +23
-18
lines changed
codegen-units/item-collection
5 files changed +23
-18
lines changed Original file line number Diff line number Diff line change @@ -98,10 +98,10 @@ Erroneous code examples:
98
98
99
99
```compile_fail,E0466
100
100
#[macro_use(a_macro(another_macro))] // error: invalid import declaration
101
- extern crate some_crate;
101
+ extern crate core as some_crate;
102
102
103
103
#[macro_use(i_want = "some_macros")] // error: invalid import declaration
104
- extern crate another_crate;
104
+ extern crate core as another_crate;
105
105
```
106
106
107
107
This is a syntax error at the level of attribute declarations. The proper
@@ -135,10 +135,10 @@ Erroneous code examples:
135
135
136
136
```compile_fail,E0467
137
137
#[macro_reexport] // error: no macros listed for export
138
- extern crate macros_for_good;
138
+ extern crate core as macros_for_good;
139
139
140
140
#[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;
142
142
```
143
143
144
144
This is a syntax error at the level of attribute declarations.
@@ -165,8 +165,8 @@ Example of erroneous code:
165
165
```compile_fail,E0468
166
166
mod foo {
167
167
#[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!(...);
170
170
}
171
171
```
172
172
Original file line number Diff line number Diff line change @@ -45,16 +45,16 @@ impl IndexMut<usize> for Indexable {
45
45
}
46
46
47
47
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]
50
50
#[ derive( PartialEq ) ]
51
51
pub struct Equatable ( u32 ) ;
52
52
53
53
54
54
impl Add < u32 > for Equatable {
55
55
type Output = u32 ;
56
56
57
- //~ TRANS_ITEM fn overloaded_operators::{{impl}}[3 ]::add[0]
57
+ //~ TRANS_ITEM fn overloaded_operators::{{impl}}[2 ]::add[0]
58
58
fn add ( self , rhs : u32 ) -> u32 {
59
59
self . 0 + rhs
60
60
}
@@ -63,7 +63,7 @@ impl Add<u32> for Equatable {
63
63
impl Deref for Equatable {
64
64
type Target = u32 ;
65
65
66
- //~ TRANS_ITEM fn overloaded_operators::{{impl}}[4 ]::deref[0]
66
+ //~ TRANS_ITEM fn overloaded_operators::{{impl}}[3 ]::deref[0]
67
67
fn deref ( & self ) -> & Self :: Target {
68
68
& self . 0
69
69
}
Original file line number Diff line number Diff line change 10
10
11
11
#![ no_std]
12
12
13
- extern crate core;
14
13
extern crate rand;
15
14
extern crate serialize as rustc_serialize;
16
15
Original file line number Diff line number Diff line change 8
8
// option. This file may not be copied, modified, or distributed
9
9
// except according to those terms.
10
10
11
- extern crate bäz; //~ ERROR non-ascii idents
11
+ extern crate core as bäz; //~ ERROR non-ascii idents
12
12
13
13
use föö:: bar; //~ ERROR non-ascii idents
14
14
Original file line number Diff line number Diff line change @@ -39,11 +39,17 @@ pub fn main() {
39
39
}
40
40
}
41
41
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
+ }
44
46
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
+ }
47
51
48
- trait Self { }
49
- //~^ ERROR expected identifier, found keyword `Self`
52
+ mod m3 {
53
+ trait Self { }
54
+ //~^ ERROR expected identifier, found keyword `Self`
55
+ }
You can’t perform that action at this time.
0 commit comments