Don't feature gate bang macros on 'proc_macro_path_invoc'.

This commit is contained in:
Sergio Benitez 2018-04-27 21:32:00 -07:00
parent ede7f94794
commit f756b072b3
25 changed files with 20 additions and 25 deletions

View File

@ -397,7 +397,7 @@ impl<'a> Resolver<'a> {
fn resolve_macro_to_def(&mut self, scope: Mark, path: &ast::Path, kind: MacroKind, force: bool)
-> Result<Def, Determinacy> {
if path.segments.len() > 1 {
if kind != MacroKind::Bang && path.segments.len() > 1 {
if !self.session.features_untracked().proc_macro_path_invoc {
emit_feature_err(
&self.session.parse_sess,
@ -409,6 +409,7 @@ impl<'a> Resolver<'a> {
);
}
}
let def = self.resolve_macro_to_def_inner(scope, path, kind, force);
if def != Err(Determinacy::Undetermined) {
// Do not report duplicated errors on every undetermined resolution.

View File

@ -10,7 +10,7 @@
// #41719
#![feature(use_extern_macros, proc_macro_path_invoc)]
#![feature(use_extern_macros)]
fn main() {
enum Foo {}

View File

@ -13,7 +13,6 @@
#![feature(asm)]
#![feature(trace_macros, concat_idents)]
#![feature(proc_macro_path_invoc)]
#[derive(Default)] //~ ERROR
enum OrDeriveThis {}

View File

@ -10,7 +10,6 @@
#![feature(decl_macro, associated_type_defaults)]
#![allow(unused, private_in_public)]
#![feature(proc_macro_path_invoc)]
mod priv_nominal {
pub struct Pub;

View File

@ -10,7 +10,6 @@
// ignore-tidy-linelength
#![feature(proc_macro_path_invoc)]
#![feature(decl_macro, associated_type_defaults)]
#![allow(unused, private_in_public)]

View File

@ -8,7 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(proc_macro_path_invoc)]
#![feature(decl_macro, associated_type_defaults)]
#![allow(unused, private_in_public)]

View File

@ -18,7 +18,6 @@
// error-pattern:type `fn(u8) -> ext::PubTupleStruct {ext::PubTupleStruct::{{constructor}}}` is priv
// error-pattern:type `for<'r> fn(&'r ext::Pub<u8>) {<ext::Pub<u8>>::priv_method}` is private
#![feature(proc_macro_path_invoc)]
#![feature(decl_macro)]
extern crate private_inferred_type as ext;

View File

@ -11,7 +11,6 @@
#![feature(associated_consts)]
#![feature(decl_macro)]
#![allow(private_in_public)]
#![feature(proc_macro_path_invoc)]
mod m {
fn priv_fn() {}

View File

@ -13,7 +13,7 @@
// aux-build:hello_macro.rs
// ignore-stage1
#![feature(proc_macro, proc_macro_path_invoc, proc_macro_non_items)]
#![feature(proc_macro, proc_macro_non_items)]
extern crate hello_macro;

View File

@ -10,7 +10,7 @@
// ignore-pretty pretty-printing is unhygienic
#![feature(decl_macro, proc_macro_path_invoc)]
#![feature(decl_macro)]
#![allow(unused)]
macro m($S:ident, $x:ident) {

View File

@ -10,7 +10,7 @@
// ignore-pretty pretty-printing is unhygienic
#![feature(decl_macro, proc_macro_path_invoc)]
#![feature(decl_macro)]
#![allow(unused)]
mod foo {

View File

@ -12,7 +12,7 @@
// aux-build:legacy_interaction.rs
#![feature(decl_macro, proc_macro_path_invoc)]
#![feature(decl_macro)]
#[allow(unused)]
extern crate legacy_interaction;

View File

@ -10,7 +10,7 @@
// ignore-pretty pretty-printing is unhygienic
#![feature(decl_macro, proc_macro_path_invoc)]
#![feature(decl_macro)]
mod bar {
mod baz {

View File

@ -13,7 +13,7 @@
// aux-build:my_crate.rs
// aux-build:unhygienic_example.rs
#![feature(decl_macro, proc_macro_path_invoc)]
#![feature(decl_macro)]
extern crate unhygienic_example;
extern crate my_crate; // (b)

View File

@ -12,7 +12,7 @@
// aux-build:xcrate.rs
#![feature(decl_macro, proc_macro_path_invoc)]
#![feature(decl_macro)]
extern crate xcrate;

View File

@ -10,7 +10,7 @@
// aux-build:two_macros.rs
#![feature(use_extern_macros, proc_macro_path_invoc)]
#![feature(use_extern_macros)]
extern crate two_macros;

View File

@ -10,7 +10,7 @@
// ignore-pretty pretty-printing is unhygienic
#![feature(decl_macro, proc_macro_path_invoc)]
#![feature(decl_macro)]
mod foo {
struct S { x: u32 }

View File

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(decl_macro, proc_macro_path_invoc)]
#![feature(decl_macro)]
mod foo {
pub fn f() {}

View File

@ -10,7 +10,7 @@
// ignore-pretty pretty-printing is unhygienic
#![feature(decl_macro, proc_macro_path_invoc)]
#![feature(decl_macro)]
mod foo {
struct S;

View File

@ -14,7 +14,7 @@
// error-pattern:type `fn() -> u32 {intercrate::foo::bar::f}` is private
#![feature(decl_macro, proc_macro_path_invoc)]
#![feature(decl_macro)]
extern crate intercrate;

View File

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(decl_macro, proc_macro_path_invoc)]
#![feature(decl_macro)]
mod foo {
pub macro m() { Vec::new(); ().clone() }

View File

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(decl_macro, proc_macro_path_invoc)]
#![feature(decl_macro)]
mod foo {
fn f() {}

View File

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(decl_macro, proc_macro_path_invoc)]
#![feature(decl_macro)]
mod foo {
pub trait T {

View File

@ -10,7 +10,7 @@
// aux-build:two_macros.rs
#![feature(use_extern_macros, proc_macro_path_invoc)]
#![feature(use_extern_macros)]
extern crate two_macros;

View File

@ -10,7 +10,7 @@
// aux-build:two_macros.rs
#![feature(use_extern_macros, proc_macro_path_invoc)]
#![feature(use_extern_macros)]
mod foo {
extern crate two_macros;