Skip to content

Commit 4975e3f

Browse files
authored
Unrolled build for #149647
Rollup merge of #149647 - reddevilmidzy:test, r=Kivooeo Add regression test for 141845 close: #141845 I saw the `tests/ui/associated-inherent-types` directory, but I felt the current location was a better fit.
2 parents 97b131c + 3d0f5f2 commit 4975e3f

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
//! Regression test for <https://github.com/rust-lang/rust/issues/141845>
2+
//! Checks const resolution stability when using inherent associated types
3+
//! and generic const arguments.
4+
5+
//@compile-flags: --crate-type=lib
6+
#![expect(incomplete_features)]
7+
#![feature(inherent_associated_types, min_generic_const_args)]
8+
trait Trait {}
9+
10+
struct Struct<const N: usize>;
11+
12+
type Alias<T: Trait> = Struct<{ Struct::N }>;
13+
//~^ ERROR: missing generics for struct `Struct` [E0107]
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
error[E0107]: missing generics for struct `Struct`
2+
--> $DIR/resolution-with-inherent-associated-types.rs:12:33
3+
|
4+
LL | type Alias<T: Trait> = Struct<{ Struct::N }>;
5+
| ^^^^^^ expected 1 generic argument
6+
|
7+
note: struct defined here, with 1 generic parameter: `N`
8+
--> $DIR/resolution-with-inherent-associated-types.rs:10:8
9+
|
10+
LL | struct Struct<const N: usize>;
11+
| ^^^^^^ --------------
12+
help: add missing generic argument
13+
|
14+
LL | type Alias<T: Trait> = Struct<{ Struct<N>::N }>;
15+
| +++
16+
17+
error: aborting due to 1 previous error
18+
19+
For more information about this error, try `rustc --explain E0107`.

0 commit comments

Comments
 (0)