Skip to content

Commit 3e0bf26

Browse files
committed
---
yaml --- r: 171962 b: refs/heads/beta c: 48f50e1 h: refs/heads/master v: v3
1 parent 93273c0 commit 3e0bf26

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,5 @@ refs/heads/automation-fail: 1bf06495443584539b958873e04cc2f864ab10e4
3131
refs/heads/issue-18208-method-dispatch-3-quick-reject: 2009f85b9f99dedcec4404418eda9ddba90258a2
3232
refs/heads/batch: b5571ed71a5879c0495a982506258d5d267744ed
3333
refs/heads/building: 126db549b038c84269a1e4fe46f051b2c15d6970
34-
refs/heads/beta: 595a08258700f2f5689ad63d99b5d65d5dfb5eab
34+
refs/heads/beta: 48f50e1e98691d74427e23e82694f528b3fb4d56
3535
refs/heads/windistfix: 7608dbad651f02e837ed05eef3d74a6662a6e928

branches/beta/src/libsyntax/parse/obsolete.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ use ptr::P;
2222
/// The specific types of unsupported syntax
2323
#[derive(Copy, PartialEq, Eq, Hash)]
2424
pub 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);

branches/beta/src/libsyntax/parse/parser.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff 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);

0 commit comments

Comments
 (0)