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

ices/97098.rs: fixed with errors #1636

Merged
merged 1 commit into from
Sep 17, 2023
Merged

ices/97098.rs: fixed with errors #1636

merged 1 commit into from
Sep 17, 2023

Conversation

github-actions[bot]
Copy link
Contributor

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

Issue: rust-lang/rust#97098

#![feature(type_alias_impl_trait)]
#![feature(generic_associated_types)]

pub trait Trait {
    type Assoc<'a>;
}

pub type Foo = impl for<'a> Trait<Assoc<'a> = FooAssoc<'a>>;
pub type FooAssoc<'a> = impl Sized;

struct Struct;
impl Trait for Struct {
    type Assoc<'a> = &'a u32;
}

const FOO: Foo = Struct;
=== stdout ===
=== stderr ===
error[E0601]: `main` function not found in crate `97098`
  --> /home/runner/work/glacier/glacier/ices/97098.rs:16:25
   |
16 | const FOO: Foo = Struct;
   |                         ^ consider adding a `main` function to `/home/runner/work/glacier/glacier/ices/97098.rs`

warning: the feature `generic_associated_types` has been stable since 1.65.0 and no longer requires an attribute to enable
 --> /home/runner/work/glacier/glacier/ices/97098.rs:2:12
  |
2 | #![feature(generic_associated_types)]
  |            ^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: `#[warn(stable_features)]` on by default

error[E0700]: hidden type for `FooAssoc<'a>` captures lifetime that does not appear in bounds
  --> /home/runner/work/glacier/glacier/ices/97098.rs:16:18
   |
8  | pub type Foo = impl for<'a> Trait<Assoc<'a> = FooAssoc<'a>>;
   |                         -- hidden type `&'a u32` captures the lifetime `'a` as defined here
9  | pub type FooAssoc<'a> = impl Sized;
   |                         ---------- opaque type defined here
...
16 | const FOO: Foo = Struct;
   |                  ^^^^^^

error: aborting due to 2 previous errors; 1 warning emitted

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 `97098`
  --> /home/runner/work/glacier/glacier/ices/97098.rs:16:25
   |
16 | const FOO: Foo = Struct;
   |                         ^ consider adding a `main` function to `/home/runner/work/glacier/glacier/ices/97098.rs`

warning: the feature `generic_associated_types` has been stable since 1.65.0 and no longer requires an attribute to enable
 --> /home/runner/work/glacier/glacier/ices/97098.rs:2:12
  |
2 | #![feature(generic_associated_types)]
  |            ^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: `#[warn(stable_features)]` on by default

error[E0700]: hidden type for `FooAssoc<'a>` captures lifetime that does not appear in bounds
  --> /home/runner/work/glacier/glacier/ices/97098.rs:16:18
   |
8  | pub type Foo = impl for<'a> Trait<Assoc<'a> = FooAssoc<'a>>;
   |                         -- hidden type `&'a u32` captures the lifetime `'a` as defined here
9  | pub type FooAssoc<'a> = impl Sized;
   |                         ---------- opaque type defined here
...
16 | const FOO: Foo = Struct;
   |                  ^^^^^^

error: aborting due to 2 previous errors; 1 warning emitted

Some errors have detailed explanations: E0601, E0700.
For more information about an error, try `rustc --explain E0601`.
==============
@JohnTitor JohnTitor merged commit 02ea489 into master Sep 17, 2023
@JohnTitor JohnTitor deleted the autofix/ices/97098.rs branch September 17, 2023 14:35
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