summaryrefslogtreecommitdiffstats
path: root/tests/ui/repr
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-18 02:49:50 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-18 02:49:50 +0000
commit9835e2ae736235810b4ea1c162ca5e65c547e770 (patch)
tree3fcebf40ed70e581d776a8a4c65923e8ec20e026 /tests/ui/repr
parentReleasing progress-linux version 1.70.0+dfsg2-1~progress7.99u1. (diff)
downloadrustc-9835e2ae736235810b4ea1c162ca5e65c547e770.tar.xz
rustc-9835e2ae736235810b4ea1c162ca5e65c547e770.zip
Merging upstream version 1.71.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ui/repr')
-rw-r--r--tests/ui/repr/invalid_repr_list_help.rs5
-rw-r--r--tests/ui/repr/invalid_repr_list_help.stderr20
-rw-r--r--tests/ui/repr/repr-transparent.stderr2
-rw-r--r--tests/ui/repr/transparent-enum-too-many-variants.stderr2
4 files changed, 27 insertions, 2 deletions
diff --git a/tests/ui/repr/invalid_repr_list_help.rs b/tests/ui/repr/invalid_repr_list_help.rs
index c32098453..785ffb1e0 100644
--- a/tests/ui/repr/invalid_repr_list_help.rs
+++ b/tests/ui/repr/invalid_repr_list_help.rs
@@ -15,3 +15,8 @@ pub struct OwO3 {
pub enum OwO4 {
UwU = 1,
}
+
+#[repr(uwu)] //~ERROR: unrecognized representation hint
+#[doc(owo)] //~WARN: unknown `doc` attribute
+ //~^ WARN: this was previously
+pub struct Owo5;
diff --git a/tests/ui/repr/invalid_repr_list_help.stderr b/tests/ui/repr/invalid_repr_list_help.stderr
index 2acd56d9a..48a6af3dd 100644
--- a/tests/ui/repr/invalid_repr_list_help.stderr
+++ b/tests/ui/repr/invalid_repr_list_help.stderr
@@ -30,6 +30,24 @@ LL | #[repr(uwu, u8)]
|
= help: valid reprs are `C`, `align`, `packed`, `transparent`, `simd`, `i8`, `u8`, `i16`, `u16`, `i32`, `u32`, `i64`, `u64`, `i128`, `u128`, `isize`, `usize`
-error: aborting due to 4 previous errors
+warning: unknown `doc` attribute `owo`
+ --> $DIR/invalid_repr_list_help.rs:20:7
+ |
+LL | #[doc(owo)]
+ | ^^^
+ |
+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+ = note: for more information, see issue #82730 <https://github.com/rust-lang/rust/issues/82730>
+ = note: `#[warn(invalid_doc_attributes)]` on by default
+
+error[E0552]: unrecognized representation hint
+ --> $DIR/invalid_repr_list_help.rs:19:8
+ |
+LL | #[repr(uwu)]
+ | ^^^
+ |
+ = help: valid reprs are `C`, `align`, `packed`, `transparent`, `simd`, `i8`, `u8`, `i16`, `u16`, `i32`, `u32`, `i64`, `u64`, `i128`, `u128`, `isize`, `usize`
+
+error: aborting due to 5 previous errors; 1 warning emitted
For more information about this error, try `rustc --explain E0552`.
diff --git a/tests/ui/repr/repr-transparent.stderr b/tests/ui/repr/repr-transparent.stderr
index f1c570b95..cb1e23377 100644
--- a/tests/ui/repr/repr-transparent.stderr
+++ b/tests/ui/repr/repr-transparent.stderr
@@ -58,7 +58,7 @@ error[E0731]: transparent enum needs exactly one variant, but has 2
LL | enum MultipleVariants {
| ^^^^^^^^^^^^^^^^^^^^^ needs exactly one variant, but has 2
LL | Foo(String),
- | ---
+ | --- variant here
LL | Bar,
| --- too many variants in `MultipleVariants`
diff --git a/tests/ui/repr/transparent-enum-too-many-variants.stderr b/tests/ui/repr/transparent-enum-too-many-variants.stderr
index fb44757ef..1a500257f 100644
--- a/tests/ui/repr/transparent-enum-too-many-variants.stderr
+++ b/tests/ui/repr/transparent-enum-too-many-variants.stderr
@@ -5,6 +5,8 @@ LL | enum Foo {
| ^^^^^^^^ needs exactly one variant, but has 2
LL | A(u8), B(u8),
| - - too many variants in `Foo`
+ | |
+ | variant here
error: aborting due to previous error