diff options
| author | roife <roifewu@gmail.com> | 2024-04-02 01:32:39 +0800 |
|---|---|---|
| committer | roife <roifewu@gmail.com> | 2024-04-02 01:32:43 +0800 |
| commit | 3d373fec8c2cbaa025a2db5c519ecc89cd1e95d9 (patch) | |
| tree | 1c45549bd2ab14d7ddbc1a235aed09c7da9a4616 | |
| parent | 8d6b65c544602c719817d7f41f895a19b9cd1481 (diff) | |
| download | rust-3d373fec8c2cbaa025a2db5c519ecc89cd1e95d9.tar.gz rust-3d373fec8c2cbaa025a2db5c519ecc89cd1e95d9.zip | |
tests: add tests for mismatches with unresolved projections
| -rw-r--r-- | crates/hir-ty/src/tests/diagnostics.rs | 17 | ||||
| -rw-r--r-- | crates/hir/src/lib.rs | 3 |
2 files changed, 19 insertions, 1 deletions
diff --git a/crates/hir-ty/src/tests/diagnostics.rs b/crates/hir-ty/src/tests/diagnostics.rs index 80f92eaf435..fde90b0a55f 100644 --- a/crates/hir-ty/src/tests/diagnostics.rs +++ b/crates/hir-ty/src/tests/diagnostics.rs @@ -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(()) +} +"#, + ); +} diff --git a/crates/hir/src/lib.rs b/crates/hir/src/lib.rs index 1d4d458e89e..b9f7ff67a00 100644 --- a/crates/hir/src/lib.rs +++ b/crates/hir/src/lib.rs @@ -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; |
