Untitled diff

作成日 差分は期限切れになりません
2 削除
657
2 追加
657
From 552d971ea849519a743457cc52a16f8d11e57539 Mon Sep 17 00:00:00 2001
From 1864bf6a510a7e9df23777591f3389b6feb27e90 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jana=20D=C3=B6nszelmann?= <jana@donsz.nl>
From: =?UTF-8?q?Jana=20D=C3=B6nszelmann?= <jana@donsz.nl>
Date: Sat, 18 Oct 2025 11:25:13 +0200
Date: Sat, 18 Oct 2025 11:25:13 +0200
Subject: [PATCH 1/3] ICE when applying test to crate root
Subject: [PATCH 1/3] ICE when applying test to crate root


---
---
tests/crashes/114920.rs | 2 --
tests/crashes/114920.rs | 2 --
tests/ui/macros/test-on-crate-root.rs | 8 ++++++++
tests/ui/macros/test-on-crate-root.rs | 8 ++++++++
2 files changed, 8 insertions(+), 2 deletions(-)
2 files changed, 8 insertions(+), 2 deletions(-)
delete mode 100644 tests/crashes/114920.rs
delete mode 100644 tests/crashes/114920.rs
create mode 100644 tests/ui/macros/test-on-crate-root.rs
create mode 100644 tests/ui/macros/test-on-crate-root.rs


diff --git a/tests/crashes/114920.rs b/tests/crashes/114920.rs
diff --git a/tests/crashes/114920.rs b/tests/crashes/114920.rs
deleted file mode 100644
deleted file mode 100644
index 9aa7598e10fc3..0000000000000
index 9aa7598e10fc3..0000000000000
--- a/tests/crashes/114920.rs
--- a/tests/crashes/114920.rs
+++ /dev/null
+++ /dev/null
@@ -1,2 +0,0 @@
@@ -1,2 +0,0 @@
-//@ known-bug: #114920
-//@ known-bug: #114920
-#![core::prelude::v1::test]
-#![core::prelude::v1::test]
diff --git a/tests/ui/macros/test-on-crate-root.rs b/tests/ui/macros/test-on-crate-root.rs
diff --git a/tests/ui/macros/test-on-crate-root.rs b/tests/ui/macros/test-on-crate-root.rs
new file mode 100644
new file mode 100644
index 0000000000000..80635a458902d
index 0000000000000..80635a458902d
--- /dev/null
--- /dev/null
+++ b/tests/ui/macros/test-on-crate-root.rs
+++ b/tests/ui/macros/test-on-crate-root.rs
@@ -0,0 +1,8 @@
@@ -0,0 +1,8 @@
+// ICE when applying `#![test]` to the crate root,
+// ICE when applying `#![test]` to the crate root,
+// though only when specified with a full path. `#![test]` is not enough.
+// though only when specified with a full path. `#![test]` is not enough.
+// Fixes #114920
+// Fixes #114920
+#![core::prelude::v1::test]
+#![core::prelude::v1::test]
+
+
+
+
+
+
+fn main() {} // not important to reproduce the issue
+fn main() {} // not important to reproduce the issue


From 00b0d26f447d7c62a05414267984f7086a6df5f5 Mon Sep 17 00:00:00 2001
From 9dd3caeebefbb36f90ea13e5ec4b37048067ca59 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jana=20D=C3=B6nszelmann?= <jana@donsz.nl>
From: =?UTF-8?q?Jana=20D=C3=B6nszelmann?= <jana@donsz.nl>
Date: Sat, 18 Oct 2025 12:10:21 +0200
Date: Sat, 18 Oct 2025 12:10:21 +0200
Subject: [PATCH 2/3] only discard items with `#[test]` on it when target is
Subject: [PATCH 2/3] only discard items with `#[test]` on it when target is
valid
valid


---
---
compiler/rustc_builtin_macros/src/test.rs | 20 +-
compiler/rustc_builtin_macros/src/test.rs | 20 +-
.../ui/feature-gates/gating-of-test-attrs.rs | 48 +++
.../ui/feature-gates/gating-of-test-attrs.rs | 48 +++
.../feature-gates/gating-of-test-attrs.stderr | 181 +++++++++++
.../feature-gates/gating-of-test-attrs.stderr | 181 +++++++++++
.../issue-43106-gating-of-builtin-attrs.rs | 32 --
.../issue-43106-gating-of-builtin-attrs.rs | 32 --
...issue-43106-gating-of-builtin-attrs.stderr | 304 +++++++++---------
...issue-43106-gating-of-builtin-attrs.stderr | 304 +++++++++---------
tests/ui/macros/attr-empty-expr.rs | 11 -
tests/ui/macros/attr-empty-expr.rs | 11 -
tests/ui/macros/attr-empty-expr.stderr | 20 --
tests/ui/macros/attr-empty-expr.stderr | 20 --
tests/ui/macros/issue-111749.rs | 4 +-
tests/ui/macros/issue-111749.rs | 4 +-
tests/ui/macros/issue-111749.stderr | 16 +-
tests/ui/macros/issue-111749.stderr | 16 +-
tests/ui/macros/test-on-crate-root.rs | 3 +-
tests/ui/macros/test-on-crate-root.rs | 3 +-
tests/ui/macros/test-on-crate-root.stderr | 25 ++
tests/ui/macros/test-on-crate-root.stderr | 25 ++
11 files changed, 431 insertions(+), 233 deletions(-)
11 files changed, 431 insertions(+), 233 deletions(-)
create mode 100644 tests/ui/feature-gates/gating-of-test-attrs.rs
create mode 100644 tests/ui/feature-gates/gating-of-test-attrs.rs
create mode 100644 tests/ui/feature-gates/gating-of-test-attrs.stderr
create mode 100644 tests/ui/feature-gates/gating-of-test-attrs.stderr
delete mode 100644 tests/ui/macros/attr-empty-expr.rs
delete mode 100644 tests/ui/macros/attr-empty-expr.rs
delete mode 100644 tests/ui/macros/attr-empty-expr.stderr
delete mode 100644 tests/ui/macros/attr-empty-expr.stderr
create mode 100644 tests/ui/macros/test-on-crate-root.stderr
create mode 100644 tests/ui/macros/test-on-crate-root.stderr


