1
Fork 0

Rollup merge of #120472 - Nilstrieb:die, r=compiler-errors

Make duplicate lang items fatal

Prevents terminal spam.
This commit is contained in:
Nadrieril 2024-01-31 12:10:52 +01:00 committed by GitHub
commit 032596e34c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 26 additions and 64 deletions

View file

@ -149,7 +149,9 @@ impl<'ast, 'tcx> LanguageItemCollector<'ast, 'tcx> {
}
};
self.tcx.dcx().emit_err(DuplicateLangItem {
// When there's a duplicate lang item, something went very wrong and there's no value in recovering or doing anything.
// Give the user the one message to let them debug the mess they created and then wish them farewell.
self.tcx.dcx().emit_fatal(DuplicateLangItem {
local_span: item_span,
lang_item_name,
crate_name,