Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//! Regression test for <https://github.com/rust-lang/rust/issues/141845>
//! Checks const resolution stability when using inherent associated types
//! and generic const arguments.
//@compile-flags: --crate-type=lib
#![expect(incomplete_features)]
#![feature(inherent_associated_types, min_generic_const_args)]
trait Trait {}

struct Struct<const N: usize>;

type Alias<T: Trait> = Struct<{ Struct::N }>;
//~^ ERROR: missing generics for struct `Struct` [E0107]
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
error[E0107]: missing generics for struct `Struct`
--> $DIR/resolution-with-inherent-associated-types.rs:12:33
|
LL | type Alias<T: Trait> = Struct<{ Struct::N }>;
| ^^^^^^ expected 1 generic argument
|
note: struct defined here, with 1 generic parameter: `N`
--> $DIR/resolution-with-inherent-associated-types.rs:10:8
|
LL | struct Struct<const N: usize>;
| ^^^^^^ --------------
help: add missing generic argument
|
LL | type Alias<T: Trait> = Struct<{ Struct<N>::N }>;
| +++

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0107`.
Loading