mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 15:23:46 +00:00
11 lines
186 B
Rust
11 lines
186 B
Rust
// from rfc2005 test suite
|
|
|
|
|
|
|
|
pub fn main() {
|
|
let Some(x) = &Some(3) else {
|
|
panic!();
|
|
};
|
|
*x += 1; //~ ERROR: cannot assign to `*x`, which is behind a `&` reference
|
|
}
|