about summary refs log tree commit diff
path: root/tests/ui/unsafe-fields/unsafe-fields-parse.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-12-07 09:38:00 +0000
committerbors <bors@rust-lang.org>2024-12-07 09:38:00 +0000
commit9c707a8b769523bb6768bf58e74fa2c39cc24844 (patch)
tree29685106e8bc422851734c9d3e4c95fb95e50e81 /tests/ui/unsafe-fields/unsafe-fields-parse.rs
parentcdb89d6b15056a5cfa8932231360ae358b08983f (diff)
parentd210b91331766bf3a9ebbdb7ea1889440afc6b93 (diff)
downloadrust-9c707a8b769523bb6768bf58e74fa2c39cc24844.tar.gz
rust-9c707a8b769523bb6768bf58e74fa2c39cc24844.zip
Auto merge of #133978 - matthiaskrgr:rollup-6gh1iho, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #130209 (Stabilize `std::io::ErrorKind::CrossesDevices`)
 - #130254 (Stabilize `std::io::ErrorKind::QuotaExceeded`)
 - #132187 (Add Extend impls for tuples of arity 1 through 12)
 - #133875 (handle `--json-output` properly)
 - #133934 (Do not implement unsafe auto traits for types with unsafe fields)
 - #133954 (Hide errors whose suggestions would contain error constants or types)
 - #133960 (rustdoc: remove eq for clean::Attributes)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'tests/ui/unsafe-fields/unsafe-fields-parse.rs')
-rw-r--r--tests/ui/unsafe-fields/unsafe-fields-parse.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/ui/unsafe-fields/unsafe-fields-parse.rs b/tests/ui/unsafe-fields/unsafe-fields-parse.rs
new file mode 100644
index 00000000000..67277731293
--- /dev/null
+++ b/tests/ui/unsafe-fields/unsafe-fields-parse.rs
@@ -0,0 +1,10 @@
+//@ compile-flags: --crate-type=lib
+#![allow(incomplete_features)]
+#![feature(unsafe_fields)]
+
+// Parse errors even *with* unsafe_fields, which would make the compiler early-exit otherwise.
+enum A {
+    TupleLike(unsafe u32), //~ ERROR
+}
+
+struct B(unsafe u32); //~ ERROR