]>
git.proxmox.com Git - rustc.git/blob - src/test/run-pass/mut-in-ident-patterns.rs
d3ae80861f231c5f29aaa57ed211104b7c59c5b8
1 // Copyright 2013 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
12 fn foo(&self, mut x
: int
) -> int
{
23 let (a
, mut b
) = (23, 4);
30 assert_eq
!(X
.foo(2), 76);
37 let (x
, mut y
) = (32, Bar
::Foo(21));
49 y
= Bar
::Baz(10.0, 3);
52 fn check_bar(y
: &Bar
) {
64 fn foo1((x
, mut y
): (f64, int
), mut z
: int
) -> int
{
73 let A { x: mut x }
= A { x: 10 }
;
78 (|A { x: mut t }
: A
| { t = t+1; t }
)(A { x: 34 }
);