-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-lang-itemArea: Language itemsArea: Language itemsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
There are currently quite a few locations in the compiler similar to the following:
rust/src/librustc_typeck/check/mod.rs
Line 5301 in 7c34d8d
let future_trait = self.tcx.lang_items().future_trait().unwrap(); |
This causes an internal compiler error in case the expected lang item is not defined,
for example when using #![no_core]
. (see #72099)
A better way to deal with this is to use tcx.require_lang_item(FutureTraitLangItem, opt_span)
instead, which cleanly stops compilation in case the lang item is missing.
See #72170, which already did this in some places.
This issue has been assigned to @doctorn via this comment.
estebank
Metadata
Metadata
Assignees
Labels
A-lang-itemArea: Language itemsArea: Language itemsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.