File tree Expand file tree Collapse file tree 3 files changed +4
-20
lines changed Expand file tree Collapse file tree 3 files changed +4
-20
lines changed Original file line number Diff line number Diff line change @@ -1822,22 +1822,7 @@ impl<'a> Resolver<'a> {
18221822
18231823 // If it's a typedef, give a note
18241824 if let Def :: TyAlias ( ..) = path_res. base_def {
1825- let trait_name = trait_path. segments . last ( ) . unwrap ( ) . identifier . name ;
1826- err. span_label ( trait_path. span , & format ! ( "`{}` is not a trait" , trait_name) ) ;
1827-
1828- let definition_site = {
1829- let segments = & trait_path. segments ;
1830- if trait_path. global {
1831- self . resolve_crate_relative_path ( trait_path. span , segments, TypeNS )
1832- } else {
1833- self . resolve_module_relative_path ( trait_path. span , segments, TypeNS )
1834- } . map ( |binding| binding. span ) . unwrap_or ( syntax_pos:: DUMMY_SP )
1835- } ;
1836-
1837- if definition_site != syntax_pos:: DUMMY_SP {
1838- err. span_label ( definition_site,
1839- & format ! ( "type aliases cannot be used for traits" ) ) ;
1840- }
1825+ err. note ( & format ! ( "type aliases cannot be used for traits" ) ) ;
18411826 }
18421827 err. emit ( ) ;
18431828 Err ( true )
Original file line number Diff line number Diff line change 1111// aux-build:issue_3907.rs
1212extern crate issue_3907;
1313
14- type Foo = issue_3907:: Foo ; //~ NOTE: type aliases cannot be used for traits
14+ type Foo = issue_3907:: Foo ;
1515
1616struct S {
1717 name : isize
1818}
1919
2020impl Foo for S { //~ ERROR: `Foo` is not a trait
21- //~| `Foo` is not a trait
21+ //~| NOTE: type aliases cannot be used for traits
2222 fn bar ( ) { }
2323}
2424
Original file line number Diff line number Diff line change 1010
1111trait I { }
1212type K = I ;
13- //~^ NOTE: aliases cannot be used for traits
1413impl K for isize { } //~ ERROR: `K` is not a trait
15- //~| is not a trait
14+ //~| NOTE: aliases cannot be used for traits
1615
1716use ImportError ; //~ ERROR unresolved
1817impl ImportError for ( ) { } // check that this is not an additional error (c.f. #35142)
You can’t perform that action at this time.
0 commit comments