Skip to content

Do not include attributes in trait item spans. #24739

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 24, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions src/libsyntax/parse/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1151,8 +1151,8 @@ impl<'a> Parser<'a> {
&token::CloseDelim(token::Brace),
seq_sep_none(),
|p| {
let lo = p.span.lo;
let mut attrs = p.parse_outer_attributes();
let lo = p.span.lo;

let (name, node) = if try!(p.eat_keyword(keywords::Type)) {
let TyParam {ident, bounds, default, ..} = try!(p.parse_ty_param());
Expand Down Expand Up @@ -3409,8 +3409,8 @@ impl<'a> Parser<'a> {
}
}

let lo = self.span.lo;
let attrs = self.parse_outer_attributes();
let lo = self.span.lo;

Ok(Some(if self.check_keyword(keywords::Let) {
check_expected_item(self, &attrs);
Expand Down Expand Up @@ -4304,8 +4304,8 @@ impl<'a> Parser<'a> {

/// Parse an impl item.
pub fn parse_impl_item(&mut self) -> PResult<P<ImplItem>> {
let lo = self.span.lo;
let mut attrs = self.parse_outer_attributes();
let lo = self.span.lo;
let vis = try!(self.parse_visibility());
let (name, node) = if try!(self.eat_keyword(keywords::Type)) {
let name = try!(self.parse_ident());
Expand Down Expand Up @@ -5380,9 +5380,8 @@ impl<'a> Parser<'a> {

/// Parse a foreign item.
fn parse_foreign_item(&mut self) -> PResult<Option<P<ForeignItem>>> {
let lo = self.span.lo;

let attrs = self.parse_outer_attributes();
let lo = self.span.lo;
let visibility = try!(self.parse_visibility());

if self.check_keyword(keywords::Static) {
Expand Down