Skip to content
This repository has been archived by the owner on May 23, 2024. It is now read-only.

ices/53475.rs: fixed with errors #1365

Merged
merged 1 commit into from
Jul 31, 2022
Merged

ices/53475.rs: fixed with errors #1365

merged 1 commit into from
Jul 31, 2022

Conversation

github-actions[bot]
Copy link
Contributor

Issue: rust-lang/rust#53475

#![feature(coerce_unsized)]

use std::ops::CoerceUnsized;
use std::any::Any;

struct Foo<T> {
    data: Box<T>
}

impl<T> CoerceUnsized<Foo<dyn Any>> for Foo<T> {}

fn main() {}
=== stdout ===
=== stderr ===
error[E0310]: the parameter type `T` may not live long enough
  --> /home/runner/work/glacier/glacier/ices/53475.rs:10:1
   |
10 | impl<T> CoerceUnsized<Foo<dyn Any>> for Foo<T> {}
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
   |
help: consider adding an explicit lifetime bound...
   |
10 | impl<T: 'static> CoerceUnsized<Foo<dyn Any>> for Foo<T> {}
   |       +++++++++

error: aborting due to previous error

For more information about this error, try `rustc --explain E0310`.
==============

=== stdout ===
=== stderr ===
error[E0310]: the parameter type `T` may not live long enough
  --> /home/runner/work/glacier/glacier/ices/53475.rs:10:1
   |
10 | impl<T> CoerceUnsized<Foo<dyn Any>> for Foo<T> {}
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
   |
help: consider adding an explicit lifetime bound...
   |
10 | impl<T: 'static> CoerceUnsized<Foo<dyn Any>> for Foo<T> {}
   |       +++++++++

error: aborting due to previous error

For more information about this error, try `rustc --explain E0310`.
==============
@JohnTitor JohnTitor merged commit de357b6 into master Jul 31, 2022
@JohnTitor JohnTitor deleted the autofix/ices/53475.rs branch July 31, 2022 08:06
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants