@@ -25,21 +25,6 @@ use parse::token;
25
25
/// The specific types of unsupported syntax
26
26
#[ deriving( Eq , TotalEq , Hash ) ]
27
27
pub enum ObsoleteSyntax {
28
- ObsoleteSwap ,
29
- ObsoleteUnsafeBlock ,
30
- ObsoleteBareFnType ,
31
- ObsoleteMultipleLocalDecl ,
32
- ObsoleteUnsafeExternFn ,
33
- ObsoleteTraitFuncVisibility ,
34
- ObsoleteConstPointer ,
35
- ObsoleteLoopAsContinue ,
36
- ObsoleteEnumWildcard ,
37
- ObsoleteStructWildcard ,
38
- ObsoleteVecDotDotWildcard ,
39
- ObsoleteMultipleImport ,
40
- ObsoleteManagedPattern ,
41
- ObsoleteManagedString ,
42
- ObsoleteManagedVec ,
43
28
ObsoleteOwnedType ,
44
29
ObsoleteOwnedExpr ,
45
30
ObsoleteOwnedPattern ,
@@ -64,71 +49,6 @@ impl<'a> ParserObsoleteMethods for Parser<'a> {
64
49
/// Reports an obsolete syntax non-fatal error.
65
50
fn obsolete ( & mut self , sp : Span , kind : ObsoleteSyntax ) {
66
51
let ( kind_str, desc) = match kind {
67
- ObsoleteSwap => (
68
- "swap" ,
69
- "use std::mem::{swap, replace} instead"
70
- ) ,
71
- ObsoleteUnsafeBlock => (
72
- "non-standalone unsafe block" ,
73
- "use an inner `unsafe { ... }` block instead"
74
- ) ,
75
- ObsoleteBareFnType => (
76
- "bare function type" ,
77
- "use `|A| -> B` or `extern fn(A) -> B` instead"
78
- ) ,
79
- ObsoleteMultipleLocalDecl => (
80
- "declaration of multiple locals at once" ,
81
- "instead of e.g. `let a = 1, b = 2`, write \
82
- `let (a, b) = (1, 2)`."
83
- ) ,
84
- ObsoleteUnsafeExternFn => (
85
- "unsafe external function" ,
86
- "external functions are always unsafe; remove the `unsafe` \
87
- keyword"
88
- ) ,
89
- ObsoleteTraitFuncVisibility => (
90
- "visibility not necessary" ,
91
- "trait functions inherit the visibility of the trait itself"
92
- ) ,
93
- ObsoleteConstPointer => (
94
- "const pointer" ,
95
- "instead of `&const Foo` or `@const Foo`, write `&Foo` or \
96
- `@Foo`"
97
- ) ,
98
- ObsoleteLoopAsContinue => (
99
- "`loop` instead of `continue`" ,
100
- "`loop` is now only used for loops and `continue` is used for \
101
- skipping iterations"
102
- ) ,
103
- ObsoleteEnumWildcard => (
104
- "enum wildcard" ,
105
- "use `..` instead of `*` for matching all enum fields"
106
- ) ,
107
- ObsoleteStructWildcard => (
108
- "struct wildcard" ,
109
- "use `..` instead of `_` for matching trailing struct fields"
110
- ) ,
111
- ObsoleteVecDotDotWildcard => (
112
- "vec slice wildcard" ,
113
- "use `..` instead of `.._` for matching slices"
114
- ) ,
115
- ObsoleteMultipleImport => (
116
- "multiple imports" ,
117
- "only one import is allowed per `use` statement"
118
- ) ,
119
- ObsoleteManagedPattern => (
120
- "managed pointer pattern" ,
121
- "use a nested `match` expression instead of a managed box \
122
- pattern"
123
- ) ,
124
- ObsoleteManagedString => (
125
- "managed string" ,
126
- "use `Rc<StrBuf>` instead of a managed string"
127
- ) ,
128
- ObsoleteManagedVec => (
129
- "managed vector" ,
130
- "use `Rc<~[T]>` instead of a managed vector"
131
- ) ,
132
52
ObsoleteOwnedType => (
133
53
"`~` notation for owned pointers" ,
134
54
"use `Box<T>` in `std::owned` instead"
0 commit comments