File tree Expand file tree Collapse file tree 5 files changed +23
-18
lines changed
codegen-units/item-collection Expand file tree Collapse file tree 5 files changed +23
-18
lines changed Original file line number Diff line number Diff 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
107107This 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
144144This is a syntax error at the level of attribute declarations.
@@ -165,8 +165,8 @@ Example of erroneous code:
165165```compile_fail,E0468
166166mod 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
Original file line number Diff line number Diff 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 ) ]
5151pub struct Equatable ( u32 ) ;
5252
5353
5454impl 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 {
6363impl 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 }
Original file line number Diff line number Diff line change 1010
1111#![ no_std]
1212
13- extern crate core;
1413extern crate rand;
1514extern crate serialize as rustc_serialize;
1615
Original file line number Diff line number Diff line change 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
1313use föö:: bar; //~ ERROR non-ascii idents
1414
Original file line number Diff line number Diff 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+ }
You can’t perform that action at this time.
0 commit comments