Move /src/test to /tests
This commit is contained in:
parent
ca855e6e42
commit
cf2dff2b1e
27592 changed files with 0 additions and 0 deletions
24
tests/ui/for-loop-while/while-prelude-drop.rs
Normal file
24
tests/ui/for-loop-while/while-prelude-drop.rs
Normal file
|
@ -0,0 +1,24 @@
|
|||
// run-pass
|
||||
#![allow(non_camel_case_types)]
|
||||
|
||||
use std::string::String;
|
||||
|
||||
#[derive(PartialEq)]
|
||||
enum t { a, b(String), }
|
||||
|
||||
fn make(i: isize) -> t {
|
||||
if i > 10 { return t::a; }
|
||||
let mut s = String::from("hello");
|
||||
// Ensure s is non-const.
|
||||
|
||||
s.push_str("there");
|
||||
return t::b(s);
|
||||
}
|
||||
|
||||
pub fn main() {
|
||||
let mut i = 0;
|
||||
|
||||
|
||||
// The auto slot for the result of make(i) should not leak.
|
||||
while make(i) != t::a { i += 1; }
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue