File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed
Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ use ptr::P;
2222/// The specific types of unsupported syntax
2323#[ derive( Copy , PartialEq , Eq , Hash ) ]
2424pub enum ObsoleteSyntax {
25+ Sized ,
2526 OwnedType ,
2627 OwnedExpr ,
2728 OwnedPattern ,
@@ -92,7 +93,11 @@ impl<'a> ParserObsoleteMethods for parser::Parser<'a> {
9293 ObsoleteSyntax :: ExternCrateRenaming => (
9394 "`extern crate foo = bar` syntax" ,
9495 "write `extern crate bar as foo` instead"
95- )
96+ ) ,
97+ ObsoleteSyntax :: Sized => (
98+ "`Sized? T` syntax for removing the `Sized` bound" ,
99+ "write `T: ?Sized` instead"
100+ ) ,
96101 } ;
97102
98103 self . report ( sp, kind, kind_str, desc) ;
Original file line number Diff line number Diff line change @@ -4092,8 +4092,8 @@ impl<'a> Parser<'a> {
40924092 // unbound, and it may only be `Sized`. To avoid backtracking and other
40934093 // complications, we parse an ident, then check for `?`. If we find it,
40944094 // we use the ident as the unbound, otherwise, we use it as the name of
4095- // type param. Even worse, for now, we need to check for `?` before or
4096- // after the bound.
4095+ // type param. Even worse, we need to check for `?` before or after the
4096+ // bound.
40974097 let mut span = self . span ;
40984098 let mut ident = self . parse_ident ( ) ;
40994099 let mut unbound = None ;
@@ -4102,6 +4102,7 @@ impl<'a> Parser<'a> {
41024102 unbound = Some ( tref) ;
41034103 span = self . span ;
41044104 ident = self . parse_ident ( ) ;
4105+ self . obsolete ( span, ObsoleteSyntax :: Sized ) ;
41054106 }
41064107
41074108 let mut bounds = self . parse_colon_then_ty_param_bounds ( BoundParsingMode :: Modified ) ;
You can’t perform that action at this time.
0 commit comments