rust/compiler
Matthias Krüger 5ebacd1b3c
Rollup merge of #135965 - estebank:shorten-ty-sugg, r=lcnr
In "specify type" suggestion, skip type params that are already known

When we suggest specifying a type for an expression or pattern, like in a `let` binding, we previously would print the entire type as the type system knew it. We now look at the params that have *no* inference variables, so they are fully known to the type system which means that they don't need to be specified.

This helps in suggestions for types that are really long, because we can usually skip most of the type params and make the annotation as short as possible:

```
error[E0282]: type annotations needed for `Result<_, ((..., ..., ..., ...), ..., ..., ...)>`
  --> $DIR/really-long-type-in-let-binding-without-sufficient-type-info.rs:7:9
   |
LL |     let y = Err(x);
   |         ^   ------ type must be known at this point
   |
help: consider giving `y` an explicit type, where the type for type parameter `T` is specified
   |
LL |     let y: Result<T, _> = Err(x);
   |          ++++++++++++++
```

Fix #135919.
2025-02-12 06:07:36 +01:00
..
rustc switch jemalloc-sys back to tikv-jemalloc-sys, and update to 0.6.0 2024-12-03 08:56:33 +00:00
rustc_abi compiler: remove abi-specific extern "{abi}" suggestions 2025-02-09 20:45:47 -08:00
rustc_arena Add inherent versions of MaybeUninit methods for slices 2025-01-11 23:57:00 -05:00
rustc_ast Rollup merge of #136419 - EnzymeAD:autodiff-tests, r=onur-ozkan,jieyouxu 2025-02-10 16:38:23 +01:00
rustc_ast_ir
rustc_ast_lowering Rollup merge of #136239 - folkertdev:show-supported-register-classes, r=SparrowLii,jieyouxu 2025-02-11 18:04:34 +01:00
rustc_ast_passes compiler: remove rustc_target::spec::abi reexports 2025-02-09 20:45:47 -08:00
rustc_ast_pretty Auto merge of #136471 - safinaskar:parallel, r=SparrowLii 2025-02-06 10:50:05 +00:00
rustc_attr_data_structures rustc_allowed_through_unstable_modules: require deprecation message 2025-02-02 12:36:12 +01:00
rustc_attr_parsing Rustfmt 2025-02-08 22:12:13 +00:00
rustc_baked_icu_data Delete the cfg(not(parallel)) serial compiler 2024-11-12 13:38:58 +00:00
rustc_borrowck Rustfmt 2025-02-08 22:12:13 +00:00
rustc_builtin_macros Auto merge of #136851 - jhpratt:rollup-ftijn95, r=jhpratt 2025-02-11 10:17:02 +00:00
rustc_codegen_cranelift Rollup merge of #136714 - tgross35:update-builtins, r=tgross35 2025-02-10 16:38:26 +01:00
rustc_codegen_gcc cg_gcc: stop caring about compiling for unknown targets 2025-02-10 11:19:02 -08:00
rustc_codegen_llvm Rollup merge of #135549 - oli-obk:push-tmxtpnrloyqu, r=compiler-errors 2025-02-12 06:07:35 +01:00
rustc_codegen_ssa Rollup merge of #136603 - workingjubilee:move-abi-versioning-into-ast, r=compiler-errors 2025-02-11 02:53:44 +01:00
rustc_const_eval Rollup merge of #136833 - workingjubilee:let-the-impossible-be-impossible, r=compiler-errors 2025-02-11 18:04:44 +01:00
rustc_data_structures Rustfmt 2025-02-08 22:12:13 +00:00
rustc_driver
rustc_driver_impl compiler: remove rustc_target::spec::abi reexports 2025-02-09 20:45:47 -08:00
rustc_error_codes fix the error code document 2025-02-10 04:36:49 +08:00
rustc_error_messages tree-wide: parallel: Fully removed all Lrc, replaced with Arc 2025-02-03 13:25:57 +03:00
rustc_errors Rollup merge of #136847 - nnethercote:simplify-intra-crate-quals, r=oli-obk 2025-02-11 18:04:49 +01:00
rustc_expand Rollup merge of #136107 - dingxiangfei2009:coerce-pointee-wellformed, r=compiler-errors 2025-02-11 02:53:42 +01:00
rustc_feature Rollup merge of #136584 - oli-obk:pattern-types-generic, r=BoxyUwU 2025-02-11 02:53:44 +01:00
rustc_fluent_macro
rustc_fs_util
rustc_graphviz Rustfmt 2025-02-08 22:12:13 +00:00
rustc_hir Rollup merge of #136107 - dingxiangfei2009:coerce-pointee-wellformed, r=compiler-errors 2025-02-11 02:53:42 +01:00
rustc_hir_analysis Rollup merge of #136107 - dingxiangfei2009:coerce-pointee-wellformed, r=compiler-errors 2025-02-11 02:53:42 +01:00
rustc_hir_pretty Rustfmt 2025-02-08 22:12:13 +00:00
rustc_hir_typeck Rollup merge of #136524 - compiler-errors:bad-pick, r=BoxyUwU 2025-02-11 02:53:43 +01:00
rustc_incremental Rustfmt 2025-02-08 22:12:13 +00:00
rustc_index Rustfmt 2025-02-08 22:12:13 +00:00
rustc_index_macros update rustc_index_macros feature handling 2024-12-19 20:32:12 +03:00
rustc_infer Rustfmt 2025-02-08 22:12:13 +00:00
rustc_interface Auto merge of #136751 - bjorn3:update_rustfmt, r=Mark-Simulacrum 2025-02-09 15:44:16 +00:00
rustc_lexer Rustfmt 2025-02-08 22:12:13 +00:00
rustc_lint Rollup merge of #136760 - chenyukang:fix-overflowing-int-lint-crash, r=oli-obk 2025-02-09 19:44:53 +01:00
rustc_lint_defs Rollup merge of #135964 - ehuss:cenum_impl_drop_cast, r=Nadrieril 2025-02-05 19:09:33 +08:00
rustc_llvm Rollup merge of #136419 - EnzymeAD:autodiff-tests, r=onur-ozkan,jieyouxu 2025-02-10 16:38:23 +01:00
rustc_log Avoid naming variables str 2025-01-07 14:30:02 +02:00
rustc_macros Rustfmt 2025-02-08 22:12:13 +00:00
rustc_metadata Rustfmt 2025-02-08 22:12:13 +00:00
rustc_middle Rollup merge of #136847 - nnethercote:simplify-intra-crate-quals, r=oli-obk 2025-02-11 18:04:49 +01:00
rustc_mir_build Rustfmt 2025-02-08 22:12:13 +00:00
rustc_mir_dataflow Rustfmt 2025-02-08 22:12:13 +00:00
rustc_mir_transform Rollup merge of #136786 - compiler-errors:de-de-duplicate-blocks, r=oli-obk 2025-02-11 18:04:42 +01:00
rustc_monomorphize Auto merge of #136751 - bjorn3:update_rustfmt, r=Mark-Simulacrum 2025-02-09 15:44:16 +00:00
rustc_next_trait_solver Rustfmt 2025-02-08 22:12:13 +00:00
rustc_parse Stop using span hack for contracts feature gating 2025-02-10 19:51:26 +00:00
rustc_parse_format Rustfmt 2025-02-08 22:12:13 +00:00
rustc_passes Rollup merge of #136833 - workingjubilee:let-the-impossible-be-impossible, r=compiler-errors 2025-02-11 18:04:44 +01:00
rustc_pattern_analysis Get rid of mir::Const::from_ty_const 2025-01-20 04:26:44 +00:00
rustc_privacy Make comma separated lists of anything easier to make for errors 2025-01-31 20:36:44 +00:00
rustc_query_impl Removed dependency on the field-offset crate. 2025-02-05 17:56:06 +01:00
rustc_query_system Auto merge of #136471 - safinaskar:parallel, r=SparrowLii 2025-02-06 10:50:05 +00:00
rustc_resolve Rollup merge of #135677 - yotamofek:resolve-cleanups2, r=compiler-errors 2025-02-11 18:04:28 +01:00
rustc_sanitizers check the types in ty::Value to value conversion 2025-01-30 18:13:16 +01:00
rustc_serialize
rustc_session Rollup merge of #135285 - tbu-:pr_fix_typo4, r=GuillaumeGomez 2025-02-11 18:04:22 +01:00
rustc_smir Rustfmt 2025-02-08 22:12:13 +00:00
rustc_span Rollup merge of #136584 - oli-obk:pattern-types-generic, r=BoxyUwU 2025-02-11 02:53:44 +01:00
rustc_symbol_mangling Move try_to_raw_bytes from ty::Valtree to ty::Value 2025-02-03 18:33:27 +01:00
rustc_target Rollup merge of #136833 - workingjubilee:let-the-impossible-be-impossible, r=compiler-errors 2025-02-11 18:04:44 +01:00
rustc_trait_selection Rollup merge of #135965 - estebank:shorten-ty-sugg, r=lcnr 2025-02-12 06:07:36 +01:00
rustc_traits Auto merge of #136011 - compiler-errors:query-norm-vaniquishes-us, r=jackh726 2025-01-29 02:12:12 +00:00
rustc_transmute transmutability: fix ICE when passing wrong ADT to ASSUME 2025-02-08 05:44:29 +01:00
rustc_ty_utils compiler: die immediately instead of handling unknown target codegen 2025-02-10 11:04:31 -08:00
rustc_type_ir Simplify intra-crate qualifiers. 2025-02-11 14:59:13 +11:00
rustc_type_ir_macros Rustfmt 2025-02-08 22:12:13 +00:00
stable_mir occured -> occurred 2025-02-08 22:28:21 +00:00