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

ices/88595.rs: fixed with errors #999

Merged
merged 1 commit into from
Oct 20, 2021
Merged

ices/88595.rs: fixed with errors #999

merged 1 commit into from
Oct 20, 2021

Conversation

github-actions[bot]
Copy link
Contributor

Issue: rust-lang/rust#88595

#![feature(generic_associated_types)]    
#![feature(type_alias_impl_trait)]    
    
fn main() {    
    println!("Hello, world!");    
}    
    
trait A<'a> {    
    type B<'b>: Clone    
    where    
        'a: 'b;    
                                         
    fn a(&'a self) -> Self::B<'a>;       
}    
    
struct C;    
    
impl<'a> A<'a> for C {    
    type B<'b> = impl Clone;               
        
    fn a(&'a self) -> Self::B<'a> {}       
}   
=== stdout ===
=== stderr ===
error[E0478]: lifetime bound not satisfied
  --> /home/runner/work/glacier/glacier/ices/88595.rs:19:5
   |
19 |     type B<'b> = impl Clone;               
   |     ^^^^^^^^^^^^^^^^^^^^^^^^
   |
note: lifetime parameter instantiated with the lifetime `'a` as defined here
  --> /home/runner/work/glacier/glacier/ices/88595.rs:18:6
   |
18 | impl<'a> A<'a> for C {    
   |      ^^
note: but lifetime parameter must outlive the lifetime `'b` as defined here
  --> /home/runner/work/glacier/glacier/ices/88595.rs:19:12
   |
19 |     type B<'b> = impl Clone;               
   |            ^^

error: non-defining opaque type use in defining scope
  --> /home/runner/work/glacier/glacier/ices/88595.rs:21:23
   |
21 |     fn a(&'a self) -> Self::B<'a> {}       
   |                       ^^^^^^^^^^^
   |
note: lifetime used multiple times
  --> /home/runner/work/glacier/glacier/ices/88595.rs:18:6
   |
18 | impl<'a> A<'a> for C {    
   |      ^^
19 |     type B<'b> = impl Clone;               
   |            ^^

error: could not find defining uses
  --> /home/runner/work/glacier/glacier/ices/88595.rs:19:18
   |
19 |     type B<'b> = impl Clone;               
   |                  ^^^^^^^^^^

error: aborting due to 3 previous errors

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

=== stdout ===
=== stderr ===
error[E0478]: lifetime bound not satisfied
  --> /home/runner/work/glacier/glacier/ices/88595.rs:19:5
   |
19 |     type B<'b> = impl Clone;               
   |     ^^^^^^^^^^^^^^^^^^^^^^^^
   |
note: lifetime parameter instantiated with the lifetime `'a` as defined here
  --> /home/runner/work/glacier/glacier/ices/88595.rs:18:6
   |
18 | impl<'a> A<'a> for C {    
   |      ^^
note: but lifetime parameter must outlive the lifetime `'b` as defined here
  --> /home/runner/work/glacier/glacier/ices/88595.rs:19:12
   |
19 |     type B<'b> = impl Clone;               
   |            ^^

error: non-defining opaque type use in defining scope
  --> /home/runner/work/glacier/glacier/ices/88595.rs:21:23
   |
21 |     fn a(&'a self) -> Self::B<'a> {}       
   |                       ^^^^^^^^^^^
   |
note: lifetime used multiple times
  --> /home/runner/work/glacier/glacier/ices/88595.rs:18:6
   |
18 | impl<'a> A<'a> for C {    
   |      ^^
19 |     type B<'b> = impl Clone;               
   |            ^^

error: could not find defining uses
  --> /home/runner/work/glacier/glacier/ices/88595.rs:19:18
   |
19 |     type B<'b> = impl Clone;               
   |                  ^^^^^^^^^^

error: aborting due to 3 previous errors

For more information about this error, try `rustc --explain E0478`.
==============
@Alexendoo Alexendoo merged commit 0c73b2b into master Oct 20, 2021
@Alexendoo Alexendoo deleted the autofix/ices/88595.rs branch October 20, 2021 18:07
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