rust/compiler
Nicholas Nethercote 2c2c7f13a6 Remove Handler::emit_diag_at_span.
Compare `Handler::warn` and `Handler::span_warn`. Conceptually they are
almost identical. But their implementations are weirdly different.

`warn`:
- calls `DiagnosticBuilder::<()>::new(self, Warning(None), msg)`, then `emit()`
- which calls `G::diagnostic_builder_emit_producing_guarantee(self)`
- which calls `handler.emit_diagnostic(&mut db.inner.diagnostic)`

`span_warn`:
- calls `self.emit_diag_at_span(Diagnostic::new(Warning(None), msg), span)`
- which calls `self.emit_diagnostic(diag.set_span(sp))`

I.e. they both end up at `emit_diagnostic`, but take very different
routes to get there.

This commit changes `span_*` and similar ones to not use
`emit_diag_at_span`. Instead they just call `struct_span_*` + `emit`.

Some nice side-effects of this:
- `span_fatal` and `span_fatal_with_code` don't need
  `FatalError.raise()`, because `emit` does that.
- `span_err` and `span_err_with_code` doesn't need `unwrap`.
- `struct_span_note`'s `span` arg type is changed from `Span` to
  `impl Into<MultiSpan>` like all the other functions.
2023-12-15 09:48:00 +11:00
..
rustc Clean up rustc_*/Cargo.toml. 2023-10-30 08:46:02 +11:00
rustc_abi Rename LayoutCalculator::delay_bug as LayoutCalculator::delayed_bug. 2023-12-02 09:01:34 +11:00
rustc_arena rustc_arena: add alloc_str 2023-12-05 17:52:51 -08:00
rustc_ast Don't gate the feature twice 2023-12-12 14:52:05 +01:00
rustc_ast_lowering Correctly gate the parsing of match arms without body 2023-12-12 14:42:04 +01:00
rustc_ast_passes Correctly gate the parsing of match arms without body 2023-12-12 14:42:04 +01:00
rustc_ast_pretty Rollup merge of #118726 - dtolnay:matchguardlet, r=compiler-errors 2023-12-11 20:46:49 +01:00
rustc_attr Use Session::diagnostic in more places. 2023-12-02 09:01:35 +11:00
rustc_baked_icu_data Bump cfg(bootstrap)s 2023-11-15 19:41:28 -05:00
rustc_borrowck remove some redundant clones 2023-12-11 21:54:36 +01:00
rustc_builtin_macros Avoid struct_diagnostic where possible. 2023-12-14 15:53:55 +11:00
rustc_codegen_cranelift Auto merge of #117758 - Urgau:lint_pointer_trait_comparisons, r=davidtwco 2023-12-11 14:33:16 +00:00
rustc_codegen_gcc Fix rustc codegen gcc tests 2023-12-11 18:48:49 +01:00
rustc_codegen_llvm Avoid struct_diagnostic where possible. 2023-12-14 15:53:55 +11:00
rustc_codegen_ssa Auto merge of #118344 - saethlin:rmeta-header-pos, r=WaffleLapkin 2023-12-11 17:21:14 +00:00
rustc_const_eval Auto merge of #118661 - fee1-dead-contrib:restore-const-partialEq, r=compiler-errors 2023-12-11 10:34:51 +00:00
rustc_data_structures remove redundant imports 2023-12-10 10:56:22 +08:00
rustc_driver Bump cfg(bootstrap)s 2023-11-15 19:41:28 -05:00
rustc_driver_impl Extract exhaustiveness into its own crate 2023-12-11 11:20:55 +01:00
rustc_error_codes Remove edition umbrella features. 2023-12-10 13:03:28 -08:00
rustc_error_messages Remove rustc_error_messages/messages.ftl. 2023-11-26 08:37:27 +11:00
rustc_errors Remove Handler::emit_diag_at_span. 2023-12-15 09:48:00 +11:00
rustc_expand Change msg: impl Into<String> for bug diagnostics. 2023-12-15 09:42:14 +11:00
rustc_feature Remove edition umbrella features. 2023-12-10 13:03:28 -08:00
rustc_fluent_macro Add a useful comment. 2023-11-26 08:38:02 +11:00
rustc_fs_util Clean up rustc_*/Cargo.toml. 2023-10-30 08:46:02 +11:00
rustc_graphviz remove unused pub fn 2023-11-23 14:11:02 +03:00
rustc_hir Auto merge of #118420 - compiler-errors:async-gen, r=eholk 2023-12-08 19:13:57 +00:00
rustc_hir_analysis review + rename fn 2023-12-12 12:28:54 +00:00
rustc_hir_pretty remove redundant imports 2023-12-10 10:56:22 +08:00
rustc_hir_typeck review + rename fn 2023-12-12 12:28:54 +00:00
rustc_incremental remove redundant imports 2023-12-10 10:56:22 +08:00
rustc_index Replace no_ord_impl with orderable. 2023-11-22 18:38:17 +11:00
rustc_index_macros Put backticks around some attributes in doc comments. 2023-11-27 09:37:01 +11:00
rustc_infer refactor writeback: emit normalization errors with new solver 2023-12-12 12:20:54 +00:00
rustc_interface remove redundant imports 2023-12-10 10:56:22 +08:00
rustc_lexer Tweak Mode. 2023-12-09 09:30:32 +11:00
rustc_lint Auto merge of #117758 - Urgau:lint_pointer_trait_comparisons, r=davidtwco 2023-12-11 14:33:16 +00:00
rustc_lint_defs Rollup merge of #117927 - ehuss:future-incompat-docs, r=wesleywiser 2023-12-12 17:40:53 +01:00
rustc_llvm llvm-wrapper: adapt for LLVM API change 2023-12-12 12:29:30 +00:00
rustc_log rustc_log: provide a way to init logging based on the values, not names, of the env vars 2023-11-11 15:24:33 +01:00
rustc_macros remove redundant imports 2023-12-10 10:56:22 +08:00
rustc_metadata Auto merge of #118344 - saethlin:rmeta-header-pos, r=WaffleLapkin 2023-12-11 17:21:14 +00:00
rustc_middle Change msg: impl Into<String> for bug diagnostics. 2023-12-15 09:42:14 +11:00
rustc_mir_build Rollup merge of #118822 - Nadrieril:librarify, r=compiler-errors 2023-12-11 20:46:50 +01:00
rustc_mir_dataflow remove redundant imports 2023-12-10 10:56:22 +08:00
rustc_mir_transform Avoid struct_diagnostic where possible. 2023-12-14 15:53:55 +11:00
rustc_monomorphize Rollup merge of #118693 - saethlin:alignment-check-symbol-reachable, r=bjorn3 2023-12-08 06:44:42 +01:00
rustc_next_trait_solver Make it not depend on nightly conditionally 2023-12-08 17:44:01 +00:00
rustc_parse Change msg: impl Into<String> for bug diagnostics. 2023-12-15 09:42:14 +11:00
rustc_parse_format Auto merge of #117819 - fmease:rustc_parse_format-stable-rustc, r=Nilstrieb 2023-11-15 14:55:35 +00:00
rustc_passes Remove #[rustc_host], use internal desugaring 2023-12-05 01:15:21 +00:00
rustc_pattern_analysis Fix doc links 2023-12-11 12:53:01 +01:00
rustc_privacy privacy: visit trait def id of projections 2023-12-08 14:26:03 +00:00
rustc_query_impl QueryContext: rename try_collect_active_jobs -> collect_active_jobs and change it's return type from Option<QueryMap> to QueryMap 2023-11-27 18:13:15 +03:00
rustc_query_system remove redundant imports 2023-12-10 10:56:22 +08:00
rustc_resolve Rollup merge of #117914 - estebank:issue-85843, r=wesleywiser 2023-12-12 17:40:53 +01:00
rustc_serialize Call FileEncoder::finish in rmeta encoding 2023-11-22 22:49:22 -05:00
rustc_session Change msg: impl Into<String> for bug diagnostics. 2023-12-15 09:42:14 +11:00
rustc_smir Rollup merge of #118846 - celinval:smir-ty-methods, r=compiler-errors 2023-12-12 06:52:51 +01:00
rustc_span Auto merge of #117758 - Urgau:lint_pointer_trait_comparisons, r=davidtwco 2023-12-11 14:33:16 +00:00
rustc_symbol_mangling Revert "Don't print host effect param in pretty path_generic_args" 2023-12-10 10:17:28 +00:00
rustc_target Auto merge of #118150 - roblabla:new-win7-targets, r=davidtwco 2023-12-09 08:41:50 +00:00
rustc_trait_selection Auto merge of #118881 - matthiaskrgr:rollup-0rl3tir, r=matthiaskrgr 2023-12-12 18:20:37 +00:00
rustc_traits add unused NormalizesTo predicate 2023-12-07 17:52:51 +01:00
rustc_transmute Update itertools to 0.11. 2023-11-22 08:13:21 +11:00
rustc_ty_utils Auto merge of #117116 - calebzulawski:repr-simd-packed, r=workingjubilee 2023-12-11 08:07:20 +00:00
rustc_type_ir Make ConstKind and TyKind Copy 2023-12-12 01:09:12 +00:00
stable_mir Rollup merge of #118846 - celinval:smir-ty-methods, r=compiler-errors 2023-12-12 06:52:51 +01:00