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