-
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
Iterator is needlessly a language item #30803
Comments
Shouldn't both |
@apasel422: Seems more logical to remove it if it's not needed anymore than the contrary. |
My reasoning is that #![feature(lang_items)]
#![feature(no_core)]
#![crate_type = "lib"]
#![no_std]
#![no_core]
#[lang = "sized"]
trait Sized {}
pub fn foo() {
for _ in () {
}
} yields
|
Then why |
I think I agree with @apasel422... when for loops are desugared the absolute path to IntoIterator is used by name, but it seems like it would be more robust to use a lang item (cc #30809). |
I generally would agree, but making them language items would be a breaking change of sorts and discussion towards that effect should be through a RFC. Removing the |
@nagisa Proposed in rust-lang/rfcs#1457. |
I think it'd be fine to add these as language items to improve error messages, but in the meantime it seems fine to remove the annotation if they're not used in the compiler currently (e.g. we can add it back very easily at any point in the future) |
…alexcrichton Fixes rust-lang#30803 r? @nagisa
Iterator language item has been removed a year ago, but
trait Iterator
still has#[lang = "iterator"]
on it. That’s not necessary and can be removed.The text was updated successfully, but these errors were encountered: