From f31b6abdb285123e7c391097ef18b7d5392f8298 Mon Sep 17 00:00:00 2001 From: Vadim Petrochenkov Date: Sun, 2 Dec 2018 22:27:37 +0300 Subject: [PATCH 1/4] Move former compile-fail-fulldeps tests to ui --- .../proc-macro/auxiliary/derive-clona.rs | 23 --- .../proc-macro/auxiliary/derive-foo.rs | 23 --- .../proc-macro/attr-invalid-exprs.rs | 0 .../ui/proc-macro/attr-invalid-exprs.stderr | 28 ++++ .../proc-macro/attr-stmt-expr.rs | 0 src/test/ui/proc-macro/attr-stmt-expr.stderr | 19 +++ .../proc-macro/attribute-with-error.rs | 0 .../ui/proc-macro/attribute-with-error.stderr | 39 +++++ .../proc-macro/attribute.rs | 0 src/test/ui/proc-macro/attribute.stderr | 50 +++++++ .../proc-macro/attributes-included.rs | 0 .../ui/proc-macro/attributes-included.stderr | 13 ++ .../proc-macro/auxiliary/attr-stmt-expr.rs | 0 .../auxiliary/attribute-with-error.rs | 0 .../auxiliary/attributes-included.rs | 0 .../proc-macro/auxiliary/bang_proc_macro2.rs | 0 .../proc-macro/auxiliary/derive-a-b.rs | 0 .../proc-macro/auxiliary/derive-a.rs | 0 .../proc-macro/auxiliary/derive-b.rs | 0 .../proc-macro/auxiliary/derive-bad.rs | 0 .../proc-macro/auxiliary/derive-unstable-2.rs | 0 .../proc-macro/auxiliary/derive-unstable.rs | 0 .../proc-macro/auxiliary/issue-41211.rs | 0 .../proc-macro/auxiliary/issue_38586.rs | 0 .../proc-macro/auxiliary/issue_50493.rs | 0 .../proc-macro/auxiliary/more-gates.rs | 0 .../proc-macro/auxiliary/proc-macro-gates.rs | 0 .../proc-macro/auxiliary/test-macros.rs | 0 .../proc-macro/define-two.rs | 0 src/test/ui/proc-macro/define-two.stderr | 14 ++ .../proc-macro/derive-bad.rs | 0 src/test/ui/proc-macro/derive-bad.stderr | 14 ++ .../proc-macro/derive-still-gated.rs | 0 .../ui/proc-macro/derive-still-gated.stderr | 11 ++ .../proc-macro/expand-to-unstable-2.rs | 0 .../ui/proc-macro/expand-to-unstable-2.stderr | 11 ++ .../proc-macro/expand-to-unstable.rs | 0 .../ui/proc-macro/expand-to-unstable.stderr | 11 ++ .../proc-macro/export-macro.rs | 0 src/test/ui/proc-macro/export-macro.stderr | 10 ++ .../proc-macro/exports.rs | 0 src/test/ui/proc-macro/exports.stderr | 26 ++++ .../illegal-proc-macro-derive-use.rs | 0 .../illegal-proc-macro-derive-use.stderr | 14 ++ .../{compile-fail => ui}/proc-macro/import.rs | 0 src/test/ui/proc-macro/import.stderr | 9 ++ .../proc-macro/issue-37788.rs | 0 src/test/ui/proc-macro/issue-37788.stderr | 17 +++ .../proc-macro/issue-38586.rs | 0 src/test/ui/proc-macro/issue-38586.stderr | 9 ++ .../proc-macro/issue-41211.rs | 0 src/test/ui/proc-macro/issue-41211.stderr | 11 ++ .../proc-macro/issue-50493.rs | 0 src/test/ui/proc-macro/issue-50493.stderr | 15 ++ .../proc-macro/item-error.rs | 0 src/test/ui/proc-macro/item-error.stderr | 9 ++ .../proc-macro/lints_in_proc_macros.rs | 0 .../ui/proc-macro/lints_in_proc_macros.stderr | 9 ++ .../proc-macro/macros-in-extern.rs | 0 .../ui/proc-macro/macros-in-extern.stderr | 27 ++++ .../proc-macro/more-gates.rs | 0 src/test/ui/proc-macro/more-gates.stderr | 43 ++++++ .../proc-macro/no-macro-use-attr.rs | 0 .../ui/proc-macro/no-macro-use-attr.stderr | 20 +++ .../proc-macro/proc-macro-attributes.rs | 0 .../proc-macro/proc-macro-attributes.stderr | 11 ++ .../proc-macro/proc-macro-gates.rs | 0 .../ui/proc-macro/proc-macro-gates.stderr | 137 ++++++++++++++++++ .../proc-macro/proc-macro-gates2.rs | 0 .../ui/proc-macro/proc-macro-gates2.stderr | 19 +++ .../proc-macro/pub-at-crate-root.rs | 0 .../ui/proc-macro/pub-at-crate-root.stderr | 32 ++++ .../proc-macro/shadow-builtin.rs | 0 src/test/ui/proc-macro/shadow-builtin.stderr | 8 + .../{compile-fail => ui}/proc-macro/shadow.rs | 0 src/test/ui/proc-macro/shadow.stderr | 18 +++ .../proc-macro/two-crate-types-1.rs | 0 .../ui/proc-macro/two-crate-types-1.stderr | 4 + .../proc-macro/two-crate-types-2.rs | 0 .../ui/proc-macro/two-crate-types-2.stderr | 4 + 80 files changed, 662 insertions(+), 46 deletions(-) delete mode 100644 src/test/compile-fail/proc-macro/auxiliary/derive-clona.rs delete mode 100644 src/test/compile-fail/proc-macro/auxiliary/derive-foo.rs rename src/test/{compile-fail => ui}/proc-macro/attr-invalid-exprs.rs (100%) create mode 100644 src/test/ui/proc-macro/attr-invalid-exprs.stderr rename src/test/{compile-fail => ui}/proc-macro/attr-stmt-expr.rs (100%) create mode 100644 src/test/ui/proc-macro/attr-stmt-expr.stderr rename src/test/{compile-fail => ui}/proc-macro/attribute-with-error.rs (100%) create mode 100644 src/test/ui/proc-macro/attribute-with-error.stderr rename src/test/{compile-fail => ui}/proc-macro/attribute.rs (100%) create mode 100644 src/test/ui/proc-macro/attribute.stderr rename src/test/{compile-fail => ui}/proc-macro/attributes-included.rs (100%) create mode 100644 src/test/ui/proc-macro/attributes-included.stderr rename src/test/{compile-fail => ui}/proc-macro/auxiliary/attr-stmt-expr.rs (100%) rename src/test/{compile-fail => ui}/proc-macro/auxiliary/attribute-with-error.rs (100%) rename src/test/{compile-fail => ui}/proc-macro/auxiliary/attributes-included.rs (100%) rename src/test/{compile-fail => ui}/proc-macro/auxiliary/bang_proc_macro2.rs (100%) rename src/test/{compile-fail => ui}/proc-macro/auxiliary/derive-a-b.rs (100%) rename src/test/{compile-fail => ui}/proc-macro/auxiliary/derive-a.rs (100%) rename src/test/{compile-fail => ui}/proc-macro/auxiliary/derive-b.rs (100%) rename src/test/{compile-fail => ui}/proc-macro/auxiliary/derive-bad.rs (100%) rename src/test/{compile-fail => ui}/proc-macro/auxiliary/derive-unstable-2.rs (100%) rename src/test/{compile-fail => ui}/proc-macro/auxiliary/derive-unstable.rs (100%) rename src/test/{compile-fail => ui}/proc-macro/auxiliary/issue-41211.rs (100%) rename src/test/{compile-fail => ui}/proc-macro/auxiliary/issue_38586.rs (100%) rename src/test/{compile-fail => ui}/proc-macro/auxiliary/issue_50493.rs (100%) rename src/test/{compile-fail => ui}/proc-macro/auxiliary/more-gates.rs (100%) rename src/test/{compile-fail => ui}/proc-macro/auxiliary/proc-macro-gates.rs (100%) rename src/test/{compile-fail => ui}/proc-macro/auxiliary/test-macros.rs (100%) rename src/test/{compile-fail => ui}/proc-macro/define-two.rs (100%) create mode 100644 src/test/ui/proc-macro/define-two.stderr rename src/test/{compile-fail => ui}/proc-macro/derive-bad.rs (100%) create mode 100644 src/test/ui/proc-macro/derive-bad.stderr rename src/test/{compile-fail => ui}/proc-macro/derive-still-gated.rs (100%) create mode 100644 src/test/ui/proc-macro/derive-still-gated.stderr rename src/test/{compile-fail => ui}/proc-macro/expand-to-unstable-2.rs (100%) create mode 100644 src/test/ui/proc-macro/expand-to-unstable-2.stderr rename src/test/{compile-fail => ui}/proc-macro/expand-to-unstable.rs (100%) create mode 100644 src/test/ui/proc-macro/expand-to-unstable.stderr rename src/test/{compile-fail => ui}/proc-macro/export-macro.rs (100%) create mode 100644 src/test/ui/proc-macro/export-macro.stderr rename src/test/{compile-fail => ui}/proc-macro/exports.rs (100%) create mode 100644 src/test/ui/proc-macro/exports.stderr rename src/test/{compile-fail => ui}/proc-macro/illegal-proc-macro-derive-use.rs (100%) create mode 100644 src/test/ui/proc-macro/illegal-proc-macro-derive-use.stderr rename src/test/{compile-fail => ui}/proc-macro/import.rs (100%) create mode 100644 src/test/ui/proc-macro/import.stderr rename src/test/{compile-fail => ui}/proc-macro/issue-37788.rs (100%) create mode 100644 src/test/ui/proc-macro/issue-37788.stderr rename src/test/{compile-fail => ui}/proc-macro/issue-38586.rs (100%) create mode 100644 src/test/ui/proc-macro/issue-38586.stderr rename src/test/{compile-fail => ui}/proc-macro/issue-41211.rs (100%) create mode 100644 src/test/ui/proc-macro/issue-41211.stderr rename src/test/{compile-fail => ui}/proc-macro/issue-50493.rs (100%) create mode 100644 src/test/ui/proc-macro/issue-50493.stderr rename src/test/{compile-fail => ui}/proc-macro/item-error.rs (100%) create mode 100644 src/test/ui/proc-macro/item-error.stderr rename src/test/{compile-fail => ui}/proc-macro/lints_in_proc_macros.rs (100%) create mode 100644 src/test/ui/proc-macro/lints_in_proc_macros.stderr rename src/test/{compile-fail => ui}/proc-macro/macros-in-extern.rs (100%) create mode 100644 src/test/ui/proc-macro/macros-in-extern.stderr rename src/test/{compile-fail => ui}/proc-macro/more-gates.rs (100%) create mode 100644 src/test/ui/proc-macro/more-gates.stderr rename src/test/{compile-fail => ui}/proc-macro/no-macro-use-attr.rs (100%) create mode 100644 src/test/ui/proc-macro/no-macro-use-attr.stderr rename src/test/{compile-fail => ui}/proc-macro/proc-macro-attributes.rs (100%) create mode 100644 src/test/ui/proc-macro/proc-macro-attributes.stderr rename src/test/{compile-fail => ui}/proc-macro/proc-macro-gates.rs (100%) create mode 100644 src/test/ui/proc-macro/proc-macro-gates.stderr rename src/test/{compile-fail => ui}/proc-macro/proc-macro-gates2.rs (100%) create mode 100644 src/test/ui/proc-macro/proc-macro-gates2.stderr rename src/test/{compile-fail => ui}/proc-macro/pub-at-crate-root.rs (100%) create mode 100644 src/test/ui/proc-macro/pub-at-crate-root.stderr rename src/test/{compile-fail => ui}/proc-macro/shadow-builtin.rs (100%) create mode 100644 src/test/ui/proc-macro/shadow-builtin.stderr rename src/test/{compile-fail => ui}/proc-macro/shadow.rs (100%) create mode 100644 src/test/ui/proc-macro/shadow.stderr rename src/test/{compile-fail => ui}/proc-macro/two-crate-types-1.rs (100%) create mode 100644 src/test/ui/proc-macro/two-crate-types-1.stderr rename src/test/{compile-fail => ui}/proc-macro/two-crate-types-2.rs (100%) create mode 100644 src/test/ui/proc-macro/two-crate-types-2.stderr diff --git a/src/test/compile-fail/proc-macro/auxiliary/derive-clona.rs b/src/test/compile-fail/proc-macro/auxiliary/derive-clona.rs deleted file mode 100644 index 719fbdb15ef2a..0000000000000 --- a/src/test/compile-fail/proc-macro/auxiliary/derive-clona.rs +++ /dev/null @@ -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 or the MIT license -// , 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() -} diff --git a/src/test/compile-fail/proc-macro/auxiliary/derive-foo.rs b/src/test/compile-fail/proc-macro/auxiliary/derive-foo.rs deleted file mode 100644 index 64dcf72ba2029..0000000000000 --- a/src/test/compile-fail/proc-macro/auxiliary/derive-foo.rs +++ /dev/null @@ -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 or the MIT license -// , 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() -} diff --git a/src/test/compile-fail/proc-macro/attr-invalid-exprs.rs b/src/test/ui/proc-macro/attr-invalid-exprs.rs similarity index 100% rename from src/test/compile-fail/proc-macro/attr-invalid-exprs.rs rename to src/test/ui/proc-macro/attr-invalid-exprs.rs diff --git a/src/test/ui/proc-macro/attr-invalid-exprs.stderr b/src/test/ui/proc-macro/attr-invalid-exprs.stderr new file mode 100644 index 0000000000000..c28def63e3e24 --- /dev/null +++ b/src/test/ui/proc-macro/attr-invalid-exprs.stderr @@ -0,0 +1,28 @@ +error: expected expression, found `` + --> $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 + diff --git a/src/test/compile-fail/proc-macro/attr-stmt-expr.rs b/src/test/ui/proc-macro/attr-stmt-expr.rs similarity index 100% rename from src/test/compile-fail/proc-macro/attr-stmt-expr.rs rename to src/test/ui/proc-macro/attr-stmt-expr.rs diff --git a/src/test/ui/proc-macro/attr-stmt-expr.stderr b/src/test/ui/proc-macro/attr-stmt-expr.stderr new file mode 100644 index 0000000000000..ee9bc77178217 --- /dev/null +++ b/src/test/ui/proc-macro/attr-stmt-expr.stderr @@ -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`. diff --git a/src/test/compile-fail/proc-macro/attribute-with-error.rs b/src/test/ui/proc-macro/attribute-with-error.rs similarity index 100% rename from src/test/compile-fail/proc-macro/attribute-with-error.rs rename to src/test/ui/proc-macro/attribute-with-error.rs diff --git a/src/test/ui/proc-macro/attribute-with-error.stderr b/src/test/ui/proc-macro/attribute-with-error.stderr new file mode 100644 index 0000000000000..d2b4ac639929a --- /dev/null +++ b/src/test/ui/proc-macro/attribute-with-error.stderr @@ -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`. diff --git a/src/test/compile-fail/proc-macro/attribute.rs b/src/test/ui/proc-macro/attribute.rs similarity index 100% rename from src/test/compile-fail/proc-macro/attribute.rs rename to src/test/ui/proc-macro/attribute.rs diff --git a/src/test/ui/proc-macro/attribute.stderr b/src/test/ui/proc-macro/attribute.stderr new file mode 100644 index 0000000000000..c752c5364f499 --- /dev/null +++ b/src/test/ui/proc-macro/attribute.stderr @@ -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 + diff --git a/src/test/compile-fail/proc-macro/attributes-included.rs b/src/test/ui/proc-macro/attributes-included.rs similarity index 100% rename from src/test/compile-fail/proc-macro/attributes-included.rs rename to src/test/ui/proc-macro/attributes-included.rs diff --git a/src/test/ui/proc-macro/attributes-included.stderr b/src/test/ui/proc-macro/attributes-included.stderr new file mode 100644 index 0000000000000..e7eeccc01f245 --- /dev/null +++ b/src/test/ui/proc-macro/attributes-included.stderr @@ -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)] + diff --git a/src/test/compile-fail/proc-macro/auxiliary/attr-stmt-expr.rs b/src/test/ui/proc-macro/auxiliary/attr-stmt-expr.rs similarity index 100% rename from src/test/compile-fail/proc-macro/auxiliary/attr-stmt-expr.rs rename to src/test/ui/proc-macro/auxiliary/attr-stmt-expr.rs diff --git a/src/test/compile-fail/proc-macro/auxiliary/attribute-with-error.rs b/src/test/ui/proc-macro/auxiliary/attribute-with-error.rs similarity index 100% rename from src/test/compile-fail/proc-macro/auxiliary/attribute-with-error.rs rename to src/test/ui/proc-macro/auxiliary/attribute-with-error.rs diff --git a/src/test/compile-fail/proc-macro/auxiliary/attributes-included.rs b/src/test/ui/proc-macro/auxiliary/attributes-included.rs similarity index 100% rename from src/test/compile-fail/proc-macro/auxiliary/attributes-included.rs rename to src/test/ui/proc-macro/auxiliary/attributes-included.rs diff --git a/src/test/compile-fail/proc-macro/auxiliary/bang_proc_macro2.rs b/src/test/ui/proc-macro/auxiliary/bang_proc_macro2.rs similarity index 100% rename from src/test/compile-fail/proc-macro/auxiliary/bang_proc_macro2.rs rename to src/test/ui/proc-macro/auxiliary/bang_proc_macro2.rs diff --git a/src/test/compile-fail/proc-macro/auxiliary/derive-a-b.rs b/src/test/ui/proc-macro/auxiliary/derive-a-b.rs similarity index 100% rename from src/test/compile-fail/proc-macro/auxiliary/derive-a-b.rs rename to src/test/ui/proc-macro/auxiliary/derive-a-b.rs diff --git a/src/test/compile-fail/proc-macro/auxiliary/derive-a.rs b/src/test/ui/proc-macro/auxiliary/derive-a.rs similarity index 100% rename from src/test/compile-fail/proc-macro/auxiliary/derive-a.rs rename to src/test/ui/proc-macro/auxiliary/derive-a.rs diff --git a/src/test/compile-fail/proc-macro/auxiliary/derive-b.rs b/src/test/ui/proc-macro/auxiliary/derive-b.rs similarity index 100% rename from src/test/compile-fail/proc-macro/auxiliary/derive-b.rs rename to src/test/ui/proc-macro/auxiliary/derive-b.rs diff --git a/src/test/compile-fail/proc-macro/auxiliary/derive-bad.rs b/src/test/ui/proc-macro/auxiliary/derive-bad.rs similarity index 100% rename from src/test/compile-fail/proc-macro/auxiliary/derive-bad.rs rename to src/test/ui/proc-macro/auxiliary/derive-bad.rs diff --git a/src/test/compile-fail/proc-macro/auxiliary/derive-unstable-2.rs b/src/test/ui/proc-macro/auxiliary/derive-unstable-2.rs similarity index 100% rename from src/test/compile-fail/proc-macro/auxiliary/derive-unstable-2.rs rename to src/test/ui/proc-macro/auxiliary/derive-unstable-2.rs diff --git a/src/test/compile-fail/proc-macro/auxiliary/derive-unstable.rs b/src/test/ui/proc-macro/auxiliary/derive-unstable.rs similarity index 100% rename from src/test/compile-fail/proc-macro/auxiliary/derive-unstable.rs rename to src/test/ui/proc-macro/auxiliary/derive-unstable.rs diff --git a/src/test/compile-fail/proc-macro/auxiliary/issue-41211.rs b/src/test/ui/proc-macro/auxiliary/issue-41211.rs similarity index 100% rename from src/test/compile-fail/proc-macro/auxiliary/issue-41211.rs rename to src/test/ui/proc-macro/auxiliary/issue-41211.rs diff --git a/src/test/compile-fail/proc-macro/auxiliary/issue_38586.rs b/src/test/ui/proc-macro/auxiliary/issue_38586.rs similarity index 100% rename from src/test/compile-fail/proc-macro/auxiliary/issue_38586.rs rename to src/test/ui/proc-macro/auxiliary/issue_38586.rs diff --git a/src/test/compile-fail/proc-macro/auxiliary/issue_50493.rs b/src/test/ui/proc-macro/auxiliary/issue_50493.rs similarity index 100% rename from src/test/compile-fail/proc-macro/auxiliary/issue_50493.rs rename to src/test/ui/proc-macro/auxiliary/issue_50493.rs diff --git a/src/test/compile-fail/proc-macro/auxiliary/more-gates.rs b/src/test/ui/proc-macro/auxiliary/more-gates.rs similarity index 100% rename from src/test/compile-fail/proc-macro/auxiliary/more-gates.rs rename to src/test/ui/proc-macro/auxiliary/more-gates.rs diff --git a/src/test/compile-fail/proc-macro/auxiliary/proc-macro-gates.rs b/src/test/ui/proc-macro/auxiliary/proc-macro-gates.rs similarity index 100% rename from src/test/compile-fail/proc-macro/auxiliary/proc-macro-gates.rs rename to src/test/ui/proc-macro/auxiliary/proc-macro-gates.rs diff --git a/src/test/compile-fail/proc-macro/auxiliary/test-macros.rs b/src/test/ui/proc-macro/auxiliary/test-macros.rs similarity index 100% rename from src/test/compile-fail/proc-macro/auxiliary/test-macros.rs rename to src/test/ui/proc-macro/auxiliary/test-macros.rs diff --git a/src/test/compile-fail/proc-macro/define-two.rs b/src/test/ui/proc-macro/define-two.rs similarity index 100% rename from src/test/compile-fail/proc-macro/define-two.rs rename to src/test/ui/proc-macro/define-two.rs diff --git a/src/test/ui/proc-macro/define-two.stderr b/src/test/ui/proc-macro/define-two.stderr new file mode 100644 index 0000000000000..1ca2e0a3e3cf7 --- /dev/null +++ b/src/test/ui/proc-macro/define-two.stderr @@ -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`. diff --git a/src/test/compile-fail/proc-macro/derive-bad.rs b/src/test/ui/proc-macro/derive-bad.rs similarity index 100% rename from src/test/compile-fail/proc-macro/derive-bad.rs rename to src/test/ui/proc-macro/derive-bad.rs diff --git a/src/test/ui/proc-macro/derive-bad.stderr b/src/test/ui/proc-macro/derive-bad.stderr new file mode 100644 index 0000000000000..57e72a07ee195 --- /dev/null +++ b/src/test/ui/proc-macro/derive-bad.stderr @@ -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 + diff --git a/src/test/compile-fail/proc-macro/derive-still-gated.rs b/src/test/ui/proc-macro/derive-still-gated.rs similarity index 100% rename from src/test/compile-fail/proc-macro/derive-still-gated.rs rename to src/test/ui/proc-macro/derive-still-gated.rs diff --git a/src/test/ui/proc-macro/derive-still-gated.stderr b/src/test/ui/proc-macro/derive-still-gated.stderr new file mode 100644 index 0000000000000..f2e92b992ed6e --- /dev/null +++ b/src/test/ui/proc-macro/derive-still-gated.stderr @@ -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`. diff --git a/src/test/compile-fail/proc-macro/expand-to-unstable-2.rs b/src/test/ui/proc-macro/expand-to-unstable-2.rs similarity index 100% rename from src/test/compile-fail/proc-macro/expand-to-unstable-2.rs rename to src/test/ui/proc-macro/expand-to-unstable-2.rs diff --git a/src/test/ui/proc-macro/expand-to-unstable-2.stderr b/src/test/ui/proc-macro/expand-to-unstable-2.stderr new file mode 100644 index 0000000000000..855e9051974b2 --- /dev/null +++ b/src/test/ui/proc-macro/expand-to-unstable-2.stderr @@ -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`. diff --git a/src/test/compile-fail/proc-macro/expand-to-unstable.rs b/src/test/ui/proc-macro/expand-to-unstable.rs similarity index 100% rename from src/test/compile-fail/proc-macro/expand-to-unstable.rs rename to src/test/ui/proc-macro/expand-to-unstable.rs diff --git a/src/test/ui/proc-macro/expand-to-unstable.stderr b/src/test/ui/proc-macro/expand-to-unstable.stderr new file mode 100644 index 0000000000000..e851b0e2bc3f1 --- /dev/null +++ b/src/test/ui/proc-macro/expand-to-unstable.stderr @@ -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`. diff --git a/src/test/compile-fail/proc-macro/export-macro.rs b/src/test/ui/proc-macro/export-macro.rs similarity index 100% rename from src/test/compile-fail/proc-macro/export-macro.rs rename to src/test/ui/proc-macro/export-macro.rs diff --git a/src/test/ui/proc-macro/export-macro.stderr b/src/test/ui/proc-macro/export-macro.stderr new file mode 100644 index 0000000000000..f82d5ab5f1c6b --- /dev/null +++ b/src/test/ui/proc-macro/export-macro.stderr @@ -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 + diff --git a/src/test/compile-fail/proc-macro/exports.rs b/src/test/ui/proc-macro/exports.rs similarity index 100% rename from src/test/compile-fail/proc-macro/exports.rs rename to src/test/ui/proc-macro/exports.rs diff --git a/src/test/ui/proc-macro/exports.stderr b/src/test/ui/proc-macro/exports.stderr new file mode 100644 index 0000000000000..3637d0fbd837e --- /dev/null +++ b/src/test/ui/proc-macro/exports.stderr @@ -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 + diff --git a/src/test/compile-fail/proc-macro/illegal-proc-macro-derive-use.rs b/src/test/ui/proc-macro/illegal-proc-macro-derive-use.rs similarity index 100% rename from src/test/compile-fail/proc-macro/illegal-proc-macro-derive-use.rs rename to src/test/ui/proc-macro/illegal-proc-macro-derive-use.rs diff --git a/src/test/ui/proc-macro/illegal-proc-macro-derive-use.stderr b/src/test/ui/proc-macro/illegal-proc-macro-derive-use.stderr new file mode 100644 index 0000000000000..715ff0e20a9b0 --- /dev/null +++ b/src/test/ui/proc-macro/illegal-proc-macro-derive-use.stderr @@ -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 + diff --git a/src/test/compile-fail/proc-macro/import.rs b/src/test/ui/proc-macro/import.rs similarity index 100% rename from src/test/compile-fail/proc-macro/import.rs rename to src/test/ui/proc-macro/import.rs diff --git a/src/test/ui/proc-macro/import.stderr b/src/test/ui/proc-macro/import.stderr new file mode 100644 index 0000000000000..f3633b2158383 --- /dev/null +++ b/src/test/ui/proc-macro/import.stderr @@ -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`. diff --git a/src/test/compile-fail/proc-macro/issue-37788.rs b/src/test/ui/proc-macro/issue-37788.rs similarity index 100% rename from src/test/compile-fail/proc-macro/issue-37788.rs rename to src/test/ui/proc-macro/issue-37788.rs diff --git a/src/test/ui/proc-macro/issue-37788.stderr b/src/test/ui/proc-macro/issue-37788.stderr new file mode 100644 index 0000000000000..f5ddf9ba6b88b --- /dev/null +++ b/src/test/ui/proc-macro/issue-37788.stderr @@ -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`. diff --git a/src/test/compile-fail/proc-macro/issue-38586.rs b/src/test/ui/proc-macro/issue-38586.rs similarity index 100% rename from src/test/compile-fail/proc-macro/issue-38586.rs rename to src/test/ui/proc-macro/issue-38586.rs diff --git a/src/test/ui/proc-macro/issue-38586.stderr b/src/test/ui/proc-macro/issue-38586.stderr new file mode 100644 index 0000000000000..6ba2c0b269fe6 --- /dev/null +++ b/src/test/ui/proc-macro/issue-38586.stderr @@ -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`. diff --git a/src/test/compile-fail/proc-macro/issue-41211.rs b/src/test/ui/proc-macro/issue-41211.rs similarity index 100% rename from src/test/compile-fail/proc-macro/issue-41211.rs rename to src/test/ui/proc-macro/issue-41211.rs diff --git a/src/test/ui/proc-macro/issue-41211.stderr b/src/test/ui/proc-macro/issue-41211.stderr new file mode 100644 index 0000000000000..ba5fad432b7ab --- /dev/null +++ b/src/test/ui/proc-macro/issue-41211.stderr @@ -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`. diff --git a/src/test/compile-fail/proc-macro/issue-50493.rs b/src/test/ui/proc-macro/issue-50493.rs similarity index 100% rename from src/test/compile-fail/proc-macro/issue-50493.rs rename to src/test/ui/proc-macro/issue-50493.rs diff --git a/src/test/ui/proc-macro/issue-50493.stderr b/src/test/ui/proc-macro/issue-50493.stderr new file mode 100644 index 0000000000000..3dcb526553565 --- /dev/null +++ b/src/test/ui/proc-macro/issue-50493.stderr @@ -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`. diff --git a/src/test/compile-fail/proc-macro/item-error.rs b/src/test/ui/proc-macro/item-error.rs similarity index 100% rename from src/test/compile-fail/proc-macro/item-error.rs rename to src/test/ui/proc-macro/item-error.rs diff --git a/src/test/ui/proc-macro/item-error.stderr b/src/test/ui/proc-macro/item-error.stderr new file mode 100644 index 0000000000000..d19328687979b --- /dev/null +++ b/src/test/ui/proc-macro/item-error.stderr @@ -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`. diff --git a/src/test/compile-fail/proc-macro/lints_in_proc_macros.rs b/src/test/ui/proc-macro/lints_in_proc_macros.rs similarity index 100% rename from src/test/compile-fail/proc-macro/lints_in_proc_macros.rs rename to src/test/ui/proc-macro/lints_in_proc_macros.rs diff --git a/src/test/ui/proc-macro/lints_in_proc_macros.stderr b/src/test/ui/proc-macro/lints_in_proc_macros.stderr new file mode 100644 index 0000000000000..42d9a30722654 --- /dev/null +++ b/src/test/ui/proc-macro/lints_in_proc_macros.stderr @@ -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`. diff --git a/src/test/compile-fail/proc-macro/macros-in-extern.rs b/src/test/ui/proc-macro/macros-in-extern.rs similarity index 100% rename from src/test/compile-fail/proc-macro/macros-in-extern.rs rename to src/test/ui/proc-macro/macros-in-extern.rs diff --git a/src/test/ui/proc-macro/macros-in-extern.stderr b/src/test/ui/proc-macro/macros-in-extern.stderr new file mode 100644 index 0000000000000..5c51de4580165 --- /dev/null +++ b/src/test/ui/proc-macro/macros-in-extern.stderr @@ -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`. diff --git a/src/test/compile-fail/proc-macro/more-gates.rs b/src/test/ui/proc-macro/more-gates.rs similarity index 100% rename from src/test/compile-fail/proc-macro/more-gates.rs rename to src/test/ui/proc-macro/more-gates.rs diff --git a/src/test/ui/proc-macro/more-gates.stderr b/src/test/ui/proc-macro/more-gates.stderr new file mode 100644 index 0000000000000..d5f30d5817c93 --- /dev/null +++ b/src/test/ui/proc-macro/more-gates.stderr @@ -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`. diff --git a/src/test/compile-fail/proc-macro/no-macro-use-attr.rs b/src/test/ui/proc-macro/no-macro-use-attr.rs similarity index 100% rename from src/test/compile-fail/proc-macro/no-macro-use-attr.rs rename to src/test/ui/proc-macro/no-macro-use-attr.rs diff --git a/src/test/ui/proc-macro/no-macro-use-attr.stderr b/src/test/ui/proc-macro/no-macro-use-attr.stderr new file mode 100644 index 0000000000000..447cb26f056d4 --- /dev/null +++ b/src/test/ui/proc-macro/no-macro-use-attr.stderr @@ -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 + diff --git a/src/test/compile-fail/proc-macro/proc-macro-attributes.rs b/src/test/ui/proc-macro/proc-macro-attributes.rs similarity index 100% rename from src/test/compile-fail/proc-macro/proc-macro-attributes.rs rename to src/test/ui/proc-macro/proc-macro-attributes.rs diff --git a/src/test/ui/proc-macro/proc-macro-attributes.stderr b/src/test/ui/proc-macro/proc-macro-attributes.stderr new file mode 100644 index 0000000000000..a1289c6356ae6 --- /dev/null +++ b/src/test/ui/proc-macro/proc-macro-attributes.stderr @@ -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`. diff --git a/src/test/compile-fail/proc-macro/proc-macro-gates.rs b/src/test/ui/proc-macro/proc-macro-gates.rs similarity index 100% rename from src/test/compile-fail/proc-macro/proc-macro-gates.rs rename to src/test/ui/proc-macro/proc-macro-gates.rs diff --git a/src/test/ui/proc-macro/proc-macro-gates.stderr b/src/test/ui/proc-macro/proc-macro-gates.stderr new file mode 100644 index 0000000000000..d5c85d97b5464 --- /dev/null +++ b/src/test/ui/proc-macro/proc-macro-gates.stderr @@ -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`. diff --git a/src/test/compile-fail/proc-macro/proc-macro-gates2.rs b/src/test/ui/proc-macro/proc-macro-gates2.rs similarity index 100% rename from src/test/compile-fail/proc-macro/proc-macro-gates2.rs rename to src/test/ui/proc-macro/proc-macro-gates2.rs diff --git a/src/test/ui/proc-macro/proc-macro-gates2.stderr b/src/test/ui/proc-macro/proc-macro-gates2.stderr new file mode 100644 index 0000000000000..2c0f2b09f066b --- /dev/null +++ b/src/test/ui/proc-macro/proc-macro-gates2.stderr @@ -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`. diff --git a/src/test/compile-fail/proc-macro/pub-at-crate-root.rs b/src/test/ui/proc-macro/pub-at-crate-root.rs similarity index 100% rename from src/test/compile-fail/proc-macro/pub-at-crate-root.rs rename to src/test/ui/proc-macro/pub-at-crate-root.rs diff --git a/src/test/ui/proc-macro/pub-at-crate-root.stderr b/src/test/ui/proc-macro/pub-at-crate-root.stderr new file mode 100644 index 0000000000000..ba9a8605f1fd3 --- /dev/null +++ b/src/test/ui/proc-macro/pub-at-crate-root.stderr @@ -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 + diff --git a/src/test/compile-fail/proc-macro/shadow-builtin.rs b/src/test/ui/proc-macro/shadow-builtin.rs similarity index 100% rename from src/test/compile-fail/proc-macro/shadow-builtin.rs rename to src/test/ui/proc-macro/shadow-builtin.rs diff --git a/src/test/ui/proc-macro/shadow-builtin.stderr b/src/test/ui/proc-macro/shadow-builtin.stderr new file mode 100644 index 0000000000000..6d04c90738694 --- /dev/null +++ b/src/test/ui/proc-macro/shadow-builtin.stderr @@ -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 + diff --git a/src/test/compile-fail/proc-macro/shadow.rs b/src/test/ui/proc-macro/shadow.rs similarity index 100% rename from src/test/compile-fail/proc-macro/shadow.rs rename to src/test/ui/proc-macro/shadow.rs diff --git a/src/test/ui/proc-macro/shadow.stderr b/src/test/ui/proc-macro/shadow.stderr new file mode 100644 index 0000000000000..847fc73f9e019 --- /dev/null +++ b/src/test/ui/proc-macro/shadow.stderr @@ -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`. diff --git a/src/test/compile-fail/proc-macro/two-crate-types-1.rs b/src/test/ui/proc-macro/two-crate-types-1.rs similarity index 100% rename from src/test/compile-fail/proc-macro/two-crate-types-1.rs rename to src/test/ui/proc-macro/two-crate-types-1.rs diff --git a/src/test/ui/proc-macro/two-crate-types-1.stderr b/src/test/ui/proc-macro/two-crate-types-1.stderr new file mode 100644 index 0000000000000..deaba1cf272fd --- /dev/null +++ b/src/test/ui/proc-macro/two-crate-types-1.stderr @@ -0,0 +1,4 @@ +error: cannot mix `proc-macro` crate type with others + +error: aborting due to previous error + diff --git a/src/test/compile-fail/proc-macro/two-crate-types-2.rs b/src/test/ui/proc-macro/two-crate-types-2.rs similarity index 100% rename from src/test/compile-fail/proc-macro/two-crate-types-2.rs rename to src/test/ui/proc-macro/two-crate-types-2.rs diff --git a/src/test/ui/proc-macro/two-crate-types-2.stderr b/src/test/ui/proc-macro/two-crate-types-2.stderr new file mode 100644 index 0000000000000..deaba1cf272fd --- /dev/null +++ b/src/test/ui/proc-macro/two-crate-types-2.stderr @@ -0,0 +1,4 @@ +error: cannot mix `proc-macro` crate type with others + +error: aborting due to previous error + From 39a4238e54db9e2a3199b1188a47f18ec76cf096 Mon Sep 17 00:00:00 2001 From: Vadim Petrochenkov Date: Sun, 2 Dec 2018 22:42:43 +0300 Subject: [PATCH 2/4] Move compile-fail-fulldeps tests to ui-fulldeps --- .../auxiliary/lint_group_plugin_test.rs | 51 ------- .../auxiliary/lint_plugin_test.rs | 48 ------- .../auxiliary/attr_plugin_test.rs | 0 .../auxiliary/lint_for_crate.rs | 0 .../auxiliary/macro_crate_test.rs | 0 .../auxiliary/macro_reexport_1.rs | 0 .../auxiliary/pub_and_stability.rs | 0 .../auxiliary/rlib_crate_test.rs | 0 .../auxiliary/use_from_trait_xc.rs | 0 .../dropck_tarena_cycle_checked.rs | 0 .../dropck_tarena_cycle_checked.stderr | 13 ++ .../dropck_tarena_unsound_drop.rs | 0 .../dropck_tarena_unsound_drop.stderr | 13 ++ .../explore-issue-38412.rs | 0 .../ui-fulldeps/explore-issue-38412.stderr | 132 ++++++++++++++++++ .../gated-plugin.rs | 0 src/test/ui-fulldeps/gated-plugin.stderr | 11 ++ .../gated-quote.rs | 0 src/test/ui-fulldeps/gated-quote.stderr | 80 +++++++++++ .../issue-15778-fail.rs | 0 src/test/ui-fulldeps/issue-15778-fail.stderr | 13 ++ .../issue-18986.rs | 0 src/test/ui-fulldeps/issue-18986.stderr | 9 ++ .../issue-48941.rs | 0 src/test/ui-fulldeps/issue-48941.stderr | 14 ++ .../lint-group-plugin-deny-cmdline.rs | 0 .../lint-group-plugin-deny-cmdline.stderr | 18 +++ .../lint-plugin-deny-attr.rs | 0 .../ui-fulldeps/lint-plugin-deny-attr.stderr | 14 ++ .../lint-plugin-deny-cmdline.rs | 0 .../lint-plugin-deny-cmdline.stderr | 10 ++ .../lint-plugin-forbid-cmdline.rs | 0 .../lint-plugin-forbid-cmdline.stderr | 19 +++ .../macro-crate-doesnt-resolve.rs | 0 .../macro-crate-doesnt-resolve.stderr | 9 ++ .../macro-crate-rlib.rs | 0 src/test/ui-fulldeps/macro-crate-rlib.stderr | 9 ++ .../macro-crate-unexported-macro.rs | 0 .../macro-crate-unexported-macro.stderr | 8 ++ .../no-link-unknown-crate.rs | 0 .../ui-fulldeps/no-link-unknown-crate.stderr | 9 ++ .../plugin-as-extern-crate.rs | 0 .../ui-fulldeps/plugin-as-extern-crate.stderr | 14 ++ .../plugin-attr-register-deny.rs | 0 .../plugin-attr-register-deny.stderr | 26 ++++ .../plugin-plus-extern-crate.rs | 0 .../plugin-plus-extern-crate.stderr | 14 ++ .../qquote.rs | 0 src/test/ui-fulldeps/qquote.stderr | 9 ++ 49 files changed, 444 insertions(+), 99 deletions(-) delete mode 100644 src/test/compile-fail-fulldeps/auxiliary/lint_group_plugin_test.rs delete mode 100644 src/test/compile-fail-fulldeps/auxiliary/lint_plugin_test.rs rename src/test/{compile-fail-fulldeps => ui-fulldeps}/auxiliary/attr_plugin_test.rs (100%) rename src/test/{compile-fail-fulldeps => ui-fulldeps}/auxiliary/lint_for_crate.rs (100%) rename src/test/{compile-fail-fulldeps => ui-fulldeps}/auxiliary/macro_crate_test.rs (100%) rename src/test/{compile-fail-fulldeps => ui-fulldeps}/auxiliary/macro_reexport_1.rs (100%) rename src/test/{compile-fail-fulldeps => ui-fulldeps}/auxiliary/pub_and_stability.rs (100%) rename src/test/{compile-fail-fulldeps => ui-fulldeps}/auxiliary/rlib_crate_test.rs (100%) rename src/test/{compile-fail-fulldeps => ui-fulldeps}/auxiliary/use_from_trait_xc.rs (100%) rename src/test/{compile-fail-fulldeps => ui-fulldeps}/dropck_tarena_cycle_checked.rs (100%) create mode 100644 src/test/ui-fulldeps/dropck_tarena_cycle_checked.stderr rename src/test/{compile-fail-fulldeps => ui-fulldeps}/dropck_tarena_unsound_drop.rs (100%) create mode 100644 src/test/ui-fulldeps/dropck_tarena_unsound_drop.stderr rename src/test/{compile-fail-fulldeps => ui-fulldeps}/explore-issue-38412.rs (100%) create mode 100644 src/test/ui-fulldeps/explore-issue-38412.stderr rename src/test/{compile-fail-fulldeps => ui-fulldeps}/gated-plugin.rs (100%) create mode 100644 src/test/ui-fulldeps/gated-plugin.stderr rename src/test/{compile-fail-fulldeps => ui-fulldeps}/gated-quote.rs (100%) create mode 100644 src/test/ui-fulldeps/gated-quote.stderr rename src/test/{compile-fail-fulldeps => ui-fulldeps}/issue-15778-fail.rs (100%) create mode 100644 src/test/ui-fulldeps/issue-15778-fail.stderr rename src/test/{compile-fail-fulldeps => ui-fulldeps}/issue-18986.rs (100%) create mode 100644 src/test/ui-fulldeps/issue-18986.stderr rename src/test/{compile-fail-fulldeps => ui-fulldeps}/issue-48941.rs (100%) create mode 100644 src/test/ui-fulldeps/issue-48941.stderr rename src/test/{compile-fail-fulldeps => ui-fulldeps}/lint-group-plugin-deny-cmdline.rs (100%) create mode 100644 src/test/ui-fulldeps/lint-group-plugin-deny-cmdline.stderr rename src/test/{compile-fail-fulldeps => ui-fulldeps}/lint-plugin-deny-attr.rs (100%) create mode 100644 src/test/ui-fulldeps/lint-plugin-deny-attr.stderr rename src/test/{compile-fail-fulldeps => ui-fulldeps}/lint-plugin-deny-cmdline.rs (100%) create mode 100644 src/test/ui-fulldeps/lint-plugin-deny-cmdline.stderr rename src/test/{compile-fail-fulldeps => ui-fulldeps}/lint-plugin-forbid-cmdline.rs (100%) create mode 100644 src/test/ui-fulldeps/lint-plugin-forbid-cmdline.stderr rename src/test/{compile-fail-fulldeps => ui-fulldeps}/macro-crate-doesnt-resolve.rs (100%) create mode 100644 src/test/ui-fulldeps/macro-crate-doesnt-resolve.stderr rename src/test/{compile-fail-fulldeps => ui-fulldeps}/macro-crate-rlib.rs (100%) create mode 100644 src/test/ui-fulldeps/macro-crate-rlib.stderr rename src/test/{compile-fail-fulldeps => ui-fulldeps}/macro-crate-unexported-macro.rs (100%) create mode 100644 src/test/ui-fulldeps/macro-crate-unexported-macro.stderr rename src/test/{compile-fail-fulldeps => ui-fulldeps}/no-link-unknown-crate.rs (100%) create mode 100644 src/test/ui-fulldeps/no-link-unknown-crate.stderr rename src/test/{compile-fail-fulldeps => ui-fulldeps}/plugin-as-extern-crate.rs (100%) create mode 100644 src/test/ui-fulldeps/plugin-as-extern-crate.stderr rename src/test/{compile-fail-fulldeps => ui-fulldeps}/plugin-attr-register-deny.rs (100%) create mode 100644 src/test/ui-fulldeps/plugin-attr-register-deny.stderr rename src/test/{compile-fail-fulldeps => ui-fulldeps}/plugin-plus-extern-crate.rs (100%) create mode 100644 src/test/ui-fulldeps/plugin-plus-extern-crate.stderr rename src/test/{compile-fail-fulldeps => ui-fulldeps}/qquote.rs (100%) create mode 100644 src/test/ui-fulldeps/qquote.stderr diff --git a/src/test/compile-fail-fulldeps/auxiliary/lint_group_plugin_test.rs b/src/test/compile-fail-fulldeps/auxiliary/lint_group_plugin_test.rs deleted file mode 100644 index f697642f8431d..0000000000000 --- a/src/test/compile-fail-fulldeps/auxiliary/lint_group_plugin_test.rs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2014 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 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// force-host - -#![feature(plugin_registrar)] -#![feature(box_syntax, rustc_private)] - -// Load rustc as a plugin to get macros -#[macro_use] -extern crate rustc; -extern crate rustc_plugin; - -use rustc::hir; -use rustc::lint::{LateContext, LintContext, LintPass, LateLintPass, LateLintPassObject, LintArray}; -use rustc_plugin::Registry; - -declare_lint!(TEST_LINT, Warn, "Warn about items named 'lintme'"); - -declare_lint!(PLEASE_LINT, Warn, "Warn about items named 'pleaselintme'"); - -struct Pass; - -impl LintPass for Pass { - fn get_lints(&self) -> LintArray { - lint_array!(TEST_LINT, PLEASE_LINT) - } -} - -impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass { - fn check_item(&mut self, cx: &LateContext, it: &hir::Item) { - match &*it.name.as_str() { - "lintme" => cx.span_lint(TEST_LINT, it.span, "item is named 'lintme'"), - "pleaselintme" => cx.span_lint(PLEASE_LINT, it.span, "item is named 'pleaselintme'"), - _ => {} - } - } -} - -#[plugin_registrar] -pub fn plugin_registrar(reg: &mut Registry) { - reg.register_late_lint_pass(box Pass); - reg.register_lint_group("lint_me", None, vec![TEST_LINT, PLEASE_LINT]); -} diff --git a/src/test/compile-fail-fulldeps/auxiliary/lint_plugin_test.rs b/src/test/compile-fail-fulldeps/auxiliary/lint_plugin_test.rs deleted file mode 100644 index 8647797270f9a..0000000000000 --- a/src/test/compile-fail-fulldeps/auxiliary/lint_plugin_test.rs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright 2014 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 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// force-host - -#![feature(plugin_registrar)] -#![feature(box_syntax, rustc_private)] - -extern crate syntax; - -// Load rustc as a plugin to get macros -#[macro_use] -extern crate rustc; -extern crate rustc_plugin; - -use rustc::lint::{EarlyContext, LintContext, LintPass, EarlyLintPass, - EarlyLintPassObject, LintArray}; -use rustc_plugin::Registry; -use syntax::ast; -declare_lint!(TEST_LINT, Warn, "Warn about items named 'lintme'"); - -struct Pass; - -impl LintPass for Pass { - fn get_lints(&self) -> LintArray { - lint_array!(TEST_LINT) - } -} - -impl EarlyLintPass for Pass { - fn check_item(&mut self, cx: &EarlyContext, it: &ast::Item) { - if it.ident.name == "lintme" { - cx.span_lint(TEST_LINT, it.span, "item is named 'lintme'"); - } - } -} - -#[plugin_registrar] -pub fn plugin_registrar(reg: &mut Registry) { - reg.register_early_lint_pass(box Pass as EarlyLintPassObject); -} diff --git a/src/test/compile-fail-fulldeps/auxiliary/attr_plugin_test.rs b/src/test/ui-fulldeps/auxiliary/attr_plugin_test.rs similarity index 100% rename from src/test/compile-fail-fulldeps/auxiliary/attr_plugin_test.rs rename to src/test/ui-fulldeps/auxiliary/attr_plugin_test.rs diff --git a/src/test/compile-fail-fulldeps/auxiliary/lint_for_crate.rs b/src/test/ui-fulldeps/auxiliary/lint_for_crate.rs similarity index 100% rename from src/test/compile-fail-fulldeps/auxiliary/lint_for_crate.rs rename to src/test/ui-fulldeps/auxiliary/lint_for_crate.rs diff --git a/src/test/compile-fail-fulldeps/auxiliary/macro_crate_test.rs b/src/test/ui-fulldeps/auxiliary/macro_crate_test.rs similarity index 100% rename from src/test/compile-fail-fulldeps/auxiliary/macro_crate_test.rs rename to src/test/ui-fulldeps/auxiliary/macro_crate_test.rs diff --git a/src/test/compile-fail-fulldeps/auxiliary/macro_reexport_1.rs b/src/test/ui-fulldeps/auxiliary/macro_reexport_1.rs similarity index 100% rename from src/test/compile-fail-fulldeps/auxiliary/macro_reexport_1.rs rename to src/test/ui-fulldeps/auxiliary/macro_reexport_1.rs diff --git a/src/test/compile-fail-fulldeps/auxiliary/pub_and_stability.rs b/src/test/ui-fulldeps/auxiliary/pub_and_stability.rs similarity index 100% rename from src/test/compile-fail-fulldeps/auxiliary/pub_and_stability.rs rename to src/test/ui-fulldeps/auxiliary/pub_and_stability.rs diff --git a/src/test/compile-fail-fulldeps/auxiliary/rlib_crate_test.rs b/src/test/ui-fulldeps/auxiliary/rlib_crate_test.rs similarity index 100% rename from src/test/compile-fail-fulldeps/auxiliary/rlib_crate_test.rs rename to src/test/ui-fulldeps/auxiliary/rlib_crate_test.rs diff --git a/src/test/compile-fail-fulldeps/auxiliary/use_from_trait_xc.rs b/src/test/ui-fulldeps/auxiliary/use_from_trait_xc.rs similarity index 100% rename from src/test/compile-fail-fulldeps/auxiliary/use_from_trait_xc.rs rename to src/test/ui-fulldeps/auxiliary/use_from_trait_xc.rs diff --git a/src/test/compile-fail-fulldeps/dropck_tarena_cycle_checked.rs b/src/test/ui-fulldeps/dropck_tarena_cycle_checked.rs similarity index 100% rename from src/test/compile-fail-fulldeps/dropck_tarena_cycle_checked.rs rename to src/test/ui-fulldeps/dropck_tarena_cycle_checked.rs diff --git a/src/test/ui-fulldeps/dropck_tarena_cycle_checked.stderr b/src/test/ui-fulldeps/dropck_tarena_cycle_checked.stderr new file mode 100644 index 0000000000000..eae33bab45392 --- /dev/null +++ b/src/test/ui-fulldeps/dropck_tarena_cycle_checked.stderr @@ -0,0 +1,13 @@ +error[E0597]: `arena` does not live long enough + --> $DIR/dropck_tarena_cycle_checked.rs:126:8 + | +LL | f(&arena); + | ^^^^^ borrowed value does not live long enough +LL | } //~^ ERROR `arena` does not live long enough + | - `arena` dropped here while still borrowed + | + = note: values in a scope are dropped in the opposite order they are created + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/compile-fail-fulldeps/dropck_tarena_unsound_drop.rs b/src/test/ui-fulldeps/dropck_tarena_unsound_drop.rs similarity index 100% rename from src/test/compile-fail-fulldeps/dropck_tarena_unsound_drop.rs rename to src/test/ui-fulldeps/dropck_tarena_unsound_drop.rs diff --git a/src/test/ui-fulldeps/dropck_tarena_unsound_drop.stderr b/src/test/ui-fulldeps/dropck_tarena_unsound_drop.stderr new file mode 100644 index 0000000000000..75ceb692c7595 --- /dev/null +++ b/src/test/ui-fulldeps/dropck_tarena_unsound_drop.stderr @@ -0,0 +1,13 @@ +error[E0597]: `arena` does not live long enough + --> $DIR/dropck_tarena_unsound_drop.rs:51:8 + | +LL | f(&arena); + | ^^^^^ borrowed value does not live long enough +LL | } //~^ ERROR `arena` does not live long enough + | - `arena` dropped here while still borrowed + | + = note: values in a scope are dropped in the opposite order they are created + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/compile-fail-fulldeps/explore-issue-38412.rs b/src/test/ui-fulldeps/explore-issue-38412.rs similarity index 100% rename from src/test/compile-fail-fulldeps/explore-issue-38412.rs rename to src/test/ui-fulldeps/explore-issue-38412.rs diff --git a/src/test/ui-fulldeps/explore-issue-38412.stderr b/src/test/ui-fulldeps/explore-issue-38412.stderr new file mode 100644 index 0000000000000..8e31c1c7e017e --- /dev/null +++ b/src/test/ui-fulldeps/explore-issue-38412.stderr @@ -0,0 +1,132 @@ +error[E0658]: use of unstable library feature 'unstable_undeclared' (see issue #38412) + --> $DIR/explore-issue-38412.rs:31:63 + | +LL | let Record { a_stable_pub: _, a_unstable_declared_pub: _, a_unstable_undeclared_pub: _, .. } = + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(unstable_undeclared)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_undeclared' (see issue #38412) + --> $DIR/explore-issue-38412.rs:40:5 + | +LL | r.a_unstable_undeclared_pub; //~ ERROR use of unstable library feature + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(unstable_undeclared)] to the crate attributes to enable + +error[E0616]: field `b_crate` of struct `pub_and_stability::Record` is private + --> $DIR/explore-issue-38412.rs:41:5 + | +LL | r.b_crate; //~ ERROR is private + | ^^^^^^^^^ + +error[E0616]: field `c_mod` of struct `pub_and_stability::Record` is private + --> $DIR/explore-issue-38412.rs:42:5 + | +LL | r.c_mod; //~ ERROR is private + | ^^^^^^^ + +error[E0616]: field `d_priv` of struct `pub_and_stability::Record` is private + --> $DIR/explore-issue-38412.rs:43:5 + | +LL | r.d_priv; //~ ERROR is private + | ^^^^^^^^ + +error[E0658]: use of unstable library feature 'unstable_undeclared' (see issue #38412) + --> $DIR/explore-issue-38412.rs:47:5 + | +LL | t.2; //~ ERROR use of unstable library feature + | ^^^ + | + = help: add #![feature(unstable_undeclared)] to the crate attributes to enable + +error[E0616]: field `3` of struct `pub_and_stability::Tuple` is private + --> $DIR/explore-issue-38412.rs:48:5 + | +LL | t.3; //~ ERROR is private + | ^^^ + +error[E0616]: field `4` of struct `pub_and_stability::Tuple` is private + --> $DIR/explore-issue-38412.rs:49:5 + | +LL | t.4; //~ ERROR is private + | ^^^ + +error[E0616]: field `5` of struct `pub_and_stability::Tuple` is private + --> $DIR/explore-issue-38412.rs:50:5 + | +LL | t.5; //~ ERROR is private + | ^^^ + +error[E0658]: use of unstable library feature 'unstable_undeclared' (see issue #38412) + --> $DIR/explore-issue-38412.rs:54:7 + | +LL | r.unstable_undeclared_trait_method(); //~ ERROR use of unstable library feature + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(unstable_undeclared)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_undeclared' (see issue #38412) + --> $DIR/explore-issue-38412.rs:58:7 + | +LL | r.unstable_undeclared(); //~ ERROR use of unstable library feature + | ^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(unstable_undeclared)] to the crate attributes to enable + +error[E0624]: method `pub_crate` is private + --> $DIR/explore-issue-38412.rs:60:7 + | +LL | r.pub_crate(); //~ ERROR `pub_crate` is private + | ^^^^^^^^^ + +error[E0624]: method `pub_mod` is private + --> $DIR/explore-issue-38412.rs:61:7 + | +LL | r.pub_mod(); //~ ERROR `pub_mod` is private + | ^^^^^^^ + +error[E0624]: method `private` is private + --> $DIR/explore-issue-38412.rs:62:7 + | +LL | r.private(); //~ ERROR `private` is private + | ^^^^^^^ + +error[E0658]: use of unstable library feature 'unstable_undeclared' (see issue #38412) + --> $DIR/explore-issue-38412.rs:67:7 + | +LL | t.unstable_undeclared_trait_method(); //~ ERROR use of unstable library feature + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(unstable_undeclared)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_undeclared' (see issue #38412) + --> $DIR/explore-issue-38412.rs:71:7 + | +LL | t.unstable_undeclared(); //~ ERROR use of unstable library feature + | ^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(unstable_undeclared)] to the crate attributes to enable + +error[E0624]: method `pub_crate` is private + --> $DIR/explore-issue-38412.rs:73:7 + | +LL | t.pub_crate(); //~ ERROR `pub_crate` is private + | ^^^^^^^^^ + +error[E0624]: method `pub_mod` is private + --> $DIR/explore-issue-38412.rs:74:7 + | +LL | t.pub_mod(); //~ ERROR `pub_mod` is private + | ^^^^^^^ + +error[E0624]: method `private` is private + --> $DIR/explore-issue-38412.rs:75:7 + | +LL | t.private(); //~ ERROR `private` is private + | ^^^^^^^ + +error: aborting due to 19 previous errors + +Some errors occurred: E0616, E0624, E0658. +For more information about an error, try `rustc --explain E0616`. diff --git a/src/test/compile-fail-fulldeps/gated-plugin.rs b/src/test/ui-fulldeps/gated-plugin.rs similarity index 100% rename from src/test/compile-fail-fulldeps/gated-plugin.rs rename to src/test/ui-fulldeps/gated-plugin.rs diff --git a/src/test/ui-fulldeps/gated-plugin.stderr b/src/test/ui-fulldeps/gated-plugin.stderr new file mode 100644 index 0000000000000..075bc799b3349 --- /dev/null +++ b/src/test/ui-fulldeps/gated-plugin.stderr @@ -0,0 +1,11 @@ +error[E0658]: compiler plugins are experimental and possibly buggy (see issue #29597) + --> $DIR/gated-plugin.rs:13:1 + | +LL | #![plugin(macro_crate_test)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(plugin)] to the crate attributes to enable + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/compile-fail-fulldeps/gated-quote.rs b/src/test/ui-fulldeps/gated-quote.rs similarity index 100% rename from src/test/compile-fail-fulldeps/gated-quote.rs rename to src/test/ui-fulldeps/gated-quote.rs diff --git a/src/test/ui-fulldeps/gated-quote.stderr b/src/test/ui-fulldeps/gated-quote.stderr new file mode 100644 index 0000000000000..db091938c6ea8 --- /dev/null +++ b/src/test/ui-fulldeps/gated-quote.stderr @@ -0,0 +1,80 @@ +error: cannot find macro `quote_path!` in this scope + --> $DIR/gated-quote.rs:65:13 + | +LL | let x = quote_path!(ecx, 3); + | ^^^^^^^^^^ + +error: cannot find macro `quote_meta_item!` in this scope + --> $DIR/gated-quote.rs:63:13 + | +LL | let x = quote_meta_item!(ecx, 3); + | ^^^^^^^^^^^^^^^ + +error: cannot find macro `quote_block!` in this scope + --> $DIR/gated-quote.rs:61:13 + | +LL | let x = quote_block!(ecx, 3); + | ^^^^^^^^^^^ + +error: cannot find macro `quote_arg!` in this scope + --> $DIR/gated-quote.rs:59:13 + | +LL | let x = quote_arg!(ecx, 3); + | ^^^^^^^^^ + +error: cannot find macro `quote_attr!` in this scope + --> $DIR/gated-quote.rs:57:13 + | +LL | let x = quote_attr!(ecx, 3); + | ^^^^^^^^^^ + +error: cannot find macro `quote_stmt!` in this scope + --> $DIR/gated-quote.rs:55:13 + | +LL | let x = quote_stmt!(ecx, 3); + | ^^^^^^^^^^ + +error: cannot find macro `quote_arm!` in this scope + --> $DIR/gated-quote.rs:53:13 + | +LL | let x = quote_arm!(ecx, 3); + | ^^^^^^^^^ + +error: cannot find macro `quote_pat!` in this scope + --> $DIR/gated-quote.rs:51:13 + | +LL | let x = quote_pat!(ecx, 3); + | ^^^^^^^^^ + +error: cannot find macro `quote_item!` in this scope + --> $DIR/gated-quote.rs:49:13 + | +LL | let x = quote_item!(ecx, 3); + | ^^^^^^^^^^ + +error: cannot find macro `quote_method!` in this scope + --> $DIR/gated-quote.rs:47:13 + | +LL | let x = quote_method!(ecx, 3); + | ^^^^^^^^^^^^ + +error: cannot find macro `quote_ty!` in this scope + --> $DIR/gated-quote.rs:45:13 + | +LL | let x = quote_ty!(ecx, 3); + | ^^^^^^^^ + +error: cannot find macro `quote_expr!` in this scope + --> $DIR/gated-quote.rs:43:13 + | +LL | let x = quote_expr!(ecx, 3); + | ^^^^^^^^^^ + +error: cannot find macro `quote_tokens!` in this scope + --> $DIR/gated-quote.rs:41:13 + | +LL | let x = quote_tokens!(ecx, 3); + | ^^^^^^^^^^^^ + +error: aborting due to 13 previous errors + diff --git a/src/test/compile-fail-fulldeps/issue-15778-fail.rs b/src/test/ui-fulldeps/issue-15778-fail.rs similarity index 100% rename from src/test/compile-fail-fulldeps/issue-15778-fail.rs rename to src/test/ui-fulldeps/issue-15778-fail.rs diff --git a/src/test/ui-fulldeps/issue-15778-fail.stderr b/src/test/ui-fulldeps/issue-15778-fail.stderr new file mode 100644 index 0000000000000..49a2b260a1e31 --- /dev/null +++ b/src/test/ui-fulldeps/issue-15778-fail.stderr @@ -0,0 +1,13 @@ +error: crate is not marked with #![crate_okay] + --> $DIR/issue-15778-fail.rs:15:1 + | +LL | / #![feature(plugin)] //~ ERROR crate is not marked with #![crate_okay] +LL | | #![plugin(lint_for_crate)] +LL | | +LL | | pub fn main() { } + | |_________________^ + | + = note: requested on the command line with `-D crate-not-okay` + +error: aborting due to previous error + diff --git a/src/test/compile-fail-fulldeps/issue-18986.rs b/src/test/ui-fulldeps/issue-18986.rs similarity index 100% rename from src/test/compile-fail-fulldeps/issue-18986.rs rename to src/test/ui-fulldeps/issue-18986.rs diff --git a/src/test/ui-fulldeps/issue-18986.stderr b/src/test/ui-fulldeps/issue-18986.stderr new file mode 100644 index 0000000000000..241cc4250a38d --- /dev/null +++ b/src/test/ui-fulldeps/issue-18986.stderr @@ -0,0 +1,9 @@ +error[E0574]: expected struct, variant or union type, found trait `Trait` + --> $DIR/issue-18986.rs:18:9 + | +LL | Trait { x: 42 } => () //~ ERROR expected struct, variant or union type, found trait `Trait` + | ^^^^^ not a struct, variant or union type + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0574`. diff --git a/src/test/compile-fail-fulldeps/issue-48941.rs b/src/test/ui-fulldeps/issue-48941.rs similarity index 100% rename from src/test/compile-fail-fulldeps/issue-48941.rs rename to src/test/ui-fulldeps/issue-48941.rs diff --git a/src/test/ui-fulldeps/issue-48941.stderr b/src/test/ui-fulldeps/issue-48941.stderr new file mode 100644 index 0000000000000..606c51fc5004d --- /dev/null +++ b/src/test/ui-fulldeps/issue-48941.stderr @@ -0,0 +1,14 @@ +error: expected unsuffixed literal or identifier, found a + --> $DIR/issue-48941.rs:20:24 + | +LL | #[noop_attribute("hi", rank = a)] //~ ERROR expected unsuffixed literal or identifier, found a + | ^^^^ + +error: expected unsuffixed literal or identifier, found = + --> $DIR/issue-48941.rs:23:27 + | +LL | #[noop_attribute("/user", data= = " $DIR/lint-group-plugin-deny-cmdline.rs:18:1 + | +LL | fn lintme() { } //~ ERROR item is named 'lintme' + | ^^^^^^^^^^^^^^^ + | + = note: `-D test-lint` implied by `-D lint-me` + +error: item is named 'pleaselintme' + --> $DIR/lint-group-plugin-deny-cmdline.rs:20:1 + | +LL | fn pleaselintme() { } //~ ERROR item is named 'pleaselintme' + | ^^^^^^^^^^^^^^^^^^^^^ + | + = note: `-D please-lint` implied by `-D lint-me` + +error: aborting due to 2 previous errors + diff --git a/src/test/compile-fail-fulldeps/lint-plugin-deny-attr.rs b/src/test/ui-fulldeps/lint-plugin-deny-attr.rs similarity index 100% rename from src/test/compile-fail-fulldeps/lint-plugin-deny-attr.rs rename to src/test/ui-fulldeps/lint-plugin-deny-attr.rs diff --git a/src/test/ui-fulldeps/lint-plugin-deny-attr.stderr b/src/test/ui-fulldeps/lint-plugin-deny-attr.stderr new file mode 100644 index 0000000000000..e0ea1e0065a9e --- /dev/null +++ b/src/test/ui-fulldeps/lint-plugin-deny-attr.stderr @@ -0,0 +1,14 @@ +error: item is named 'lintme' + --> $DIR/lint-plugin-deny-attr.rs:18:1 + | +LL | fn lintme() { } //~ ERROR item is named 'lintme' + | ^^^^^^^^^^^^^^^ + | +note: lint level defined here + --> $DIR/lint-plugin-deny-attr.rs:16:9 + | +LL | #![deny(test_lint)] + | ^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail-fulldeps/lint-plugin-deny-cmdline.rs b/src/test/ui-fulldeps/lint-plugin-deny-cmdline.rs similarity index 100% rename from src/test/compile-fail-fulldeps/lint-plugin-deny-cmdline.rs rename to src/test/ui-fulldeps/lint-plugin-deny-cmdline.rs diff --git a/src/test/ui-fulldeps/lint-plugin-deny-cmdline.stderr b/src/test/ui-fulldeps/lint-plugin-deny-cmdline.stderr new file mode 100644 index 0000000000000..9084253b71e98 --- /dev/null +++ b/src/test/ui-fulldeps/lint-plugin-deny-cmdline.stderr @@ -0,0 +1,10 @@ +error: item is named 'lintme' + --> $DIR/lint-plugin-deny-cmdline.rs:18:1 + | +LL | fn lintme() { } //~ ERROR item is named 'lintme' + | ^^^^^^^^^^^^^^^ + | + = note: requested on the command line with `-D test-lint` + +error: aborting due to previous error + diff --git a/src/test/compile-fail-fulldeps/lint-plugin-forbid-cmdline.rs b/src/test/ui-fulldeps/lint-plugin-forbid-cmdline.rs similarity index 100% rename from src/test/compile-fail-fulldeps/lint-plugin-forbid-cmdline.rs rename to src/test/ui-fulldeps/lint-plugin-forbid-cmdline.rs diff --git a/src/test/ui-fulldeps/lint-plugin-forbid-cmdline.stderr b/src/test/ui-fulldeps/lint-plugin-forbid-cmdline.stderr new file mode 100644 index 0000000000000..30043db41da89 --- /dev/null +++ b/src/test/ui-fulldeps/lint-plugin-forbid-cmdline.stderr @@ -0,0 +1,19 @@ +error[E0453]: allow(test_lint) overruled by outer forbid(test_lint) + --> $DIR/lint-plugin-forbid-cmdline.rs:20:9 + | +LL | #[allow(test_lint)] //~ ERROR allow(test_lint) overruled by outer forbid(test_lint) + | ^^^^^^^^^ overruled by previous forbid + | + = note: `forbid` lint level was set on command line + +error: item is named 'lintme' + --> $DIR/lint-plugin-forbid-cmdline.rs:18:1 + | +LL | fn lintme() { } //~ ERROR item is named 'lintme' + | ^^^^^^^^^^^^^^^ + | + = note: requested on the command line with `-F test-lint` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0453`. diff --git a/src/test/compile-fail-fulldeps/macro-crate-doesnt-resolve.rs b/src/test/ui-fulldeps/macro-crate-doesnt-resolve.rs similarity index 100% rename from src/test/compile-fail-fulldeps/macro-crate-doesnt-resolve.rs rename to src/test/ui-fulldeps/macro-crate-doesnt-resolve.rs diff --git a/src/test/ui-fulldeps/macro-crate-doesnt-resolve.stderr b/src/test/ui-fulldeps/macro-crate-doesnt-resolve.stderr new file mode 100644 index 0000000000000..c45cfa9070f07 --- /dev/null +++ b/src/test/ui-fulldeps/macro-crate-doesnt-resolve.stderr @@ -0,0 +1,9 @@ +error[E0425]: cannot find function `foo` in module `macro_crate_test` + --> $DIR/macro-crate-doesnt-resolve.rs:17:23 + | +LL | macro_crate_test::foo(); //~ ERROR cannot find function `foo` in module `macro_crate_test` + | ^^^ not found in `macro_crate_test` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0425`. diff --git a/src/test/compile-fail-fulldeps/macro-crate-rlib.rs b/src/test/ui-fulldeps/macro-crate-rlib.rs similarity index 100% rename from src/test/compile-fail-fulldeps/macro-crate-rlib.rs rename to src/test/ui-fulldeps/macro-crate-rlib.rs diff --git a/src/test/ui-fulldeps/macro-crate-rlib.stderr b/src/test/ui-fulldeps/macro-crate-rlib.stderr new file mode 100644 index 0000000000000..8a7f7883a1088 --- /dev/null +++ b/src/test/ui-fulldeps/macro-crate-rlib.stderr @@ -0,0 +1,9 @@ +error[E0457]: plugin `rlib_crate_test` only found in rlib format, but must be available in dylib format + --> $DIR/macro-crate-rlib.rs:16:11 + | +LL | #![plugin(rlib_crate_test)] + | ^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0457`. diff --git a/src/test/compile-fail-fulldeps/macro-crate-unexported-macro.rs b/src/test/ui-fulldeps/macro-crate-unexported-macro.rs similarity index 100% rename from src/test/compile-fail-fulldeps/macro-crate-unexported-macro.rs rename to src/test/ui-fulldeps/macro-crate-unexported-macro.rs diff --git a/src/test/ui-fulldeps/macro-crate-unexported-macro.stderr b/src/test/ui-fulldeps/macro-crate-unexported-macro.stderr new file mode 100644 index 0000000000000..8d87c882a1ac4 --- /dev/null +++ b/src/test/ui-fulldeps/macro-crate-unexported-macro.stderr @@ -0,0 +1,8 @@ +error: cannot find macro `unexported_macro!` in this scope + --> $DIR/macro-crate-unexported-macro.rs:17:5 + | +LL | unexported_macro!(); + | ^^^^^^^^^^^^^^^^ help: you could try the macro: `exported_macro` + +error: aborting due to previous error + diff --git a/src/test/compile-fail-fulldeps/no-link-unknown-crate.rs b/src/test/ui-fulldeps/no-link-unknown-crate.rs similarity index 100% rename from src/test/compile-fail-fulldeps/no-link-unknown-crate.rs rename to src/test/ui-fulldeps/no-link-unknown-crate.rs diff --git a/src/test/ui-fulldeps/no-link-unknown-crate.stderr b/src/test/ui-fulldeps/no-link-unknown-crate.stderr new file mode 100644 index 0000000000000..182b484f80bfb --- /dev/null +++ b/src/test/ui-fulldeps/no-link-unknown-crate.stderr @@ -0,0 +1,9 @@ +error[E0463]: can't find crate for `doesnt_exist` + --> $DIR/no-link-unknown-crate.rs:12:1 + | +LL | extern crate doesnt_exist; //~ ERROR can't find crate + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ can't find crate + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0463`. diff --git a/src/test/compile-fail-fulldeps/plugin-as-extern-crate.rs b/src/test/ui-fulldeps/plugin-as-extern-crate.rs similarity index 100% rename from src/test/compile-fail-fulldeps/plugin-as-extern-crate.rs rename to src/test/ui-fulldeps/plugin-as-extern-crate.rs diff --git a/src/test/ui-fulldeps/plugin-as-extern-crate.stderr b/src/test/ui-fulldeps/plugin-as-extern-crate.stderr new file mode 100644 index 0000000000000..713f1b0734544 --- /dev/null +++ b/src/test/ui-fulldeps/plugin-as-extern-crate.stderr @@ -0,0 +1,14 @@ +error: compiler plugin used as an ordinary library + --> $DIR/plugin-as-extern-crate.rs:20:1 + | +LL | extern crate macro_crate_test; //~ ERROR compiler plugin used as an ordinary library + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +note: lint level defined here + --> $DIR/plugin-as-extern-crate.rs:17:9 + | +LL | #![deny(plugin_as_library)] + | ^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail-fulldeps/plugin-attr-register-deny.rs b/src/test/ui-fulldeps/plugin-attr-register-deny.rs similarity index 100% rename from src/test/compile-fail-fulldeps/plugin-attr-register-deny.rs rename to src/test/ui-fulldeps/plugin-attr-register-deny.rs diff --git a/src/test/ui-fulldeps/plugin-attr-register-deny.stderr b/src/test/ui-fulldeps/plugin-attr-register-deny.stderr new file mode 100644 index 0000000000000..0bb2d1c9f5ee0 --- /dev/null +++ b/src/test/ui-fulldeps/plugin-attr-register-deny.stderr @@ -0,0 +1,26 @@ +error: unused attribute + --> $DIR/plugin-attr-register-deny.rs:24:5 + | +LL | #[bar] + | ^^^^^^ + | +note: lint level defined here + --> $DIR/plugin-attr-register-deny.rs:16:9 + | +LL | #![deny(unused_attributes)] + | ^^^^^^^^^^^^^^^^^ + +error: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] + --> $DIR/plugin-attr-register-deny.rs:24:5 + | +LL | #[bar] + | ^^^^^^ + +error: unused attribute + --> $DIR/plugin-attr-register-deny.rs:21:1 + | +LL | #[foo] + | ^^^^^^ + +error: aborting due to 3 previous errors + diff --git a/src/test/compile-fail-fulldeps/plugin-plus-extern-crate.rs b/src/test/ui-fulldeps/plugin-plus-extern-crate.rs similarity index 100% rename from src/test/compile-fail-fulldeps/plugin-plus-extern-crate.rs rename to src/test/ui-fulldeps/plugin-plus-extern-crate.rs diff --git a/src/test/ui-fulldeps/plugin-plus-extern-crate.stderr b/src/test/ui-fulldeps/plugin-plus-extern-crate.stderr new file mode 100644 index 0000000000000..faefe04e14ab8 --- /dev/null +++ b/src/test/ui-fulldeps/plugin-plus-extern-crate.stderr @@ -0,0 +1,14 @@ +error: compiler plugin used as an ordinary library + --> $DIR/plugin-plus-extern-crate.rs:22:1 + | +LL | extern crate macro_crate_test; //~ ERROR compiler plugin used as an ordinary library + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +note: lint level defined here + --> $DIR/plugin-plus-extern-crate.rs:18:9 + | +LL | #![deny(plugin_as_library)] + | ^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail-fulldeps/qquote.rs b/src/test/ui-fulldeps/qquote.rs similarity index 100% rename from src/test/compile-fail-fulldeps/qquote.rs rename to src/test/ui-fulldeps/qquote.rs diff --git a/src/test/ui-fulldeps/qquote.stderr b/src/test/ui-fulldeps/qquote.stderr new file mode 100644 index 0000000000000..4c136ad4b787a --- /dev/null +++ b/src/test/ui-fulldeps/qquote.stderr @@ -0,0 +1,9 @@ +error[E0425]: cannot find value `abcd` in this scope + --> $DIR/qquote.rs:35:38 + | +LL | let expr = quote_expr!(&cx, 2 - $abcd + 7); //~ ERROR cannot find value `abcd` in this scope + | ^^^^ not found in this scope + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0425`. From 7a3d7b1828fcea5472f39fc33991eda17d2419b4 Mon Sep 17 00:00:00 2001 From: Vadim Petrochenkov Date: Sun, 2 Dec 2018 22:59:50 +0300 Subject: [PATCH 3/4] Move some tests from ui-fulldeps to ui --- .../ui-fulldeps/auxiliary/macro_reexport_1.rs | 15 --------------- .../auxiliary/pub_and_stability.rs | 0 .../auxiliary/use_from_trait_xc.rs | 0 .../{ui-fulldeps => ui}/explore-issue-38412.rs | 0 .../explore-issue-38412.stderr | 0 src/test/{ui-fulldeps => ui}/issue-18986.rs | 0 src/test/{ui-fulldeps => ui}/issue-18986.stderr | 0 .../{ui-fulldeps => ui}/no-link-unknown-crate.rs | 0 .../no-link-unknown-crate.stderr | 0 .../proc-macro/auxiliary/edition-imports-2015.rs | 0 .../proc-macro/edition-imports-2018.rs | 0 11 files changed, 15 deletions(-) delete mode 100644 src/test/ui-fulldeps/auxiliary/macro_reexport_1.rs rename src/test/{ui-fulldeps => ui}/auxiliary/pub_and_stability.rs (100%) rename src/test/{ui-fulldeps => ui}/auxiliary/use_from_trait_xc.rs (100%) rename src/test/{ui-fulldeps => ui}/explore-issue-38412.rs (100%) rename src/test/{ui-fulldeps => ui}/explore-issue-38412.stderr (100%) rename src/test/{ui-fulldeps => ui}/issue-18986.rs (100%) rename src/test/{ui-fulldeps => ui}/issue-18986.stderr (100%) rename src/test/{ui-fulldeps => ui}/no-link-unknown-crate.rs (100%) rename src/test/{ui-fulldeps => ui}/no-link-unknown-crate.stderr (100%) rename src/test/{ui-fulldeps => ui}/proc-macro/auxiliary/edition-imports-2015.rs (100%) rename src/test/{ui-fulldeps => ui}/proc-macro/edition-imports-2018.rs (100%) diff --git a/src/test/ui-fulldeps/auxiliary/macro_reexport_1.rs b/src/test/ui-fulldeps/auxiliary/macro_reexport_1.rs deleted file mode 100644 index aaeccc6e89883..0000000000000 --- a/src/test/ui-fulldeps/auxiliary/macro_reexport_1.rs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2014 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 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![crate_type = "dylib"] -#[macro_export] -macro_rules! reexported { - () => ( 3 ) -} diff --git a/src/test/ui-fulldeps/auxiliary/pub_and_stability.rs b/src/test/ui/auxiliary/pub_and_stability.rs similarity index 100% rename from src/test/ui-fulldeps/auxiliary/pub_and_stability.rs rename to src/test/ui/auxiliary/pub_and_stability.rs diff --git a/src/test/ui-fulldeps/auxiliary/use_from_trait_xc.rs b/src/test/ui/auxiliary/use_from_trait_xc.rs similarity index 100% rename from src/test/ui-fulldeps/auxiliary/use_from_trait_xc.rs rename to src/test/ui/auxiliary/use_from_trait_xc.rs diff --git a/src/test/ui-fulldeps/explore-issue-38412.rs b/src/test/ui/explore-issue-38412.rs similarity index 100% rename from src/test/ui-fulldeps/explore-issue-38412.rs rename to src/test/ui/explore-issue-38412.rs diff --git a/src/test/ui-fulldeps/explore-issue-38412.stderr b/src/test/ui/explore-issue-38412.stderr similarity index 100% rename from src/test/ui-fulldeps/explore-issue-38412.stderr rename to src/test/ui/explore-issue-38412.stderr diff --git a/src/test/ui-fulldeps/issue-18986.rs b/src/test/ui/issue-18986.rs similarity index 100% rename from src/test/ui-fulldeps/issue-18986.rs rename to src/test/ui/issue-18986.rs diff --git a/src/test/ui-fulldeps/issue-18986.stderr b/src/test/ui/issue-18986.stderr similarity index 100% rename from src/test/ui-fulldeps/issue-18986.stderr rename to src/test/ui/issue-18986.stderr diff --git a/src/test/ui-fulldeps/no-link-unknown-crate.rs b/src/test/ui/no-link-unknown-crate.rs similarity index 100% rename from src/test/ui-fulldeps/no-link-unknown-crate.rs rename to src/test/ui/no-link-unknown-crate.rs diff --git a/src/test/ui-fulldeps/no-link-unknown-crate.stderr b/src/test/ui/no-link-unknown-crate.stderr similarity index 100% rename from src/test/ui-fulldeps/no-link-unknown-crate.stderr rename to src/test/ui/no-link-unknown-crate.stderr diff --git a/src/test/ui-fulldeps/proc-macro/auxiliary/edition-imports-2015.rs b/src/test/ui/proc-macro/auxiliary/edition-imports-2015.rs similarity index 100% rename from src/test/ui-fulldeps/proc-macro/auxiliary/edition-imports-2015.rs rename to src/test/ui/proc-macro/auxiliary/edition-imports-2015.rs diff --git a/src/test/ui-fulldeps/proc-macro/edition-imports-2018.rs b/src/test/ui/proc-macro/edition-imports-2018.rs similarity index 100% rename from src/test/ui-fulldeps/proc-macro/edition-imports-2018.rs rename to src/test/ui/proc-macro/edition-imports-2018.rs From 3d809d3ab391c8313645891ade255f99b62877cc Mon Sep 17 00:00:00 2001 From: Vadim Petrochenkov Date: Sun, 2 Dec 2018 23:07:22 +0300 Subject: [PATCH 4/4] Remove compile-fail-fulldeps test suite --- src/bootstrap/builder.rs | 1 - src/bootstrap/test.rs | 6 ------ src/tools/tidy/src/features.rs | 9 +++------ 3 files changed, 3 insertions(+), 13 deletions(-) diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs index 079fdee7e8626..ab4a9967e2aa9 100644 --- a/src/bootstrap/builder.rs +++ b/src/bootstrap/builder.rs @@ -389,7 +389,6 @@ impl<'a> Builder<'a> { test::UiFullDeps, test::RunPassFullDeps, test::RunFailFullDeps, - test::CompileFailFullDeps, test::Rustdoc, test::Pretty, test::RunPassPretty, diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs index da827356800e9..31b6a83714498 100644 --- a/src/bootstrap/test.rs +++ b/src/bootstrap/test.rs @@ -833,12 +833,6 @@ host_test!(RunFailFullDeps { suite: "run-fail-fulldeps" }); -host_test!(CompileFailFullDeps { - path: "src/test/compile-fail-fulldeps", - mode: "compile-fail", - suite: "compile-fail-fulldeps" -}); - host_test!(Rustdoc { path: "src/test/rustdoc", mode: "rustdoc", diff --git a/src/tools/tidy/src/features.rs b/src/tools/tidy/src/features.rs index 85b123e4af51f..259a549c89d89 100644 --- a/src/tools/tidy/src/features.rs +++ b/src/tools/tidy/src/features.rs @@ -61,12 +61,9 @@ pub fn check(path: &Path, bad: &mut bool, quiet: bool) { let mut contents = String::new(); - super::walk_many(&[&path.join("test/ui-fulldeps"), - &path.join("test/ui"), - &path.join("test/compile-fail"), - &path.join("test/compile-fail-fulldeps"), - &path.join("test/parse-fail"), - &path.join("test/ui"),], + super::walk_many(&[&path.join("test/ui"), + &path.join("test/ui-fulldeps"), + &path.join("test/compile-fail")], &mut |path| super::filter_dirs(path), &mut |file| { let filename = file.file_name().unwrap().to_string_lossy();