// -*- rust -*- type point = rec(int x, int y, mutable int z); fn f(mutable &point p) { p.z = 13; } fn main() { let point x = rec(x=10, y=11, z=mutable 12); f(x); check (x.z == 13); } // -*- rust -*- type point = rec(int x, int y, mutable int z); fn f(& mutable point p) { p.z = 13; } fn main() { let point x = rec(x=10, y=11, z=mutable 12); f(x); check (x.z == 13); } // -*- rust -*- type point = rec(int x, int y, mutable int z); fn f(& mutable point p) { p.z = 13; } fn main() { let point x = rec(x=10, y=11, mutable z=12); f(x); check (x.z == 13); } // -*- rust -*- type point = rec(int x, int y, mutable int z); impure fn f(& mutable point p) { p.z = 13; } impure fn main() { let point x = rec(x=10, y=11, mutable z=12); f(x); check (x.z == 13); } // -*- rust -*- type point = rec(int x, int y, mutable int z); fn f(& mutable point p) { p.z = 13; } fn main() { let point x = rec(x=10, y=11, mutable z=12); f(x); check (x.z == 13); } // -*- rust -*- type point = rec(int x, int y, mutable int z); fn f(& mutable point p) { p.z = 13; } fn main() { let point x = rec(x=10, y=11, mutable z=12); f(x); assert (x.z == 13); } // -*- rust -*- type point = rec(int x, int y, mutable int z); fn f(& mutable point p) { p.z = 13; } fn main() { let point x = rec(x=10, y=11, mutable z=12); f(x); check (x.z == 13); } // -*- rust -*- type point = rec(int x, int y, mutable int z); fn f(& mutable point p) { p.z = 13; } fn main() { let point x = rec(x=10, y=11, mutable z=12); f(x); assert (x.z == 13); } // -*- rust -*- type point = rec(int x, int y, mutable int z); fn f(&mutable point p) { p.z = 13; } fn main() { let point x = rec(x=10, y=11, mutable z=12); f(x); assert (x.z == 13); } // -*- rust -*- type point = {x: int, y: int, mutable z: int}; fn f(p: &mutable point) { p.z = 13; } fn main() { let x: point = {x: 10, y: 11, mutable z: 12}; f(x); assert (x.z == 13); } // -*- rust -*- type point = {x: int, y: int, mutable z: int}; fn f(p: &mutable point) { p.z = 13; } fn main() { let x: point = {x: 10, y: 11, mutable z: 12}; f(x); assert (x.z == 13); } // -*- rust -*- type point = {x: int, y: int, mutable z: int}; fn f(&p: point) { p.z = 13; } fn main() { let x: point = {x: 10, y: 11, mutable z: 12}; f(x); assert (x.z == 13); } // -*- rust -*- type point = {x: int, y: int, mutable z: int}; fn f(&p: point) { p.z = 13; } fn main() { let mut x: point = {x: 10, y: 11, mutable z: 12}; f(x); assert (x.z == 13); } // -*- rust -*- type point = {x: int, y: int, mut z: int}; fn f(&p: point) { p.z = 13; } fn main() { let mut x: point = {x: 10, y: 11, mut z: 12}; f(x); assert (x.z == 13); } // -*- rust -*- type point = {x: int, y: int, mut z: int}; fn f(p: &mut point) { p.z = 13; } fn main() { let mut x: point = {x: 10, y: 11, mut z: 12}; f(&mut x); assert (x.z == 13); } // Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. // -*- rust -*- type point = {x: int, y: int, mut z: int}; fn f(p: &mut point) { p.z = 13; } fn main() { let mut x: point = {x: 10, y: 11, mut z: 12}; f(&mut x); assert (x.z == 13); } // Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. // -*- rust -*- struct Point {x: int, y: int, mut z: int} fn f(p: &mut Point) { p.z = 13; } fn main() { let mut x: Point = Point {x: 10, y: 11, mut z: 12}; f(&mut x); assert (x.z == 13); } // Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. // -*- rust -*- struct Point {x: int, y: int, mut z: int} fn f(p: &mut Point) { p.z = 13; } pub fn main() { let mut x: Point = Point {x: 10, y: 11, mut z: 12}; f(&mut x); assert (x.z == 13); } // Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. // -*- rust -*- struct Point {x: int, y: int, z: int} fn f(p: &mut Point) { p.z = 13; } pub fn main() { let mut x: Point = Point {x: 10, y: 11, z: 12}; f(&mut x); assert (x.z == 13); } // Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. // -*- rust -*- struct Point {x: int, y: int, z: int} fn f(p: &mut Point) { p.z = 13; } pub fn main() { let mut x: Point = Point {x: 10, y: 11, z: 12}; f(&mut x); fail_unless!((x.z == 13)); } // Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. // -*- rust -*- struct Point {x: int, y: int, z: int} fn f(p: &mut Point) { p.z = 13; } pub fn main() { let mut x: Point = Point {x: 10, y: 11, z: 12}; f(&mut x); assert!((x.z == 13)); } // Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. // -*- rust -*- struct Point {x: int, y: int, z: int} fn f(p: &mut Point) { p.z = 13; } pub fn main() { let mut x: Point = Point {x: 10, y: 11, z: 12}; f(&mut x); assert_eq!(x.z, 13); } // Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. use std::unstable; struct Point {x: int, y: int, z: int} fn f(p: &mut Point) { p.z = 13; } pub fn main() { unsafe { let x = Some(unstable::sync::exclusive(true)); match x { Some(ref z) if z.with(|b| *b) => { do z.with |b| { assert!(*b); } }, _ => fail!() } } } // Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. use std::unstable; struct Point {x: int, y: int, z: int} fn f(p: &mut Point) { p.z = 13; } pub fn main() { unsafe { let x = Some(unstable::sync::Exclusive::new(true)); match x { Some(ref z) if z.with(|b| *b) => { do z.with |b| { assert!(*b); } }, _ => fail!() } } } // Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. use std::unstable; struct Point {x: int, y: int, z: int} fn f(p: &mut Point) { p.z = 13; } pub fn main() { unsafe { let x = Some(unstable::sync::Exclusive::new(true)); match x { Some(ref z) if z.with(|b| *b) => { do z.with |b| { assert!(*b); } }, _ => fail2!() } } } // Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. use std::unstable; struct Point {x: int, y: int, z: int} fn f(p: &mut Point) { p.z = 13; } pub fn main() { unsafe { let x = Some(unstable::sync::Exclusive::new(true)); match x { Some(ref z) if z.with(|b| *b) => { do z.with |b| { assert!(*b); } }, _ => fail!() } } } // Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. use std::unstable; struct Point {x: int, y: int, z: int} fn f(p: &mut Point) { p.z = 13; } pub fn main() { unsafe { let x = Some(unstable::sync::Exclusive::new(true)); match x { Some(ref z) if z.with(|b| *b) => { z.with(|b| assert!(*b)); }, _ => fail!() } } } // Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. use std::rt; struct Point {x: int, y: int, z: int} fn f(p: &mut Point) { p.z = 13; } pub fn main() { unsafe { let x = Some(rt::exclusive::Exclusive::new(true)); match x { Some(ref z) if *z.lock() => { assert!(*z.lock()); }, _ => fail!() } } } // Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. struct Point {x: int, y: int, z: int} fn f(p: &mut Point) { p.z = 13; } pub fn main() { unsafe { let x = Some(::std::rt::exclusive::Exclusive::new(true)); match x { Some(ref z) if *z.lock() => { assert!(*z.lock()); }, _ => fail!() } } } // Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. struct Point {x: int, y: int, z: int} fn f(p: &mut Point) { p.z = 13; } pub fn main() { unsafe { let x = Some(::std::rt::exclusive::Exclusive::new(true)); match x { Some(ref z) if *z.lock() => { assert!(*z.lock()); }, _ => panic!() } } } // Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. extern crate rustrt; struct Point {x: int, y: int, z: int} fn f(p: &mut Point) { p.z = 13; } pub fn main() { unsafe { let x = Some(::rustrt::exclusive::Exclusive::new(true)); match x { Some(ref z) if *z.lock() => { assert!(*z.lock()); }, _ => panic!() } } } // Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. use std::rt::exclusive; struct Point {x: int, y: int, z: int} fn f(p: &mut Point) { p.z = 13; } pub fn main() { unsafe { let x = Some(exclusive::Exclusive::new(true)); match x { Some(ref z) if *z.lock() => { assert!(*z.lock()); }, _ => panic!() } } } // Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. use std::sync::Mutex; struct Point {x: int, y: int, z: int} fn f(p: &mut Point) { p.z = 13; } pub fn main() { unsafe { let x = Some(Mutex::new(true)); match x { Some(ref z) if *z.lock() => { assert!(*z.lock()); }, _ => panic!() } } } // Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. use std::sync::Mutex; struct Point {x: int, y: int, z: int} fn f(p: &mut Point) { p.z = 13; } pub fn main() { let x = Some(Mutex::new(true)); match x { Some(ref z) if *z.lock().unwrap() => { assert!(*z.lock().unwrap()); }, _ => panic!() } } // Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. // pretty-expanded FIXME #23616 use std::sync::Mutex; struct Point {x: int, y: int, z: int} fn f(p: &mut Point) { p.z = 13; } pub fn main() { let x = Some(Mutex::new(true)); match x { Some(ref z) if *z.lock().unwrap() => { assert!(*z.lock().unwrap()); }, _ => panic!() } } // Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. // pretty-expanded FIXME #23616 use std::sync::Mutex; struct Point {x: isize, y: isize, z: isize} fn f(p: &mut Point) { p.z = 13; } pub fn main() { let x = Some(Mutex::new(true)); match x { Some(ref z) if *z.lock().unwrap() => { assert!(*z.lock().unwrap()); }, _ => panic!() } } // Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. use std::sync::Mutex; struct Point {x: isize, y: isize, z: isize} fn f(p: &mut Point) { p.z = 13; } pub fn main() { let x = Some(Mutex::new(true)); match x { Some(ref z) if *z.lock().unwrap() => { assert!(*z.lock().unwrap()); }, _ => panic!() } }