mirror of
https://github.com/rust-lang/rust.git
synced 2025-12-01 16:27:55 +00:00
12 lines
333 B
Rust
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 ()>`
|
|
}
|