Skip to content

Commit 667d4e6

Browse files
committed
---
yaml --- r: 232366 b: refs/heads/try c: 39d164d h: refs/heads/master v: v3
1 parent 55ac86e commit 667d4e6

37 files changed

+986
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: edeb4f1c86cbf6af8ef9874d4b3af50f721ea1b8
33
refs/heads/snap-stage3: 1af31d4974e33027a68126fa5a5a3c2c6491824f
4-
refs/heads/try: 6bb1e2291195a518ddeef6e64337f4edb1432a72
4+
refs/heads/try: 39d164d0421a7560ea1e35a2347fda223cd43f6e
55
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
66
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
77
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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.t
10+
11+
// Check that the explicit lifetime bound (`'b`, in this example) must
12+
// outlive all the superbound from the trait (`'a`, in this example).
13+
14+
trait TheTrait<'t>: 't { }
15+
16+
struct Foo<'a,'b> {
17+
//~^ ERROR lifetime bound not satisfied
18+
x: Box<TheTrait<'a>+'b>
19+
}
20+
21+
fn main() { }
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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+
// Check that array elemen types must be Sized. Issue #25692.
12+
13+
#![feature(rustc_attrs)]
14+
#![allow(dead_code)]
15+
16+
struct Foo { //~ WARN E0277
17+
foo: [[u8]],
18+
}
19+
20+
#[rustc_error]
21+
fn main() { } //~ ERROR compilation successful
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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+
// Test that we check the types of constants are well-formed.
12+
13+
#![feature(associated_type_defaults)]
14+
#![feature(rustc_attrs)]
15+
#![allow(dead_code)]
16+
17+
struct IsCopy<T:Copy> { t: T }
18+
struct NotCopy;
19+
20+
const FOO: IsCopy<Option<NotCopy>> = IsCopy { t: None };
21+
//~^ ERROR E0277
22+
23+
#[rustc_error]
24+
fn main() { }
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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+
// Test that we check enum bounds for WFedness.
12+
13+
#![feature(associated_type_defaults)]
14+
#![feature(rustc_attrs)]
15+
#![allow(dead_code)]
16+
17+
trait ExtraCopy<T:Copy> { }
18+
19+
enum SomeEnum<T,U> //~ WARN E0277
20+
where T: ExtraCopy<U>
21+
{
22+
SomeVariant(T,U)
23+
}
24+
25+
#[rustc_error]
26+
fn main() { } //~ ERROR compilation successful
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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+
// Test that we check struct fields for WFedness.
12+
13+
#![feature(associated_type_defaults)]
14+
#![feature(rustc_attrs)]
15+
#![allow(dead_code)]
16+
17+
struct IsCopy<T:Copy> {
18+
value: T
19+
}
20+
21+
enum SomeEnum<A> {
22+
SomeVariant(IsCopy<A>) //~ ERROR E0277
23+
}
24+
25+
enum AnotherEnum<A> { //~ ERROR E0277
26+
AnotherVariant {
27+
f: IsCopy<A>
28+
}
29+
}
30+
31+
#[rustc_error]
32+
fn main() { }
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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+
// Test that we check where-clauses on fn items.
12+
13+
#![feature(associated_type_defaults)]
14+
#![feature(rustc_attrs)]
15+
#![allow(dead_code)]
16+
17+
trait ExtraCopy<T:Copy> { }
18+
19+
fn foo<T,U>() where T: ExtraCopy<U> //~ WARN E0277
20+
{
21+
}
22+
23+
#[rustc_error]
24+
fn main() { } //~ ERROR compilation successful
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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+
// Check that we require that associated types in an impl are well-formed.
12+
13+
#![feature(rustc_attrs)]
14+
15+
pub trait Foo<'a> {
16+
type Bar;
17+
}
18+
19+
impl<'a, T> Foo<'a> for T {
20+
type Bar = &'a T; //~ WARN E0309
21+
}
22+
23+
#[rustc_error]
24+
fn main() { } //~ ERROR compilation
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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+
// Check that we require that associated types in an impl are well-formed.
12+
13+
#![feature(rustc_attrs)]
14+
#![allow(dead_code)]
15+
16+
pub trait MyHash { }
17+
18+
pub struct MySet<T:MyHash> {
19+
data: Vec<T>
20+
}
21+
22+
pub trait Foo {
23+
type Bar;
24+
}
25+
26+
impl<T> Foo for T {
27+
type Bar = MySet<T>;
28+
//~^ WARN the trait `MyHash` is not implemented for the type `T`
29+
}
30+
31+
#[rustc_error]
32+
fn main() { } //~ ERROR compilation successful
33+
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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+
// Check that we enforce WF conditions also for argument types in fn items.
12+
13+
#![feature(rustc_attrs)]
14+
#![allow(dead_code)]
15+
16+
struct MustBeCopy<T:Copy> {
17+
t: T
18+
}
19+
20+
fn bar<T>(_: &MustBeCopy<T>) //~ ERROR E0277
21+
{
22+
}
23+
24+
fn main() { }
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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+
// Check that we enforce WF conditions also for return types in fn items.
12+
13+
#![feature(rustc_attrs)]
14+
#![allow(dead_code)]
15+
16+
struct MustBeCopy<T:Copy> {
17+
t: T
18+
}
19+
20+
fn bar<T>() -> MustBeCopy<T> //~ ERROR E0277
21+
{
22+
}
23+
24+
fn main() { }
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+
// Check that we enforce WF conditions also for types in fns.
12+
13+
struct MustBeCopy<T:Copy> {
14+
t: T
15+
}
16+
17+
struct Bar<T> {
18+
// needs T: Copy
19+
x: fn(MustBeCopy<T>) //~ ERROR E0277
20+
}
21+
22+
fn main() { }
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+
// Check that we enforce WF conditions also for types in fns.
12+
13+
struct MustBeCopy<T:Copy> {
14+
t: T
15+
}
16+
17+
struct Foo<T> {
18+
// needs T: 'static
19+
x: fn() -> MustBeCopy<T> //~ ERROR E0277
20+
}
21+
22+
fn main() { }
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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+
// Check that we enforce WF conditions related to regions also for
12+
// types in fns.
13+
14+
#![allow(dead_code)]
15+
#![feature(rustc_attrs)]
16+
17+
struct MustBeCopy<T:Copy> {
18+
t: T
19+
}
20+
21+
struct Foo<T> { //~ WARN E0310
22+
// needs T: 'static
23+
x: fn() -> &'static T //~ WARN E0310
24+
}
25+
26+
struct Bar<T> { //~ WARN E0310
27+
// needs T: Copy
28+
x: fn(&'static T) //~ WARN E0310
29+
}
30+
31+
#[rustc_error]
32+
fn main() { } //~ ERROR compilation successful
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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+
// Check that we enforce WF conditions also for where clauses in fn items.
12+
13+
#![feature(rustc_attrs)]
14+
#![allow(dead_code)]
15+
16+
trait MustBeCopy<T:Copy> {
17+
}
18+
19+
fn bar<T,U>() //~ WARN E0277
20+
where T: MustBeCopy<U>
21+
{
22+
}
23+
24+
#[rustc_error]
25+
fn main() { } //~ ERROR compilation successful

0 commit comments

Comments
 (0)