Skip to content

Commit 3d373fe

Browse files
committed
tests: add tests for mismatches with unresolved projections
1 parent 8d6b65c commit 3d373fe

2 files changed

Lines changed: 19 additions & 1 deletion

File tree

‎crates/hir-ty/src/tests/diagnostics.rs‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,3 +136,20 @@ impl Trait for () {
136136
"#,
137137
);
138138
}
139+
140+
#[test]
141+
fnno_mismatches_with_unresolved_projections(){
142+
check_no_mismatches(
143+
r#"
144+
// Thing is {unknown}
145+
fn create() -> Option<(i32, Thing)> {
146+
Some((69420, Thing))
147+
}
148+
149+
fn consume() -> Option<()> {
150+
let (number, thing) = create()?;
151+
Some(())
152+
}
153+
"#,
154+
);
155+
}

‎crates/hir/src/lib.rs‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ use hir_ty::{
7373
traits::FnTrait,
7474
AliasTy,CallableDefId,CallableSig,Canonical,CanonicalVarKinds,Cast,ClosureId,GenericArg,
7575
GenericArgData,Interner,ParamKind,QuantifiedWhereClause,Scalar,Substitution,
76-
TraitEnvironment,TraitRefExt,Ty,TyBuilder,TyDefId,TyExt,TyKind,ValueTyDefId,WhereClause,
76+
TraitEnvironment,TraitRefExt,Ty,TyBuilder,TyDefId,TyExt,TyKind,ValueTyDefId,
77+
WhereClause,
7778
};
7879
use itertools::Itertools;
7980
use nameres::diagnostics::DefDiagnosticKind;

0 commit comments

Comments
 (0)