mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 23:34:48 +00:00
Move former compile-fail-fulldeps tests to ui
This commit is contained in:
parent
ea007c6b10
commit
4c9c70af38
@ -1,23 +0,0 @@
|
||||
// Copyright 2016 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.
|
||||
|
||||
// force-host
|
||||
// no-prefer-dynamic
|
||||
|
||||
#![crate_type = "proc-macro"]
|
||||
|
||||
extern crate proc_macro;
|
||||
|
||||
use proc_macro::TokenStream;
|
||||
|
||||
#[proc_macro_derive(Clona)]
|
||||
pub fn derive_clonea(input: TokenStream) -> TokenStream {
|
||||
"".parse().unwrap()
|
||||
}
|
@ -1,23 +0,0 @@
|
||||
// Copyright 2016 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.
|
||||
|
||||
// force-host
|
||||
// no-prefer-dynamic
|
||||
|
||||
#![crate_type = "proc-macro"]
|
||||
|
||||
extern crate proc_macro;
|
||||
|
||||
use proc_macro::TokenStream;
|
||||
|
||||
#[proc_macro_derive(FooWithLongName)]
|
||||
pub fn derive_foo(input: TokenStream) -> TokenStream {
|
||||
"".parse().unwrap()
|
||||
}
|
28
src/test/ui/proc-macro/attr-invalid-exprs.stderr
Normal file
28
src/test/ui/proc-macro/attr-invalid-exprs.stderr
Normal file
@ -0,0 +1,28 @@
|
||||
error: expected expression, found `<eof>`
|
||||
--> $DIR/attr-invalid-exprs.rs:21:13
|
||||
|
|
||||
LL | let _ = #[no_output] "Hello, world!";
|
||||
| ^^^^^^^^^^^^
|
||||
|
||||
error: macro expansion ignores token `,` and any following
|
||||
--> $DIR/attr-invalid-exprs.rs:24:13
|
||||
|
|
||||
LL | let _ = #[duplicate] "Hello, world!";
|
||||
| ^^^^^^^^^^^^- help: you might be missing a semicolon here: `;`
|
||||
| |
|
||||
| caused by the macro expansion here
|
||||
|
|
||||
= note: the usage of `duplicate!` is likely invalid in expression context
|
||||
|
||||
error: macro expansion ignores token `,` and any following
|
||||
--> $DIR/attr-invalid-exprs.rs:33:9
|
||||
|
|
||||
LL | #[duplicate]
|
||||
| ^^^^^^^^^^^^- help: you might be missing a semicolon here: `;`
|
||||
| |
|
||||
| caused by the macro expansion here
|
||||
|
|
||||
= note: the usage of `duplicate!` is likely invalid in expression context
|
||||
|
||||
error: aborting due to 3 previous errors
|
||||
|
19
src/test/ui/proc-macro/attr-stmt-expr.stderr
Normal file
19
src/test/ui/proc-macro/attr-stmt-expr.stderr
Normal file
@ -0,0 +1,19 @@
|
||||
error[E0658]: attributes on expressions are experimental. (see issue #15701)
|
||||
--> $DIR/attr-stmt-expr.rs:20:5
|
||||
|
|
||||
LL | #[expect_print_expr]
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: add #![feature(stmt_expr_attributes)] to the crate attributes to enable
|
||||
|
||||
error[E0658]: attributes on expressions are experimental. (see issue #15701)
|
||||
--> $DIR/attr-stmt-expr.rs:33:5
|
||||
|
|
||||
LL | #[expect_expr]
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: add #![feature(stmt_expr_attributes)] to the crate attributes to enable
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0658`.
|
39
src/test/ui/proc-macro/attribute-with-error.stderr
Normal file
39
src/test/ui/proc-macro/attribute-with-error.stderr
Normal file
@ -0,0 +1,39 @@
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/attribute-with-error.rs:21:18
|
||||
|
|
||||
LL | let a: i32 = "foo";
|
||||
| ^^^^^ expected i32, found reference
|
||||
|
|
||||
= note: expected type `i32`
|
||||
found type `&'static str`
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/attribute-with-error.rs:23:18
|
||||
|
|
||||
LL | let b: i32 = "f'oo";
|
||||
| ^^^^^^ expected i32, found reference
|
||||
|
|
||||
= note: expected type `i32`
|
||||
found type `&'static str`
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/attribute-with-error.rs:36:22
|
||||
|
|
||||
LL | let a: i32 = "foo";
|
||||
| ^^^^^ expected i32, found reference
|
||||
|
|
||||
= note: expected type `i32`
|
||||
found type `&'static str`
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/attribute-with-error.rs:46:22
|
||||
|
|
||||
LL | let a: i32 = "foo";
|
||||
| ^^^^^ expected i32, found reference
|
||||
|
|
||||
= note: expected type `i32`
|
||||
found type `&'static str`
|
||||
|
||||
error: aborting due to 4 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0308`.
|
50
src/test/ui/proc-macro/attribute.stderr
Normal file
50
src/test/ui/proc-macro/attribute.stderr
Normal file
@ -0,0 +1,50 @@
|
||||
error: attribute must be of form: #[proc_macro_derive(TraitName)]
|
||||
--> $DIR/attribute.rs:18:1
|
||||
|
|
||||
LL | #[proc_macro_derive]
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: attribute must be of form: #[proc_macro_derive(TraitName)]
|
||||
--> $DIR/attribute.rs:24:1
|
||||
|
|
||||
LL | #[proc_macro_derive = "foo"]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: must only be one word
|
||||
--> $DIR/attribute.rs:31:5
|
||||
|
|
||||
LL | a = "b"
|
||||
| ^^^^^^^
|
||||
|
||||
error: attribute must have either one or two arguments
|
||||
--> $DIR/attribute.rs:38:1
|
||||
|
|
||||
LL | #[proc_macro_derive(b, c, d)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: must only be one word
|
||||
--> $DIR/attribute.rs:44:21
|
||||
|
|
||||
LL | #[proc_macro_derive(d(e))]
|
||||
| ^^^^
|
||||
|
||||
error: must only be one word
|
||||
--> $DIR/attribute.rs:50:35
|
||||
|
|
||||
LL | #[proc_macro_derive(f, attributes(g = "h"))]
|
||||
| ^^^^^^^
|
||||
|
||||
error: must only be one word
|
||||
--> $DIR/attribute.rs:56:35
|
||||
|
|
||||
LL | #[proc_macro_derive(i, attributes(j(k)))]
|
||||
| ^^^^
|
||||
|
||||
error: attribute must have either one or two arguments
|
||||
--> $DIR/attribute.rs:62:1
|
||||
|
|
||||
LL | #[proc_macro_derive(l, attributes(m), n)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to 8 previous errors
|
||||
|
13
src/test/ui/proc-macro/attributes-included.stderr
Normal file
13
src/test/ui/proc-macro/attributes-included.stderr
Normal file
@ -0,0 +1,13 @@
|
||||
warning: unused variable: `a`
|
||||
--> $DIR/attributes-included.rs:27:9
|
||||
|
|
||||
LL | let a: i32 = "foo"; //~ WARN: unused variable
|
||||
| ^ help: consider using `_a` instead
|
||||
|
|
||||
note: lint level defined here
|
||||
--> $DIR/attributes-included.rs:14:9
|
||||
|
|
||||
LL | #![warn(unused)]
|
||||
| ^^^^^^
|
||||
= note: #[warn(unused_variables)] implied by #[warn(unused)]
|
||||
|
14
src/test/ui/proc-macro/define-two.stderr
Normal file
14
src/test/ui/proc-macro/define-two.stderr
Normal file
@ -0,0 +1,14 @@
|
||||
error[E0428]: the name `A` is defined multiple times
|
||||
--> $DIR/define-two.rs:25:21
|
||||
|
|
||||
LL | #[proc_macro_derive(A)]
|
||||
| - previous definition of the macro `A` here
|
||||
...
|
||||
LL | #[proc_macro_derive(A)] //~ ERROR the name `A` is defined multiple times
|
||||
| ^ `A` redefined here
|
||||
|
|
||||
= note: `A` must be defined only once in the macro namespace of this module
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0428`.
|
14
src/test/ui/proc-macro/derive-bad.stderr
Normal file
14
src/test/ui/proc-macro/derive-bad.stderr
Normal file
@ -0,0 +1,14 @@
|
||||
error: expected `:`, found `}`
|
||||
--> $DIR/derive-bad.rs:17:5
|
||||
|
|
||||
LL | A
|
||||
| ^ expected `:`
|
||||
|
||||
error: proc-macro derive produced unparseable tokens
|
||||
--> $DIR/derive-bad.rs:17:5
|
||||
|
|
||||
LL | A
|
||||
| ^
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
11
src/test/ui/proc-macro/derive-still-gated.stderr
Normal file
11
src/test/ui/proc-macro/derive-still-gated.stderr
Normal file
@ -0,0 +1,11 @@
|
||||
error[E0658]: attributes of the form `#[derive_*]` are reserved for the compiler (see issue #29644)
|
||||
--> $DIR/derive-still-gated.rs:18:3
|
||||
|
|
||||
LL | #[derive_A] //~ ERROR: attributes of the form `#[derive_*]` are reserved for the compiler
|
||||
| ^^^^^^^^
|
||||
|
|
||||
= help: add #![feature(custom_derive)] to the crate attributes to enable
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0658`.
|
11
src/test/ui/proc-macro/expand-to-unstable-2.stderr
Normal file
11
src/test/ui/proc-macro/expand-to-unstable-2.stderr
Normal file
@ -0,0 +1,11 @@
|
||||
error[E0658]: unless otherwise specified, attributes with the prefix `rustc_` are reserved for internal compiler diagnostics (see issue #29642)
|
||||
--> $DIR/expand-to-unstable-2.rs:18:10
|
||||
|
|
||||
LL | #[derive(Unstable)]
|
||||
| ^^^^^^^^
|
||||
|
|
||||
= help: add #![feature(rustc_attrs)] to the crate attributes to enable
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0658`.
|
11
src/test/ui/proc-macro/expand-to-unstable.stderr
Normal file
11
src/test/ui/proc-macro/expand-to-unstable.stderr
Normal file
@ -0,0 +1,11 @@
|
||||
error[E0658]: use of unstable library feature 'core_intrinsics': intrinsics are unlikely to ever be stabilized, instead they should be used through stabilized interfaces in the rest of the standard library
|
||||
--> $DIR/expand-to-unstable.rs:18:10
|
||||
|
|
||||
LL | #[derive(Unstable)]
|
||||
| ^^^^^^^^
|
||||
|
|
||||
= help: add #![feature(core_intrinsics)] to the crate attributes to enable
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0658`.
|
10
src/test/ui/proc-macro/export-macro.stderr
Normal file
10
src/test/ui/proc-macro/export-macro.stderr
Normal file
@ -0,0 +1,10 @@
|
||||
error: cannot export macro_rules! macros from a `proc-macro` crate type currently
|
||||
--> $DIR/export-macro.rs:19:1
|
||||
|
|
||||
LL | / macro_rules! foo {
|
||||
LL | | ($e:expr) => ($e)
|
||||
LL | | }
|
||||
| |_^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
26
src/test/ui/proc-macro/exports.stderr
Normal file
26
src/test/ui/proc-macro/exports.stderr
Normal file
@ -0,0 +1,26 @@
|
||||
error: `proc-macro` crate types cannot export any items other than functions tagged with `#[proc_macro_derive]` currently
|
||||
--> $DIR/exports.rs:17:1
|
||||
|
|
||||
LL | pub fn a() {} //~ ERROR: cannot export any items
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
error: `proc-macro` crate types cannot export any items other than functions tagged with `#[proc_macro_derive]` currently
|
||||
--> $DIR/exports.rs:18:1
|
||||
|
|
||||
LL | pub struct B; //~ ERROR: cannot export any items
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
error: `proc-macro` crate types cannot export any items other than functions tagged with `#[proc_macro_derive]` currently
|
||||
--> $DIR/exports.rs:19:1
|
||||
|
|
||||
LL | pub enum C {} //~ ERROR: cannot export any items
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
error: `proc-macro` crate types cannot export any items other than functions tagged with `#[proc_macro_derive]` currently
|
||||
--> $DIR/exports.rs:20:1
|
||||
|
|
||||
LL | pub mod d {} //~ ERROR: cannot export any items
|
||||
| ^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to 4 previous errors
|
||||
|
14
src/test/ui/proc-macro/illegal-proc-macro-derive-use.stderr
Normal file
14
src/test/ui/proc-macro/illegal-proc-macro-derive-use.stderr
Normal file
@ -0,0 +1,14 @@
|
||||
error: the `#[proc_macro_derive]` attribute is only usable with crates of the `proc-macro` crate type
|
||||
--> $DIR/illegal-proc-macro-derive-use.rs:13:1
|
||||
|
|
||||
LL | #[proc_macro_derive(Foo)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: the `#[proc_macro_derive]` attribute may only be used on bare functions
|
||||
--> $DIR/illegal-proc-macro-derive-use.rs:20:1
|
||||
|
|
||||
LL | #[proc_macro_derive(Foo)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
9
src/test/ui/proc-macro/import.stderr
Normal file
9
src/test/ui/proc-macro/import.stderr
Normal file
@ -0,0 +1,9 @@
|
||||
error[E0432]: unresolved import `derive_a::derive_a`
|
||||
--> $DIR/import.rs:18:5
|
||||
|
|
||||
LL | use derive_a::derive_a;
|
||||
| ^^^^^^^^^^^^^^^^^^ no `derive_a` in the root
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0432`.
|
17
src/test/ui/proc-macro/issue-37788.stderr
Normal file
17
src/test/ui/proc-macro/issue-37788.stderr
Normal file
@ -0,0 +1,17 @@
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/issue-37788.rs:18:5
|
||||
|
|
||||
LL | fn main() {
|
||||
| - expected `()` because of default return type
|
||||
LL | // Test that constructing the `visible_parent_map` (in `cstore_impl.rs`) does not ICE.
|
||||
LL | std::cell::Cell::new(0) //~ ERROR mismatched types
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^- help: try adding a semicolon: `;`
|
||||
| |
|
||||
| expected (), found struct `std::cell::Cell`
|
||||
|
|
||||
= note: expected type `()`
|
||||
found type `std::cell::Cell<{integer}>`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0308`.
|
9
src/test/ui/proc-macro/issue-38586.stderr
Normal file
9
src/test/ui/proc-macro/issue-38586.stderr
Normal file
@ -0,0 +1,9 @@
|
||||
error[E0425]: cannot find value `foo` in this scope
|
||||
--> $DIR/issue-38586.rs:16:10
|
||||
|
|
||||
LL | #[derive(A)] //~ ERROR `foo`
|
||||
| ^ not found in this scope
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0425`.
|
11
src/test/ui/proc-macro/issue-41211.stderr
Normal file
11
src/test/ui/proc-macro/issue-41211.stderr
Normal file
@ -0,0 +1,11 @@
|
||||
error[E0658]: The attribute `emit_unchanged` is currently unknown to the compiler and may have meaning added to it in the future (see issue #29642)
|
||||
--> $DIR/issue-41211.rs:18:4
|
||||
|
|
||||
LL | #![emit_unchanged]
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
|
||||
= 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`.
|
15
src/test/ui/proc-macro/issue-50493.stderr
Normal file
15
src/test/ui/proc-macro/issue-50493.stderr
Normal file
@ -0,0 +1,15 @@
|
||||
error: visibilities can only be restricted to ancestor modules
|
||||
--> $DIR/issue-50493.rs:18:12
|
||||
|
|
||||
LL | pub(in restricted) field: usize, //~ visibilities can only be restricted to ancestor modules
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error[E0616]: field `field` of struct `Restricted` is private
|
||||
--> $DIR/issue-50493.rs:16:10
|
||||
|
|
||||
LL | #[derive(Derive)] //~ ERROR field `field` of struct `Restricted` is private
|
||||
| ^^^^^^
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0616`.
|
9
src/test/ui/proc-macro/item-error.stderr
Normal file
9
src/test/ui/proc-macro/item-error.stderr
Normal file
@ -0,0 +1,9 @@
|
||||
error[E0106]: missing lifetime specifier
|
||||
--> $DIR/item-error.rs:20:8
|
||||
|
|
||||
LL | a: &u64
|
||||
| ^ expected lifetime parameter
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0106`.
|
9
src/test/ui/proc-macro/lints_in_proc_macros.stderr
Normal file
9
src/test/ui/proc-macro/lints_in_proc_macros.stderr
Normal file
@ -0,0 +1,9 @@
|
||||
error[E0425]: cannot find value `foobar2` in this scope
|
||||
--> $DIR/lints_in_proc_macros.rs:22:5
|
||||
|
|
||||
LL | bang_proc_macro2!();
|
||||
| ^^^^^^^^^^^^^^^^^^^^ did you mean `foobar`?
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0425`.
|
27
src/test/ui/proc-macro/macros-in-extern.stderr
Normal file
27
src/test/ui/proc-macro/macros-in-extern.stderr
Normal file
@ -0,0 +1,27 @@
|
||||
error[E0658]: macro invocations in `extern {}` blocks are experimental (see issue #49476)
|
||||
--> $DIR/macros-in-extern.rs:25:5
|
||||
|
|
||||
LL | #[no_output]
|
||||
| ^^^^^^^^^^^^
|
||||
|
|
||||
= help: add #![feature(macros_in_extern)] to the crate attributes to enable
|
||||
|
||||
error[E0658]: macro invocations in `extern {}` blocks are experimental (see issue #49476)
|
||||
--> $DIR/macros-in-extern.rs:29:5
|
||||
|
|
||||
LL | #[nop_attr]
|
||||
| ^^^^^^^^^^^
|
||||
|
|
||||
= help: add #![feature(macros_in_extern)] to the crate attributes to enable
|
||||
|
||||
error[E0658]: macro invocations in `extern {}` blocks are experimental (see issue #49476)
|
||||
--> $DIR/macros-in-extern.rs:33:5
|
||||
|
|
||||
LL | emit_input!(fn rust_dbg_extern_identity_u32(arg: u32) -> u32;);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: add #![feature(macros_in_extern)] to the crate attributes to enable
|
||||
|
||||
error: aborting due to 3 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0658`.
|
43
src/test/ui/proc-macro/more-gates.stderr
Normal file
43
src/test/ui/proc-macro/more-gates.stderr
Normal file
@ -0,0 +1,43 @@
|
||||
error[E0658]: procedural macros cannot expand to macro definitions (see issue #54727)
|
||||
--> $DIR/more-gates.rs:17:1
|
||||
|
|
||||
LL | #[attr2mac1]
|
||||
| ^^^^^^^^^^^^
|
||||
|
|
||||
= help: add #![feature(proc_macro_hygiene)] to the crate attributes to enable
|
||||
|
||||
error[E0658]: procedural macros cannot expand to macro definitions (see issue #54727)
|
||||
--> $DIR/more-gates.rs:20:1
|
||||
|
|
||||
LL | #[attr2mac2]
|
||||
| ^^^^^^^^^^^^
|
||||
|
|
||||
= help: add #![feature(proc_macro_hygiene)] to the crate attributes to enable
|
||||
|
||||
error[E0658]: procedural macros cannot expand to macro definitions (see issue #54727)
|
||||
--> $DIR/more-gates.rs:24:1
|
||||
|
|
||||
LL | mac2mac1!(); //~ ERROR: cannot expand to macro definitions
|
||||
| ^^^^^^^^^^^^
|
||||
|
|
||||
= help: add #![feature(proc_macro_hygiene)] to the crate attributes to enable
|
||||
|
||||
error[E0658]: procedural macros cannot expand to macro definitions (see issue #54727)
|
||||
--> $DIR/more-gates.rs:25:1
|
||||
|
|
||||
LL | mac2mac2!(); //~ ERROR: cannot expand to macro definitions
|
||||
| ^^^^^^^^^^^^
|
||||
|
|
||||
= help: add #![feature(proc_macro_hygiene)] to the crate attributes to enable
|
||||
|
||||
error[E0658]: procedural macros cannot expand to macro definitions (see issue #54727)
|
||||
--> $DIR/more-gates.rs:27:1
|
||||
|
|
||||
LL | tricky!();
|
||||
| ^^^^^^^^^^
|
||||
|
|
||||
= help: add #![feature(proc_macro_hygiene)] to the crate attributes to enable
|
||||
|
||||
error: aborting due to 5 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0658`.
|
20
src/test/ui/proc-macro/no-macro-use-attr.stderr
Normal file
20
src/test/ui/proc-macro/no-macro-use-attr.stderr
Normal file
@ -0,0 +1,20 @@
|
||||
warning: unused extern crate
|
||||
--> $DIR/no-macro-use-attr.rs:16:1
|
||||
|
|
||||
LL | extern crate derive_a;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^ help: remove it
|
||||
|
|
||||
note: lint level defined here
|
||||
--> $DIR/no-macro-use-attr.rs:14:9
|
||||
|
|
||||
LL | #![warn(unused_extern_crates)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: compilation successful
|
||||
--> $DIR/no-macro-use-attr.rs:20:1
|
||||
|
|
||||
LL | fn main() {} //~ ERROR compilation successful
|
||||
| ^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
11
src/test/ui/proc-macro/proc-macro-attributes.stderr
Normal file
11
src/test/ui/proc-macro/proc-macro-attributes.stderr
Normal file
@ -0,0 +1,11 @@
|
||||
error[E0658]: The attribute `C` is currently unknown to the compiler and may have meaning added to it in the future (see issue #29642)
|
||||
--> $DIR/proc-macro-attributes.rs:17:3
|
||||
|
|
||||
LL | #[C] //~ ERROR attribute `C` 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`.
|
137
src/test/ui/proc-macro/proc-macro-gates.stderr
Normal file
137
src/test/ui/proc-macro/proc-macro-gates.stderr
Normal file
@ -0,0 +1,137 @@
|
||||
error[E0658]: non-builtin inner attributes are unstable (see issue #54726)
|
||||
--> $DIR/proc-macro-gates.rs:21:5
|
||||
|
|
||||
LL | #![a] //~ ERROR: non-builtin inner attributes are unstable
|
||||
| ^^^^^
|
||||
|
|
||||
= help: add #![feature(custom_inner_attributes)] to the crate attributes to enable
|
||||
|
||||
error[E0658]: non-builtin inner attributes are unstable (see issue #54726)
|
||||
--> $DIR/proc-macro-gates.rs:28:5
|
||||
|
|
||||
LL | #![a] //~ ERROR: custom attributes cannot be applied to modules
|
||||
| ^^^^^
|
||||
|
|
||||
= help: add #![feature(custom_inner_attributes)] to the crate attributes to enable
|
||||
|
||||
error[E0658]: custom attributes cannot be applied to modules (see issue #54727)
|
||||
--> $DIR/proc-macro-gates.rs:24:1
|
||||
|
|
||||
LL | #[a] //~ ERROR: custom attributes cannot be applied to modules
|
||||
| ^^^^
|
||||
|
|
||||
= help: add #![feature(proc_macro_hygiene)] to the crate attributes to enable
|
||||
|
||||
error[E0658]: custom attributes cannot be applied to modules (see issue #54727)
|
||||
--> $DIR/proc-macro-gates.rs:28:5
|
||||
|
|
||||
LL | #![a] //~ ERROR: custom attributes cannot be applied to modules
|
||||
| ^^^^^
|
||||
|
|
||||
= help: add #![feature(proc_macro_hygiene)] to the crate attributes to enable
|
||||
|
||||
error: custom attribute invocations must be of the form #[foo] or #[foo(..)], the macro name must only be followed by a delimiter token
|
||||
--> $DIR/proc-macro-gates.rs:32:1
|
||||
|
|
||||
LL | #[a = y] //~ ERROR: must only be followed by a delimiter token
|
||||
| ^^^^^^^^
|
||||
|
||||
error[E0658]: custom attributes cannot be applied to statements (see issue #54727)
|
||||
--> $DIR/proc-macro-gates.rs:41:5
|
||||
|
|
||||
LL | #[a] //~ ERROR: custom attributes cannot be applied to statements
|
||||
| ^^^^
|
||||
|
|
||||
= help: add #![feature(proc_macro_hygiene)] to the crate attributes to enable
|
||||
|
||||
error[E0658]: custom attributes cannot be applied to statements (see issue #54727)
|
||||
--> $DIR/proc-macro-gates.rs:45:5
|
||||
|
|
||||
LL | #[a] //~ ERROR: custom attributes cannot be applied to statements
|
||||
| ^^^^
|
||||
|
|
||||
= help: add #![feature(proc_macro_hygiene)] to the crate attributes to enable
|
||||
|
||||
error[E0658]: custom attributes cannot be applied to statements (see issue #54727)
|
||||
--> $DIR/proc-macro-gates.rs:49:5
|
||||
|
|
||||
LL | #[a] //~ ERROR: custom attributes cannot be applied to statements
|
||||
| ^^^^
|
||||
|
|
||||
= help: add #![feature(proc_macro_hygiene)] to the crate attributes to enable
|
||||
|
||||
error[E0658]: custom attributes cannot be applied to expressions (see issue #54727)
|
||||
--> $DIR/proc-macro-gates.rs:53:14
|
||||
|
|
||||
LL | let _x = #[a] 2; //~ ERROR: custom attributes cannot be applied to expressions
|
||||
| ^^^^
|
||||
|
|
||||
= help: add #![feature(proc_macro_hygiene)] to the crate attributes to enable
|
||||
|
||||
error[E0658]: custom attributes cannot be applied to expressions (see issue #54727)
|
||||
--> $DIR/proc-macro-gates.rs:56:15
|
||||
|
|
||||
LL | let _x = [#[a] 2]; //~ ERROR: custom attributes cannot be applied to expressions
|
||||
| ^^^^
|
||||
|
|
||||
= help: add #![feature(proc_macro_hygiene)] to the crate attributes to enable
|
||||
|
||||
error[E0658]: custom attributes cannot be applied to expressions (see issue #54727)
|
||||
--> $DIR/proc-macro-gates.rs:59:14
|
||||
|
|
||||
LL | let _x = #[a] println!(); //~ ERROR: custom attributes cannot be applied to expressions
|
||||
| ^^^^
|
||||
|
|
||||
= help: add #![feature(proc_macro_hygiene)] to the crate attributes to enable
|
||||
|
||||
error[E0658]: procedural macros cannot be expanded to types (see issue #54727)
|
||||
--> $DIR/proc-macro-gates.rs:63:13
|
||||
|
|
||||
LL | let _x: m!(u32) = 3; //~ ERROR: procedural macros cannot be expanded to types
|
||||
| ^^^^^^^
|
||||
|
|
||||
= help: add #![feature(proc_macro_hygiene)] to the crate attributes to enable
|
||||
|
||||
error[E0658]: procedural macros cannot be expanded to patterns (see issue #54727)
|
||||
--> $DIR/proc-macro-gates.rs:64:12
|
||||
|
|
||||
LL | if let m!(Some(_x)) = Some(3) {} //~ ERROR: procedural macros cannot be expanded to patterns
|
||||
| ^^^^^^^^^^^^
|
||||
|
|
||||
= help: add #![feature(proc_macro_hygiene)] to the crate attributes to enable
|
||||
|
||||
error[E0658]: procedural macros cannot be expanded to statements (see issue #54727)
|
||||
--> $DIR/proc-macro-gates.rs:66:5
|
||||
|
|
||||
LL | m!(struct S;); //~ ERROR: procedural macros cannot be expanded to statements
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: add #![feature(proc_macro_hygiene)] to the crate attributes to enable
|
||||
|
||||
error[E0658]: procedural macros cannot be expanded to statements (see issue #54727)
|
||||
--> $DIR/proc-macro-gates.rs:67:5
|
||||
|
|
||||
LL | m!(let _x = 3;); //~ ERROR: procedural macros cannot be expanded to statements
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: add #![feature(proc_macro_hygiene)] to the crate attributes to enable
|
||||
|
||||
error[E0658]: procedural macros cannot be expanded to expressions (see issue #54727)
|
||||
--> $DIR/proc-macro-gates.rs:69:14
|
||||
|
|
||||
LL | let _x = m!(3); //~ ERROR: procedural macros cannot be expanded to expressions
|
||||
| ^^^^^
|
||||
|
|
||||
= help: add #![feature(proc_macro_hygiene)] to the crate attributes to enable
|
||||
|
||||
error[E0658]: procedural macros cannot be expanded to expressions (see issue #54727)
|
||||
--> $DIR/proc-macro-gates.rs:70:15
|
||||
|
|
||||
LL | let _x = [m!(3)]; //~ ERROR: procedural macros cannot be expanded to expressions
|
||||
| ^^^^^
|
||||
|
|
||||
= help: add #![feature(proc_macro_hygiene)] to the crate attributes to enable
|
||||
|
||||
error: aborting due to 17 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0658`.
|
19
src/test/ui/proc-macro/proc-macro-gates2.stderr
Normal file
19
src/test/ui/proc-macro/proc-macro-gates2.stderr
Normal file
@ -0,0 +1,19 @@
|
||||
error[E0658]: The attribute `a` is currently unknown to the compiler and may have meaning added to it in the future (see issue #29642)
|
||||
--> $DIR/proc-macro-gates2.rs:23:11
|
||||
|
|
||||
LL | fn _test6<#[a] T>() {}
|
||||
| ^^^^
|
||||
|
|
||||
= help: add #![feature(custom_attribute)] to the crate attributes to enable
|
||||
|
||||
error[E0658]: The attribute `a` is currently unknown to the compiler and may have meaning added to it in the future (see issue #29642)
|
||||
--> $DIR/proc-macro-gates2.rs:28:9
|
||||
|
|
||||
LL | #[a] //~ ERROR: unknown to the compiler
|
||||
| ^^^^
|
||||
|
|
||||
= help: add #![feature(custom_attribute)] to the crate attributes to enable
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0658`.
|
32
src/test/ui/proc-macro/pub-at-crate-root.stderr
Normal file
32
src/test/ui/proc-macro/pub-at-crate-root.stderr
Normal file
@ -0,0 +1,32 @@
|
||||
error: `proc-macro` crate types cannot export any items other than functions tagged with `#[proc_macro_derive]` currently
|
||||
--> $DIR/pub-at-crate-root.rs:18:1
|
||||
|
|
||||
LL | / pub mod a { //~ `proc-macro` crate types cannot export any items
|
||||
LL | | use proc_macro::TokenStream;
|
||||
LL | |
|
||||
LL | | #[proc_macro_derive(B)]
|
||||
... |
|
||||
LL | | }
|
||||
LL | | }
|
||||
| |_^
|
||||
|
||||
error: functions tagged with `#[proc_macro_derive]` must currently reside in the root of the crate
|
||||
--> $DIR/pub-at-crate-root.rs:22:5
|
||||
|
|
||||
LL | / pub fn bar(a: TokenStream) -> TokenStream {
|
||||
LL | | //~^ ERROR: must currently reside in the root of the crate
|
||||
LL | | a
|
||||
LL | | }
|
||||
| |_____^
|
||||
|
||||
error: functions tagged with `#[proc_macro_derive]` must be `pub`
|
||||
--> $DIR/pub-at-crate-root.rs:29:1
|
||||
|
|
||||
LL | / fn bar(a: proc_macro::TokenStream) -> proc_macro::TokenStream {
|
||||
LL | | //~^ ERROR: functions tagged with `#[proc_macro_derive]` must be `pub`
|
||||
LL | | a
|
||||
LL | | }
|
||||
| |_^
|
||||
|
||||
error: aborting due to 3 previous errors
|
||||
|
8
src/test/ui/proc-macro/shadow-builtin.stderr
Normal file
8
src/test/ui/proc-macro/shadow-builtin.stderr
Normal file
@ -0,0 +1,8 @@
|
||||
error: cannot override a built-in #[derive] mode
|
||||
--> $DIR/shadow-builtin.rs:20:21
|
||||
|
|
||||
LL | #[proc_macro_derive(PartialEq)]
|
||||
| ^^^^^^^^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
18
src/test/ui/proc-macro/shadow.stderr
Normal file
18
src/test/ui/proc-macro/shadow.stderr
Normal file
@ -0,0 +1,18 @@
|
||||
error[E0259]: the name `derive_a` is defined multiple times
|
||||
--> $DIR/shadow.rs:16:1
|
||||
|
|
||||
LL | extern crate derive_a;
|
||||
| ---------------------- previous import of the extern crate `derive_a` here
|
||||
LL | #[macro_use]
|
||||
LL | extern crate derive_a; //~ ERROR the name `derive_a` is defined multiple times
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^ `derive_a` reimported here
|
||||
|
|
||||
= note: `derive_a` must be defined only once in the type namespace of this module
|
||||
help: you can use `as` to change the binding name of the import
|
||||
|
|
||||
LL | extern crate derive_a as other_derive_a; //~ ERROR the name `derive_a` is defined multiple times
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0259`.
|
4
src/test/ui/proc-macro/two-crate-types-1.stderr
Normal file
4
src/test/ui/proc-macro/two-crate-types-1.stderr
Normal file
@ -0,0 +1,4 @@
|
||||
error: cannot mix `proc-macro` crate type with others
|
||||
|
||||
error: aborting due to previous error
|
||||
|
4
src/test/ui/proc-macro/two-crate-types-2.stderr
Normal file
4
src/test/ui/proc-macro/two-crate-types-2.stderr
Normal file
@ -0,0 +1,4 @@
|
||||
error: cannot mix `proc-macro` crate type with others
|
||||
|
||||
error: aborting due to previous error
|
||||
|
Loading…
Reference in New Issue
Block a user