-
Notifications
You must be signed in to change notification settings - Fork 13.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove deprecated lang items #44526
Remove deprecated lang items #44526
Conversation
They have been deprecated for years and there is no trace left of them in the compiler.
It's unused and unnecessary
Small refactorings
Short and sweet
src/librustc/middle/lang_items.rs
Outdated
|
||
pub fn require_owned_box(&self) -> Result<DefId, String> { | ||
self.require(OwnedBoxLangItem) | ||
self.items[it as usize].ok_or(format!("requires `{}` lang_item", it.name())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make this an ok_or_else
since otherwise we allocate a String
each name, and also go through a lookup table to get the name of the lang item, both of which are somewhat expensive operations to do for lang item lookup.
src/librustc/middle/lang_items.rs
Outdated
match Some(id) { | ||
x if x == self.fn_trait() => Some(ty::ClosureKind::Fn), | ||
x if x == self.fn_mut_trait() => Some(ty::ClosureKind::FnMut), | ||
x if x == self.fn_once_trait() => Some(ty::ClosureKind::FnOnce), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Extra space after the =>
.
@bors r+ |
📌 Commit 9218e44 has been approved by |
…ielb1 Remove deprecated lang items They have been deprecated for years and there is no trace left of them in the compiler. Also removed `require_owned_box` which is dead code and other small refactorings.
☀️ Test successful - status-appveyor, status-travis |
They have been deprecated for years and there is no trace left of them in the compiler. Also removed
require_owned_box
which is dead code and other small refactorings.