Merged
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())) |
Member
There was a problem hiding this comment.
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), |
Member
There was a problem hiding this comment.
nit: Extra space after the =>.
Member
Contributor
|
@bors r+ |
Collaborator
|
📌 Commit 9218e44 has been approved by |
Collaborator
bors
added a commit
that referenced
this pull request
Sep 14, 2017
…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.
Collaborator
|
☀️ Test successful - status-appveyor, status-travis |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
They have been deprecated for years and there is no trace left of them in the compiler. Also removed
require_owned_boxwhich is dead code and other small refactorings.