mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-08 21:13:55 +00:00
Split up tests, reduce coverage
This commit is contained in:
parent
8f41b74dba
commit
be1117113f
@ -17,15 +17,3 @@ fn unconstrained_type() {
|
||||
[];
|
||||
//~^ ERROR cannot determine a type for this expression: unconstrained type
|
||||
}
|
||||
|
||||
fn invalid_impl_within_scope() {
|
||||
{
|
||||
use std::ops::Deref;
|
||||
struct Something;
|
||||
|
||||
impl Deref for Something {}
|
||||
//~^ ERROR not all trait items implemented, missing: `Target`, `deref`
|
||||
|
||||
*Something
|
||||
};
|
||||
}
|
18
src/test/compile-fail/issue-23041.rs
Normal file
18
src/test/compile-fail/issue-23041.rs
Normal file
@ -0,0 +1,18 @@
|
||||
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use std::any::Any;
|
||||
fn main()
|
||||
{
|
||||
fn bar(x:i32) ->i32 { 3*x };
|
||||
let b:Box<Any> = Box::new(bar as fn(_)->_);
|
||||
b.downcast_ref::<fn(_)->_>();
|
||||
//~^ ERROR cannot determine a type for this expression: unconstrained type
|
||||
}
|
14
src/test/compile-fail/issue-23966.rs
Normal file
14
src/test/compile-fail/issue-23966.rs
Normal file
@ -0,0 +1,14 @@
|
||||
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
fn main() {
|
||||
"".chars().fold(|_, _| (), ());
|
||||
//~^ ERROR cannot determine a type for this expression: unconstrained type
|
||||
}
|
17
src/test/compile-fail/issue-24013.rs
Normal file
17
src/test/compile-fail/issue-24013.rs
Normal file
@ -0,0 +1,17 @@
|
||||
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
fn main() {
|
||||
use std::mem::{transmute, swap};
|
||||
let a = 1;
|
||||
let b = 2;
|
||||
unsafe {swap::<&mut _>(transmute(&a), transmute(&b))};
|
||||
//~^ ERROR cannot determine a type for this expression: unconstrained type
|
||||
}
|
Loading…
Reference in New Issue
Block a user