tests: Move run-pass tests without naming conflicts to ui
This commit is contained in:
parent
ca9faa52f5
commit
9be35f82c1
3226 changed files with 64 additions and 196 deletions
23
src/test/ui/out-pointer-aliasing.rs
Normal file
23
src/test/ui/out-pointer-aliasing.rs
Normal file
|
@ -0,0 +1,23 @@
|
|||
// run-pass
|
||||
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct Foo {
|
||||
f1: isize,
|
||||
_f2: isize,
|
||||
}
|
||||
|
||||
#[inline(never)]
|
||||
pub fn foo(f: &mut Foo) -> Foo {
|
||||
let ret = *f;
|
||||
f.f1 = 0;
|
||||
ret
|
||||
}
|
||||
|
||||
pub fn main() {
|
||||
let mut f = Foo {
|
||||
f1: 8,
|
||||
_f2: 9,
|
||||
};
|
||||
f = foo(&mut f);
|
||||
assert_eq!(f.f1, 8);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue