Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/aienux/blob/main/vendor/syn/tests/zzz_stable.rs # aienux Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately. Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `aienux / vendor / syn / tests / zzz_stable.rs` 33 lines · 1098 bytes Raw Blame History 1 #![cfg(syn_disable_nightly_tests)] 2 3 use std::io::{self, Write}; 4 use termcolor::{Color, ColorChoice, ColorSpec, StandardStream, WriteColor}; 5 6 const MSG: &str = "\ 7 ‖ 8 ‖ WARNING: 9 ‖ This is not a nightly compiler so not all tests were able to 10 ‖ run. Syn includes tests that compare Syn's parser against the 11 ‖ compiler's parser, which requires access to unstable librustc 12 ‖ data structures and a nightly compiler. 13 ‖ 14 "; 15 16 #[test] 17 fn notice() -> io::Result<()> { 18 let header = "WARNING"; 19 let index_of_header = MSG.find(header).unwrap(); 20 let before = &MSG[..index_of_header]; 21 let after = &MSG[index_of_header + header.len()..]; 22 23 let mut stderr = StandardStream::stderr(ColorChoice::Auto); 24 stderr.set_color(ColorSpec::new().set_fg(Some(Color::Yellow)))?; 25 write!(&mut stderr, "{}", before)?; 26 stderr.set_color(ColorSpec::new().set_bold(true).set_fg(Some(Color::Yellow)))?; 27 write!(&mut stderr, "{}", header)?; 28 stderr.set_color(ColorSpec::new().set_fg(Some(Color::Yellow)))?; 29 write!(&mut stderr, "{}", after)?; 30 stderr.reset()?; 31 32 Ok(()) 33 }