1
Fork 0

remove unnecessary assertion for reference error

This commit is contained in:
yukang 2025-01-17 13:24:09 +08:00
parent bb3fa4b48e
commit 865a09d50a
4 changed files with 13 additions and 6 deletions

View file

@ -1637,7 +1637,6 @@ fn check_type_alias_type_params_are_used<'tcx>(tcx: TyCtxt<'tcx>, def_id: LocalD
let ty = tcx.type_of(def_id).instantiate_identity();
if ty.references_error() {
// If there is already another error, do not emit an error for not using a type parameter.
assert!(tcx.dcx().has_errors().is_some());
return;
}

View file

@ -1,5 +0,0 @@
//@ known-bug: #135341
type A<T> = B;
type B = _;
pub fn main() {}

View file

@ -0,0 +1,4 @@
type A<T> = B;
type B = _; //~ ERROR the placeholder `_` is not allowed within types on item signatures for type aliases
fn main() {}

View file

@ -0,0 +1,9 @@
error[E0121]: the placeholder `_` is not allowed within types on item signatures for type aliases
--> $DIR/ice-hir-wf-issue-135341.rs:2:10
|
LL | type B = _;
| ^ not allowed in type signatures
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0121`.