diff --git a/compiler/rustc_builtin_macros/src/test.rs b/compiler/rustc_builtin_macros/src/test.rs
diff --git a/compiler/rustc_builtin_macros/src/test.rs b/compiler/rustc_builtin_macros/src/test.rs
index 532539f893aed..8f6244e418fdb 100644
index 532539f893aed..8f6244e418fdb 100644
--- a/compiler/rustc_builtin_macros/src/test.rs
--- a/compiler/rustc_builtin_macros/src/test.rs
+++ b/compiler/rustc_builtin_macros/src/test.rs
+++ b/compiler/rustc_builtin_macros/src/test.rs
@@ -34,10 +34,6 @@ pub(crate) fn expand_test_case(
@@ -34,10 +34,6 @@ pub(crate) fn expand_test_case(
check_builtin_macro_attribute(ecx, meta_item, sym::test_case);
check_builtin_macro_attribute(ecx, meta_item, sym::test_case);
warn_on_duplicate_attribute(ecx, &anno_item, sym::test_case);
warn_on_duplicate_attribute(ecx, &anno_item, sym::test_case);
- if !ecx.ecfg.should_test {
- if !ecx.ecfg.should_test {
- return vec![];
- return vec![];
- }
- }
-
-
let sp = ecx.with_def_site_ctxt(attr_sp);
let sp = ecx.with_def_site_ctxt(attr_sp);
let (mut item, is_stmt) = match anno_item {
let (mut item, is_stmt) = match anno_item {
Annotatable::Item(item) => (item, false),
Annotatable::Item(item) => (item, false),
@@ -54,6 +50,10 @@ pub(crate) fn expand_test_case(
@@ -54,6 +50,10 @@ pub(crate) fn expand_test_case(
}
}
};
};
+ if !ecx.ecfg.should_test {
+ if !ecx.ecfg.should_test {
+ return vec![];
+ return vec![];
+ }
+ }
+
+
// `#[test_case]` is valid on functions, consts, and statics. Only modify
// `#[test_case]` is valid on functions, consts, and statics. Only modify
// the item in those cases.
// the item in those cases.
match &mut item.kind {
match &mut item.kind {
@@ -113,11 +113,6 @@ pub(crate) fn expand_test_or_bench(
@@ -113,11 +113,6 @@ pub(crate) fn expand_test_or_bench(
item: Annotatable,
item: Annotatable,
is_bench: bool,
is_bench: bool,
) -> Vec<Annotatable> {
) -> Vec<Annotatable> {
- // If we're not in test configuration, remove the annotated item
- // If we're not in test configuration, remove the annotated item
- if !cx.ecfg.should_test {
- if !cx.ecfg.should_test {
- return vec![];
- return vec![];
- }
- }
-
-
let (item, is_stmt) = match item {
let (item, is_stmt) = match item {
Annotatable::Item(i) => (i, false),
Annotatable::Item(i) => (i, false),
Annotatable::Stmt(box ast::Stmt { kind: ast::StmtKind::Item(i), .. }) => (i, true),
Annotatable::Stmt(box ast::Stmt { kind: ast::StmtKind::Item(i), .. }) => (i, true),
@@ -136,6 +131,11 @@ pub(crate) fn expand_test_or_bench(
@@ -136,6 +131,11 @@ pub(crate) fn expand_test_or_bench(
};
};
};
};
+ // If we're not in test configuration, remove the annotated item
+ // If we're not in test configuration, remove the annotated item
+ if !cx.ecfg.should_test {
+ if !cx.ecfg.should_test {
+ return vec![];
+ return vec![];
+ }
+ }
+
+
if let Some(attr) = attr::find_by_name(&item.attrs, sym::naked) {
if let Some(attr) = attr::find_by_name(&item.attrs, sym::naked) {
cx.dcx().emit_err(errors::NakedFunctionTestingAttribute {
cx.dcx().emit_err(errors::NakedFunctionTestingAttribute {
testing_span: attr_sp,
testing_span: attr_sp,
@@ -407,7 +407,7 @@ pub(crate) fn expand_test_or_bench(
@@ -407,7 +407,7 @@ pub(crate) fn expand_test_or_bench(
fn not_testable_error(cx: &ExtCtxt<'_>, attr_sp: Span, item: Option<&ast::Item>) {
fn not_testable_error(cx: &ExtCtxt<'_>, attr_sp: Span, item: Option<&ast::Item>) {
let dcx = cx.dcx();
let dcx = cx.dcx();
- let msg = "the `#[test]` attribute may only be used on a non-associated function";
- let msg = "the `#[test]` attribute may only be used on a non-associated function";
+ let msg = "the `#[test]` attribute may only be used on a free function";
+ let msg = "the `#[test]` attribute may only be used on a free function";
let level = match item.map(|i| &i.kind) {
let level = match item.map(|i| &i.kind) {
// These were a warning before #92959 and need to continue being that to avoid breaking
// These were a warning before #92959 and need to continue being that to avoid breaking
// stable user code (#94508).
// stable user code (#94508).
diff --git a/tests/ui/feature-gates/gating-of-test-attrs.rs b/tests/ui/feature-gates/gating-of-test-attrs.rs
diff --git a/tests/ui/feature-gates/gating-of-test-attrs.rs b/tests/ui/feature-gates/gating-of-test-attrs.rs
new file mode 100644
new file mode 100644
index 0000000000000..22b0454e17410
index 0000000000000..22b0454e17410
--- /dev/null
--- /dev/null
+++ b/tests/ui/feature-gates/gating-of-test-attrs.rs
+++ b/tests/ui/feature-gates/gating-of-test-attrs.rs
@@ -0,0 +1,48 @@
@@ -0,0 +1,48 @@
+#![feature(test)]
+#![feature(test)]
+
+
+// test is a built-in macro, not a built-in attribute, but it kind of acts like both.
+// test is a built-in macro, not a built-in attribute, but it kind of acts like both.
+// check its target checking anyway here
+// check its target checking anyway here
+#[test]
+#[test]
+//~^ ERROR the `#[test]` attribute may only be used on a non-associated function
+//~^ ERROR the `#[test]` attribute may only be used on a non-associated function
+mod test {
+mod test {
+ mod inner { #![test] }
+ mod inner { #![test] }
+ //~^ ERROR inner macro attributes are unstable
+ //~^ ERROR inner macro attributes are unstable
+ //~| ERROR the `#[test]` attribute may only be used on a non-associated function
+ //~| ERROR the `#[test]` attribute may only be used on a non-associated function
+
+
+ #[test]
+ #[test]
+ //~^ ERROR the `#[test]` attribute may only be used on a non-associated function
+ //~^ ERROR the `#[test]` attribute may only be used on a non-associated function
+ struct S;
+ struct S;
+
+
+ #[test]
+ #[test]
+ //~^ ERROR the `#[test]` attribute may only be used on a non-associated function
+ //~^ ERROR the `#[test]` attribute may only be used on a non-associated function
+ type T = S;
+ type T = S;
+
+
+ #[test]
+ #[test]
+ //~^ ERROR the `#[test]` attribute may only be used on a non-associated function
+ //~^ ERROR the `#[test]` attribute may only be used on a non-associated function
+ impl S { }
+ impl S { }
+}
+}
+
+
+// At time of unit test authorship, if compiling without `--test` then
+// At time of unit test authorship, if compiling without `--test` then
+// non-crate-level #[bench] attributes seem to be ignored.
+// non-crate-level #[bench] attributes seem to be ignored.
+
+
+#[bench]
+#[bench]
+//~^ ERROR the `#[test]` attribute may only be used on a non-associated function
+//~^ ERROR the `#[test]` attribute may only be used on a non-associated function
+mod bench {
+mod bench {
+ mod inner { #![bench] }
+ mod inner { #![bench] }
+ //~^ ERROR inner macro attributes are unstable
+ //~^ ERROR inner macro attributes are unstable
+ //~| ERROR the `#[test]` attribute may only be used on a non-associated function
+ //~| ERROR the `#[test]` attribute may only be used on a non-associated function
+
+
+ #[bench]
+ #[bench]
+ //~^ ERROR the `#[test]` attribute may only be used on a non-associated function
+ //~^ ERROR the `#[test]` attribute may only be used on a non-associated function
+ struct S;
+ struct S;
+
+
+ #[bench]
+ #[bench]
+ //~^ ERROR the `#[test]` attribute may only be used on a non-associated function
+ //~^ ERROR the `#[test]` attribute may only be used on a non-associated function
+ type T = S;
+ type T = S;
+
+
+ #[bench]
+ #[bench]
+ //~^ ERROR the `#[test]` attribute may only be used on a non-associated function
+ //~^ ERROR the `#[test]` attribute may only be used on a non-associated function
+ impl S { }
+ impl S { }
+}
+}
+
+
+fn main() {}
+fn main() {}
diff --git a/tests/ui/feature-gates/gating-of-test-attrs.stderr b/tests/ui/feature-gates/gating-of-test-attrs.stderr
diff --git a/tests/ui/feature-gates/gating-of-test-attrs.stderr b/tests/ui/feature-gates/gating-of-test-attrs.stderr
new file mode 100644
new file mode 100644
index 0000000000000..339a68f5d5e48
index 0000000000000..339a68f5d5e48
--- /dev/null
--- /dev/null
+++ b/tests/ui/feature-gates/gating-of-test-attrs.stderr
+++ b/tests/ui/feature-gates/gating-of-test-attrs.stderr
@@ -0,0 +1,181 @@
@@ -0,0 +1,181 @@
+error: the `#[test]` attribute may only be used on a non-associated function
+error: the `#[test]` attribute may only be used on a non-associated function
+ --> $DIR/gating-of-test-attrs.rs:5:1
+ --> $DIR/gating-of-test-attrs.rs:5:1
+ |
+ |
+LL | #[test]
+LL | #[test]
+ | ^^^^^^^ the `#[test]` macro causes a function to be run as a test and has no effect on non-functions
+ | ^^^^^^^ the `#[test]` macro causes a function to be run as a test and has no effect on non-functions
+LL |
+LL |
+LL | / mod test {
+LL | / mod test {
+LL | | mod inner { #![test] }
+LL | | mod inner { #![test] }
+... |
+... |
+LL | | impl S { }
+LL | | impl S { }
+LL | | }
+LL | | }
+ | |_- expected a non-associated function, found a module
+ | |_- expected a non-associated function, found a module
+ |
+ |
+help: replace with conditional compilation to make the item only exist when tests are being run
+help: replace with conditional compilation to make the item only exist when tests are being run
+ |
+ |
+LL - #[test]
+LL - #[test]
+LL + #[cfg(test)]
+LL + #[cfg(test)]
+ |
+ |
+
+
+error[E0658]: inner macro attributes are unstable
+error[E0658]: inner macro attributes are unstable
+ --> $DIR/gating-of-test-attrs.rs:8:20
+ --> $DIR/gating-of-test-attrs.rs:8:20
+ |
+ |
+LL | mod inner { #![test] }
+LL | mod inner { #![test] }
+ | ^^^^
+ | ^^^^
+ |
+ |
+ = note: see issue #54726 <https://github.com/rust-lang/rust/issues/54726> for more information
+ = note: see issue #54726 <https://github.com/rust-lang/rust/issues/54726> for more information
+ = help: add `#![feature(custom_inner_attributes)]` to the crate attributes to enable
+ = help: add `#![feature(custom_inner_attributes)]` to the crate attributes to enable
+ = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
+ = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
+
+
+error: the `#[test]` attribute may only be used on a non-associated function
+error: the `#[test]` attribute may only be used on a non-associated function
+ --> $DIR/gating-of-test-attrs.rs:8:17
+ --> $DIR/gating-of-test-attrs.rs:8:17
+ |
+ |
+LL | mod inner { #![test] }
+LL | mod inner { #![test] }
+ | ------------^^^^^^^^--
+ | ------------^^^^^^^^--
+ | | |
+ | | |
+ | | the `#[test]` macro causes a function to be run as a test and has no effect on non-functions
+ | | the `#[test]` macro causes a function to be run as a test and has no effect on non-functions
+ | expected a non-associated function, found a module
+ | expected a non-associated function, found a module
+ |
+ |
+help: replace with conditional compilation to make the item only exist when tests are being run
+help: replace with conditional compilation to make the item only exist when tests are being run
+ |
+ |
+LL - mod inner { #![test] }
+LL - mod inner { #![test] }
+LL + mod inner { #[cfg(test)] }
+LL + mod inner { #[cfg(test)] }
+ |
+ |
+
+
+error: the `#[test]` attribute may only be used on a non-associated function
+error: the `#[test]` attribute may only be used on a non-associated function
+ --> $DIR/gating-of-test-attrs.rs:12:5
+ --> $DIR/gating-of-test-attrs.rs:12:5
+ |
+ |
+LL | #[test]
+LL | #[test]
+ | ^^^^^^^ the `#[test]` macro causes a function to be run as a test and has no effect on non-functions
+ | ^^^^^^^ the `#[test]` macro causes a function to be run as a test and has no effect on non-functions
+LL |
+LL |
+LL | struct S;
+LL | struct S;
+ | --------- expected a non-associated function, found a struct
+ | --------- expected a non-associated function, found a struct
+ |
+ |
+help: replace with conditional compilation to make the item only exist when tests are being run
+help: replace with conditional compilation to make the item only exist when tests are being run
+ |
+ |
+LL - #[test]
+LL - #[test]
+LL + #[cfg(test)]
+LL + #[cfg(test)]
+ |
+ |
+
+
+error: the `#[test]` attribute may only be used on a non-associated function
+error: the `#[test]` attribute may only be used on a non-associated function
+ --> $DIR/gating-of-test-attrs.rs:16:5
+ --> $DIR/gating-of-test-attrs.rs:16:5
+ |
+ |
+LL | #[test]
+LL | #[test]
+ | ^^^^^^^ the `#[test]` macro causes a function to be run as a test and has no effect on non-functions
+ | ^^^^^^^ the `#[test]` macro causes a function to be run as a test and has no effect on non-functions
+LL |
+LL |
+LL | type T = S;
+LL | type T = S;
+ | ----------- expected a non-associated function, found a type alias
+ | ----------- expected a non-associated function, found a type alias
+ |
+ |
+help: replace with conditional compilation to make the item only exist when tests are being run
+help: replace with conditional compilation to make the item only exist when tests are being run
+ |
+ |
+LL - #[test]
+LL - #[test]
+LL + #[cfg(test)]
+LL + #[cfg(test)]
+ |
+ |
+
+
+error: the `#[test]` attribute may only be used on a non-associated function
+error: the `#[test]` attribute may only be used on a non-associated function
+ --> $DIR/gating-of-test-attrs.rs:20:5
+ --> $DIR/gating-of-test-attrs.rs:20:5
+ |
+ |
+LL | #[test]
+LL | #[test]
+ | ^^^^^^^ the `#[test]` macro causes a function to be run as a test and has no effect on non-functions
+ | ^^^^^^^ the `#[test]` macro causes a function to be run as a test and has no effect on non-functions
+LL |
+LL |
+LL | impl S { }
+LL | impl S { }
+ | ---------- expected a non-associated function, found an implementation
+ | ---------- expected a non-associated function, found an implementation
+ |
+ |
+help: replace with conditional compilation to make the item only exist when tests are being run
+help: replace with conditional compilation to make the item only exist when tests are being run
+ |
+ |
+LL - #[test]
+LL - #[test]
+LL + #[cfg(test)]
+LL + #[cfg(test)]
+ |
+ |
+
+
+error: the `#[test]` attribute may only be used on a non-associated function
+error: the `#[test]` attribute may only be used on a non-associated function
+ --> $DIR/gating-of-test-attrs.rs:28:1
+ --> $DIR/gating-of-test-attrs.rs:28:1
+ |
+ |
+LL | #[bench]
+LL | #[bench]
+ | ^^^^^^^^ the `#[test]` macro causes a function to be run as a test and has no effect on non-functions
+ | ^^^^^^^^ the `#[test]` macro causes a function to be run as a test and has no effect on non-functions
+LL |
+LL |
+LL | / mod bench {
+LL | / mod bench {
+LL | | mod inner { #![bench] }
+LL | | mod inner { #![bench] }
+... |
+... |
+LL | | impl S { }
+LL | | impl S { }
+LL | | }
+LL | | }
+ | |_- expected a non-associated function, found a module
+ | |_- expected a non-associated function, found a module
+ |
+ |
+help: replace with conditional compilation to make the item only exist when tests are being run
+help: replace with conditional compilation to make the item only exist when tests are being run
+ |
+ |
+LL - #[bench]
+LL - #[bench]
+LL + #[cfg(test)]
+LL + #[cfg(test)]
+ |
+ |
+
+
+error[E0658]: inner macro attributes are unstable
+error[E0658]: inner macro attributes are unstable
+ --> $DIR/gating-of-test-attrs.rs:31:20
+ --> $DIR/gating-of-test-attrs.rs:31:20
+ |
+ |
+LL | mod inner { #![bench] }
+LL | mod inner { #![bench] }
+ | ^^^^^
+ | ^^^^^
+ |
+ |
+ = note: see issue #54726 <https://github.com/rust-lang/rust/issues/54726> for more information
+ = note: see issue #54726 <https://github.com/rust-lang/rust/issues/54726> for more information
+ = help: add `#![feature(custom_inner_attributes)]` to the crate attributes to enable
+ = help: add `#![feature(custom_inner_attributes)]` to the crate attributes to enable
+ = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
+ = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
+
+
+error: the `#[test]` attribute may only be used on a non-associated function
+error: the `#[test]` attribute may only be used on a non-associated function
+ --> $DIR/gating-of-test-attrs.rs:31:17
+ --> $DIR/gating-of-test-attrs.rs:31:17
+ |
+ |
+LL | mod inner { #![bench] }
+LL | mod inner { #![bench] }
+ | ------------^^^^^^^^^--
+ | ------------^^^^^^^^^--
+ | | |
+ | | |
+ | | the `#[test]` macro causes a function to be run as a test and has no effect on non-functions
+ | | the `#[test]` macro causes a function to be run as a test and has no effect on non-functions
+ | expected a non-associated function, found a module
+ | expected a non-associated function, found a module
+ |
+ |
+help: replace with conditional compilation to make the item only exist when tests are being run
+help: replace with conditional compilation to make the item only exist when tests are being run
+ |
+ |
+LL - mod inner { #![bench] }
+LL - mod inner { #![bench] }
+LL + mod inner { #[cfg(test)] }
+LL + mod inner { #[cfg(test)] }
+ |
+ |
+
+
+error: the `#[test]` attribute may only be used on a non-associated function
+error: the `#[test]` attribute may only be used on a non-associated function
+ --> $DIR/gating-of-test-attrs.rs:35:5
+ --> $DIR/gating-of-test-attrs.rs:35:5
+ |
+ |
+LL | #[bench]
+LL | #[bench]
+ | ^^^^^^^^ the `#[test]` macro causes a function to be run as a test and has no effect on non-functions
+ | ^^^^^^^^ the `#[test]` macro causes a function to be run as a test and has no effect on non-functions
+LL |
+LL |
+LL | struct S;
+LL | struct S;
+ | --------- expected a non-associated function, found a struct
+ | --------- expected a non-associated function, found a struct
+ |
+ |
+help: replace with conditional compilation to make the item only exist when tests are being run
+help: replace with conditional compilation to make the item only exist when tests are being run
+ |
+ |
+LL - #[bench]
+LL - #[bench]
+LL + #[cfg(test)]
+LL + #[cfg(test)]
+ |
+ |
+
+
+error: the `#[test]` attribute may only be used on a non-associated function
+error: the `#[test]` attribute may only be used on a non-associated function
+ --> $DIR/gating-of-test-attrs.rs:39:5
+ --> $DIR/gating-of-test-attrs.rs:39:5
+ |
+ |
+LL | #[bench]
+LL | #[bench]
+ | ^^^^^^^^ the `#[test]` macro causes a function to be run as a test and has no effect on non-functions
+ | ^^^^^^^^ the `#[test]` macro causes a function to be run as a test and has no effect on non-functions
+LL |
+LL |
+LL | type T = S;
+LL | type T = S;
+ | ----------- expected a non-associated function, found a type alias
+ | ----------- expected a non-associated function, found a type alias
+ |
+ |
+help: replace with conditional compilation to make the item only exist when tests are being run
+help: replace with conditional compilation to make the item only exist when tests are being run
+ |
+ |
+LL - #[bench]
+LL - #[bench]
+LL + #[cfg(test)]
+LL + #[cfg(test)]
+ |
+ |
+
+
+error: the `#[test]` attribute may only be used on a non-associated function
+error: the `#[test]` attribute may only be used on a non-associated function
+ --> $DIR/gating-of-test-attrs.rs:43:5
+ --> $DIR/gating-of-test-attrs.rs:43:5
+ |
+ |
+LL | #[bench]
+LL | #[bench]
+ | ^^^^^^^^ the `#[test]` macro causes a function to be run as a test and has no effect on non-functions
+ | ^^^^^^^^ the `#[test]` macro causes a function to be run as a test and has no effect on non-functions
+LL |
+LL |
+LL | impl S { }
+LL | impl S { }
+ | ---------- expected a non-associated function, found an implementation
+ | ---------- expected a non-associated function, found an implementation
+ |
+ |
+help: replace with conditional compilation to make the item only exist when tests are being run
+help: replace with conditional compilation to make the item only exist when tests are being run
+ |
+ |
+LL - #[bench]
+LL - #[bench]
+LL + #[cfg(test)]
+LL + #[cfg(test)]
+ |
+ |
+
+
+error: aborting due to 12 previous errors
+error: aborting due to 12 previous errors
+
+
+For more information about this error, try `rustc --explain E0658`.
+For more information about this error, try `rustc --explain E0658`.
diff --git a/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs b/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs
diff --git a/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs b/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs
index 8d67bf37279df..5b32c5ca0dfa5 100644
index 8d67bf37279df..5b32c5ca0dfa5 100644
--- a/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs
--- a/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs
+++ b/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs
+++ b/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs
@@ -250,38 +250,6 @@ mod macro_export {
@@ -250,38 +250,6 @@ mod macro_export {
//~| HELP remove the attribute
//~| HELP remove the attribute
}
}
-// At time of unit test authorship, if compiling without `--test` then
-// At time of unit test authorship, if compiling without `--test` then
-// non-crate-level #[test] attributes seem to be ignored.
-// non-crate-level #[test] attributes seem to be ignored.
-
-
-#[test]
-#[test]
-mod test { mod inner { #![test] }
-mod test { mod inner { #![test] }
-
-
- fn f() { }
- fn f() { }
-
-
- struct S;
- struct S;
-
-
- type T = S;
- type T = S;
-
-
- impl S { }
- impl S { }
-}
-}
-
-
-// At time of unit test authorship, if compiling without `--test` then
-// At time of unit test authorship, if compiling without `--test` then
-// non-crate-level #[bench] attributes seem to be ignored.
-// non-crate-level #[bench] attributes seem to be ignored.
-
-
-#[bench]
-#[bench]
-mod bench {
-mod bench {
- mod inner { #![bench] }
- mod inner { #![bench] }
-
-
- #[bench]
- #[bench]
- struct S;
- struct S;
-
-
- #[bench]
- #[bench]
- type T = S;
- type T = S;
-
-
- #[bench]
- #[bench]
- impl S { }
- impl S { }
-}
-}
-
-
#[path = "3800"]
#[path = "3800"]
mod path {
mod path {
mod inner { #![path="3800"] }
mod inner { #![path="3800"] }
diff --git a/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.stderr b/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.stderr
diff --git a/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.stderr b/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.stderr
index f7e8d9c7c4001..d8b1dc91acc4f 100644
index f7e8d9c7c4001..d8b1dc91acc4f 100644
--- a/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.stderr
--- a/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.stderr
+++ b/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.stderr
+++ b/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.stderr
@@ -1,5 +1,5 @@
@@ -1,5 +1,5 @@
warning: `#[macro_escape]` is a deprecated synonym for `#[macro_use]`
warning: `#[macro_escape]` is a deprecated synonym for `#[macro_use]`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:529:17
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:529:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:497:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:497:17
|
|
LL | mod inner { #![macro_escape] }
LL | mod inner { #![macro_escape] }
| ^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^
@@ -7,7 +7,7 @@ LL | mod inner { #![macro_escape] }
@@ -7,7 +7,7 @@ LL | mod inner { #![macro_escape] }
= help: try an outer attribute: `#[macro_use]`
= help: try an outer attribute: `#[macro_use]`
warning: `#[macro_escape]` is a deprecated synonym for `#[macro_use]`
warning: `#[macro_escape]` is a deprecated synonym for `#[macro_use]`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:526:1
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:526:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:494:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:494:1
|
|
LL | #[macro_escape]
LL | #[macro_escape]
| ^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^
@@ -187,7 +187,7 @@ LL | #[deny(x5100)] impl S { }
@@ -187,7 +187,7 @@ LL | #[deny(x5100)] impl S { }
| ^^^^^
| ^^^^^
warning: crate-level attribute should be an inner attribute
warning: crate-level attribute should be an inner attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:501:1
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:501:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:469:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:469:1
|
|
LL | #[reexport_test_harness_main = "2900"]
LL | #[reexport_test_harness_main = "2900"]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -203,7 +203,7 @@ LL | #![reexport_test_harness_main = "2900"]
@@ -203,7 +203,7 @@ LL | #![reexport_test_harness_main = "2900"]
| +
| +
warning: attribute should be applied to an `extern` block with non-Rust ABI
warning: attribute should be applied to an `extern` block with non-Rust ABI
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:739:1
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:739:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:707:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:707:1
|
|
LL | #[link(name = "x")]
LL | #[link(name = "x")]
| ^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^
@@ -219,7 +219,7 @@ LL | | }
@@ -219,7 +219,7 @@ LL | | }
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: crate-level attribute should be an inner attribute
warning: crate-level attribute should be an inner attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:865:1
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:865:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:833:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:833:1
|
|
LL | #[crate_type = "0800"]
LL | #[crate_type = "0800"]
| ^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^
@@ -230,7 +230,7 @@ LL | #![crate_type = "0800"]
@@ -230,7 +230,7 @@ LL | #![crate_type = "0800"]
| +
| +
warning: crate-level attribute should be an inner attribute
warning: crate-level attribute should be an inner attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:889:1
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:889:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:857:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:857:1
|
|
LL | #[feature(x0600)]
LL | #[feature(x0600)]
| ^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^
@@ -241,7 +241,7 @@ LL | #![feature(x0600)]
@@ -241,7 +241,7 @@ LL | #![feature(x0600)]
| +
| +
warning: crate-level attribute should be an inner attribute
warning: crate-level attribute should be an inner attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:914:1
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:914:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:882:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:882:1
|
|
LL | #[no_main]
LL | #[no_main]
| ^^^^^^^^^^
| ^^^^^^^^^^
@@ -252,7 +252,7 @@ LL | #![no_main]
@@ -252,7 +252,7 @@ LL | #![no_main]
| +
| +
warning: crate-level attribute should be an inner attribute
warning: crate-level attribute should be an inner attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:938:1
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:938:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:906:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:906:1
|
|
LL | #[no_builtins]
LL | #[no_builtins]
| ^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^
@@ -279,13 +279,13 @@ LL | #![feature(rust1)]
@@ -279,13 +279,13 @@ LL | #![feature(rust1)]
= note: `#[warn(stable_features)]` on by default
= note: `#[warn(stable_features)]` on by default
warning: crate-level attribute should be in the root module
warning: crate-level attribute should be in the root module
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:505:17
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:505:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:473:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:473:17
|
|
LL | mod inner { #![reexport_test_harness_main="2900"] }
LL | mod inner { #![reexport_test_harness_main="2900"] }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute
warning: crate-level attribute should be an inner attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:508:5
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:508:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:476:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:476:5
|
|
LL | #[reexport_test_harness_main = "2900"] fn f() { }
LL | #[reexport_test_harness_main = "2900"] fn f() { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -296,7 +296,7 @@ LL | #![reexport_test_harness_main = "2900"] fn f() { }
@@ -296,7 +296,7 @@ LL | #![reexport_test_harness_main = "2900"] fn f() { }
| +
| +
warning: crate-level attribute should be an inner attribute
warning: crate-level attribute should be an inner attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:512:5
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:512:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:480:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:480:5
|
|
LL | #[reexport_test_harness_main = "2900"] struct S;
LL | #[reexport_test_harness_main = "2900"] struct S;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -307,7 +307,7 @@ LL | #![reexport_test_harness_main = "2900"] struct S;
@@ -307,7 +307,7 @@ LL | #![reexport_test_harness_main = "2900"] struct S;
| +
| +
warning: crate-level attribute should be an inner attribute
warning: crate-level attribute should be an inner attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:516:5
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:516:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:484:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:484:5
|
|
LL | #[reexport_test_harness_main = "2900"] type T = S;
LL | #[reexport_test_harness_main = "2900"] type T = S;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -318,7 +318,7 @@ LL | #![reexport_test_harness_main = "2900"] type T = S;
@@ -318,7 +318,7 @@ LL | #![reexport_test_harness_main = "2900"] type T = S;
| +
| +
warning: crate-level attribute should be an inner attribute
warning: crate-level attribute should be an inner attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:520:5
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:520:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:488:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:488:5
|
|
LL | #[reexport_test_harness_main = "2900"] impl S { }
LL | #[reexport_test_harness_main = "2900"] impl S { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -329,7 +329,7 @@ LL | #![reexport_test_harness_main = "2900"] impl S { }
@@ -329,7 +329,7 @@ LL | #![reexport_test_harness_main = "2900"] impl S { }
| +
| +
warning: attribute should be applied to an `extern` block with non-Rust ABI
warning: attribute should be applied to an `extern` block with non-Rust ABI
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:745:17
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:745:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:713:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:713:17
|
|
LL | mod inner { #![link(name = "x")] }
LL | mod inner { #![link(name = "x")] }
| ------------^^^^^^^^^^^^^^^^^^^^-- not an `extern` block
| ------------^^^^^^^^^^^^^^^^^^^^-- not an `extern` block
@@ -337,7 +337,7 @@ LL | mod inner { #![link(name = "x")] }
@@ -337,7 +337,7 @@ LL | mod inner { #![link(name = "x")] }
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: attribute should be applied to an `extern` block with non-Rust ABI
warning: attribute should be applied to an `extern` block with non-Rust ABI
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:750:5
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:750:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:718:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:718:5
|
|
LL | #[link(name = "x")] fn f() { }
LL | #[link(name = "x")] fn f() { }
| ^^^^^^^^^^^^^^^^^^^ ---------- not an `extern` block
| ^^^^^^^^^^^^^^^^^^^ ---------- not an `extern` block
@@ -345,7 +345,7 @@ LL | #[link(name = "x")] fn f() { }
@@ -345,7 +345,7 @@ LL | #[link(name = "x")] fn f() { }
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: attribute should be applied to an `extern` block with non-Rust ABI
warning: attribute should be applied to an `extern` block with non-Rust ABI
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:755:5
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:755:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:723:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:723:5
|
|
LL | #[link(name = "x")] struct S;
LL | #[link(name = "x")] struct S;
| ^^^^^^^^^^^^^^^^^^^ --------- not an `extern` block
| ^^^^^^^^^^^^^^^^^^^ --------- not an `extern` block
@@ -353,7 +353,7 @@ LL | #[link(name = "x")] struct S;
@@ -353,7 +353,7 @@ LL | #[link(name = "x")] struct S;
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: attribute should be applied to an `extern` block with non-Rust ABI
warning: attribute should be applied to an `extern` block with non-Rust ABI
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:760:5
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:760:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:728:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:728:5
|
|
LL | #[link(name = "x")] type T = S;
LL | #[link(name = "x")] type T = S;
| ^^^^^^^^^^^^^^^^^^^ ----------- not an `extern` block
| ^^^^^^^^^^^^^^^^^^^ ----------- not an `extern` block
@@ -361,7 +361,7 @@ LL | #[link(name = "x")] type T = S;
@@ -361,7 +361,7 @@ LL | #[link(name = "x")] type T = S;
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: attribute should be applied to an `extern` block with non-Rust ABI
warning: attribute should be applied to an `extern` block with non-Rust ABI
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:765:5
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:765:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:733:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:733:5
|
|
LL | #[link(name = "x")] impl S { }
LL | #[link(name = "x")] impl S { }
| ^^^^^^^^^^^^^^^^^^^ ---------- not an `extern` block
| ^^^^^^^^^^^^^^^^^^^ ---------- not an `extern` block
@@ -369,7 +369,7 @@ LL | #[link(name = "x")] impl S { }
@@ -369,7 +369,7 @@ LL | #[link(name = "x")] impl S { }
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: attribute should be applied to an `extern` block with non-Rust ABI
warning: attribute should be applied to an `extern` block with non-Rust ABI
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:770:5
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:770:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:738:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:738:5
|
|
LL | #[link(name = "x")] extern "Rust" {}
LL | #[link(name = "x")] extern "Rust" {}
| ^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^
@@ -377,13 +377,13 @@ LL | #[link(name = "x")] extern "Rust" {}
@@ -377,13 +377,13 @@ LL | #[link(name = "x")] extern "Rust" {}
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: crate-level attribute should be in the root module
warning: crate-level attribute should be in the root module
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:869:17
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:869:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:837:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:837:17
|
|
LL | mod inner { #![crate_type="0800"] }
LL | mod inner { #![crate_type="0800"] }
| ^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute
warning: crate-level attribute should be an inner attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:872:5
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:872:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:840:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:840:5
|
|
LL | #[crate_type = "0800"] fn f() { }
LL | #[crate_type = "0800"] fn f() { }
| ^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^
@@ -394,7 +394,7 @@ LL | #![crate_type = "0800"] fn f() { }
@@ -394,7 +394,7 @@ LL | #![crate_type = "0800"] fn f() { }
| +
| +
warning: crate-level attribute should be an inner attribute
warning: crate-level attribute should be an inner attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:876:5
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:876:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:844:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:844:5
|
|
LL | #[crate_type = "0800"] struct S;
LL | #[crate_type = "0800"] struct S;
| ^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^
@@ -405,7 +405,7 @@ LL | #![crate_type = "0800"] struct S;
@@ -405,7 +405,7 @@ LL | #![crate_type = "0800"] struct S;
| +
| +
warning: crate-level attribute should be an inner attribute
warning: crate-level attribute should be an inner attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:880:5
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:880:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:848:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:848:5
|
|
LL | #[crate_type = "0800"] type T = S;
LL | #[crate_type = "0800"] type T = S;
| ^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^
@@ -416,7 +416,7 @@ LL | #![crate_type = "0800"] type T = S;
@@ -416,7 +416,7 @@ LL | #![crate_type = "0800"] type T = S;
| +
| +
warning: crate-level attribute should be an inner attribute
warning: crate-level attribute should be an inner attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:884:5
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:884:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:852:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:852:5
|
|
LL | #[crate_type = "0800"] impl S { }
LL | #[crate_type = "0800"] impl S { }
| ^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^
@@ -427,13 +427,13 @@ LL | #![crate_type = "0800"] impl S { }
@@ -427,13 +427,13 @@ LL | #![crate_type = "0800"] impl S { }
| +
| +
warning: crate-level attribute should be in the root module
warning: crate-level attribute should be in the root module
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:893:17
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:893:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:861:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:861:17
|
|
LL | mod inner { #![feature(x0600)] }
LL | mod inner { #![feature(x0600)] }
| ^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute
warning: crate-level attribute should be an inner attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:896:5
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:896:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:864:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:864:5
|
|
LL | #[feature(x0600)] fn f() { }
LL | #[feature(x0600)] fn f() { }
| ^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^
@@ -444,7 +444,7 @@ LL | #![feature(x0600)] fn f() { }
@@ -444,7 +444,7 @@ LL | #![feature(x0600)] fn f() { }
| +
| +
warning: crate-level attribute should be an inner attribute
warning: crate-level attribute should be an inner attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:900:5
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:900:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:868:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:868:5
|
|
LL | #[feature(x0600)] struct S;
LL | #[feature(x0600)] struct S;
| ^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^
@@ -455,7 +455,7 @@ LL | #![feature(x0600)] struct S;
@@ -455,7 +455,7 @@ LL | #![feature(x0600)] struct S;
| +
| +
warning: crate-level attribute should be an inner attribute
warning: crate-level attribute should be an inner attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:904:5
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:904:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:872:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:872:5
|
|
LL | #[feature(x0600)] type T = S;
LL | #[feature(x0600)] type T = S;
| ^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^
@@ -466,7 +466,7 @@ LL | #![feature(x0600)] type T = S;
@@ -466,7 +466,7 @@ LL | #![feature(x0600)] type T = S;
| +
| +
warning: crate-level attribute should be an inner attribute
warning: crate-level attribute should be an inner attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:908:5
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:908:5
+ --> $DIR/issue-43106-gating-of-builtin-att
+ --> $DIR/issue-43106-gating-of-builtin-att