parent
ad775be8b4
commit
da663ccf9f
8 changed files with 107 additions and 1 deletions
14
src/test/compile-fail/issue-14303-enum.rs
Normal file
14
src/test/compile-fail/issue-14303-enum.rs
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
// Copyright 2014 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.
|
||||
|
||||
enum X<'a, T, 'b> {
|
||||
//~^ ERROR lifetime parameters must be declared prior to type parameters
|
||||
A(&'a T)
|
||||
}
|
||||
12
src/test/compile-fail/issue-14303-fn-def.rs
Normal file
12
src/test/compile-fail/issue-14303-fn-def.rs
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
// Copyright 2014 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 foo<'a, T, 'b>(x: &'a T) {}
|
||||
//~^ ERROR lifetime parameters must be declared prior to type parameters
|
||||
16
src/test/compile-fail/issue-14303-fncall.rs
Normal file
16
src/test/compile-fail/issue-14303-fncall.rs
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
// Copyright 2014 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() {
|
||||
range(0, 4)
|
||||
.map(|x| x * 2)
|
||||
.collect::<Vec<'a, uint, 'b>>()
|
||||
//~^ ERROR lifetime parameters must be declared prior to type parameters
|
||||
}
|
||||
14
src/test/compile-fail/issue-14303-impl.rs
Normal file
14
src/test/compile-fail/issue-14303-impl.rs
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
// Copyright 2014 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.
|
||||
|
||||
struct X { x: int }
|
||||
|
||||
impl<'a, T, 'b> X {}
|
||||
//~^ ERROR lifetime parameters must be declared prior to type parameters
|
||||
12
src/test/compile-fail/issue-14303-path.rs
Normal file
12
src/test/compile-fail/issue-14303-path.rs
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
// Copyright 2014 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 bar<'a, T>(x: mymodule::X<'a, T, 'b, 'c>) {}
|
||||
//~^ ERROR lifetime parameters must be declared prior to type parameters
|
||||
14
src/test/compile-fail/issue-14303-struct.rs
Normal file
14
src/test/compile-fail/issue-14303-struct.rs
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
// Copyright 2014 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.
|
||||
|
||||
struct X<'a, T, 'b> {
|
||||
//~^ ERROR lifetime parameters must be declared prior to type parameters
|
||||
x: &'a T
|
||||
}
|
||||
12
src/test/compile-fail/issue-14303-trait.rs
Normal file
12
src/test/compile-fail/issue-14303-trait.rs
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
// Copyright 2014 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.
|
||||
|
||||
trait Foo<'a, T, 'b> {}
|
||||
//~^ ERROR lifetime parameters must be declared prior to type parameters
|
||||
Loading…
Add table
Add a link
Reference in a new issue