3f2434eee3
Closes #12803 (std: Relax an assertion in oneshot selection) r=brson Closes #12818 (green: Fix a scheduler assertion on yielding) r=brson Closes #12819 (doc: discuss try! in std::io) r=alexcrichton Closes #12820 (Use generic impls for `Hash`) r=alexcrichton Closes #12826 (Remove remaining nolink usages) r=alexcrichton Closes #12835 (Emacs: always jump the cursor if needed on indent) r=brson Closes #12838 (Json method cleanup) r=alexcrichton Closes #12843 (rustdoc: whitelist the headers that get a § on hover) r=alexcrichton Closes #12844 (docs: add two unlisted libraries to the index page) r=pnkfelix Closes #12846 (Added a test that checks that unary structs can be mutably borrowed) r=sfackler Closes #12847 (mk: Fix warnings about duplicated rules) r=nmatsakis
26 lines
749 B
Rust
26 lines
749 B
Rust
// Copyright 2014 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.
|
|
|
|
// Tests that unary structs can be mutably borrowed.
|
|
|
|
struct Empty;
|
|
|
|
impl Iterator<int> for Empty {
|
|
fn next(&mut self) -> Option<int> { None }
|
|
}
|
|
|
|
fn do_something_with(a : &mut Iterator<int>) {
|
|
println!("{}", a.next())
|
|
}
|
|
|
|
pub fn main() {
|
|
do_something_with(&mut Empty);
|
|
}
|