glacier icon indicating copy to clipboard operation
glacier copied to clipboard

ices/108271-1.rs: fixed with errors

Open github-actions[bot] opened this issue 1 year ago • 0 comments

Issue: https://github.com/rust-lang/rust/issues/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`.
==============

github-actions[bot] avatar Mar 19 '24 03:03 github-actions[bot]