Skip to content

Commit e3da79e

Browse files
committed
test: regression test for #118179
check for `{type error}` being leaked in user-facing messages, particularly when using the `adt_const_params` feature
1 parent a9bdb2c commit e3da79e

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
//! Regression test for #118179: `adt_const_params` feature shouldn't leak
2+
//! `{type error}` in error messages.
3+
4+
struct G<T, const N: Vec<T>>(T);
5+
//~^ ERROR the type of const parameters must not depend on other generic parameters
6+
7+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
error[E0770]: the type of const parameters must not depend on other generic parameters
2+
--> $DIR/wfcheck_err_leak_issue_118179.rs:4:26
3+
|
4+
LL | struct G<T, const N: Vec<T>>(T);
5+
| ^ the type must not depend on the parameter `T`
6+
|
7+
= note: type parameters may not be used in the type of const parameters
8+
9+
error: aborting due to 1 previous error
10+
11+
For more information about this error, try `rustc --explain E0770`.

0 commit comments

Comments
 (0)