From 0e9969c81c6df7b13b75638a7c3635d0a4515c36 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Wed, 23 Aug 2017 08:47:50 -0700 Subject: [PATCH] Fix tests and fallout --- src/libsyntax/parse/parser.rs | 2 +- src/test/compile-fail/import-ty-params.rs | 2 +- src/test/compile-fail/privacy/restricted/ty-params.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 1a1f35505d020..573e01eab2abf 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -1752,7 +1752,7 @@ impl<'a> Parser<'a> { -> PResult<'a, ast::Path> { maybe_whole!(self, NtPath, |path| { - if style == PathStyle::Mod && + if mode == PathStyle::Mod && path.segments.iter().any(|segment| segment.parameters.is_some()) { self.diagnostic().span_err(path.span, "unexpected generic arguments in path"); } diff --git a/src/test/compile-fail/import-ty-params.rs b/src/test/compile-fail/import-ty-params.rs index 7344f31535fba..a345523ded57d 100644 --- a/src/test/compile-fail/import-ty-params.rs +++ b/src/test/compile-fail/import-ty-params.rs @@ -20,6 +20,6 @@ macro_rules! import { ($p: path) => (use $p;); } -import! { a::b::c::S } //~ERROR type or lifetime parameters in import path +import! { a::b::c::S } //~ERROR unexpected generic arguments in path fn main() {} diff --git a/src/test/compile-fail/privacy/restricted/ty-params.rs b/src/test/compile-fail/privacy/restricted/ty-params.rs index c83a4e568528f..5708d31998435 100644 --- a/src/test/compile-fail/privacy/restricted/ty-params.rs +++ b/src/test/compile-fail/privacy/restricted/ty-params.rs @@ -13,7 +13,7 @@ macro_rules! m { } struct S(T); -m!{ S } //~ ERROR type or lifetime parameters in visibility path +m!{ S } //~ ERROR unexpected generic arguments in path //~^ ERROR expected module, found struct `S` fn main() {}