diff options
author | Nilstrieb <48135649+Nilstrieb@users.noreply.github.com> | 2023-05-16 11:39:40 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-16 11:39:40 +0200 |
commit | 87e25f78550cd282927f86197552992f191a6074 (patch) | |
tree | 7fb263e8503cf51cecdb1b5765ffbf8ae50a9fe4 | |
parent | 6e48dcf77f3a078e3e9d28c3571a8def01e60863 (diff) | |
parent | 65f9603a4e9b75ddeba961de4a66a9f88072eb77 (diff) | |
download | rust-87e25f78550cd282927f86197552992f191a6074.tar.gz |
Rollup merge of #111614 - aDotInTheVoid:nonsense, r=cjgillot
Add more interesting nonsense to weird-exprs.rs
Some cursed things rust allows that I've ran into.
[The second is taken from here](https://twitter.com/Lucretiel/status/1638929955751964679)
-rw-r--r-- | tests/ui/weird-exprs.rs | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/ui/weird-exprs.rs b/tests/ui/weird-exprs.rs index d65703ef5ca..c4fa850a4f9 100644 --- a/tests/ui/weird-exprs.rs +++ b/tests/ui/weird-exprs.rs @@ -5,13 +5,16 @@ #![allow(non_camel_case_types)] #![allow(dead_code)] +#![allow(redundant_semicolons)] #![allow(unreachable_code)] #![allow(unused_braces, unused_must_use, unused_parens)] #![allow(uncommon_codepoints, confusable_idents)] +#![allow(unused_imports)] #![allow(unreachable_patterns)] #![recursion_limit = "256"] +extern crate core; use std::cell::Cell; use std::mem::swap; @@ -204,6 +207,30 @@ fn closure_matching() { assert!(matches!(x(..), |_| Some(4))); } +fn semisemisemisemisemi() { + ;;;;;;; ;;;;;;; ;;; ;;; ;; + ;; ;; ;;;; ;;;; ;; + ;;;;;;; ;;;;; ;; ;;;; ;; ;; + ;; ;; ;; ;; ;; ;; + ;;;;;;; ;;;;;;; ;; ;; ;; +} + +fn useful_syntax() { + use {{std::{{collections::{{HashMap}}}}}}; + use ::{{{{core}, {std}}}}; + use {{::{{core as core2}}}}; +} + +fn infcx() { + pub mod cx { + pub mod cx { + pub use super::cx; + pub struct Cx; + } + } + let _cx: cx::cx::Cx = cx::cx::cx::cx::cx::Cx; +} + pub fn main() { strange(); funny(); @@ -227,4 +254,7 @@ pub fn main() { function(); bathroom_stall(); closure_matching(); + semisemisemisemisemi(); + useful_syntax(); + infcx(); } |