Skip to content

min_generic_const_args makes {u,i}*::{MIN, MAX} ambiguous #158506

Description

@Lars-Schumann

Enabling mgca somehow breaks these associated consts.

I tried this code: playground

#![allow(incomplete_features)]
#![feature(generic_const_items, min_generic_const_args)]

const TAKES_U8<const FOO: u8>: () = ();
const _: () = TAKES_U8::<{ u8::MAX }>;

I expected to see this happen: compiles.

Instead, this happened: fails to compile. (but compiles fine without mgca enabled)

error[E0223]: ambiguous associated constant
 --> src/lib.rs:5:28
  |
5 | const _: () = TAKES_U8::<{ u8::MAX }>;
  |                            ^^^^^^^
  |
help: you are looking for the module in `std`, not the primitive type
  |
5 | const _: () = TAKES_U8::<{ std::u8::MAX }>;
  |                            +++++

It also compiles fine if you add the const keyword like this:

const _: () = TAKES_U8::<const { u8::MAX }>;

Meta

tested on playground, 1.98.0-nightly (2026-06-26 ce9954c0cfc4bf26b82a)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.F-generic_const_items`#![feature(generic_const_items)]`F-min_generic_const_args`#![feature(min_generic_const_args)]`needs-triageThis issue may need triage. Remove it if it has been sufficiently triaged.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions