-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Lang item #32264
Lang item #32264
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
let item_def_id = self.ast_map.local_def_id(item.id); | ||
let span = self.ast_map.span_if_local(item_def_id).unwrap(); | ||
span_err!(self.session, span, E0522, | ||
"creating new item lang is forbidden: `{}`.", |
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.
Why not just, uh, “definition of a unknown language item”?
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.
Indeed, way better.
d1e79fc
to
df3baed
Compare
The lang attribute is intended for marking special items that are built-in to | ||
Rust itself. This includes special traits (like `Copy` and `Sized`) that affect | ||
how the compiler behaves, as well as special functions that may be automatically | ||
invoked (such as the handker for out-of-bounds accesses when indexing a slice). |
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: s/handker/handler/
df3baed
to
b2fd882
Compare
Updated. |
@bors r+ rollup |
📌 Commit b2fd882 has been approved by |
The Rust version is now at: ``` rustc 1.9.0-nightly (0dcc413e4 2016-03-22) ``` This includes a fix for the following build error that the new version produced: ``` src/rust_base.rs:17:1: 19:2 error: definition of an unknown language item: `stack_exhausted`. [E0522] src/rust_base.rs:17 pub extern fn stack_exhausted() { src/rust_base.rs:18 panic!("Stack exhausted"); src/rust_base.rs:19 } src/rust_base.rs:17:1: 19:2 help: run `rustc --explain E0522` to see a detailed explanation ``` It looks like the `stack_exhausted item was removed last year: rust-lang/rust#27338 This didn't cause an error so far, because the compiler didn't complain about defining lang items that don't exist. This seems to have changed in this pull request: rust-lang/rust#32264
Fixes #32033