// Search for external modules.
if namespace == TypeNS {
- if let Some(module) = module_.external_module_children.borrow().get(&name).cloned() {
+ // FIXME (21114): In principle unclear `child` *has* to be lifted.
+ let child = module_.external_module_children.borrow().get(&name).cloned();
+ if let Some(module) = child {
let name_bindings =
Rc::new(Resolver::create_name_bindings_from_module(module));
debug!("lower name bindings succeeded");
// Finally, search through external children.
if namespace == TypeNS {
- if let Some(module) = module_.external_module_children.borrow().get(&name).cloned() {
+ // FIXME (21114): In principle unclear `child` *has* to be lifted.
+ let child = module_.external_module_children.borrow().get(&name).cloned();
+ if let Some(module) = child {
let name_bindings =
Rc::new(Resolver::create_name_bindings_from_module(module));
return Success((Target::new(module_,
trait_def_id);
let trait_impls = self.tcx().trait_impls.borrow();
- let impl_def_ids = match trait_impls.get(&trait_def_id) {
+ let impl_def_ids = trait_impls.get(&trait_def_id);
+ let impl_def_ids = match impl_def_ids {
None => { return; }
Some(impls) => impls,
};
//! ```rust
//! use std::old_io as io;
//!
-//! for line in io::stdin().lock().lines() {
+//! let mut stdin = io::stdin();
+//! for line in stdin.lock().lines() {
//! print!("{}", line.unwrap());
//! }
//! ```
/// ```rust
/// use std::old_io;
///
- /// for line in old_io::stdin().lock().lines() {
+ /// let mut stdin = old_io::stdin();
+ /// for line in stdin.lock().lines() {
/// println!("{}", line.unwrap());
/// }
/// ```
// the unused ty param is necessary so this gets monomorphized
pub fn request<T>(req: &header_map) {
- let _x = req["METHOD".to_string()].clone().borrow().clone()[0].clone();
+ let data = req["METHOD".to_string()].clone();
+ let _x = data.borrow().clone()[0].clone();
}
let fd = std::old_io::File::open(&Path::new("shootout-k-nucleotide.data"));
get_sequence(&mut std::old_io::BufferedReader::new(fd), ">THREE")
} else {
- get_sequence(&mut *std::old_io::stdin().lock(), ">THREE")
+ let mut stdin = std::old_io::stdin();
+ let mut stdin = stdin.lock();
+ get_sequence(&mut *stdin, ">THREE")
};
let input = Arc::new(input);
let mut sudoku = if use_default {
Sudoku::from_vec(&DEFAULT_SUDOKU)
} else {
- Sudoku::read(&mut *old_io::stdin().lock())
+ let mut stdin = old_io::stdin();
+ let mut stdin = stdin.lock();
+ Sudoku::read(&mut *stdin)
};
sudoku.solve();
sudoku.write(&mut old_io::stdout());
}
fn child() {
- for line in old_io::stdin().lock().lines() {
+ let mut stdin = old_io::stdin();
+ for line in stdin.lock().lines() {
println!("{}", line.unwrap());
}
}
fn child() {
old_io::stdout().write_line("foo").unwrap();
old_io::stderr().write_line("bar").unwrap();
- assert_eq!(old_io::stdin().lock().read_line().err().unwrap().kind, old_io::EndOfFile);
+ let mut stdin = old_io::stdin();
+ assert_eq!(stdin.lock().read_line().err().unwrap().kind, old_io::EndOfFile);
}
fn test() {
fn main() {
let b = RefCell::new(Bar);
- b.borrow().foo()
+ b.borrow().foo();
}
}
pub fn main() {
+ let box_5 = box 5u;
assert_eq!(Rc::new(5u).to_uint(), Some(5));
- assert_eq!((box &box &Rc::new(box box &box 5u)).to_uint(), Some(5));
+ assert_eq!((box &box &Rc::new(box box &box_5)).to_uint(), Some(5));
let point = Rc::new(Point {x: 2, y: 4});
assert_eq!(point.x, 2);
assert_eq!(point.y, 4);