Skip to content

Move compile-fail-fulldeps tests to UI #56444

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Dec 9, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Move former compile-fail-fulldeps tests to ui
  • Loading branch information
petrochenkov committed Dec 9, 2018
commit 4c9c70af3891e63d2192b77211837507e0a6ddb5
23 changes: 0 additions & 23 deletions src/test/compile-fail/proc-macro/auxiliary/derive-clona.rs

This file was deleted.

23 changes: 0 additions & 23 deletions src/test/compile-fail/proc-macro/auxiliary/derive-foo.rs

This file was deleted.

28 changes: 28 additions & 0 deletions src/test/ui/proc-macro/attr-invalid-exprs.stderr
Original file line number Diff line number Diff line change
@@ -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 changes: 19 additions & 0 deletions src/test/ui/proc-macro/attr-stmt-expr.stderr
Original file line number Diff line number Diff line change
@@ -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 changes: 39 additions & 0 deletions src/test/ui/proc-macro/attribute-with-error.stderr
Original file line number Diff line number Diff line change
@@ -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 changes: 50 additions & 0 deletions src/test/ui/proc-macro/attribute.stderr
Original file line number Diff line number Diff line change
@@ -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 changes: 13 additions & 0 deletions src/test/ui/proc-macro/attributes-included.stderr
Original file line number Diff line number Diff line change
@@ -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 changes: 14 additions & 0 deletions src/test/ui/proc-macro/define-two.stderr
Original file line number Diff line number Diff line change
@@ -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 changes: 14 additions & 0 deletions src/test/ui/proc-macro/derive-bad.stderr
Original file line number Diff line number Diff line change
@@ -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 changes: 11 additions & 0 deletions src/test/ui/proc-macro/derive-still-gated.stderr
Original file line number Diff line number Diff line change
@@ -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 changes: 11 additions & 0 deletions src/test/ui/proc-macro/expand-to-unstable-2.stderr
Original file line number Diff line number Diff line change
@@ -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 changes: 11 additions & 0 deletions src/test/ui/proc-macro/expand-to-unstable.stderr
Original file line number Diff line number Diff line change
@@ -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 changes: 10 additions & 0 deletions src/test/ui/proc-macro/export-macro.stderr
Original file line number Diff line number Diff line change
@@ -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 changes: 26 additions & 0 deletions src/test/ui/proc-macro/exports.stderr
Original file line number Diff line number Diff line change
@@ -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 changes: 14 additions & 0 deletions src/test/ui/proc-macro/illegal-proc-macro-derive-use.stderr
Original file line number Diff line number Diff line change
@@ -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 changes: 9 additions & 0 deletions src/test/ui/proc-macro/import.stderr
Original file line number Diff line number Diff line change
@@ -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 changes: 17 additions & 0 deletions src/test/ui/proc-macro/issue-37788.stderr
Original file line number Diff line number Diff line change
@@ -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 changes: 9 additions & 0 deletions src/test/ui/proc-macro/issue-38586.stderr
Original file line number Diff line number Diff line change
@@ -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 changes: 11 additions & 0 deletions src/test/ui/proc-macro/issue-41211.stderr
Original file line number Diff line number Diff line change
@@ -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 changes: 15 additions & 0 deletions src/test/ui/proc-macro/issue-50493.stderr
Original file line number Diff line number Diff line change
@@ -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 changes: 9 additions & 0 deletions src/test/ui/proc-macro/item-error.stderr
Original file line number Diff line number Diff line change
@@ -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`.
Loading