rename various regression tests
This commit is contained in:
parent
85ae47f83e
commit
a7dea5504b
7 changed files with 41 additions and 76 deletions
|
|
@ -1,15 +1,22 @@
|
|||
//! Regression test for https://github.com/rust-lang/rust/issues/2074
|
||||
|
||||
//@ run-pass
|
||||
|
||||
#![allow(non_camel_case_types)]
|
||||
|
||||
pub fn main() {
|
||||
let one = || {
|
||||
enum r { a }
|
||||
enum r {
|
||||
a,
|
||||
}
|
||||
r::a as usize
|
||||
};
|
||||
let two = || {
|
||||
enum r { a }
|
||||
enum r {
|
||||
a,
|
||||
}
|
||||
r::a as usize
|
||||
};
|
||||
one(); two();
|
||||
one();
|
||||
two();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,30 +0,0 @@
|
|||
//@ run-pass
|
||||
#![allow(dead_code)]
|
||||
#![allow(non_camel_case_types)]
|
||||
|
||||
|
||||
struct c1<T> {
|
||||
x: T,
|
||||
}
|
||||
|
||||
impl<T> c1<T> {
|
||||
pub fn f1(&self, _x: isize) {
|
||||
}
|
||||
}
|
||||
|
||||
fn c1<T>(x: T) -> c1<T> {
|
||||
c1 {
|
||||
x: x
|
||||
}
|
||||
}
|
||||
|
||||
impl<T> c1<T> {
|
||||
pub fn f2(&self, _x: isize) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
pub fn main() {
|
||||
c1::<isize>(3).f1(4);
|
||||
c1::<isize>(3).f2(4);
|
||||
}
|
||||
|
|
@ -1,8 +1,9 @@
|
|||
//! Regression test for https://github.com/rust-lang/rust/issues/2445
|
||||
|
||||
//@ run-pass
|
||||
#![allow(dead_code)]
|
||||
#![allow(non_camel_case_types)]
|
||||
|
||||
|
||||
struct c1<T> {
|
||||
x: T,
|
||||
}
|
||||
|
|
@ -12,16 +13,13 @@ impl<T> c1<T> {
|
|||
}
|
||||
|
||||
fn c1<T>(x: T) -> c1<T> {
|
||||
c1 {
|
||||
x: x
|
||||
}
|
||||
c1 { x }
|
||||
}
|
||||
|
||||
impl<T> c1<T> {
|
||||
pub fn f2(&self, _x: T) {}
|
||||
}
|
||||
|
||||
|
||||
pub fn main() {
|
||||
c1::<isize>(3).f1(4);
|
||||
c1::<isize>(3).f2(4);
|
||||
|
|
|
|||
|
|
@ -2,10 +2,8 @@
|
|||
#![allow(dead_code)]
|
||||
#![allow(non_camel_case_types)]
|
||||
|
||||
|
||||
struct socket {
|
||||
sock: isize,
|
||||
|
||||
}
|
||||
|
||||
impl Drop for socket {
|
||||
|
|
@ -13,19 +11,22 @@ impl Drop for socket {
|
|||
}
|
||||
|
||||
impl socket {
|
||||
pub fn set_identity(&self) {
|
||||
pub fn set_identity(&self) {
|
||||
closure(|| setsockopt_bytes(self.sock.clone()))
|
||||
}
|
||||
}
|
||||
|
||||
fn socket() -> socket {
|
||||
socket {
|
||||
sock: 1
|
||||
}
|
||||
socket { sock: 1 }
|
||||
}
|
||||
|
||||
fn closure<F>(f: F) where F: FnOnce() { f() }
|
||||
fn closure<F>(f: F)
|
||||
where
|
||||
F: FnOnce(),
|
||||
{
|
||||
f()
|
||||
}
|
||||
|
||||
fn setsockopt_bytes(_sock: isize) { }
|
||||
fn setsockopt_bytes(_sock: isize) {}
|
||||
|
||||
pub fn main() {}
|
||||
|
|
@ -1,11 +1,11 @@
|
|||
//! Regression test for https://github.com/rust-lang/rust/issues/2502
|
||||
|
||||
//@ check-pass
|
||||
#![allow(dead_code)]
|
||||
#![allow(non_camel_case_types)]
|
||||
|
||||
|
||||
|
||||
struct font<'a> {
|
||||
fontbuf: &'a Vec<u8> ,
|
||||
fontbuf: &'a Vec<u8>,
|
||||
}
|
||||
|
||||
impl<'a> font<'a> {
|
||||
|
|
@ -14,10 +14,8 @@ impl<'a> font<'a> {
|
|||
}
|
||||
}
|
||||
|
||||
fn font(fontbuf: &Vec<u8> ) -> font<'_> {
|
||||
font {
|
||||
fontbuf: fontbuf
|
||||
}
|
||||
fn font(fontbuf: &Vec<u8>) -> font<'_> {
|
||||
font { fontbuf }
|
||||
}
|
||||
|
||||
pub fn main() { }
|
||||
pub fn main() {}
|
||||
|
|
|
|||
|
|
@ -1,20 +1,18 @@
|
|||
//! Regression test for https://github.com/rust-lang/rust/issues/2550
|
||||
|
||||
//@ run-pass
|
||||
#![allow(dead_code)]
|
||||
#![allow(non_snake_case)]
|
||||
|
||||
|
||||
struct C {
|
||||
x: usize,
|
||||
}
|
||||
|
||||
fn C(x: usize) -> C {
|
||||
C {
|
||||
x: x
|
||||
}
|
||||
C { x }
|
||||
}
|
||||
|
||||
fn f<T>(_x: T) {
|
||||
}
|
||||
fn f<T>(_x: T) {}
|
||||
|
||||
pub fn main() {
|
||||
f(C(1));
|
||||
|
|
|
|||
|
|
@ -1,24 +1,17 @@
|
|||
//! Regression test for https://github.com/rust-lang/rust/issues/2463
|
||||
|
||||
//@ run-pass
|
||||
#![allow(dead_code)]
|
||||
|
||||
struct Pair { f: isize, g: isize }
|
||||
struct Pair {
|
||||
f: isize,
|
||||
g: isize,
|
||||
}
|
||||
|
||||
pub fn main() {
|
||||
let x = Pair { f: 0, g: 0 };
|
||||
|
||||
let x = Pair {
|
||||
f: 0,
|
||||
g: 0,
|
||||
};
|
||||
|
||||
let _y = Pair {
|
||||
f: 1,
|
||||
g: 1,
|
||||
.. x
|
||||
};
|
||||
|
||||
let _z = Pair {
|
||||
f: 1,
|
||||
.. x
|
||||
};
|
||||
let _y = Pair { f: 1, g: 1, ..x };
|
||||
|
||||
let _z = Pair { f: 1, ..x };
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue