diff --git a/src/subtyping.md b/src/subtyping.md index 3f5e35b46..15b0b206a 100644 --- a/src/subtyping.md +++ b/src/subtyping.md @@ -29,8 +29,8 @@ let subtype: &(for<'a> fn(&'a i32) -> &'a i32) = &((|x| x) as fn(&_) -> &_); let supertype: &(fn(&'static i32) -> &'static i32) = subtype; // This works similarly for trait objects -let subtype: &(for<'a> Fn(&'a i32) -> &'a i32) = &|x| x; -let supertype: &(Fn(&'static i32) -> &'static i32) = subtype; +let subtype: &(dyn for<'a> Fn(&'a i32) -> &'a i32) = &|x| x; +let supertype: &(dyn Fn(&'static i32) -> &'static i32) = subtype; // We can also substitute one higher-ranked lifetime for another let subtype: &(for<'a, 'b> fn(&'a i32, &'b i32))= &((|x, y| {}) as fn(&_, &_));