Skip to content

Commit cb809b6

Browse files
committed
Add more tests
1 parent 8362e60 commit cb809b6

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
//! Test that we do not need to handle host effects in `expand_trait_aliases`
2+
3+
#![feature(trait_alias, const_trait_impl)]
4+
//@ check-pass
5+
6+
mod foo {
7+
pub const trait Bar {
8+
fn bar(&self) {}
9+
}
10+
pub const trait Baz {
11+
fn baz(&self) {}
12+
}
13+
14+
impl const Bar for () {}
15+
impl const Baz for () {}
16+
17+
pub const trait Foo = [const] Bar + Baz;
18+
}
19+
20+
use foo::Foo as _;
21+
22+
23+
const _: () = {
24+
// Ok via `[const] Bar` on `Foo`
25+
().bar();
26+
// Also works, because everything is fully concrete, so we're ignoring that
27+
// `Baz` is not a const trait bound of `Foo`.
28+
().baz();
29+
};
30+
31+
fn main() {}

0 commit comments

Comments
 (0)