rust/compiler
bors 7c89e389d0 Auto merge of #87265 - Aaron1011:hir-wf-fn, r=estebank
Support HIR wf checking for function signatures

During function type-checking, we normalize any associated types in
the function signature (argument types + return type), and then
create WF obligations for each of the normalized types. The HIR wf code
does not currently support this case, so any errors that we get have
imprecise spans.

This commit extends `ObligationCauseCode::WellFormed` to support
recording a function parameter, allowing us to get the corresponding
HIR type if an error occurs. Function typechecking is modified to
pass this information during signature normalization and WF checking.
The resulting code is fairly verbose, due to the fact that we can
no longer normalize the entire signature with a single function call.

As part of the refactoring, we now perform HIR-based WF checking
for several other 'typed items' (statics, consts, and inherent impls).

As a result, WF and projection errors in a function signature now
have a precise span, which points directly at the responsible type.
If a function signature is constructed via a macro, this will allow
the error message to point at the code 'most responsible' for the error
(e.g. a user-supplied macro argument).
2021-07-22 07:21:45 +00:00
..
rustc
rustc_apfloat
rustc_arena
rustc_ast Remove special case for ExprKind::Paren in MutVisitor 2021-07-19 17:23:10 -05:00
rustc_ast_lowering Auto merge of #87244 - jackh726:issue-71883, r=estebank 2021-07-20 10:56:08 +00:00
rustc_ast_passes Auto merge of #83918 - workingjubilee:stable-rangefrom-pat, r=joshtriplett 2021-07-11 06:31:42 +00:00
rustc_ast_pretty Rework SESSION_GLOBALS API to prevent overwriting it 2021-07-08 16:16:28 +02:00
rustc_attr Enhance well-formedness checks for #[repr(...)] attributes 2021-07-09 22:03:48 +02:00
rustc_builtin_macros Rollup merge of #87206 - matthiaskrgr:clippy_collect, r=davidtwco 2021-07-21 15:52:45 +02:00
rustc_codegen_cranelift Rollup merge of #87092 - ricobbe:fix-raw-dylib-multiple-definitions, r=petrochenkov 2021-07-18 14:21:56 +09:00
rustc_codegen_llvm Auto merge of #86950 - tmiasko:personality, r=nagisa 2021-07-18 20:33:23 +00:00
rustc_codegen_ssa Auto merge of #87153 - michaelwoerister:debuginfo-names-dyn-trait-projection-bounds, r=wesleywiser 2021-07-19 21:25:43 +00:00
rustc_data_structures Some perf optimizations and logging 2021-07-17 16:09:17 -04:00
rustc_driver
rustc_error_codes Rollup merge of #87342 - midgleyc:add-E0757-long, r=GuillaumeGomez 2021-07-21 15:52:53 +02:00
rustc_errors Various diagnostics clean ups/tweaks 2021-07-19 08:43:35 -07:00
rustc_expand Only use assign_id! for ast nodes that support attributes 2021-07-17 23:03:58 -05:00
rustc_feature Improve impl_trait_in_bindings removed feature text 2021-07-19 09:20:15 -03:00
rustc_fs_util
rustc_graphviz
rustc_hir Rollup merge of #87273 - fee1-dead:impl-const-impl-bounds, r=oli-obk 2021-07-21 15:52:47 +02:00
rustc_hir_pretty
rustc_incremental Move OnDiskCache to rustc_query_impl. 2021-07-18 11:14:07 +02:00
rustc_index
rustc_infer Auto merge of #87246 - rust-lang:placeholder-pretty, r=nikomatsakis 2021-07-22 02:22:02 +00:00
rustc_interface Remove deadlock virtual call. 2021-07-18 11:14:08 +02:00
rustc_lexer
rustc_lint Rename force-warns to force-warn 2021-07-21 15:41:10 +02:00
rustc_lint_defs Rename force-warns to force-warn 2021-07-21 15:41:10 +02:00
rustc_llvm Upgrade cc crate to 1.0.69 2021-07-13 17:58:50 +09:00
rustc_macros Move OnDiskCache to rustc_query_impl. 2021-07-18 11:14:07 +02:00
rustc_metadata Auto merge of #86698 - cjgillot:modc, r=estebank 2021-07-18 10:42:23 +00:00
rustc_middle Auto merge of #87265 - Aaron1011:hir-wf-fn, r=estebank 2021-07-22 07:21:45 +00:00
rustc_mir Rollup merge of #87311 - oli-obk:nll_suggestion_span, r=estebank 2021-07-21 15:52:51 +02:00
rustc_mir_build Revert "structural_match: non-structural-match ty closures" 2021-07-18 09:30:10 -03:00
rustc_parse Auto merge of #87242 - JohnTitor:rollup-t9rmwpo, r=JohnTitor 2021-07-18 08:15:17 +00:00
rustc_parse_format Rework SESSION_GLOBALS API to prevent overwriting it 2021-07-08 16:16:28 +02:00
rustc_passes Warn about useless assignments of variables/fields to themselves 2021-07-14 16:29:35 +02:00
rustc_plugin_impl
rustc_privacy
rustc_query_impl Support HIR wf checking for function signatures 2021-07-20 10:58:14 -05:00
rustc_query_system
rustc_resolve Compute a better lint_node_id during expansion 2021-07-17 23:03:56 -05:00
rustc_save_analysis rustc_span: Revert addition of proc_macro field to ExpnKind::Macro 2021-07-10 23:03:35 +03:00
rustc_serialize
rustc_session Rename force-warns to force-warn 2021-07-21 15:41:10 +02:00
rustc_span Auto merge of #87225 - estebank:cleanup, r=oli-obk 2021-07-19 18:44:27 +00:00
rustc_symbol_mangling
rustc_target Auto merge of #87124 - Andy-Python-Programmer:code_model_uefi_patch, r=petrochenkov 2021-07-17 10:15:33 +00:00
rustc_trait_selection Auto merge of #87265 - Aaron1011:hir-wf-fn, r=estebank 2021-07-22 07:21:45 +00:00
rustc_traits Add initial implementation of HIR-based WF checking for diagnostics 2021-07-16 16:29:02 -05:00
rustc_ty_utils Add impl_constness query 2021-07-10 20:54:49 +08:00
rustc_type_ir
rustc_typeck Auto merge of #87265 - Aaron1011:hir-wf-fn, r=estebank 2021-07-22 07:21:45 +00:00