Skip to content

Commit 5deb3c9

Browse files
committed
Remove obsolete warnings for extern mod
This patch gets rid of ObsoleteExternModAttributesInParens and ObsoleteNamedExternModule since the replacement of `extern mod` with `extern crate` avoids those cases and raises different errors. Both have been around for at least a version which makes this a good moment to get rid of them.
1 parent 9a6d92c commit 5deb3c9

File tree

2 files changed

+0
-17
lines changed

2 files changed

+0
-17
lines changed

src/libsyntax/parse/obsolete.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ pub enum ObsoleteSyntax {
3030
ObsoleteSwap,
3131
ObsoleteUnsafeBlock,
3232
ObsoleteBareFnType,
33-
ObsoleteNamedExternModule,
3433
ObsoleteMultipleLocalDecl,
3534
ObsoleteUnsafeExternFn,
3635
ObsoleteTraitFuncVisibility,
@@ -42,7 +41,6 @@ pub enum ObsoleteSyntax {
4241
ObsoleteBoxedClosure,
4342
ObsoleteClosureType,
4443
ObsoleteMultipleImport,
45-
ObsoleteExternModAttributesInParens,
4644
ObsoleteManagedPattern,
4745
ObsoleteManagedString,
4846
ObsoleteManagedVec,
@@ -86,11 +84,6 @@ impl ParserObsoleteMethods for Parser {
8684
"bare function type",
8785
"use `|A| -> B` or `extern fn(A) -> B` instead"
8886
),
89-
ObsoleteNamedExternModule => (
90-
"named external module",
91-
"instead of `extern mod foo { ... }`, write `mod foo { \
92-
extern { ... } }`"
93-
),
9487
ObsoleteMultipleLocalDecl => (
9588
"declaration of multiple locals at once",
9689
"instead of e.g. `let a = 1, b = 2`, write \
@@ -141,11 +134,6 @@ impl ParserObsoleteMethods for Parser {
141134
"multiple imports",
142135
"only one import is allowed per `use` statement"
143136
),
144-
ObsoleteExternModAttributesInParens => (
145-
"`extern mod` with linkage attribute list",
146-
"use `extern mod foo = \"bar\";` instead of \
147-
`extern mod foo (name = \"bar\")`"
148-
),
149137
ObsoleteManagedPattern => (
150138
"managed pointer pattern",
151139
"use a nested `match` expression instead of a managed box \

src/test/compile-fail/obsolete-syntax.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
extern mod obsolete_name {
12-
//~^ ERROR obsolete syntax: named external module
13-
fn bar();
14-
}
15-
1611
trait A {
1712
pub fn foo(); //~ ERROR: visibility not necessary
1813
pub fn bar(); //~ ERROR: visibility not necessary

0 commit comments

Comments
 (0)