rust/compiler
bors fc42fb8e70 Auto merge of #77354 - ecstatic-morse:const-checking-moar-errors, r=oli-obk
Overhaul const-checking diagnostics

The primary purpose of this PR was to remove `NonConstOp::STOPS_CONST_CHECKING`, which causes any additional errors found by the const-checker to be silenced. I used this flag to preserve diagnostic parity with `qualify_min_const_fn.rs`, which has since been removed.

However, simply removing the flag caused a deluge of errors in some cases, since an error would be emitted any time a local or temporary had a wrong type. To remedy this, I added an alternative system (`DiagnosticImportance`) to silence additional error messages that were likely to distract the user from the underlying issue. When an error of the highest importance occurs, all less important errors are silenced. When no error of the highest importance occurs, all less important errors are emitted after checking is complete. Following the suggestions from the important error is usually enough to fix the less important errors, so this should lead to better UX most of the time.

There's also some unrelated diagnostics improvements in this PR isolated in their own commits. Splitting them out would be possible, but a bit of a pain. This isn't as tidy as some of my other PRs, but it should *only* affect diagnostics, never whether or not something passes const-checking. Note that there are a few trivial exceptions to this, like banning `Yield` in all const-contexts, not just `const fn`.

As always, meant to be reviewed commit-by-commit.

r? `@oli-obk`
2020-10-01 07:38:47 +00:00
..
rustc
rustc_apfloat
rustc_arena
rustc_ast
rustc_ast_lowering
rustc_ast_passes
rustc_ast_pretty
rustc_attr Remove rustc_allow_const_fn_ptr 2020-09-27 10:46:41 -07:00
rustc_builtin_macros expand: Stop un-interpolating NtIdents before passing them to built-in macros 2020-09-28 23:10:44 +03:00
rustc_codegen_llvm Add support for cmse_nonsecure_entry attribute 2020-09-30 15:48:59 +01:00
rustc_codegen_ssa Rollup merge of #77202 - ehuss:defer-apple-sdkroot, r=petrochenkov 2020-10-01 02:13:34 +02:00
rustc_data_structures Stable hashing: add comments and tests concerning platform-independence 2020-09-30 00:57:35 -07:00
rustc_driver Rollup merge of #76474 - bjorn3:driver_selected_codegen, r=oli-obk 2020-09-28 18:39:40 +02:00
rustc_error_codes Auto merge of #77354 - ecstatic-morse:const-checking-moar-errors, r=oli-obk 2020-10-01 07:38:47 +00:00
rustc_errors
rustc_expand expand: Minor fn ptr call cleanup 2020-09-28 23:10:48 +03:00
rustc_feature Add support for cmse_nonsecure_entry attribute 2020-09-30 15:48:59 +01:00
rustc_fs_util
rustc_graphviz
rustc_hir
rustc_hir_pretty
rustc_incremental
rustc_index
rustc_infer
rustc_interface
rustc_lexer
rustc_lint
rustc_llvm Update LLVM and add Unsupported diagnostic 2020-09-30 14:57:37 +01:00
rustc_macros
rustc_metadata
rustc_middle Auto merge of #77354 - ecstatic-morse:const-checking-moar-errors, r=oli-obk 2020-10-01 07:38:47 +00:00
rustc_mir Auto merge of #77354 - ecstatic-morse:const-checking-moar-errors, r=oli-obk 2020-10-01 07:38:47 +00:00
rustc_mir_build
rustc_parse Fix recursive nonterminal expansion during pretty-print/reparse check 2020-09-28 19:14:42 -04:00
rustc_parse_format
rustc_passes Rollup merge of #77343 - varkor:rustc_args_required_const-validation, r=lcnr 2020-10-01 02:13:44 +02:00
rustc_plugin_impl
rustc_privacy
rustc_query_system
rustc_resolve Improve wording for external crate resolution error 2020-09-30 16:03:01 -07:00
rustc_save_analysis
rustc_serialize
rustc_session [mir-opt] Introduce a new flag to enable experimental/unsound mir opts 2020-09-27 19:21:01 -04:00
rustc_span Add support for cmse_nonsecure_entry attribute 2020-09-30 15:48:59 +01:00
rustc_symbol_mangling
rustc_target Rollup merge of #77202 - ehuss:defer-apple-sdkroot, r=petrochenkov 2020-10-01 02:13:34 +02:00
rustc_trait_selection Rollup merge of #77305 - lcnr:candidate_from_obligation, r=davidtwco 2020-10-01 02:13:37 +02:00
rustc_traits
rustc_ty
rustc_typeck Auto merge of #77372 - jonas-schievink:rollup-e5bdzga, r=jonas-schievink 2020-09-30 20:49:27 +00:00