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

ices/108271-1.rs: fixed with errors #1718

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

github-actions[bot]
Copy link
Contributor

Issue: rust-lang/rust#108271

pub trait TraitWAssocConst<T> {
    const A: T;
}

fn foo<T, B: TraitWAssocConst<T, A = { 1 }>>() {}

fn main() {}
=== stdout ===
=== stderr ===
error[E0658]: associated const equality is incomplete
 --> /home/runner/work/glacier/glacier/ices/108271-1.rs:5:34
  |
5 | fn foo<T, B: TraitWAssocConst<T, A = { 1 }>>() {}
  |                                  ^^^^^^^^^
  |
  = note: see issue #92827 <https://github.com/rust-lang/rust/issues/92827> for more information
  = help: add `#![feature(associated_const_equality)]` to the crate attributes to enable
  = note: this compiler was built on 2024-03-18; consider upgrading it if it is out of date

error: the type of the associated constant `A` must not depend on generic parameters
 --> /home/runner/work/glacier/glacier/ices/108271-1.rs:5:34
  |
5 | fn foo<T, B: TraitWAssocConst<T, A = { 1 }>>() {}
  |        -                         ^ its type must not depend on the type parameter `T`
  |        |
  |        the type parameter `T` is defined here
  |
  = note: `A` has type `T`

error: aborting due to 2 previous errors

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

=== stdout ===
=== stderr ===
error[E0658]: associated const equality is incomplete
 --> /home/runner/work/glacier/glacier/ices/108271-1.rs:5:34
  |
5 | fn foo<T, B: TraitWAssocConst<T, A = { 1 }>>() {}
  |                                  ^^^^^^^^^
  |
  = note: see issue #92827 <rust-lang/rust#92827> for more information
  = help: add `#![feature(associated_const_equality)]` to the crate attributes to enable
  = note: this compiler was built on 2024-03-18; consider upgrading it if it is out of date

error: the type of the associated constant `A` must not depend on generic parameters
 --> /home/runner/work/glacier/glacier/ices/108271-1.rs:5:34
  |
5 | fn foo<T, B: TraitWAssocConst<T, A = { 1 }>>() {}
  |        -                         ^ its type must not depend on the type parameter `T`
  |        |
  |        the type parameter `T` is defined here
  |
  = note: `A` has type `T`

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0658`.
==============
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.

1 participant