diff options
| author | Aaron Hill <aa1ronham@gmail.com> | 2019-11-15 10:47:47 -0500 |
|---|---|---|
| committer | Aaron Hill <aa1ronham@gmail.com> | 2019-11-18 14:01:36 -0500 |
| commit | 61c75bdb11e782ee50ff1e4de6d29fd5ff4f0e31 (patch) | |
| tree | 45968aa867f5626013e74c8668d5d030a007ed52 | |
| parent | 0e2ccaaa3e70d85d1243c07e6ac0ef3829115a8d (diff) | |
| download | rust-61c75bdb11e782ee50ff1e4de6d29fd5ff4f0e31.tar.gz rust-61c75bdb11e782ee50ff1e4de6d29fd5ff4f0e31.zip | |
Add explanation of unconstrained opaque type
| -rw-r--r-- | src/test/ui/type-alias-impl-trait/fallback.rs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/test/ui/type-alias-impl-trait/fallback.rs b/src/test/ui/type-alias-impl-trait/fallback.rs index c59c1e3b7d0..fe1ca2230da 100644 --- a/src/test/ui/type-alias-impl-trait/fallback.rs +++ b/src/test/ui/type-alias-impl-trait/fallback.rs @@ -11,11 +11,17 @@ enum Wrapper<T> { Second } -fn _make_iter() -> Foo { +// This method constrains `Foo` to be `bool` +fn constrained_foo() -> Foo { true } -fn _produce() -> Wrapper<Foo> { + +// This method does not constrain `Foo`. +// Per RFC 2071, function bodies may either +// fully constrain an opaque type, or place no +// constraints on it. +fn unconstrained_foo() -> Wrapper<Foo> { Wrapper::Second } |
