File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,7 @@ pub enum ObsoleteSyntax {
48
48
ObsoleteUnenforcedBound ,
49
49
ObsoleteImplSyntax ,
50
50
ObsoleteTraitBoundSeparator ,
51
+ ObsoleteMutOwnedPointer ,
51
52
}
52
53
53
54
pub impl to_bytes:: IterBytes for ObsoleteSyntax {
@@ -126,6 +127,12 @@ pub impl Parser {
126
127
"space-separated trait bounds" ,
127
128
"write `+` between trait bounds"
128
129
) ,
130
+ ObsoleteMutOwnedPointer => (
131
+ "mutable owned pointer" ,
132
+ "mutability inherits through `~` pointers; place the `~` box
133
+ in a mutable location, like a mutable local variable or an \
134
+ `@mut` box"
135
+ ) ,
129
136
} ;
130
137
131
138
self . report ( sp, kind, kind_str, desc) ;
Original file line number Diff line number Diff line change @@ -75,7 +75,7 @@ use parse::obsolete::{ObsoleteMoveInit, ObsoleteBinaryMove};
75
75
use parse:: obsolete:: { ObsoleteStructCtor , ObsoleteWith } ;
76
76
use parse:: obsolete:: { ObsoleteSyntax , ObsoleteLowerCaseKindBounds } ;
77
77
use parse:: obsolete:: { ObsoleteUnsafeBlock , ObsoleteImplSyntax } ;
78
- use parse:: obsolete:: { ObsoleteTraitBoundSeparator } ;
78
+ use parse:: obsolete:: { ObsoleteTraitBoundSeparator , ObsoleteMutOwnedPointer } ;
79
79
use parse:: prec:: { as_prec, token_to_binop} ;
80
80
use parse:: token:: { can_begin_expr, is_ident, is_ident_or_path} ;
81
81
use parse:: token:: { is_plain_ident, INTERPOLATED , special_idents} ;
@@ -677,6 +677,11 @@ pub impl Parser {
677
677
// rather than boxed ptrs. But the special casing of str/vec is not
678
678
// reflected in the AST type.
679
679
let mt = self . parse_mt ( ) ;
680
+
681
+ if mt. mutbl == m_mutbl && sigil == OwnedSigil {
682
+ self . obsolete ( * self . last_span , ObsoleteMutOwnedPointer ) ;
683
+ }
684
+
680
685
ctor ( mt)
681
686
}
682
687
You can’t perform that action at this time.
0 commit comments