diff options
| author | bors <bors@rust-lang.org> | 2022-10-31 12:07:07 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-10-31 12:07:07 +0000 |
| commit | 2afca78a0b03db144c5d8b9f8868feebfe096309 (patch) | |
| tree | 50b298f204ba63b6de1acf5f7667559bc86b0d8a /compiler/rustc_monomorphize/src | |
| parent | 4596f4f8b565bdd02d3b99d1ab12ff09146a93de (diff) | |
| parent | 4a254d557aef513c4dec1757eb1c2e7913a9f5a0 (diff) | |
Auto merge of #103797 - Dylan-DPC:rollup-ps589fi, r=Dylan-DPC
Rollup of 5 pull requests Successful merges: - #103338 (Fix unreachable_pub suggestion for enum with fields) - #103603 (Lang item cleanups) - #103732 (Revert "Make the `c` feature for `compiler-builtins` opt-in instead of inferred") - #103766 (Add tracking issue to `error_in_core`) - #103789 (Update E0382.md) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_monomorphize/src')
| -rw-r--r-- | compiler/rustc_monomorphize/src/collector.rs | 11 | ||||
| -rw-r--r-- | compiler/rustc_monomorphize/src/errors.rs | 6 |
2 files changed, 2 insertions, 15 deletions
diff --git a/compiler/rustc_monomorphize/src/collector.rs b/compiler/rustc_monomorphize/src/collector.rs index a71218e6997..3cfddd75462 100644 --- a/compiler/rustc_monomorphize/src/collector.rs +++ b/compiler/rustc_monomorphize/src/collector.rs @@ -201,7 +201,7 @@ use std::iter; use std::ops::Range; use std::path::PathBuf; -use crate::errors::{LargeAssignmentsLint, RecursionLimit, RequiresLangItem, TypeLengthLimit}; +use crate::errors::{LargeAssignmentsLint, RecursionLimit, TypeLengthLimit}; #[derive(PartialEq)] pub enum MonoItemCollectionMode { @@ -1298,14 +1298,7 @@ impl<'v> RootCollector<'_, 'v> { return; }; - let start_def_id = match self.tcx.lang_items().require(LangItem::Start) { - Ok(s) => s, - Err(lang_item_err) => { - self.tcx - .sess - .emit_fatal(RequiresLangItem { lang_item: lang_item_err.0.name().to_string() }); - } - }; + let start_def_id = self.tcx.require_lang_item(LangItem::Start, None); let main_ret_ty = self.tcx.fn_sig(main_def_id).output(); // Given that `main()` has no arguments, diff --git a/compiler/rustc_monomorphize/src/errors.rs b/compiler/rustc_monomorphize/src/errors.rs index ce097b8d846..870d50728bd 100644 --- a/compiler/rustc_monomorphize/src/errors.rs +++ b/compiler/rustc_monomorphize/src/errors.rs @@ -32,12 +32,6 @@ pub struct TypeLengthLimit { pub type_length: usize, } -#[derive(Diagnostic)] -#[diag(monomorphize_requires_lang_item)] -pub struct RequiresLangItem { - pub lang_item: String, -} - pub struct UnusedGenericParams { pub span: Span, pub param_spans: Vec<Span>, |
