Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // tries to narrow `'static` to `'a`
- struct Narrowing<'a> {
- covariant: &'a (),
- }
- impl<'a> Foo<'a> {
- fn smaller(v: &mut &'a i32) {}
- fn bigger(v: &mut &'static i32) {
- Self::smaller(v)
- }
- }
- // tries to widen `'a` to `'static`
- struct Widening<'a> {
- covariant: &'a (),
- }
- impl<'a> Widening<'a> {
- fn smaller(v: &mut &'a i32) {
- Self::bigger(v)
- }
- fn bigger(v: &mut &'static i32) {}
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement