Skip to content

Commit

Permalink
syntax: fix span for obsolete extern visibility error
Browse files Browse the repository at this point in the history
  • Loading branch information
Blei committed Jul 26, 2013
1 parent 5109ce6 commit 2a18c29
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/libsyntax/parse/parser.rs
Expand Up @@ -4196,7 +4196,7 @@ impl Parser {

// Do not allow visibility to be specified.
if visibility != ast::inherited {
self.obsolete(*self.span, ObsoleteExternVisibility);
self.obsolete(*self.last_span, ObsoleteExternVisibility);
}

let abis = opt_abis.get_or_default(AbiSet::C());
Expand Down
10 changes: 10 additions & 0 deletions src/test/compile-fail/obsolete-syntax.rs
Expand Up @@ -63,4 +63,14 @@ fn obsolete_moves() {
//~^ ERROR obsolete syntax: binary move
}

extern mod obsolete_name {
//~^ ERROR obsolete syntax: named external module
fn bar();
}

pub extern {
//~^ ERROR obsolete syntax: `pub extern`
pub fn bar();
}

fn main() { }

5 comments on commit 2a18c29

@bors
Copy link
Contributor

@bors bors commented on 2a18c29 Jul 27, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors
Copy link
Contributor

@bors bors commented on 2a18c29 Jul 27, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging Blei/rust/fix-obsolete-extern-visibility-span = 2a18c29 into auto

@bors
Copy link
Contributor

@bors bors commented on 2a18c29 Jul 27, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blei/rust/fix-obsolete-extern-visibility-span = 2a18c29 merged ok, testing candidate = ed20fcc

@bors
Copy link
Contributor

@bors bors commented on 2a18c29 Jul 27, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = ed20fcc

Please sign in to comment.