mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
Add more tests
This commit is contained in:
@@ -181,3 +181,5 @@ trait Visible {
|
||||
pub fn f();
|
||||
pub fn g() {}
|
||||
}
|
||||
|
||||
const trait Foomp = Hash;
|
||||
@@ -218,3 +218,5 @@ trait Visible {
|
||||
pub fn f();
|
||||
pub fn g() {}
|
||||
}
|
||||
|
||||
trait Foomp = Hash;
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
//! Test that we do not need to handle host effects in `expand_trait_aliases`
|
||||
|
||||
#![feature(trait_alias, const_trait_impl)]
|
||||
//@ check-pass
|
||||
|
||||
mod foo {
|
||||
pub const trait Bar {
|
||||
fn bar(&self) {}
|
||||
}
|
||||
pub const trait Baz {
|
||||
fn baz(&self) {}
|
||||
}
|
||||
|
||||
impl const Bar for () {}
|
||||
impl const Baz for () {}
|
||||
|
||||
pub const trait Foo = [const] Bar + Baz;
|
||||
}
|
||||
|
||||
use foo::Foo as _;
|
||||
|
||||
|
||||
const _: () = {
|
||||
// Ok via `[const] Bar` on `Foo`
|
||||
().bar();
|
||||
// Also works, because everything is fully concrete, so we're ignoring that
|
||||
// `Baz` is not a const trait bound of `Foo`.
|
||||
().baz();
|
||||
};
|
||||
|
||||
fn main() {}
|
||||
Reference in New Issue
Block a user