Skip to content

Commit ed20fcc

Browse files
committed
auto merge of #8060 : Blei/rust/fix-obsolete-extern-visibility-span, r=pcwalton
2 parents e721194 + 2a18c29 commit ed20fcc

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/libsyntax/parse/parser.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4196,7 +4196,7 @@ impl Parser {
41964196

41974197
// Do not allow visibility to be specified.
41984198
if visibility != ast::inherited {
4199-
self.obsolete(*self.span, ObsoleteExternVisibility);
4199+
self.obsolete(*self.last_span, ObsoleteExternVisibility);
42004200
}
42014201

42024202
let abis = opt_abis.get_or_default(AbiSet::C());

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

+10
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,14 @@ fn obsolete_moves() {
6363
//~^ ERROR obsolete syntax: binary move
6464
}
6565

66+
extern mod obsolete_name {
67+
//~^ ERROR obsolete syntax: named external module
68+
fn bar();
69+
}
70+
71+
pub extern {
72+
//~^ ERROR obsolete syntax: `pub extern`
73+
pub fn bar();
74+
}
75+
6676
fn main() { }

0 commit comments

Comments
 (0)