-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Use keyword crate
to define crates: pub crate std;
#12107
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
Comments
To my knowledge, the purpose of a declaration like I would not want to copy all of the currently-inner attributes for a crate (which currently appear once, in the file that is defining the crate itself) on to each site where that crate is being linked (as such sites appear many times, on each other application or library that is linking to the crate). Is there hidden in your proposal an implicit request that the declaration |
I saw someone suggest the same thing a few days ago: use /// Docs go here
#[crate_id="std"]
#[crate_type="rlib"]
crate;
mod foo {
/// Docs go here
#[macro_escape]
mod;
} |
Wow, are inner attributes really that distasteful to everyone else? This suggestion seems like a step backwards to me, but I don't have the same reaction towards inner attributes, I guess. |
(FWIW, I wasn't arguing for or against this change, I was just noting another very similar suggestion; I'm quite happy with inner attributes... if they weren't just a |
2014年2月8日 下午8:12于 "Felix S Klock II" [email protected]写道:
To explicitly define a crate, as we define a function, and explicitly It is define a crate, not declare to link it.
|
I think the idea of attaching attributes to the keyword |
Too many doc-comment styles currently
|
Visiting for triage, language changes such as this now require going through the formal RFC process, so I'm going to close this. If you'd still like to pursue this, feel free to open an RFC! |
This issue has been moved to the RFCs repo: rust-lang/rfcs#307 |
new lint: `macro_metavars_in_unsafe` This implements a lint that I've been meaning to write for a while: a macro with an `expr` metavariable that is then expanded in an unsafe context. It's bad because it lets the user write unsafe code without an unsafe block. Note: this has gone through some major rewrites, so any comment before rust-lang/rust-clippy#12107 (comment) is outdated and was based on an older version that has since been completely rewritten. changelog: new lint: [`macro_metavars_in_unsafe`]
After #12017 (
extern crate x;
) is landed, we may reuse the new keywordcrate
to define crates:We can always place docs and attributes on top of the crate's definition. As a result, the inner- (or outer- someone maybe calls it) docs and attributes, will forever gone.
src/libstd/lib.rs:
The text was updated successfully, but these errors were encountered: