Skip to content

Commit 61c75bd

Browse files
committed
Add explanation of unconstrained opaque type
1 parent 0e2ccaa commit 61c75bd

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/test/ui/type-alias-impl-trait/fallback.rs

+8-2
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,17 @@ enum Wrapper<T> {
1111
Second
1212
}
1313

14-
fn _make_iter() -> Foo {
14+
// This method constrains `Foo` to be `bool`
15+
fn constrained_foo() -> Foo {
1516
true
1617
}
1718

18-
fn _produce() -> Wrapper<Foo> {
19+
20+
// This method does not constrain `Foo`.
21+
// Per RFC 2071, function bodies may either
22+
// fully constrain an opaque type, or place no
23+
// constraints on it.
24+
fn unconstrained_foo() -> Wrapper<Foo> {
1925
Wrapper::Second
2026
}
2127

0 commit comments

Comments
 (0)