Skip to content

Commit 1442d66

Browse files
committed
---
yaml --- r: 277334 b: refs/heads/try c: 8dbab51 h: refs/heads/master
1 parent d0d17f8 commit 1442d66

File tree

3 files changed

+14
-11
lines changed

3 files changed

+14
-11
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 6dbb0e86aec11050480beb76eade6fb805010ba7
33
refs/heads/snap-stage3: 235d77457d80b549dad3ac36d94f235208a1eafb
4-
refs/heads/try: e2c821d35ee5cb5211f92480a53b409b2b2c359e
4+
refs/heads/try: 8dbab5121e214a08690eefdaa3ee45bb2d1bbd5e
55
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
66
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
77
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try/src/librustc_resolve/build_reduced_graph.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ impl<'b, 'tcx:'b> Resolver<'b, 'tcx> {
120120
// prevent `self` or `super` at beginning of global path
121121
if path.global && path.segments.len() > 0 {
122122
let first = path.segments[0].identifier.name;
123-
if first == keywords::Super.to_name() || first == keywords::SelfValue.to_name() {
123+
if first == keywords::Super.ident.name || first == keywords::SelfValue.ident.name {
124124
self.session.add_lint(
125125
lint::builtin::SUPER_OR_SELF_IN_GLOBAL_PATH, id, path.span,
126126
format!("expected identifier, found keyword `{}`", first)

branches/try/src/libsyntax/parse/parser.rs

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -583,6 +583,11 @@ impl<'a> Parser<'a> {
583583
}
584584
}
585585

586+
fn parse_ident_into_path(&mut self) -> PResult<'a, ast::Path> {
587+
let ident = self.parse_ident()?;
588+
Ok(ast::Path::from_ident(self.last_span, ident))
589+
}
590+
586591
/// Check if the next token is `tok`, and return `true` if so.
587592
///
588593
/// This method will automatically add `tok` to `expected_tokens` if `tok` is not
@@ -1462,7 +1467,7 @@ impl<'a> Parser<'a> {
14621467
} else if self.eat_lt() {
14631468

14641469
let (qself, path) =
1465-
self.parse_qualified_path(NoTypesAllowed)?;
1470+
self.parse_qualified_path(LifetimeAndTypesWithoutColons)?;
14661471

14671472
TyKind::Path(Some(qself), path)
14681473
} else if self.is_path_start() {
@@ -3573,7 +3578,7 @@ impl<'a> Parser<'a> {
35733578
let (qself, path) = if self.eat_lt() {
35743579
// Parse a qualified path
35753580
let (qself, path) =
3576-
self.parse_qualified_path(NoTypesAllowed)?;
3581+
self.parse_qualified_path(LifetimeAndTypesWithColons)?;
35773582
(Some(qself), path)
35783583
} else {
35793584
// Parse an unqualified path
@@ -3651,9 +3656,7 @@ impl<'a> Parser<'a> {
36513656
// Plain idents have some extra abilities here compared to general paths
36523657
if self.look_ahead(1, |t| *t == token::Not) {
36533658
// Parse macro invocation
3654-
let ident = self.parse_ident()?;
3655-
let ident_span = self.last_span;
3656-
let path = ast::Path::from_ident(ident_span, ident);
3659+
let path = self.parse_ident_into_path()?;
36573660
self.bump();
36583661
let delim = self.expect_open_delim()?;
36593662
let tts = self.parse_seq_to_end(
@@ -3673,7 +3676,7 @@ impl<'a> Parser<'a> {
36733676
let (qself, path) = if self.eat_lt() {
36743677
// Parse a qualified path
36753678
let (qself, path) =
3676-
self.parse_qualified_path(NoTypesAllowed)?;
3679+
self.parse_qualified_path(LifetimeAndTypesWithColons)?;
36773680
(Some(qself), path)
36783681
} else {
36793682
// Parse an unqualified path
@@ -3936,7 +3939,7 @@ impl<'a> Parser<'a> {
39363939

39373940
// Potential trouble: if we allow macros with paths instead of
39383941
// idents, we'd need to look ahead past the whole path here...
3939-
let pth = self.parse_path(NoTypesAllowed)?;
3942+
let pth = self.parse_ident_into_path()?;
39403943
self.bump();
39413944

39423945
let id = match self.token {
@@ -4956,7 +4959,7 @@ impl<'a> Parser<'a> {
49564959
self.complain_if_pub_macro(&vis, last_span);
49574960

49584961
let lo = self.span.lo;
4959-
let pth = self.parse_path(NoTypesAllowed)?;
4962+
let pth = self.parse_ident_into_path()?;
49604963
self.expect(&token::Not)?;
49614964

49624965
// eat a matched-delimiter token tree:
@@ -6009,7 +6012,7 @@ impl<'a> Parser<'a> {
60096012
let mac_lo = self.span.lo;
60106013

60116014
// item macro.
6012-
let pth = self.parse_path(NoTypesAllowed)?;
6015+
let pth = self.parse_ident_into_path()?;
60136016
self.expect(&token::Not)?;
60146017

60156018
// a 'special' identifier (like what `macro_rules!` uses)

0 commit comments

Comments
 (0)