rust/tests/ui/traits/alias/maybe-bound.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

30 lines
506 B
Rust
Raw Normal View History

//@ build-pass (FIXME(62277): could be check-pass?)
2019-05-02 01:21:20 +00:00
2019-03-30 22:06:09 +00:00
// Test that `dyn ... + ?Sized + ...` resulting from the expansion of trait aliases is okay.
#![feature(trait_alias)]
2019-05-02 01:21:20 +00:00
trait Foo {}
2019-03-30 22:06:09 +00:00
trait S = ?Sized;
// Nest a couple of levels deep:
trait _0 = S;
trait _1 = _0;
// Straight list expansion:
2019-05-02 01:21:20 +00:00
type _T0 = dyn _1 + Foo;
2019-03-30 22:06:09 +00:00
// In second position:
2019-05-02 01:21:20 +00:00
type _T1 = dyn Foo + _1;
2019-03-30 22:06:09 +00:00
// ... and with an auto trait:
2019-05-02 01:21:20 +00:00
type _T2 = dyn Foo + Send + _1;
2019-03-30 22:06:09 +00:00
// Twice:
trait _2 = _1 + _1;
2019-05-02 01:21:20 +00:00
type _T3 = dyn _2 + Foo;
2019-03-30 22:06:09 +00:00
fn main() {}