tests: Move run-pass tests without naming conflicts to ui

This commit is contained in:
Vadim Petrochenkov 2019-07-27 01:33:01 +03:00
parent ca9faa52f5
commit 9be35f82c1
3226 changed files with 64 additions and 196 deletions

View file

@ -0,0 +1,31 @@
// run-pass
#![allow(non_camel_case_types)]
use std::cell::Cell;
// Make sure that destructors get run on slice literals
struct foo<'a> {
x: &'a Cell<isize>,
}
impl<'a> Drop for foo<'a> {
fn drop(&mut self) {
self.x.set(self.x.get() + 1);
}
}
fn foo(x: &Cell<isize>) -> foo {
foo {
x: x
}
}
pub fn main() {
let x = &Cell::new(0);
{
let l = &[foo(x)];
assert_eq!(l[0].x.get(), 0);
}
assert_eq!(x.get(), 1);
}