rust/tests/ui/rust-2024/reserved-guarded-strings-via-macro-2.rs
2024-10-08 18:21:16 -06:00

19 lines
659 B
Rust

//@ edition:2021
//@ aux-build:reserved-guarded-strings-macro-2021.rs
//@ aux-build:reserved-guarded-strings-macro-2024.rs
extern crate reserved_guarded_strings_macro_2021 as m2021;
extern crate reserved_guarded_strings_macro_2024 as m2024;
fn main() {
// Ok:
m2021::number_of_tokens_in_a_guarded_string_literal!();
m2021::number_of_tokens_in_a_guarded_unterminated_string_literal!();
// Error, even though *this* crate is 2021:
m2024::number_of_tokens_in_a_guarded_string_literal!();
//~^ ERROR invalid string literal
m2024::number_of_tokens_in_a_guarded_unterminated_string_literal!();
//~^ ERROR invalid string literal
}