Skip to content

Commit

Permalink
Rollup merge of rust-lang#111614 - aDotInTheVoid:nonsense, r=cjgillot
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
Noratrieb authored May 16, 2023
2 parents bbbc728 + 65f9603 commit e973cc7
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions tests/ui/weird-exprs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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();
Expand All @@ -227,4 +254,7 @@ pub fn main() {
function();
bathroom_stall();
closure_matching();
semisemisemisemisemi();
useful_syntax();
infcx();
}

0 comments on commit e973cc7

Please # to comment.