mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-12 08:36:03 +00:00
28 lines
759 B
Rust
28 lines
759 B
Rust
//@ check-pass
|
|
|
|
#![feature(auto_traits)]
|
|
#![feature(more_maybe_bounds)]
|
|
#![feature(negative_impls)]
|
|
|
|
trait Trait1 {}
|
|
auto trait Trait2 {}
|
|
|
|
trait Trait3 : ?Trait1 {}
|
|
trait Trait4 where Self: Trait1 {}
|
|
|
|
fn foo(_: Box<(dyn Trait3 + ?Trait2)>) {}
|
|
fn bar<T: ?Sized + ?Trait2 + ?Trait1 + ?Trait4>(_: &T) {}
|
|
//~^ WARN relaxing a default bound only does something for `?Sized`; all other traits are not bound by default
|
|
//~| WARN relaxing a default bound only does something for `?Sized`; all other traits are not bound by default
|
|
//~| WARN relaxing a default bound only does something for `?Sized`; all other traits are not bound by default
|
|
|
|
struct S;
|
|
impl !Trait2 for S {}
|
|
impl Trait1 for S {}
|
|
impl Trait3 for S {}
|
|
|
|
fn main() {
|
|
foo(Box::new(S));
|
|
bar(&S);
|
|
}
|