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

ices/97099-2.rs: fixed with errors #1638

Merged
merged 1 commit into from
Oct 15, 2023
Merged

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Aug 5, 2023

Issue: rust-lang/rust#97099

trait Trait<E> {
    type Assoc;
}

struct Foo;

impl<'a> Trait<&'a ()> for Foo {
    type Assoc = ();
}

fn foo() -> impl for<'a> Trait<&'a ()> {
    Foo
}

fn bar() -> impl for<'a> Trait<&'a (), Assoc = impl Sized> {
    foo()
}
=== stdout ===
=== stderr ===
error[E0601]: `main` function not found in crate `97099_2`
  --> /home/runner/work/glacier/glacier/ices/97099-2.rs:17:2
   |
17 | }
   |  ^ consider adding a `main` function to `/home/runner/work/glacier/glacier/ices/97099-2.rs`

error[E0700]: hidden type for `impl Sized` captures lifetime that does not appear in bounds
  --> /home/runner/work/glacier/glacier/ices/97099-2.rs:16:5
   |
15 | fn bar() -> impl for<'a> Trait<&'a (), Assoc = impl Sized> {
   |                      --                        ---------- opaque type defined here
   |                      |
   |                      hidden type `<impl for<'a> Trait<&'a ()> as Trait<&'a ()>>::Assoc` captures the lifetime `'a` as defined here
16 |     foo()
   |     ^^^^^

error: aborting due to 2 previous errors

Some errors have detailed explanations: E0601, E0700.
For more information about an error, try `rustc --explain E0601`.
==============

=== stdout ===
=== stderr ===
error[E0601]: `main` function not found in crate `97099_2`
  --> /home/runner/work/glacier/glacier/ices/97099-2.rs:17:2
   |
17 | }
   |  ^ consider adding a `main` function to `/home/runner/work/glacier/glacier/ices/97099-2.rs`

error[E0700]: hidden type for `impl Sized` captures lifetime that does not appear in bounds
  --> /home/runner/work/glacier/glacier/ices/97099-2.rs:16:5
   |
15 | fn bar() -> impl for<'a> Trait<&'a (), Assoc = impl Sized> {
   |                      --                        ---------- opaque type defined here
   |                      |
   |                      hidden type `<impl for<'a> Trait<&'a ()> as Trait<&'a ()>>::Assoc` captures the lifetime `'a` as defined here
16 |     foo()
   |     ^^^^^

error: aborting due to 2 previous errors

Some errors have detailed explanations: E0601, E0700.
For more information about an error, try `rustc --explain E0601`.
==============
@JohnTitor JohnTitor merged commit a5e31dd into master Oct 15, 2023
@JohnTitor JohnTitor deleted the autofix/ices/97099-2.rs branch October 15, 2023 03: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