Auto merge of #50911 - petrochenkov:macuse, r=alexcrichton
Stabilize `use_extern_macros` Closes https://github.com/rust-lang/rust/issues/35896
This commit is contained in:
commit
c8c587fe4e
87 changed files with 172 additions and 532 deletions
|
|
@ -8,8 +8,6 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
#![feature(use_extern_macros)]
|
||||
|
||||
pub use std::panic;
|
||||
|
||||
#[macro_export]
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
error[E0255]: the name `panic` is defined multiple times
|
||||
--> $DIR/duplicate-check-macro-exports.rs:16:1
|
||||
--> $DIR/duplicate-check-macro-exports.rs:14:1
|
||||
|
|
||||
LL | pub use std::panic;
|
||||
| ---------- previous import of the macro `panic` here
|
||||
|
|
|
|||
2
src/test/ui/extern/extern-macro.rs
vendored
2
src/test/ui/extern/extern-macro.rs
vendored
|
|
@ -10,8 +10,6 @@
|
|||
|
||||
// #41719
|
||||
|
||||
#![feature(use_extern_macros)]
|
||||
|
||||
fn main() {
|
||||
enum Foo {}
|
||||
let _ = Foo::bar!(); //~ ERROR fail to resolve non-ident macro path
|
||||
|
|
|
|||
2
src/test/ui/extern/extern-macro.stderr
vendored
2
src/test/ui/extern/extern-macro.stderr
vendored
|
|
@ -1,5 +1,5 @@
|
|||
error: fail to resolve non-ident macro path
|
||||
--> $DIR/extern-macro.rs:17:13
|
||||
--> $DIR/extern-macro.rs:15:13
|
||||
|
|
||||
LL | let _ = Foo::bar!(); //~ ERROR fail to resolve non-ident macro path
|
||||
| ^^^^^^^^
|
||||
|
|
|
|||
|
|
@ -8,8 +8,6 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
#![feature(use_extern_macros)]
|
||||
|
||||
fn main() {
|
||||
#[rustfmt::skip] //~ ERROR tool attributes are unstable
|
||||
let x = 3
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
error[E0658]: tool attributes are unstable (see issue #44690)
|
||||
--> $DIR/feature-gate-tool_attributes.rs:14:5
|
||||
--> $DIR/feature-gate-tool_attributes.rs:12:5
|
||||
|
|
||||
LL | #[rustfmt::skip] //~ ERROR tool attributes are unstable
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
|
|
|
|||
|
|
@ -11,8 +11,6 @@
|
|||
// compile-pass
|
||||
// aux-build:local_inner_macros.rs
|
||||
|
||||
#![feature(use_extern_macros)]
|
||||
|
||||
extern crate local_inner_macros;
|
||||
|
||||
use local_inner_macros::{public_macro, public_macro_dynamic};
|
||||
|
|
|
|||
|
|
@ -1,20 +0,0 @@
|
|||
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// `local_inner_macros` has no effect if `feature(use_extern_macros)` is not enabled
|
||||
|
||||
// aux-build:local_inner_macros.rs
|
||||
|
||||
#[macro_use(public_macro)]
|
||||
extern crate local_inner_macros;
|
||||
|
||||
public_macro!(); //~ ERROR cannot find macro `helper2!` in this scope
|
||||
|
||||
fn main() {}
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
error: cannot find macro `helper2!` in this scope
|
||||
--> $DIR/local_inner_macros_disabled.rs:18:1
|
||||
|
|
||||
LL | public_macro!(); //~ ERROR cannot find macro `helper2!` in this scope
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
@ -10,8 +10,6 @@
|
|||
|
||||
// Crate-local macro expanded `macro_export` macros cannot be accessed with module-relative paths.
|
||||
|
||||
#![feature(use_extern_macros)]
|
||||
|
||||
macro_rules! define_exported { () => {
|
||||
#[macro_export]
|
||||
macro_rules! exported {
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
error: macro-expanded `macro_export` macros from the current crate cannot be referred to by absolute paths
|
||||
--> $DIR/local-modularized-tricky-fail-3.rs:25:9
|
||||
--> $DIR/local-modularized-tricky-fail-3.rs:23:9
|
||||
|
|
||||
LL | use exported;
|
||||
| ^^^^^^^^
|
||||
|
|
||||
note: the macro is defined here
|
||||
--> $DIR/local-modularized-tricky-fail-3.rs:17:5
|
||||
--> $DIR/local-modularized-tricky-fail-3.rs:15:5
|
||||
|
|
||||
LL | / macro_rules! exported {
|
||||
LL | | () => ()
|
||||
|
|
@ -16,13 +16,13 @@ LL | define_exported!();
|
|||
| ------------------- in this macro invocation
|
||||
|
||||
error: macro-expanded `macro_export` macros from the current crate cannot be referred to by absolute paths
|
||||
--> $DIR/local-modularized-tricky-fail-3.rs:30:5
|
||||
--> $DIR/local-modularized-tricky-fail-3.rs:28:5
|
||||
|
|
||||
LL | ::exported!();
|
||||
| ^^^^^^^^^^
|
||||
|
|
||||
note: the macro is defined here
|
||||
--> $DIR/local-modularized-tricky-fail-3.rs:17:5
|
||||
--> $DIR/local-modularized-tricky-fail-3.rs:15:5
|
||||
|
|
||||
LL | / macro_rules! exported {
|
||||
LL | | () => ()
|
||||
|
|
|
|||
|
|
@ -10,8 +10,6 @@
|
|||
|
||||
// compile-pass
|
||||
|
||||
#![feature(use_extern_macros)]
|
||||
|
||||
macro_rules! define_exported { () => {
|
||||
#[macro_export]
|
||||
macro_rules! exported {
|
||||
|
|
|
|||
|
|
@ -10,8 +10,6 @@
|
|||
|
||||
// compile-pass
|
||||
|
||||
#![feature(use_extern_macros)]
|
||||
|
||||
#[macro_export(local_inner_macros)]
|
||||
macro_rules! dollar_crate_exported {
|
||||
(1) => { $crate::exported!(); };
|
||||
|
|
|
|||
|
|
@ -10,8 +10,6 @@
|
|||
|
||||
// aux-build:two_macros.rs
|
||||
|
||||
#![feature(use_extern_macros)]
|
||||
|
||||
extern crate two_macros;
|
||||
|
||||
mod foo {
|
||||
|
|
|
|||
|
|
@ -1,34 +1,34 @@
|
|||
error[E0659]: `bar` is ambiguous
|
||||
--> $DIR/macro-paths.rs:25:5
|
||||
--> $DIR/macro-paths.rs:23:5
|
||||
|
|
||||
LL | bar::m! { //~ ERROR ambiguous
|
||||
| ^^^^^^
|
||||
|
|
||||
note: `bar` could refer to the name defined here
|
||||
--> $DIR/macro-paths.rs:26:9
|
||||
--> $DIR/macro-paths.rs:24:9
|
||||
|
|
||||
LL | mod bar { pub use two_macros::m; }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
note: `bar` could also refer to the name imported here
|
||||
--> $DIR/macro-paths.rs:24:9
|
||||
--> $DIR/macro-paths.rs:22:9
|
||||
|
|
||||
LL | use foo::*;
|
||||
| ^^^^^^
|
||||
= note: macro-expanded items do not shadow when used in a macro invocation path
|
||||
|
||||
error[E0659]: `baz` is ambiguous
|
||||
--> $DIR/macro-paths.rs:35:5
|
||||
--> $DIR/macro-paths.rs:33:5
|
||||
|
|
||||
LL | baz::m! { //~ ERROR ambiguous
|
||||
| ^^^^^^
|
||||
|
|
||||
note: `baz` could refer to the name defined here
|
||||
--> $DIR/macro-paths.rs:36:9
|
||||
--> $DIR/macro-paths.rs:34:9
|
||||
|
|
||||
LL | mod baz { pub use two_macros::m; }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
note: `baz` could also refer to the name defined here
|
||||
--> $DIR/macro-paths.rs:30:1
|
||||
--> $DIR/macro-paths.rs:28:1
|
||||
|
|
||||
LL | / pub mod baz {
|
||||
LL | | pub use two_macros::m;
|
||||
|
|
|
|||
|
|
@ -10,8 +10,6 @@
|
|||
|
||||
// aux-build:two_macros.rs
|
||||
|
||||
#![feature(use_extern_macros)]
|
||||
|
||||
extern crate two_macros; // two identity macros `m` and `n`
|
||||
|
||||
mod foo {
|
||||
|
|
|
|||
|
|
@ -1,51 +1,51 @@
|
|||
error: `m` is ambiguous
|
||||
--> $DIR/macros.rs:50:5
|
||||
--> $DIR/macros.rs:48:5
|
||||
|
|
||||
LL | m!(); //~ ERROR ambiguous
|
||||
| ^
|
||||
|
|
||||
note: `m` could refer to the macro defined here
|
||||
--> $DIR/macros.rs:48:5
|
||||
--> $DIR/macros.rs:46:5
|
||||
|
|
||||
LL | macro_rules! m { () => {} }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
note: `m` could also refer to the macro imported here
|
||||
--> $DIR/macros.rs:49:9
|
||||
--> $DIR/macros.rs:47:9
|
||||
|
|
||||
LL | use two_macros::m;
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
error[E0659]: `m` is ambiguous
|
||||
--> $DIR/macros.rs:28:5
|
||||
--> $DIR/macros.rs:26:5
|
||||
|
|
||||
LL | m! { //~ ERROR ambiguous
|
||||
| ^
|
||||
|
|
||||
note: `m` could refer to the name imported here
|
||||
--> $DIR/macros.rs:29:13
|
||||
--> $DIR/macros.rs:27:13
|
||||
|
|
||||
LL | use foo::m;
|
||||
| ^^^^^^
|
||||
note: `m` could also refer to the name imported here
|
||||
--> $DIR/macros.rs:27:9
|
||||
--> $DIR/macros.rs:25:9
|
||||
|
|
||||
LL | use two_macros::*;
|
||||
| ^^^^^^^^^^^^^
|
||||
= note: macro-expanded macro imports do not shadow
|
||||
|
||||
error[E0659]: `m` is ambiguous
|
||||
--> $DIR/macros.rs:41:9
|
||||
--> $DIR/macros.rs:39:9
|
||||
|
|
||||
LL | m! { //~ ERROR ambiguous
|
||||
| ^
|
||||
|
|
||||
note: `m` could refer to the name imported here
|
||||
--> $DIR/macros.rs:42:17
|
||||
--> $DIR/macros.rs:40:17
|
||||
|
|
||||
LL | use two_macros::n as m;
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
note: `m` could also refer to the name imported here
|
||||
--> $DIR/macros.rs:34:9
|
||||
--> $DIR/macros.rs:32:9
|
||||
|
|
||||
LL | use two_macros::m;
|
||||
| ^^^^^^^^^^^^^
|
||||
|
|
|
|||
|
|
@ -10,8 +10,6 @@
|
|||
|
||||
// aux-build:two_macros.rs
|
||||
|
||||
#![feature(use_extern_macros)]
|
||||
|
||||
mod foo {
|
||||
extern crate two_macros;
|
||||
pub use self::two_macros::m as panic;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
error: `panic` is already in scope
|
||||
--> $DIR/shadow_builtin_macros.rs:42:9
|
||||
--> $DIR/shadow_builtin_macros.rs:40:9
|
||||
|
|
||||
LL | macro_rules! panic { () => {} } //~ ERROR `panic` is already in scope
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
@ -10,13 +10,13 @@ LL | m!();
|
|||
= note: macro-expanded `macro_rules!`s may not shadow existing macros (see RFC 1560)
|
||||
|
||||
error[E0659]: `panic` is ambiguous
|
||||
--> $DIR/shadow_builtin_macros.rs:27:14
|
||||
--> $DIR/shadow_builtin_macros.rs:25:14
|
||||
|
|
||||
LL | fn f() { panic!(); } //~ ERROR ambiguous
|
||||
| ^^^^^
|
||||
|
|
||||
note: `panic` could refer to the name imported here
|
||||
--> $DIR/shadow_builtin_macros.rs:26:9
|
||||
--> $DIR/shadow_builtin_macros.rs:24:9
|
||||
|
|
||||
LL | use foo::*;
|
||||
| ^^^^^^
|
||||
|
|
@ -24,13 +24,13 @@ LL | use foo::*;
|
|||
= note: consider adding an explicit import of `panic` to disambiguate
|
||||
|
||||
error[E0659]: `panic` is ambiguous
|
||||
--> $DIR/shadow_builtin_macros.rs:32:14
|
||||
--> $DIR/shadow_builtin_macros.rs:30:14
|
||||
|
|
||||
LL | fn f() { panic!(); } //~ ERROR ambiguous
|
||||
| ^^^^^
|
||||
|
|
||||
note: `panic` could refer to the name imported here
|
||||
--> $DIR/shadow_builtin_macros.rs:31:26
|
||||
--> $DIR/shadow_builtin_macros.rs:29:26
|
||||
|
|
||||
LL | ::two_macros::m!(use foo::panic;);
|
||||
| ^^^^^^^^^^
|
||||
|
|
@ -38,18 +38,18 @@ LL | ::two_macros::m!(use foo::panic;);
|
|||
= note: macro-expanded macro imports do not shadow
|
||||
|
||||
error[E0659]: `n` is ambiguous
|
||||
--> $DIR/shadow_builtin_macros.rs:61:5
|
||||
--> $DIR/shadow_builtin_macros.rs:59:5
|
||||
|
|
||||
LL | n!(); //~ ERROR ambiguous
|
||||
| ^
|
||||
|
|
||||
note: `n` could refer to the name imported here
|
||||
--> $DIR/shadow_builtin_macros.rs:60:9
|
||||
--> $DIR/shadow_builtin_macros.rs:58:9
|
||||
|
|
||||
LL | use bar::*;
|
||||
| ^^^^^^
|
||||
note: `n` could also refer to the name imported here
|
||||
--> $DIR/shadow_builtin_macros.rs:48:13
|
||||
--> $DIR/shadow_builtin_macros.rs:46:13
|
||||
|
|
||||
LL | #[macro_use(n)]
|
||||
| ^
|
||||
|
|
|
|||
|
|
@ -20,5 +20,4 @@ mod foo {
|
|||
|
||||
fn main() {
|
||||
bar!();
|
||||
//~^ ERROR cannot find macro `bar!`
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,3 @@
|
|||
error: cannot find macro `bar!` in this scope
|
||||
--> $DIR/issue-49074.rs:22:4
|
||||
|
|
||||
LL | bar!();
|
||||
| ^^^
|
||||
|
|
||||
= help: have you added the `#[macro_use]` on the module/import?
|
||||
|
||||
error[E0658]: The attribute `marco_use` is currently unknown to the compiler and may have meaning added to it in the future (see issue #29642)
|
||||
--> $DIR/issue-49074.rs:13:1
|
||||
|
|
||||
|
|
@ -14,6 +6,6 @@ LL | #[marco_use] // typo
|
|||
|
|
||||
= help: add #![feature(custom_attribute)] to the crate attributes to enable
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0658`.
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
#![feature(use_extern_macros, extern_prelude)]
|
||||
#![feature(extern_prelude)]
|
||||
|
||||
mod m {
|
||||
fn check() {
|
||||
|
|
|
|||
|
|
@ -8,8 +8,6 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
#![feature(use_extern_macros)]
|
||||
|
||||
mod m {
|
||||
fn check() {
|
||||
Result::Ok!(); //~ ERROR fail to resolve non-ident macro path
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
error: fail to resolve non-ident macro path
|
||||
--> $DIR/macro-path-prelude-fail-2.rs:15:9
|
||||
--> $DIR/macro-path-prelude-fail-2.rs:13:9
|
||||
|
|
||||
LL | Result::Ok!(); //~ ERROR fail to resolve non-ident macro path
|
||||
| ^^^^^^^^^^
|
||||
|
|
|
|||
|
|
@ -8,8 +8,6 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
#![feature(use_extern_macros)]
|
||||
|
||||
#[derive(inline)] //~ ERROR cannot find derive macro `inline` in this scope
|
||||
struct S;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
error: cannot find derive macro `inline` in this scope
|
||||
--> $DIR/macro-path-prelude-fail-3.rs:13:10
|
||||
--> $DIR/macro-path-prelude-fail-3.rs:11:10
|
||||
|
|
||||
LL | #[derive(inline)] //~ ERROR cannot find derive macro `inline` in this scope
|
||||
| ^^^^^^
|
||||
|
||||
error: cannot find macro `inline!` in this scope
|
||||
--> $DIR/macro-path-prelude-fail-3.rs:17:5
|
||||
--> $DIR/macro-path-prelude-fail-3.rs:15:5
|
||||
|
|
||||
LL | inline!(); //~ ERROR cannot find macro `inline!` in this scope
|
||||
| ^^^^^^ help: you could try the macro: `line`
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
// compile-pass
|
||||
|
||||
#![feature(use_extern_macros, extern_prelude)]
|
||||
#![feature(extern_prelude)]
|
||||
|
||||
mod m {
|
||||
fn check() {
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ error[E0557]: feature has been removed
|
|||
LL | #![feature(macro_reexport)] //~ ERROR feature has been removed
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
|
||||
note: subsumed by `#![feature(use_extern_macros)]` and `pub use`
|
||||
note: subsumed by `pub use`
|
||||
--> $DIR/macro-reexport-removed.rs:13:12
|
||||
|
|
||||
LL | #![feature(macro_reexport)] //~ ERROR feature has been removed
|
||||
|
|
|
|||
|
|
@ -1,15 +0,0 @@
|
|||
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// gate-test-use_extern_macros
|
||||
|
||||
fn main() {
|
||||
globnar::brotz!(); //~ ERROR non-ident macro paths are experimental
|
||||
}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
error[E0658]: non-ident macro paths are experimental (see issue #35896)
|
||||
--> $DIR/macro-with-seps-err-msg.rs:14:5
|
||||
|
|
||||
LL | globnar::brotz!(); //~ ERROR non-ident macro paths are experimental
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: add #![feature(use_extern_macros)] to the crate attributes to enable
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0658`.
|
||||
|
|
@ -19,5 +19,5 @@ mod m {
|
|||
|
||||
fn main() {
|
||||
k!(); //~ ERROR cannot find
|
||||
kl!(); //~ ERROR cannot find
|
||||
kl!();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,16 +1,8 @@
|
|||
error: cannot find macro `kl!` in this scope
|
||||
--> $DIR/macro_undefined.rs:22:5
|
||||
|
|
||||
LL | kl!(); //~ ERROR cannot find
|
||||
| ^^
|
||||
|
|
||||
= help: have you added the `#[macro_use]` on the module/import?
|
||||
|
||||
error: cannot find macro `k!` in this scope
|
||||
--> $DIR/macro_undefined.rs:21:5
|
||||
|
|
||||
LL | k!(); //~ ERROR cannot find
|
||||
| ^ help: you could try the macro: `kl`
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -30,8 +30,6 @@ fn main() {
|
|||
env!(foo, abr, baz); //~ ERROR
|
||||
env!("RUST_HOPEFULLY_THIS_DOESNT_EXIST"); //~ ERROR
|
||||
|
||||
foo::blah!(); //~ ERROR
|
||||
|
||||
format!(invalid); //~ ERROR
|
||||
|
||||
include!(invalid); //~ ERROR
|
||||
|
|
|
|||
|
|
@ -40,16 +40,8 @@ error: environment variable `RUST_HOPEFULLY_THIS_DOESNT_EXIST` not defined
|
|||
LL | env!("RUST_HOPEFULLY_THIS_DOESNT_EXIST"); //~ ERROR
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0658]: non-ident macro paths are experimental (see issue #35896)
|
||||
--> $DIR/macros-nonfatal-errors.rs:33:5
|
||||
|
|
||||
LL | foo::blah!(); //~ ERROR
|
||||
| ^^^^^^^^^
|
||||
|
|
||||
= help: add #![feature(use_extern_macros)] to the crate attributes to enable
|
||||
|
||||
error: format argument must be a string literal
|
||||
--> $DIR/macros-nonfatal-errors.rs:35:13
|
||||
--> $DIR/macros-nonfatal-errors.rs:33:13
|
||||
|
|
||||
LL | format!(invalid); //~ ERROR
|
||||
| ^^^^^^^
|
||||
|
|
@ -59,42 +51,41 @@ LL | format!("{}", invalid); //~ ERROR
|
|||
| ^^^^^
|
||||
|
||||
error: argument must be a string literal
|
||||
--> $DIR/macros-nonfatal-errors.rs:37:14
|
||||
--> $DIR/macros-nonfatal-errors.rs:35:14
|
||||
|
|
||||
LL | include!(invalid); //~ ERROR
|
||||
| ^^^^^^^
|
||||
|
||||
error: argument must be a string literal
|
||||
--> $DIR/macros-nonfatal-errors.rs:39:18
|
||||
--> $DIR/macros-nonfatal-errors.rs:37:18
|
||||
|
|
||||
LL | include_str!(invalid); //~ ERROR
|
||||
| ^^^^^^^
|
||||
|
||||
error: couldn't read $DIR/i'd be quite surprised if a file with this name existed: No such file or directory (os error 2)
|
||||
--> $DIR/macros-nonfatal-errors.rs:40:5
|
||||
--> $DIR/macros-nonfatal-errors.rs:38:5
|
||||
|
|
||||
LL | include_str!("i'd be quite surprised if a file with this name existed"); //~ ERROR
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: argument must be a string literal
|
||||
--> $DIR/macros-nonfatal-errors.rs:41:20
|
||||
--> $DIR/macros-nonfatal-errors.rs:39:20
|
||||
|
|
||||
LL | include_bytes!(invalid); //~ ERROR
|
||||
| ^^^^^^^
|
||||
|
||||
error: couldn't read $DIR/i'd be quite surprised if a file with this name existed: No such file or directory (os error 2)
|
||||
--> $DIR/macros-nonfatal-errors.rs:42:5
|
||||
--> $DIR/macros-nonfatal-errors.rs:40:5
|
||||
|
|
||||
LL | include_bytes!("i'd be quite surprised if a file with this name existed"); //~ ERROR
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: trace_macros! accepts only `true` or `false`
|
||||
--> $DIR/macros-nonfatal-errors.rs:44:5
|
||||
--> $DIR/macros-nonfatal-errors.rs:42:5
|
||||
|
|
||||
LL | trace_macros!(invalid); //~ ERROR
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to 15 previous errors
|
||||
error: aborting due to 14 previous errors
|
||||
|
||||
Some errors occurred: E0658, E0665.
|
||||
For more information about an error, try `rustc --explain E0658`.
|
||||
For more information about this error, try `rustc --explain E0665`.
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@
|
|||
|
||||
#[no_link]
|
||||
extern crate empty_struct;
|
||||
//~^ WARN proc macro crates and `#[no_link]` crates have no effect without `#[macro_use]`
|
||||
|
||||
fn main() {
|
||||
empty_struct::XEmpty1; //~ ERROR cannot find value `XEmpty1` in module `empty_struct`
|
||||
|
|
|
|||
|
|
@ -1,11 +1,5 @@
|
|||
warning: proc macro crates and `#[no_link]` crates have no effect without `#[macro_use]`
|
||||
--> $DIR/no-link.rs:14:1
|
||||
|
|
||||
LL | extern crate empty_struct;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0425]: cannot find value `XEmpty1` in module `empty_struct`
|
||||
--> $DIR/no-link.rs:18:19
|
||||
--> $DIR/no-link.rs:17:19
|
||||
|
|
||||
LL | empty_struct::XEmpty1; //~ ERROR cannot find value `XEmpty1` in module `empty_struct`
|
||||
| ^^^^^^^ not found in `empty_struct`
|
||||
|
|
|
|||
|
|
@ -1,32 +1,8 @@
|
|||
error: BaseDefault
|
||||
--> $DIR/object-lifetime-default.rs:16:1
|
||||
error: 'a,Ambiguous
|
||||
--> $DIR/object-lifetime-default.rs:34:1
|
||||
|
|
||||
LL | struct A<T>(T); //~ ERROR BaseDefault
|
||||
| ^^^^^^^^^^^^^^^
|
||||
|
||||
error: BaseDefault
|
||||
--> $DIR/object-lifetime-default.rs:19:1
|
||||
|
|
||||
LL | struct B<'a,T>(&'a (), T); //~ ERROR BaseDefault
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: 'a
|
||||
--> $DIR/object-lifetime-default.rs:22:1
|
||||
|
|
||||
LL | struct C<'a,T:'a>(&'a T); //~ ERROR 'a
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: Ambiguous
|
||||
--> $DIR/object-lifetime-default.rs:25:1
|
||||
|
|
||||
LL | struct D<'a,'b,T:'a+'b>(&'a T, &'b T); //~ ERROR Ambiguous
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: 'b
|
||||
--> $DIR/object-lifetime-default.rs:28:1
|
||||
|
|
||||
LL | struct E<'a,'b:'a,T:'b>(&'a T, &'b T); //~ ERROR 'b
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
LL | struct G<'a,'b,T:'a,U:'a+'b>(&'a T, &'b U); //~ ERROR 'a,Ambiguous
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: 'a,'b
|
||||
--> $DIR/object-lifetime-default.rs:31:1
|
||||
|
|
@ -34,11 +10,35 @@ error: 'a,'b
|
|||
LL | struct F<'a,'b,T:'a,U:'b>(&'a T, &'b U); //~ ERROR 'a,'b
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: 'a,Ambiguous
|
||||
--> $DIR/object-lifetime-default.rs:34:1
|
||||
error: 'b
|
||||
--> $DIR/object-lifetime-default.rs:28:1
|
||||
|
|
||||
LL | struct G<'a,'b,T:'a,U:'a+'b>(&'a T, &'b U); //~ ERROR 'a,Ambiguous
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
LL | struct E<'a,'b:'a,T:'b>(&'a T, &'b T); //~ ERROR 'b
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: Ambiguous
|
||||
--> $DIR/object-lifetime-default.rs:25:1
|
||||
|
|
||||
LL | struct D<'a,'b,T:'a+'b>(&'a T, &'b T); //~ ERROR Ambiguous
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: 'a
|
||||
--> $DIR/object-lifetime-default.rs:22:1
|
||||
|
|
||||
LL | struct C<'a,T:'a>(&'a T); //~ ERROR 'a
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: BaseDefault
|
||||
--> $DIR/object-lifetime-default.rs:19:1
|
||||
|
|
||||
LL | struct B<'a,T>(&'a (), T); //~ ERROR BaseDefault
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: BaseDefault
|
||||
--> $DIR/object-lifetime-default.rs:16:1
|
||||
|
|
||||
LL | struct A<T>(T); //~ ERROR BaseDefault
|
||||
| ^^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to 7 previous errors
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@
|
|||
// compile-pass
|
||||
|
||||
#![warn(macro_use_extern_crate, unused)]
|
||||
#![feature(use_extern_macros)]
|
||||
|
||||
#[macro_use] //~ WARN should be replaced at use sites with a `use` statement
|
||||
extern crate macro_use_warned_against;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
warning: deprecated `#[macro_use]` directive used to import macros should be replaced at use sites with a `use` statement to import the macro instead
|
||||
--> $DIR/macro-use-warned-against.rs:18:1
|
||||
--> $DIR/macro-use-warned-against.rs:17:1
|
||||
|
|
||||
LL | #[macro_use] //~ WARN should be replaced at use sites with a `use` statement
|
||||
| ^^^^^^^^^^^^
|
||||
|
|
@ -11,7 +11,7 @@ LL | #![warn(macro_use_extern_crate, unused)]
|
|||
| ^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
warning: unused `#[macro_use]` import
|
||||
--> $DIR/macro-use-warned-against.rs:20:1
|
||||
--> $DIR/macro-use-warned-against.rs:19:1
|
||||
|
|
||||
LL | #[macro_use] //~ WARN unused `#[macro_use]`
|
||||
| ^^^^^^^^^^^^
|
||||
|
|
|
|||
|
|
@ -1,15 +0,0 @@
|
|||
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// If macro modularization (`use_extern_macros`) is not enabled,
|
||||
// then tool attributes are treated as custom attributes.
|
||||
|
||||
#[rustfmt::bar] //~ ERROR The attribute `rustfmt::bar` is currently unknown to the compiler
|
||||
fn main() {}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
error[E0658]: The attribute `rustfmt::bar` is currently unknown to the compiler and may have meaning added to it in the future (see issue #29642)
|
||||
--> $DIR/tool-attributes-disabled-1.rs:14:1
|
||||
|
|
||||
LL | #[rustfmt::bar] //~ ERROR The attribute `rustfmt::bar` is currently unknown to the compiler
|
||||
| ^^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: add #![feature(custom_attribute)] to the crate attributes to enable
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0658`.
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// If macro modularization (`use_extern_macros`) is not enabled,
|
||||
// then tool attributes are treated as custom attributes.
|
||||
|
||||
#[rustfmt::bar] //~ ERROR attribute `rustfmt::bar` is currently unknown to the compiler
|
||||
fn main() {}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
error[E0658]: The attribute `rustfmt::bar` is currently unknown to the compiler and may have meaning added to it in the future (see issue #29642)
|
||||
--> $DIR/tool-attributes-disabled-2.rs:14:1
|
||||
|
|
||||
LL | #[rustfmt::bar] //~ ERROR attribute `rustfmt::bar` is currently unknown to the compiler
|
||||
| ^^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: add #![feature(custom_attribute)] to the crate attributes to enable
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0658`.
|
||||
Loading…
Add table
Add a link
Reference in a new issue