rust/tests/ui/reborrow/option_mut_coerce_shared.rs
2025-09-15 20:23:26 +03:00

12 lines
333 B
Rust

fn method(a: Option<&()>) {} //~NOTE function defined here
fn main() {
let a = Some(&mut ());
method(a);
//~^ ERROR mismatched types
//~| NOTE arguments to this function are incorrect
//~| NOTE types differ in mutability
//~| NOTE expected enum `Option<&()>`
//~| NOTE found enum `Option<&mut ()>`
}