Skip to content

Commit 8ef152e

Browse files
authored
Rollup merge of rust-lang#135611 - chenyukang:yukang-fix-135341-ice-crash, r=oli-obk
Remove unnecessary assertion for reference error Fixes rust-lang#135341 From comment: rust-lang#135341 (comment) r? `@oli-obk`
2 parents f9c3b8c + 865a09d commit 8ef152e

File tree

4 files changed

+13
-6
lines changed

4 files changed

+13
-6
lines changed

compiler/rustc_hir_analysis/src/check/check.rs

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

tests/crashes/135341.rs

-5
This file was deleted.
+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
type A<T> = B;
2+
type B = _; //~ ERROR the placeholder `_` is not allowed within types on item signatures for type aliases
3+
4+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
error[E0121]: the placeholder `_` is not allowed within types on item signatures for type aliases
2+
--> $DIR/ice-hir-wf-issue-135341.rs:2:10
3+
|
4+
LL | type B = _;
5+
| ^ not allowed in type signatures
6+
7+
error: aborting due to 1 previous error
8+
9+
For more information about this error, try `rustc --explain E0121`.

0 commit comments

Comments
 (0)