]> git.lizzy.rs Git - rust.git/commitdiff
Remove obsolete warnings for `extern mod`
authorFlavio Percoco <flaper87@gmail.com>
Mon, 3 Feb 2014 21:49:14 +0000 (22:49 +0100)
committerFlavio Percoco <flaper87@gmail.com>
Thu, 13 Feb 2014 19:52:17 +0000 (20:52 +0100)
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.

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

index 6f6f8d7d5631f4eaa8d5d5f029fbe6ceb87aac59..24227dea531f8cb9efbe59a588838ddbfa862c04 100644 (file)
@@ -30,7 +30,6 @@ pub enum ObsoleteSyntax {
     ObsoleteSwap,
     ObsoleteUnsafeBlock,
     ObsoleteBareFnType,
-    ObsoleteNamedExternModule,
     ObsoleteMultipleLocalDecl,
     ObsoleteUnsafeExternFn,
     ObsoleteTraitFuncVisibility,
@@ -42,7 +41,6 @@ pub enum ObsoleteSyntax {
     ObsoleteBoxedClosure,
     ObsoleteClosureType,
     ObsoleteMultipleImport,
-    ObsoleteExternModAttributesInParens,
     ObsoleteManagedPattern,
     ObsoleteManagedString,
     ObsoleteManagedVec,
@@ -86,11 +84,6 @@ fn obsolete(&mut self, sp: Span, kind: ObsoleteSyntax) {
                 "bare function type",
                 "use `|A| -> B` or `extern fn(A) -> B` instead"
             ),
-            ObsoleteNamedExternModule => (
-                "named external module",
-                "instead of `extern mod foo { ... }`, write `mod foo { \
-                 extern { ... } }`"
-            ),
             ObsoleteMultipleLocalDecl => (
                 "declaration of multiple locals at once",
                 "instead of e.g. `let a = 1, b = 2`, write \
@@ -141,11 +134,6 @@ fn obsolete(&mut self, sp: Span, kind: ObsoleteSyntax) {
                 "multiple imports",
                 "only one import is allowed per `use` statement"
             ),
-            ObsoleteExternModAttributesInParens => (
-                "`extern mod` with linkage attribute list",
-                "use `extern mod foo = \"bar\";` instead of \
-                `extern mod foo (name = \"bar\")`"
-            ),
             ObsoleteManagedPattern => (
                 "managed pointer pattern",
                 "use a nested `match` expression instead of a managed box \
index 07fa5077d9b264ac6754833e2b360298d957888d..9fe5e2031bbf56e67feabd4f0ccd1d3096692a1a 100644 (file)
@@ -8,11 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-extern mod obsolete_name {
-    //~^ ERROR obsolete syntax: named external module
-    fn bar();
-}
-
 trait A {
     pub fn foo(); //~ ERROR: visibility not necessary
     pub fn bar(); //~ ERROR: visibility not necessary