]> git.lizzy.rs Git - rust.git/blob - src/test/ui/proc-macro/attr-stmt-expr.rs
Rollup merge of #76119 - Amjad50:stabilizing-move_ref_pattern, r=nikomatsakis
[rust.git] / src / test / ui / proc-macro / attr-stmt-expr.rs
1 // aux-build:attr-stmt-expr.rs
2
3 #![feature(proc_macro_hygiene)]
4
5 extern crate attr_stmt_expr;
6 use attr_stmt_expr::{expect_let, expect_print_stmt, expect_expr, expect_print_expr};
7
8 fn print_str(string: &'static str) {
9     // macros are handled a bit differently
10     #[expect_print_expr]
11     //~^ ERROR attributes on expressions are experimental
12     //~| HELP add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable
13     println!("{}", string)
14 }
15
16 fn main() {
17     #[expect_let]
18     let string = "Hello, world!";
19
20     #[expect_print_stmt]
21     println!("{}", string);
22
23     #[expect_expr]
24     //~^ ERROR attributes on expressions are experimental
25     //~| HELP add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable
26     print_str("string")
27 }