blob: 5fdb710416f04ea6fbbd86ce94a4b9fe59786e7b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
// check-pass
#![feature(lint_reasons)]
#[warn(unused_variables)]
/// This should catch the unused_variables lint and not emit anything
fn check_fulfilled_expectation(#[expect(unused_variables)] unused_value: u32) {}
fn check_unfulfilled_expectation(#[expect(unused_variables)] used_value: u32) {
//~^ WARNING this lint expectation is unfulfilled [unfulfilled_lint_expectations]
//~| NOTE `#[warn(unfulfilled_lint_expectations)]` on by default
println!("I use the value {used_value}");
}
fn main() {}
|