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

ices/72278.rs: fixed with errors #391

Merged
merged 1 commit into from
May 31, 2020
Merged

ices/72278.rs: fixed with errors #391

merged 1 commit into from
May 31, 2020

Conversation

github-actions[bot]
Copy link
Contributor

Issue: rust-lang/rust#72278

pub struct RefAny { }

impl RefAny {
    pub fn downcast_mut<'a, U: 'static>(&'a mut self) -> Option<&'a mut U> {
        unsafe { self.downcast_mut_unchecked::<'a, U>() } // <- panic here in lifetime resolution
    }

    unsafe fn downcast_mut_unchecked<'a, U>(&'a mut self) -> Option<&'a mut U> {
        None
    }
}
=== stdout ===
=== stderr ===
error[E0601]: `main` function not found in crate `72278`
  --> /home/runner/work/glacier/glacier/ices/72278.rs:1:1
   |
1  | / pub struct RefAny { }
2  | |
3  | | impl RefAny {
4  | |     pub fn downcast_mut<'a, U: 'static>(&'a mut self) -> Option<&'a mut U> {
...  |
10 | |     }
11 | | }
   | |_^ consider adding a `main` function to `/home/runner/work/glacier/glacier/ices/72278.rs`

warning: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
 --> /home/runner/work/glacier/glacier/ices/72278.rs:5:48
  |
5 |         unsafe { self.downcast_mut_unchecked::<'a, U>() } // <- panic here in lifetime resolution
  |                                                ^^
...
8 |     unsafe fn downcast_mut_unchecked<'a, U>(&'a mut self) -> Option<&'a mut U> {
  |                                      -- the late bound lifetime parameter is introduced here
  |
  = note: `#[warn(late_bound_lifetime_arguments)]` on by default
  = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
  = note: for more information, see issue #42868 <https://github.com/rust-lang/rust/issues/42868>

error: aborting due to previous error; 1 warning emitted

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

=== stdout ===
=== stderr ===
error[E0601]: `main` function not found in crate `72278`
  --> /home/runner/work/glacier/glacier/ices/72278.rs:1:1
   |
1  | / pub struct RefAny { }
2  | |
3  | | impl RefAny {
4  | |     pub fn downcast_mut<'a, U: 'static>(&'a mut self) -> Option<&'a mut U> {
...  |
10 | |     }
11 | | }
   | |_^ consider adding a `main` function to `/home/runner/work/glacier/glacier/ices/72278.rs`

warning: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
 --> /home/runner/work/glacier/glacier/ices/72278.rs:5:48
  |
5 |         unsafe { self.downcast_mut_unchecked::<'a, U>() } // <- panic here in lifetime resolution
  |                                                ^^
...
8 |     unsafe fn downcast_mut_unchecked<'a, U>(&'a mut self) -> Option<&'a mut U> {
  |                                      -- the late bound lifetime parameter is introduced here
  |
  = note: `#[warn(late_bound_lifetime_arguments)]` on by default
  = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
  = note: for more information, see issue #42868 <rust-lang/rust#42868>

error: aborting due to previous error; 1 warning emitted

For more information about this error, try `rustc --explain E0601`.
==============
@JohnTitor JohnTitor merged commit 5f52d76 into master May 31, 2020
@JohnTitor JohnTitor deleted the autofix/ices/72278.rs branch May 31, 2020 12:18
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