Skip to content

Commit a4b57be

Browse files
committed
Rollup merge of rust-lang#23402 - tamird:needstest-tests, r=jakub-
@alexcrichton @jakub-
2 parents 74adeda + c1f6951 commit a4b57be

17 files changed

+274
-6
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
pub static ARRAY: &'static [u8] = &[1];

src/test/compile-fail/associated-types-eq-expr-path.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@ impl Foo for isize {
2222

2323
pub fn main() {
2424
let x: isize = Foo::<A=usize>::bar();
25-
//~^ERROR unexpected binding of associated item in expression path
25+
//~^ ERROR unexpected binding of associated item in expression path
2626
}

src/test/compile-fail/integral-indexing.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ pub fn main() {
2424
s.as_bytes()[3_usize];
2525
s.as_bytes()[3];
2626
s.as_bytes()[3u8]; //~ERROR the trait `core::ops::Index<u8>` is not implemented
27-
//~^ERROR the trait `core::ops::Index<u8>` is not implemented
27+
//~^ ERROR the trait `core::ops::Index<u8>` is not implemented
2828
s.as_bytes()[3i8]; //~ERROR the trait `core::ops::Index<i8>` is not implemented
29-
//~^ERROR the trait `core::ops::Index<i8>` is not implemented
29+
//~^ ERROR the trait `core::ops::Index<i8>` is not implemented
3030
s.as_bytes()[3u32]; //~ERROR the trait `core::ops::Index<u32>` is not implemented
31-
//~^ERROR the trait `core::ops::Index<u32>` is not implemented
31+
//~^ ERROR the trait `core::ops::Index<u32>` is not implemented
3232
s.as_bytes()[3i32]; //~ERROR the trait `core::ops::Index<i32>` is not implemented
33-
//~^ERROR the trait `core::ops::Index<i32>` is not implemented
33+
//~^ ERROR the trait `core::ops::Index<i32>` is not implemented
3434
}

src/test/compile-fail/issue-13407.rs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
mod A {
12+
struct C;
13+
}
14+
15+
fn main() {
16+
A::C = 1;
17+
//~^ ERROR: illegal left-hand side expression
18+
//~| ERROR: mismatched types
19+
}

src/test/compile-fail/issue-16922.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
use std::any::Any;
12+
13+
fn foo<T: Any>(value: &T) -> Box<Any> {
14+
Box::new(value) as Box<Any>
15+
//~^ ERROR: cannot infer an appropriate lifetime
16+
}
17+
18+
fn main() {
19+
let _ = foo(&5);
20+
}

src/test/compile-fail/issue-18919.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
type FuncType<'f> = Fn(&isize) -> isize + 'f;
12+
13+
fn ho_func(f: Option<FuncType>) {
14+
//~^ ERROR: the trait `core::marker::Sized` is not implemented for the type
15+
}
16+
17+
fn main() {}

src/test/compile-fail/issue-19982.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
#![feature(unboxed_closures)]
12+
13+
struct Foo;
14+
15+
impl Fn<(&(),)> for Foo { } //~ ERROR missing lifetime specifier
16+
17+
fn main() {}

src/test/compile-fail/issue-20225.rs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
#![feature(unboxed_closures)]
12+
13+
struct Foo;
14+
15+
impl<'a, T> Fn<(&'a T,)> for Foo {
16+
type Output = ();
17+
18+
extern "rust-call" fn call(&self, (_,): (T,)) {}
19+
//~^ ERROR: has an incompatible type for trait: expected &-ptr
20+
}
21+
22+
fn main() {}

src/test/compile-fail/issue-20261.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
fn main() {
12+
for (ref i,) in [].iter() { //~ ERROR: type mismatch resolving
13+
i.clone();
14+
//~^ ERROR: the type of this value must be known in this context
15+
//~| ERROR: reached the recursion limit while auto-dereferencing
16+
}
17+
}

src/test/compile-fail/issue-20714.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
struct G;
12+
13+
fn main() {
14+
let g = G(); //~ ERROR: expected function, found `G`
15+
}

0 commit comments

Comments
 (0)