We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8362e60 commit cb809b6Copy full SHA for cb809b6
tests/ui/consts/trait_alias_method_call.rs
@@ -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