Skip to content

Commit

Permalink
tests: add tests for mismatches with unresolved projections
Browse files Browse the repository at this point in the history
  • Loading branch information
roife committed Apr 1, 2024
1 parent 8d6b65c commit 3d373fe
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
17 changes: 17 additions & 0 deletions crates/hir-ty/src/tests/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(())
}
"#,
);
}
3 changes: 2 additions & 1 deletion crates/hir/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 3d373fe

Please sign in to comment.