/dports/devel/rust-analyzer/rust-analyzer-2021-12-20/crates/hir_ty/src/infer/ |
H A D | coerce.rs | 47 expected_ty: Ty, field 52 CoerceMany { expected_ty: expected } in new() 69 self.expected_ty = ctx.resolve_ty_shallow(&self.expected_ty); in coerce() 74 let sig = match (self.expected_ty.kind(Interner), expr_ty.kind(Interner)) { in coerce() 87 let result1 = ctx.coerce_inner(self.expected_ty.clone(), &target_ty); in coerce() 92 return self.expected_ty = target_ty; in coerce() 100 if ctx.coerce(expr, &expr_ty, &self.expected_ty).is_ok() { in coerce() 102 } else if ctx.coerce(expr, &self.expected_ty, &expr_ty).is_ok() { in coerce() 103 self.expected_ty = expr_ty; in coerce() 108 TypeMismatch { expected: self.expected_ty.clone(), actual: expr_ty }, in coerce() [all …]
|
H A D | pat.rs | 50 let expected_ty = var_data in infer_tuple_struct_pat() localVariable 56 let expected_ty = self.normalize_associated_types_in(expected_ty); in infer_tuple_struct_pat() localVariable 57 self.infer_pat(subpat, &expected_ty, default_bm); in infer_tuple_struct_pat() 85 let expected_ty = matching_field.map_or(self.err_ty(), |field| { in infer_record_pat() localVariable 88 let expected_ty = self.normalize_associated_types_in(expected_ty); in infer_record_pat() localVariable 89 self.infer_pat(subpat.pat, &expected_ty, default_bm); in infer_record_pat()
|
H A D | closure.rs | 22 let expected_ty = match expectation.to_option(&mut self.table) { in deduce_closure_type_from_expectations() localVariable 28 let _ = self.coerce(Some(closure_expr), closure_ty, &expected_ty); in deduce_closure_type_from_expectations() 31 if let TyKind::Dyn(dyn_ty) = expected_ty.kind(Interner) { in deduce_closure_type_from_expectations()
|
H A D | expr.rs | 50 if let Some(expected_ty) = expected.only_has_type(&mut self.table) { in infer_expr() 51 let could_unify = self.unify(&ty, &expected_ty); in infer_expr() 55 TypeMismatch { expected: expected_ty, actual: ty.clone() }, in infer_expr() 1037 if let Some(expected_ty) = expected_output.to_option(&mut self.table) { in expected_inputs_for_expected_output() 1039 if table.try_unify(&expected_ty, &output).is_ok() { in expected_inputs_for_expected_output() 1070 for ((&arg, param_ty), expected_ty) in args.iter().zip(param_iter).zip(expected_iter) { in check_call_arguments() 1084 let expected = Expectation::rvalue_hint(&mut self.table, expected_ty); in check_call_arguments()
|
/dports/lang/rust/rustc-1.58.1-src/src/tools/rust-analyzer/crates/hir_ty/src/infer/ |
H A D | coerce.rs | 46 expected_ty: Ty, field 51 CoerceMany { expected_ty: expected } in new() 68 self.expected_ty = ctx.resolve_ty_shallow(&self.expected_ty); in coerce() 73 let sig = match (self.expected_ty.kind(&Interner), expr_ty.kind(&Interner)) { in coerce() 86 let result1 = ctx.coerce_inner(self.expected_ty.clone(), &target_ty); in coerce() 91 return self.expected_ty = target_ty; in coerce() 99 if ctx.coerce(expr, &expr_ty, &self.expected_ty).is_ok() { in coerce() 101 } else if ctx.coerce(expr, &self.expected_ty, &expr_ty).is_ok() { in coerce() 102 self.expected_ty = expr_ty; in coerce() 107 TypeMismatch { expected: self.expected_ty.clone(), actual: expr_ty }, in coerce() [all …]
|
H A D | pat.rs | 50 let expected_ty = var_data in infer_tuple_struct_pat() localVariable 56 let expected_ty = self.normalize_associated_types_in(expected_ty); in infer_tuple_struct_pat() localVariable 57 self.infer_pat(subpat, &expected_ty, default_bm); in infer_tuple_struct_pat() 85 let expected_ty = matching_field.map_or(self.err_ty(), |field| { in infer_record_pat() localVariable 88 let expected_ty = self.normalize_associated_types_in(expected_ty); in infer_record_pat() localVariable 89 self.infer_pat(subpat.pat, &expected_ty, default_bm); in infer_record_pat()
|
H A D | closure.rs | 22 let expected_ty = match expectation.to_option(&mut self.table) { in deduce_closure_type_from_expectations() localVariable 28 let _ = self.coerce(Some(closure_expr), closure_ty, &expected_ty); in deduce_closure_type_from_expectations() 31 if let TyKind::Dyn(dyn_ty) = expected_ty.kind(&Interner) { in deduce_closure_type_from_expectations()
|
H A D | expr.rs | 50 if let Some(expected_ty) = expected.only_has_type(&mut self.table) { in infer_expr() 51 let could_unify = self.unify(&ty, &expected_ty); in infer_expr() 55 TypeMismatch { expected: expected_ty, actual: ty.clone() }, in infer_expr() 1037 if let Some(expected_ty) = expected_output.to_option(&mut self.table) { in expected_inputs_for_expected_output() 1039 if table.try_unify(&expected_ty, &output).is_ok() { in expected_inputs_for_expected_output() 1070 for ((&arg, param_ty), expected_ty) in args.iter().zip(param_iter).zip(expected_iter) { in check_call_arguments() 1084 let expected = Expectation::rvalue_hint(&mut self.table, expected_ty); in check_call_arguments()
|
/dports/lang/rust/rustc-1.58.1-src/compiler/rustc_typeck/src/check/ |
H A D | demand.rs | 904 expected_ty: Ty<'tcx>, in check_for_cast() 983 expected_ty.kind().article(), in check_for_cast() 984 expected_ty, in check_for_cast() 990 expected_ty.kind().article(), in check_for_cast() 991 expected_ty, in check_for_cast() 995 checked_ty, expected_ty, in check_for_cast() 1013 (&expected_ty.kind(), &checked_ty.kind()), in check_for_cast() 1026 format!("{})", expected_ty) in check_for_cast() 1028 expected_ty.to_string() in check_for_cast() 1061 lhs_src, expected_ty, checked_ty, src in check_for_cast() [all …]
|
H A D | coercion.rs | 1226 expected_ty: Ty<'tcx>, field 1245 pub fn new(expected_ty: Ty<'tcx>) -> Self { in new() 1246 Self::make(expected_ty, Expressions::Dynamic(vec![])) in new() 1255 Self::make(expected_ty, Expressions::UpFront(coercion_sites)) in with_coercion_sites() 1259 CoerceMany { expected_ty, final_ty: None, expressions, pushed: 0 } in make() 1270 pub fn expected_ty(&self) -> Ty<'tcx> { in expected_ty() method 1271 self.expected_ty in expected_ty() 1279 self.final_ty.unwrap_or(self.expected_ty) in merged_ty() 1364 self.expected_ty, in coerce_inner() 1433 (expression_ty, self.final_ty.unwrap_or(self.expected_ty)) in coerce_inner() [all …]
|
H A D | closure.rs | 172 expected_ty: Ty<'tcx>, in deduce_expectations_from_expected_type() 174 match *expected_ty.kind() { in deduce_expectations_from_expected_type() 512 for ((hir_ty, &supplied_ty), expected_ty) in iter::zip( in check_supplied_sig_against_expectation() 529 self.at(&cause, self.param_env).eq(*expected_ty, supplied_ty)?; in check_supplied_sig_against_expectation() 629 let ret_ty = ret_coercion.borrow().expected_ty(); in deduce_future_output_from_obligations()
|
H A D | _match.rs | 138 let ret_ty = ret_coercion.borrow().expected_ty(); in check_match() 489 expected_ty: Option<Ty<'tcx>>, in find_block_span() 495 (stmt.span, expected_ty.and_then(|ty| self.could_remove_semicolon(block, ty))) in find_block_span()
|
H A D | expr.rs | 72 let expected_ty = expected.to_option(&self).unwrap_or(self.tcx.types.bool); in check_expr_meets_expectation_or_error() localVariable 93 if let Some(mut err) = self.demand_suptype_diag(expr.span, expected_ty, ty) { in check_expr_meets_expectation_or_error() 95 self.suggest_deref_ref_or_into(&mut err, expr, expected_ty, ty, None); in check_expr_meets_expectation_or_error() 598 Some(ctxt) => ctxt.coerce.as_ref().map(|coerce| coerce.expected_ty()), in check_expr_break() 644 let ty = coerce.expected_ty(); in check_expr_break() 812 let ret_ty = ret_coercion.borrow().expected_ty(); in check_return_expr() 989 let expected_ty = expected.coercion_target_type(self, expr.span); in check_expr_assign() localVariable 990 if expected_ty == self.tcx.types.bool { in check_expr_assign() 995 let mut err = self.demand_suptype_diag(expr.span, expected_ty, actual_ty).unwrap(); in check_expr_assign()
|
/dports/lang/ocaml/ocaml-4.05.0/typing/ |
H A D | typecore.ml | 360 unify env ty expected_ty 980 sp expected_ty k = 992 pat_type = expected_ty; 1016 pat_type = expected_ty; 1026 pat_type = expected_ty; 1074 pat_type = expected_ty; 1102 pat_type = expected_ty; 1259 expected_ty 1322 expected_ty; 1337 let ty, expected_ty' = [all …]
|
/dports/lang/ocaml-nox11/ocaml-4.05.0/typing/ |
H A D | typecore.ml | 360 unify env ty expected_ty 980 sp expected_ty k = 992 pat_type = expected_ty; 1016 pat_type = expected_ty; 1026 pat_type = expected_ty; 1074 pat_type = expected_ty; 1102 pat_type = expected_ty; 1259 expected_ty 1322 expected_ty; 1337 let ty, expected_ty' = [all …]
|
/dports/multimedia/gstreamer1-plugins-rust/gst-plugins-rs-d0466b3eee114207f851b37cae0015c0e718f021/cargo-crates/glib-0.14.4/src/ |
H A D | variant.rs | 336 let expected_ty = &*Vec::<u8>::static_variant_type(); in bytes() localVariable 337 if t == expected_ty { in bytes() 346 expected: expected_ty.to_owned(), in bytes() 488 let expected_ty = child_ty.with_array(); in array_iter_str() localVariable 489 if actual_ty != expected_ty { in array_iter_str() 492 expected: expected_ty, in array_iter_str()
|
/dports/graphics/librsvg2-rust/librsvg-2.52.8/vendor/glib/src/ |
H A D | variant.rs | 336 let expected_ty = &*Vec::<u8>::static_variant_type(); in bytes() localVariable 337 if t == expected_ty { in bytes() 346 expected: expected_ty.to_owned(), in bytes() 488 let expected_ty = child_ty.with_array(); in array_iter_str() localVariable 489 if actual_ty != expected_ty { in array_iter_str() 492 expected: expected_ty, in array_iter_str()
|
/dports/sysutils/czkawka/czkawka-3.3.1/cargo-crates/glib-0.14.8/src/ |
H A D | variant.rs | 336 let expected_ty = &*Vec::<u8>::static_variant_type(); in bytes() localVariable 337 if t == expected_ty { in bytes() 346 expected: expected_ty.to_owned(), in bytes() 488 let expected_ty = child_ty.with_array(); in array_iter_str() localVariable 489 if actual_ty != expected_ty { in array_iter_str() 492 expected: expected_ty, in array_iter_str()
|
/dports/audio/gnome-podcasts/podcasts-c86f7bfdef7692bbf20f315a90450321f6ca9ce7/cargo-crates/glib-0.14.8/src/ |
H A D | variant.rs | 336 let expected_ty = &*Vec::<u8>::static_variant_type(); in bytes() localVariable 337 if t == expected_ty { in bytes() 346 expected: expected_ty.to_owned(), in bytes() 488 let expected_ty = child_ty.with_array(); in array_iter_str() localVariable 489 if actual_ty != expected_ty { in array_iter_str() 492 expected: expected_ty, in array_iter_str()
|
/dports/x11/sirula/sirula-1.0.0/cargo-crates/glib-0.14.8/src/ |
H A D | variant.rs | 336 let expected_ty = &*Vec::<u8>::static_variant_type(); in bytes() localVariable 337 if t == expected_ty { in bytes() 346 expected: expected_ty.to_owned(), in bytes() 488 let expected_ty = child_ty.with_array(); in array_iter_str() localVariable 489 if actual_ty != expected_ty { in array_iter_str() 492 expected: expected_ty, in array_iter_str()
|
/dports/mail/thunderbird/thunderbird-91.8.0/third_party/rust/naga/src/valid/ |
H A D | function.rs | 349 let expected_ty = context.return_type.map(|ty| &context.types[ty].inner); in validate_block_impl() localVariable 350 if value_ty != expected_ty { in validate_block_impl() 354 expected_ty in validate_block_impl()
|
/dports/www/firefox-esr/firefox-91.8.0/third_party/rust/naga/src/valid/ |
H A D | function.rs | 349 let expected_ty = context.return_type.map(|ty| &context.types[ty].inner); in validate_block_impl() localVariable 350 if value_ty != expected_ty { in validate_block_impl() 354 expected_ty in validate_block_impl()
|
/dports/lang/rust/rustc-1.58.1-src/compiler/rustc_typeck/src/check/fn_ctxt/ |
H A D | checks.rs | 738 if let Some(expected_ty) = expected.only_has_type(self) { in check_block_with_expected() 739 self.consider_hint_about_removing_semicolon(blk, expected_ty, err); in check_block_with_expected() 740 if expected_ty == self.tcx.types.bool { in check_block_with_expected() 805 expected_ty: Ty<'tcx>, in consider_hint_about_removing_semicolon() 808 if let Some((span_semi, boxed)) = self.could_remove_semicolon(blk, expected_ty) { in consider_hint_about_removing_semicolon()
|
/dports/lang/rust/rustc-1.58.1-src/compiler/rustc_codegen_llvm/src/ |
H A D | builder.rs | 1375 .all(|(expected_ty, actual_ty)| *expected_ty == actual_ty); in check_call() 1383 .map(|(i, (expected_ty, &actual_val))| { in check_call() 1385 if expected_ty != actual_ty { in check_call() 1389 llfn, expected_ty, i, actual_ty in check_call() 1391 self.bitcast(actual_val, expected_ty) in check_call()
|
/dports/misc/tvm/incubator-tvm-0.6.1/tests/python/relay/ |
H A D | test_type_infer.py | 97 expected_ty = relay.FuncType([t1, t2], t3) 98 assert_has_type(func, expected_ty)
|