Move /src/test to /tests
This commit is contained in:
parent
ca855e6e42
commit
cf2dff2b1e
27592 changed files with 0 additions and 0 deletions
22
tests/ui/rfc-2005-default-binding-mode/enum.rs
Normal file
22
tests/ui/rfc-2005-default-binding-mode/enum.rs
Normal file
|
@ -0,0 +1,22 @@
|
|||
enum Wrapper {
|
||||
Wrap(i32),
|
||||
}
|
||||
|
||||
use Wrapper::Wrap;
|
||||
|
||||
pub fn main() {
|
||||
let Wrap(x) = &Wrap(3);
|
||||
*x += 1; //~ ERROR cannot assign to `*x`, which is behind a `&` reference
|
||||
|
||||
|
||||
if let Some(x) = &Some(3) {
|
||||
*x += 1; //~ ERROR cannot assign to `*x`, which is behind a `&` reference
|
||||
} else {
|
||||
panic!();
|
||||
}
|
||||
|
||||
while let Some(x) = &Some(3) {
|
||||
*x += 1; //~ ERROR cannot assign to `*x`, which is behind a `&` reference
|
||||
break;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue