tests: add tests for mismatches with unresolved projections

This commit is contained in:
roife 2024-04-02 01:32:39 +08:00
parent 8d6b65c544
commit 3d373fec8c
2 changed files with 19 additions and 1 deletions

View file

@ -136,3 +136,20 @@ impl Trait for () {
"#,
);
}
#[test]
fn no_mismatches_with_unresolved_projections() {
check_no_mismatches(
r#"
// Thing is {unknown}
fn create() -> Option<(i32, Thing)> {
Some((69420, Thing))
}
fn consume() -> Option<()> {
let (number, thing) = create()?;
Some(())
}
"#,
);
}

View file

@ -73,7 +73,8 @@ use hir_ty::{
traits::FnTrait,
AliasTy, CallableDefId, CallableSig, Canonical, CanonicalVarKinds, Cast, ClosureId, GenericArg,
GenericArgData, Interner, ParamKind, QuantifiedWhereClause, Scalar, Substitution,
TraitEnvironment, TraitRefExt, Ty, TyBuilder, TyDefId, TyExt, TyKind, ValueTyDefId, WhereClause,
TraitEnvironment, TraitRefExt, Ty, TyBuilder, TyDefId, TyExt, TyKind, ValueTyDefId,
WhereClause,
};
use itertools::Itertools;
use nameres::diagnostics::DefDiagnosticKind;