summaryrefslogtreecommitdiffstats
path: root/tests/ui/feature-gates
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 18:31:44 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 18:31:44 +0000
commitc23a457e72abe608715ac76f076f47dc42af07a5 (patch)
tree2772049aaf84b5c9d0ed12ec8d86812f7a7904b6 /tests/ui/feature-gates
parentReleasing progress-linux version 1.73.0+dfsg1-1~progress7.99u1. (diff)
downloadrustc-c23a457e72abe608715ac76f076f47dc42af07a5.tar.xz
rustc-c23a457e72abe608715ac76f076f47dc42af07a5.zip
Merging upstream version 1.74.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--tests/ui/feature-gates/feature-gate-adt_const_params.stderr2
-rw-r--r--tests/ui/feature-gates/feature-gate-coverage-attribute.rs14
-rw-r--r--tests/ui/feature-gates/feature-gate-coverage-attribute.stderr21
-rw-r--r--tests/ui/feature-gates/feature-gate-no_coverage.rs13
-rw-r--r--tests/ui/feature-gates/feature-gate-no_coverage.stderr12
-rw-r--r--tests/ui/feature-gates/feature-gate-proc_macro_byte_character.rs10
-rw-r--r--tests/ui/feature-gates/feature-gate-proc_macro_byte_character.stderr12
-rw-r--r--tests/ui/feature-gates/feature-gate-type_privacy_lints.rs6
-rw-r--r--tests/ui/feature-gates/feature-gate-type_privacy_lints.stderr70
-rw-r--r--tests/ui/feature-gates/feature-gate-unnamed_fields.rs26
-rw-r--r--tests/ui/feature-gates/feature-gate-unnamed_fields.stderr84
-rw-r--r--tests/ui/feature-gates/print-with-path.cfg.stderr2
-rw-r--r--tests/ui/feature-gates/print-with-path.rs7
-rw-r--r--tests/ui/feature-gates/print-with-path.target-cpus.stderr2
-rw-r--r--tests/ui/feature-gates/print-with-path.target-features.stderr2
15 files changed, 173 insertions, 110 deletions
diff --git a/tests/ui/feature-gates/feature-gate-adt_const_params.stderr b/tests/ui/feature-gates/feature-gate-adt_const_params.stderr
index d8f089a28..13b9b84f0 100644
--- a/tests/ui/feature-gates/feature-gate-adt_const_params.stderr
+++ b/tests/ui/feature-gates/feature-gate-adt_const_params.stderr
@@ -5,7 +5,7 @@ LL | struct Foo<const NAME: &'static str>;
| ^^^^^^^^^^^^
|
= note: the only supported types are integers, `bool` and `char`
- = help: more complex types are supported with `#![feature(adt_const_params)]`
+ = help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
error: aborting due to previous error
diff --git a/tests/ui/feature-gates/feature-gate-coverage-attribute.rs b/tests/ui/feature-gates/feature-gate-coverage-attribute.rs
new file mode 100644
index 000000000..0a463755f
--- /dev/null
+++ b/tests/ui/feature-gates/feature-gate-coverage-attribute.rs
@@ -0,0 +1,14 @@
+#![crate_type = "lib"]
+#![feature(no_coverage)] //~ ERROR feature has been removed [E0557]
+
+#[derive(PartialEq, Eq)] // ensure deriving `Eq` does not enable `feature(coverage)`
+struct Foo {
+ a: u8,
+ b: u32,
+}
+
+#[coverage(off)] //~ ERROR the `#[coverage]` attribute is an experimental feature
+fn requires_feature_coverage() -> bool {
+ let bar = Foo { a: 0, b: 0 };
+ bar == Foo { a: 0, b: 0 }
+}
diff --git a/tests/ui/feature-gates/feature-gate-coverage-attribute.stderr b/tests/ui/feature-gates/feature-gate-coverage-attribute.stderr
new file mode 100644
index 000000000..0131a19a3
--- /dev/null
+++ b/tests/ui/feature-gates/feature-gate-coverage-attribute.stderr
@@ -0,0 +1,21 @@
+error[E0557]: feature has been removed
+ --> $DIR/feature-gate-coverage-attribute.rs:2:12
+ |
+LL | #![feature(no_coverage)]
+ | ^^^^^^^^^^^ feature has been removed
+ |
+ = note: renamed to `coverage_attribute`
+
+error[E0658]: the `#[coverage]` attribute is an experimental feature
+ --> $DIR/feature-gate-coverage-attribute.rs:10:1
+ |
+LL | #[coverage(off)]
+ | ^^^^^^^^^^^^^^^^
+ |
+ = note: see issue #84605 <https://github.com/rust-lang/rust/issues/84605> for more information
+ = help: add `#![feature(coverage_attribute)]` to the crate attributes to enable
+
+error: aborting due to 2 previous errors
+
+Some errors have detailed explanations: E0557, E0658.
+For more information about an error, try `rustc --explain E0557`.
diff --git a/tests/ui/feature-gates/feature-gate-no_coverage.rs b/tests/ui/feature-gates/feature-gate-no_coverage.rs
deleted file mode 100644
index fd4c6f760..000000000
--- a/tests/ui/feature-gates/feature-gate-no_coverage.rs
+++ /dev/null
@@ -1,13 +0,0 @@
-#![crate_type = "lib"]
-
-#[derive(PartialEq, Eq)] // ensure deriving `Eq` does not enable `feature(no_coverage)`
-struct Foo {
- a: u8,
- b: u32,
-}
-
-#[no_coverage] //~ ERROR the `#[no_coverage]` attribute is an experimental feature
-fn requires_feature_no_coverage() -> bool {
- let bar = Foo { a: 0, b: 0 };
- bar == Foo { a: 0, b: 0 }
-}
diff --git a/tests/ui/feature-gates/feature-gate-no_coverage.stderr b/tests/ui/feature-gates/feature-gate-no_coverage.stderr
deleted file mode 100644
index f7167e0b7..000000000
--- a/tests/ui/feature-gates/feature-gate-no_coverage.stderr
+++ /dev/null
@@ -1,12 +0,0 @@
-error[E0658]: the `#[no_coverage]` attribute is an experimental feature
- --> $DIR/feature-gate-no_coverage.rs:9:1
- |
-LL | #[no_coverage]
- | ^^^^^^^^^^^^^^
- |
- = note: see issue #84605 <https://github.com/rust-lang/rust/issues/84605> for more information
- = help: add `#![feature(no_coverage)]` 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/tests/ui/feature-gates/feature-gate-proc_macro_byte_character.rs b/tests/ui/feature-gates/feature-gate-proc_macro_byte_character.rs
new file mode 100644
index 000000000..0648ce0ee
--- /dev/null
+++ b/tests/ui/feature-gates/feature-gate-proc_macro_byte_character.rs
@@ -0,0 +1,10 @@
+// force-host
+#![crate_type = "proc-macro"]
+
+extern crate proc_macro;
+
+use proc_macro::Literal;
+
+fn test() {
+ Literal::byte_character(b'a'); //~ ERROR use of unstable library feature 'proc_macro_byte_character'
+}
diff --git a/tests/ui/feature-gates/feature-gate-proc_macro_byte_character.stderr b/tests/ui/feature-gates/feature-gate-proc_macro_byte_character.stderr
new file mode 100644
index 000000000..006915389
--- /dev/null
+++ b/tests/ui/feature-gates/feature-gate-proc_macro_byte_character.stderr
@@ -0,0 +1,12 @@
+error[E0658]: use of unstable library feature 'proc_macro_byte_character'
+ --> $DIR/feature-gate-proc_macro_byte_character.rs:9:5
+ |
+LL | Literal::byte_character(b'a');
+ | ^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: see issue #115268 <https://github.com/rust-lang/rust/issues/115268> for more information
+ = help: add `#![feature(proc_macro_byte_character)]` 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/tests/ui/feature-gates/feature-gate-type_privacy_lints.rs b/tests/ui/feature-gates/feature-gate-type_privacy_lints.rs
index aad64c9d0..8bb9736f1 100644
--- a/tests/ui/feature-gates/feature-gate-type_privacy_lints.rs
+++ b/tests/ui/feature-gates/feature-gate-type_privacy_lints.rs
@@ -1,11 +1,5 @@
// check-pass
-#![warn(private_interfaces)] //~ WARN unknown lint
- //~| WARN unknown lint
- //~| WARN unknown lint
-#![warn(private_bounds)] //~ WARN unknown lint
- //~| WARN unknown lint
- //~| WARN unknown lint
#![warn(unnameable_types)] //~ WARN unknown lint
//~| WARN unknown lint
//~| WARN unknown lint
diff --git a/tests/ui/feature-gates/feature-gate-type_privacy_lints.stderr b/tests/ui/feature-gates/feature-gate-type_privacy_lints.stderr
index 79cc974cc..4349fea6f 100644
--- a/tests/ui/feature-gates/feature-gate-type_privacy_lints.stderr
+++ b/tests/ui/feature-gates/feature-gate-type_privacy_lints.stderr
@@ -1,26 +1,5 @@
-warning: unknown lint: `private_interfaces`
- --> $DIR/feature-gate-type_privacy_lints.rs:3:1
- |
-LL | #![warn(private_interfaces)]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- |
- = note: the `private_interfaces` lint is unstable
- = note: see issue #48054 <https://github.com/rust-lang/rust/issues/48054> for more information
- = help: add `#![feature(type_privacy_lints)]` to the crate attributes to enable
- = note: `#[warn(unknown_lints)]` on by default
-
-warning: unknown lint: `private_bounds`
- --> $DIR/feature-gate-type_privacy_lints.rs:6:1
- |
-LL | #![warn(private_bounds)]
- | ^^^^^^^^^^^^^^^^^^^^^^^^
- |
- = note: the `private_bounds` lint is unstable
- = note: see issue #48054 <https://github.com/rust-lang/rust/issues/48054> for more information
- = help: add `#![feature(type_privacy_lints)]` to the crate attributes to enable
-
warning: unknown lint: `unnameable_types`
- --> $DIR/feature-gate-type_privacy_lints.rs:9:1
+ --> $DIR/feature-gate-type_privacy_lints.rs:3:1
|
LL | #![warn(unnameable_types)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -28,29 +7,10 @@ LL | #![warn(unnameable_types)]
= note: the `unnameable_types` lint is unstable
= note: see issue #48054 <https://github.com/rust-lang/rust/issues/48054> for more information
= help: add `#![feature(type_privacy_lints)]` to the crate attributes to enable
-
-warning: unknown lint: `private_interfaces`
- --> $DIR/feature-gate-type_privacy_lints.rs:3:1
- |
-LL | #![warn(private_interfaces)]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- |
- = note: the `private_interfaces` lint is unstable
- = note: see issue #48054 <https://github.com/rust-lang/rust/issues/48054> for more information
- = help: add `#![feature(type_privacy_lints)]` to the crate attributes to enable
-
-warning: unknown lint: `private_bounds`
- --> $DIR/feature-gate-type_privacy_lints.rs:6:1
- |
-LL | #![warn(private_bounds)]
- | ^^^^^^^^^^^^^^^^^^^^^^^^
- |
- = note: the `private_bounds` lint is unstable
- = note: see issue #48054 <https://github.com/rust-lang/rust/issues/48054> for more information
- = help: add `#![feature(type_privacy_lints)]` to the crate attributes to enable
+ = note: `#[warn(unknown_lints)]` on by default
warning: unknown lint: `unnameable_types`
- --> $DIR/feature-gate-type_privacy_lints.rs:9:1
+ --> $DIR/feature-gate-type_privacy_lints.rs:3:1
|
LL | #![warn(unnameable_types)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -59,28 +19,8 @@ LL | #![warn(unnameable_types)]
= note: see issue #48054 <https://github.com/rust-lang/rust/issues/48054> for more information
= help: add `#![feature(type_privacy_lints)]` to the crate attributes to enable
-warning: unknown lint: `private_interfaces`
- --> $DIR/feature-gate-type_privacy_lints.rs:3:1
- |
-LL | #![warn(private_interfaces)]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- |
- = note: the `private_interfaces` lint is unstable
- = note: see issue #48054 <https://github.com/rust-lang/rust/issues/48054> for more information
- = help: add `#![feature(type_privacy_lints)]` to the crate attributes to enable
-
-warning: unknown lint: `private_bounds`
- --> $DIR/feature-gate-type_privacy_lints.rs:6:1
- |
-LL | #![warn(private_bounds)]
- | ^^^^^^^^^^^^^^^^^^^^^^^^
- |
- = note: the `private_bounds` lint is unstable
- = note: see issue #48054 <https://github.com/rust-lang/rust/issues/48054> for more information
- = help: add `#![feature(type_privacy_lints)]` to the crate attributes to enable
-
warning: unknown lint: `unnameable_types`
- --> $DIR/feature-gate-type_privacy_lints.rs:9:1
+ --> $DIR/feature-gate-type_privacy_lints.rs:3:1
|
LL | #![warn(unnameable_types)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -89,5 +29,5 @@ LL | #![warn(unnameable_types)]
= note: see issue #48054 <https://github.com/rust-lang/rust/issues/48054> for more information
= help: add `#![feature(type_privacy_lints)]` to the crate attributes to enable
-warning: 9 warnings emitted
+warning: 3 warnings emitted
diff --git a/tests/ui/feature-gates/feature-gate-unnamed_fields.rs b/tests/ui/feature-gates/feature-gate-unnamed_fields.rs
new file mode 100644
index 000000000..4bbd0c83b
--- /dev/null
+++ b/tests/ui/feature-gates/feature-gate-unnamed_fields.rs
@@ -0,0 +1,26 @@
+struct Foo {
+ foo: u8,
+ _: union { //~ ERROR unnamed fields are not yet fully implemented [E0658]
+ //~^ ERROR unnamed fields are not yet fully implemented [E0658]
+ //~| ERROR anonymous unions are unimplemented
+ bar: u8,
+ baz: u16
+ }
+}
+
+union Bar {
+ foobar: u8,
+ _: struct { //~ ERROR unnamed fields are not yet fully implemented [E0658]
+ //~^ ERROR unnamed fields are not yet fully implemented [E0658]
+ //~| ERROR anonymous structs are unimplemented
+ foobaz: u8,
+ barbaz: u16
+ }
+}
+
+struct S;
+struct Baz {
+ _: S //~ ERROR unnamed fields are not yet fully implemented [E0658]
+}
+
+fn main(){}
diff --git a/tests/ui/feature-gates/feature-gate-unnamed_fields.stderr b/tests/ui/feature-gates/feature-gate-unnamed_fields.stderr
new file mode 100644
index 000000000..f026f2c36
--- /dev/null
+++ b/tests/ui/feature-gates/feature-gate-unnamed_fields.stderr
@@ -0,0 +1,84 @@
+error[E0658]: unnamed fields are not yet fully implemented
+ --> $DIR/feature-gate-unnamed_fields.rs:3:5
+ |
+LL | _: union {
+ | ^
+ |
+ = note: see issue #49804 <https://github.com/rust-lang/rust/issues/49804> for more information
+ = help: add `#![feature(unnamed_fields)]` to the crate attributes to enable
+
+error[E0658]: unnamed fields are not yet fully implemented
+ --> $DIR/feature-gate-unnamed_fields.rs:3:8
+ |
+LL | _: union {
+ | ________^
+LL | |
+LL | |
+LL | | bar: u8,
+LL | | baz: u16
+LL | | }
+ | |_____^
+ |
+ = note: see issue #49804 <https://github.com/rust-lang/rust/issues/49804> for more information
+ = help: add `#![feature(unnamed_fields)]` to the crate attributes to enable
+
+error[E0658]: unnamed fields are not yet fully implemented
+ --> $DIR/feature-gate-unnamed_fields.rs:13:5
+ |
+LL | _: struct {
+ | ^
+ |
+ = note: see issue #49804 <https://github.com/rust-lang/rust/issues/49804> for more information
+ = help: add `#![feature(unnamed_fields)]` to the crate attributes to enable
+
+error[E0658]: unnamed fields are not yet fully implemented
+ --> $DIR/feature-gate-unnamed_fields.rs:13:8
+ |
+LL | _: struct {
+ | ________^
+LL | |
+LL | |
+LL | | foobaz: u8,
+LL | | barbaz: u16
+LL | | }
+ | |_____^
+ |
+ = note: see issue #49804 <https://github.com/rust-lang/rust/issues/49804> for more information
+ = help: add `#![feature(unnamed_fields)]` to the crate attributes to enable
+
+error[E0658]: unnamed fields are not yet fully implemented
+ --> $DIR/feature-gate-unnamed_fields.rs:23:5
+ |
+LL | _: S
+ | ^
+ |
+ = note: see issue #49804 <https://github.com/rust-lang/rust/issues/49804> for more information
+ = help: add `#![feature(unnamed_fields)]` to the crate attributes to enable
+
+error: anonymous unions are unimplemented
+ --> $DIR/feature-gate-unnamed_fields.rs:3:8
+ |
+LL | _: union {
+ | ________^
+LL | |
+LL | |
+LL | | bar: u8,
+LL | | baz: u16
+LL | | }
+ | |_____^
+
+error: anonymous structs are unimplemented
+ --> $DIR/feature-gate-unnamed_fields.rs:13:8
+ |
+LL | _: struct {
+ | ________^
+LL | |
+LL | |
+LL | | foobaz: u8,
+LL | | barbaz: u16
+LL | | }
+ | |_____^
+
+error: aborting due to 7 previous errors
+
+For more information about this error, try `rustc --explain E0658`.
diff --git a/tests/ui/feature-gates/print-with-path.cfg.stderr b/tests/ui/feature-gates/print-with-path.cfg.stderr
deleted file mode 100644
index a6c51baa3..000000000
--- a/tests/ui/feature-gates/print-with-path.cfg.stderr
+++ /dev/null
@@ -1,2 +0,0 @@
-error: the `-Z unstable-options` flag must also be passed to enable the path print option
-
diff --git a/tests/ui/feature-gates/print-with-path.rs b/tests/ui/feature-gates/print-with-path.rs
deleted file mode 100644
index f929c14c2..000000000
--- a/tests/ui/feature-gates/print-with-path.rs
+++ /dev/null
@@ -1,7 +0,0 @@
-// check-fail
-// revisions: cfg target-features target-cpus
-// [cfg]compile-flags: --print cfg=cfg.txt
-// [target-cpus]compile-flags: --print target-cpu=target_cpu.txt
-// [target-features]compile-flags: --print target-features=target_features.txt
-
-fn main() {}
diff --git a/tests/ui/feature-gates/print-with-path.target-cpus.stderr b/tests/ui/feature-gates/print-with-path.target-cpus.stderr
deleted file mode 100644
index a6c51baa3..000000000
--- a/tests/ui/feature-gates/print-with-path.target-cpus.stderr
+++ /dev/null
@@ -1,2 +0,0 @@
-error: the `-Z unstable-options` flag must also be passed to enable the path print option
-
diff --git a/tests/ui/feature-gates/print-with-path.target-features.stderr b/tests/ui/feature-gates/print-with-path.target-features.stderr
deleted file mode 100644
index a6c51baa3..000000000
--- a/tests/ui/feature-gates/print-with-path.target-features.stderr
+++ /dev/null
@@ -1,2 +0,0 @@
-error: the `-Z unstable-options` flag must also be passed to enable the path print option
-