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
31 changes: 31 additions & 0 deletions tests/ui/cast/generic-trait-object-call.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
//! Regression test for https://github.com/rust-lang/rust/issues/2288

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

trait clam<A> {
fn chowder(&self, y: A);
}

#[derive(Copy, Clone)]
struct foo<A> {
x: A,
}

impl<A> clam<A> for foo<A> {
fn chowder(&self, _y: A) {}
}

fn foo<A>(b: A) -> foo<A> {
foo { x: b }
}

fn f<A>(x: Box<dyn clam<A>>, a: A) {
x.chowder(a);
}

pub fn main() {
let c = foo(42);
let d: Box<dyn clam<isize>> = Box::new(c) as Box<dyn clam<isize>>;
f(d, c.x);
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! Regression test for https://github.com/rust-lang/rust/issues/2214

//@ run-pass
//@ ignore-wasm32 wasi-libc does not have lgamma
//@ ignore-sgx no libc
Expand All @@ -19,7 +21,7 @@ mod m {
use std::ffi::{c_double, c_int};
extern "C" {
#[cfg(all(unix, not(target_os = "vxworks")))]
#[link_name="lgamma_r"]
#[link_name = "lgamma_r"]
pub fn lgamma(n: c_double, sign: &mut c_int) -> c_double;
#[cfg(windows)]
#[link_name = "lgamma"]
Expand Down
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the name of the test is very generic, could you keep the issue number in the name

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#![allow(dead_code)]
#![allow(non_camel_case_types)]


trait clam<A> {
fn get(self) -> A;
}
Expand All @@ -12,15 +11,13 @@ struct foo<A> {
}

impl<A> foo<A> {
pub fn bar<B,C:clam<A>>(&self, _c: C) -> B {
panic!();
}
pub fn bar<B, C: clam<A>>(&self, _c: C) -> B {
panic!();
}
}

fn foo<A>(b: A) -> foo<A> {
foo {
x: b
}
foo { x: b }
}

pub fn main() { }
pub fn main() {}
13 changes: 13 additions & 0 deletions tests/ui/generics/generic-trait-method-params-2311.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//! Regression test for https://github.com/rust-lang/rust/issues/2311

//@ check-pass
#![allow(non_camel_case_types)]

trait clam<A> {
fn get(self) -> A;
}
trait foo<A> {
fn bar<B, C: clam<A>>(&self, c: C) -> B;
}

pub fn main() {}
21 changes: 21 additions & 0 deletions tests/ui/generics/resolve-generic-method-param-2312.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
//! Regression test for https://github.com/rust-lang/rust/issues/2312

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

// Testing that the B's are resolved

trait clam<A> {
fn get(self) -> A;
}

struct foo(isize);

impl foo {
pub fn bar<B, C: clam<B>>(&self, _c: C) -> B {
panic!();
}
}

pub fn main() {}
33 changes: 0 additions & 33 deletions tests/ui/issues/issue-2288.rs

This file was deleted.

10 changes: 0 additions & 10 deletions tests/ui/issues/issue-2311.rs

This file was deleted.

16 changes: 0 additions & 16 deletions tests/ui/issues/issue-2312.rs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use std::thread::Builder;

static GENERATIONS: usize = 1024+256+128+49;
static GENERATIONS: usize = 1024 + 256 + 128 + 49;

fn spawn(mut f: Box<dyn FnMut() + 'static + Send>) {
Builder::new().stack_size(32 * 1024).spawn(move || f());
Expand All @@ -11,7 +11,7 @@ fn spawn(mut f: Box<dyn FnMut() + 'static + Send>) {
fn child_no(x: usize) -> Box<dyn FnMut() + 'static + Send> {
Box::new(move || {
if x < GENERATIONS {
spawn(child_no(x+1));
spawn(child_no(x + 1));
}
})
}
Expand Down
Loading