diff options
| author | Camille GILLOT <gillot.camille@gmail.com> | 2022-12-04 10:22:20 +0000 |
|---|---|---|
| committer | Camille GILLOT <gillot.camille@gmail.com> | 2022-12-04 10:33:07 +0000 |
| commit | 12473d3f36d4c9214443936be2c81975f24c446a (patch) | |
| tree | 1dd5ccc397c4691a192fe046c6ff2e9237643f88 /src/test/ui/impl-trait | |
| parent | cab4fd678c5b148a330f2bf255bf28a67dfea0fc (diff) | |
Use parent function WfCheckingContext to check RPITIT.
Diffstat (limited to 'src/test/ui/impl-trait')
| -rw-r--r-- | src/test/ui/impl-trait/in-trait/where-clause.rs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/test/ui/impl-trait/in-trait/where-clause.rs b/src/test/ui/impl-trait/in-trait/where-clause.rs new file mode 100644 index 00000000000..87bac519cf3 --- /dev/null +++ b/src/test/ui/impl-trait/in-trait/where-clause.rs @@ -0,0 +1,24 @@ +// check-pass +// edition: 2021 + +#![feature(return_position_impl_trait_in_trait)] +#![allow(incomplete_features)] + +use std::fmt::Debug; + +trait Foo<Item> { + fn foo<'a>(&'a self) -> impl Debug + where + Item: 'a; +} + +impl<Item, D: Debug + Clone> Foo<Item> for D { + fn foo<'a>(&'a self) -> impl Debug + where + Item: 'a, + { + self.clone() + } +} + +fn main() {} |
