Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions tests/ui/closures/local-enums-in-closure-2074.rs
Original file line number Diff line number Diff line change
@@ -0,0 +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,
}
r::a as usize
};
let two = || {
enum r {
a,
}
r::a as usize
};
one();
two();
}
15 changes: 0 additions & 15 deletions tests/ui/issues/issue-2074.rs

This file was deleted.

30 changes: 0 additions & 30 deletions tests/ui/issues/issue-2445-b.rs

This file was deleted.

24 changes: 0 additions & 24 deletions tests/ui/issues/issue-2463.rs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -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,
}
Expand All @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,31 @@
#![allow(dead_code)]
#![allow(non_camel_case_types)]


struct socket {
sock: isize,

}

impl Drop for socket {
fn drop(&mut self) {}
}

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() {}
Original file line number Diff line number Diff line change
@@ -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> {
Expand All @@ -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() {}
Original file line number Diff line number Diff line change
@@ -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));
Expand Down
17 changes: 17 additions & 0 deletions tests/ui/structs/struct-update-syntax-2463.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//! Regression test for https://github.com/rust-lang/rust/issues/2463

//@ run-pass
#![allow(dead_code)]

struct Pair {
f: isize,
g: isize,
}

pub fn main() {
let x = Pair { f: 0, g: 0 };

let _y = Pair { f: 1, g: 1, ..x };

let _z = Pair { f: 1, ..x };
}
Loading