Move /src/test to /tests
This commit is contained in:
parent
ca855e6e42
commit
cf2dff2b1e
27592 changed files with 0 additions and 0 deletions
18
tests/ui/variance/variance-trait-object-bound.rs
Normal file
18
tests/ui/variance/variance-trait-object-bound.rs
Normal file
|
@ -0,0 +1,18 @@
|
|||
// Checks that regions which appear in a trait object type are
|
||||
// observed by the variance inference algorithm (and hence
|
||||
// `TOption` is contavariant w/r/t `'a` and not bivariant).
|
||||
//
|
||||
// Issue #18262.
|
||||
|
||||
#![feature(rustc_attrs)]
|
||||
|
||||
use std::mem;
|
||||
|
||||
trait T { fn foo(&self); }
|
||||
|
||||
#[rustc_variance]
|
||||
struct TOption<'a> { //~ ERROR [-]
|
||||
v: Option<Box<dyn T + 'a>>,
|
||||
}
|
||||
|
||||
fn main() { }
|
Loading…
Add table
Add a link
Reference in a new issue