Repository navigation
Add Documentation for the crate_type attribute - #164519
Conversation
|
rustbot has assigned @Mark-Simulacrum. Use Why was this reviewer chosen?The reviewer was selected based on:
|
| /// ``` | ||
| /// | ||
| /// The specified crate type must be a known crate type (including `bin`, `lib`, `rlib`, `dylib`, `cdylib`, | ||
| /// `staticlib` and `proc-macro`), otherwise `rustc` reports an error (unless the `unknown_crate_types` lint |
There was a problem hiding this comment.
I don't think it makes sense to document that you can allow this lint. Essentially nobody should be doing that.
In general, I would keep this short and just link to the reference docs here.
The reference already contains relevant documentation here: https://doc.rust-lang.org/nightly/reference/linkage.html, which seems like we should link to instead of repeating the list of valid crate types here.
There was a problem hiding this comment.
Thanks for the advice! I have changed the file accordingly. If anything else needs to be changed, please let me know.
|
Reminder, once the PR becomes ready for a review, use |
8c55e96 to
de5aa1c
Compare
|
@rustbot ready |
| /// ``` | ||
| /// | ||
| /// The specified crate type must be a known crate type (for the list of valid crate types, see [Linkage]), | ||
| /// otherwise `rustc` reports an error. Note that even when the `crate_type` attribute is ignored (for example |
There was a problem hiding this comment.
I don't think we need to document that unused attributes are still linted / examined. That's the case for ~all Rust code (e.g., we run type check against dead code).
There was a problem hiding this comment.
My bad. I have deleted this sentence, along with a few other places that might be redundant.
Please take another look when you have the time.
de5aa1c to
435ca70
Compare
|
@rustbot ready |
|
@bors r+ rollup |
…uwer Rollup of 7 pull requests Successful merges: - #160777 (Document and correct assignment order for yield and inline-asm) - #165224 (Ensure all output is printed from lldb debugger tester) - #165629 (std: fix build on RTEMS after libc 0.2.191) - #163624 (String::retain: convert only the untouched UTF-8 tail) - #164519 (Add Documentation for the `crate_type` attribute) - #165249 (Fix unused attribute duplication for lint attributes) - #165643 (oneshot_multi_task_recv_then_send test: wait for test thread to finish)
Rollup merge of #164519 - krokodeyu:document-crate-type-attribute, r=Mark-Simulacrum Add Documentation for the `crate_type` attribute Add documentation for the `crate_type` attribute <!-- homu-ignore:start --> Briefly introduces how the attribute works, possible errors and necessary details when using the attribute. Part of #157604
Add documentation for the
crate_typeattributeBriefly introduces how the attribute works, possible errors and necessary details when using the attribute.
Part of #157604