Added tests.
This commit is contained in:
parent
d08a42bf2c
commit
0e89f570d2
13 changed files with 133 additions and 42 deletions
|
|
@ -14,5 +14,4 @@ trait Trait {
|
|||
|
||||
type Foo = Trait; //~ ERROR E0191
|
||||
|
||||
fn main() {
|
||||
}
|
||||
fn main() {}
|
||||
|
|
|
|||
17
src/test/ui/error-codes/E0719.rs
Normal file
17
src/test/ui/error-codes/E0719.rs
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
// Copyright 2018 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.
|
||||
|
||||
#![feature(trait_alias)]
|
||||
|
||||
trait I32Iterator = Iterator<Item = i32>;
|
||||
|
||||
pub fn main() {
|
||||
let _: &I32Iterator<Item = f32>; //~ ERROR E0719
|
||||
}
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
// compile-pass
|
||||
|
||||
#![crate_type = "lib"]
|
||||
#![feature(linkage)]
|
||||
|
||||
// MergeFunctions will merge these via an anonymous internal
|
||||
// backing function, which must be named if ThinLTO buffers are used
|
||||
|
||||
#[linkage = "weak"]
|
||||
pub fn fn1(a: u32, b: u32, c: u32) -> u32 {
|
||||
a + b + c
|
||||
}
|
||||
|
||||
#[linkage = "weak"]
|
||||
pub fn fn2(a: u32, b: u32, c: u32) -> u32 {
|
||||
a + b + c
|
||||
}
|
||||
27
src/test/ui/issues/issue-51947.rs
Normal file
27
src/test/ui/issues/issue-51947.rs
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
// Copyright 2018 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.
|
||||
|
||||
// compile-pass
|
||||
|
||||
#![crate_type = "lib"]
|
||||
#![feature(linkage)]
|
||||
|
||||
// MergeFunctions will merge these via an anonymous internal
|
||||
// backing function, which must be named if ThinLTO buffers are used
|
||||
|
||||
#[linkage = "weak"]
|
||||
pub fn fn1(a: u32, b: u32, c: u32) -> u32 {
|
||||
a + b + c
|
||||
}
|
||||
|
||||
#[linkage = "weak"]
|
||||
pub fn fn2(a: u32, b: u32, c: u32) -> u32 {
|
||||
a + b + c
|
||||
}
|
||||
17
src/test/ui/traits/trait-alias-associated-type-rebound.rs
Normal file
17
src/test/ui/traits/trait-alias-associated-type-rebound.rs
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
// Copyright 2018 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.
|
||||
|
||||
#![feature(trait_alias)]
|
||||
|
||||
trait I32Iterator = Iterator<Item = i32>;
|
||||
trait I32Iterator2 = I32Iterator<Item = i32>;
|
||||
trait U32Iterator = I32Iterator2<Item = i32>;
|
||||
|
||||
pub fn main() {}
|
||||
Loading…
Add table
Add a link
Reference in a new issue