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;
22
22
/// The specific types of unsupported syntax
23
23
#[ derive( Copy , PartialEq , Eq , Hash ) ]
24
24
pub enum ObsoleteSyntax {
25
+ Sized ,
25
26
OwnedType ,
26
27
OwnedExpr ,
27
28
OwnedPattern ,
@@ -92,7 +93,11 @@ impl<'a> ParserObsoleteMethods for parser::Parser<'a> {
92
93
ObsoleteSyntax :: ExternCrateRenaming => (
93
94
"`extern crate foo = bar` syntax" ,
94
95
"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
+ ) ,
96
101
} ;
97
102
98
103
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> {
4092
4092
// unbound, and it may only be `Sized`. To avoid backtracking and other
4093
4093
// complications, we parse an ident, then check for `?`. If we find it,
4094
4094
// 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.
4097
4097
let mut span = self . span ;
4098
4098
let mut ident = self . parse_ident ( ) ;
4099
4099
let mut unbound = None ;
@@ -4102,6 +4102,7 @@ impl<'a> Parser<'a> {
4102
4102
unbound = Some ( tref) ;
4103
4103
span = self . span ;
4104
4104
ident = self . parse_ident ( ) ;
4105
+ self . obsolete ( span, ObsoleteSyntax :: Sized ) ;
4105
4106
}
4106
4107
4107
4108
let mut bounds = self . parse_colon_then_ty_param_bounds ( BoundParsingMode :: Modified ) ;
You can’t perform that action at this time.
0 commit comments