Uh oh!
There was an error while loading. Please reload this page.
Document #![register_tool] - #138586
Conversation
rustbot
commented
Mar 17, 2025
| `register_tool` also allows configuring lint levels for external tools. | ||
| Tool attributes are only meant for ignorable attributes. If your code *changes* meaning when the attribute is present, it should not use a tool attribute (because it cannot be compiled with anything other than the external tool, and in a sense is a fork of the language). |
There was a problem hiding this comment.
this bit really belongs in an RFC, not here. i will try to make an RFC in the new few months.
| #![feature(register_tool)] | ||
| #![register_tool(c2rust)] | ||
| #[c2rust::header_src = "/home/user/some/workspace/foobar/bar.h:5"] | ||
| pub mod bar_h { |
There was a problem hiding this comment.
@kkysen are you ok with me mentioning c2rust in the official docs here?
There was a problem hiding this comment.
You can also just use some kind of stub tool name 🤷
There was a problem hiding this comment.
Sure, I think so. @thedataking, this is fine, right?
There was a problem hiding this comment.
You can also just use some kind of stub tool name 🤷
i think giving an example that shows how the attribute is useful is better than just shoving in foo/bar everywhere. motivating examples, and all that.
(of course it doesn't need to be c2rust specifically; i'm happy to find some other external tool if Per doesn't want it mentioned here.)
There was a problem hiding this comment.
For what it's worth, I think it'd be very cool to mention c2rust here.
There was a problem hiding this comment.
Sure, I think so. @thedataking, this is fine, right?
Definitely fine. Please go ahead @jyn514.
| #![feature(register_tool)] | ||
| #![register_tool(bevy)] | ||
| #![deny(bevy::duplicate_bevy_dependencies)] |
There was a problem hiding this comment.
i've already asked @alice-i-cecile about this example, she said mentioning bevy is fine.
There was a problem hiding this comment.
Note that this lint / tool doesn't exist yet, but I think it's a very clear example of where this might be useful.
There was a problem hiding this comment.
Note that this lint / tool doesn't exist yet, but I think it's a very clear example of where this might be useful.
This specific lint comes in the 0.2.0 release, but yea it's not an official bevy tool yet.
Uh oh!
There was an error while loading. Please reload this page.
jieyouxu
left a comment
There was a problem hiding this comment.
Thanks, looks good. One tiny nit but r=me with or without.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
ae1fe37 to
e390be7Compare
alice-i-cecile
left a comment
There was a problem hiding this comment.
Good stuff; the c2rust section in particular is much clearer to me now.
This comment has been minimized.
This comment has been minimized.
jieyouxu
commented
Mar 17, 2025
Thanks! |
bors
commented
Mar 17, 2025
Rollup of 9 pull requests Successful merges: - rust-lang#136355 (Add `*_value` methods to proc_macro lib) - rust-lang#137621 (Add std support to cygwin target) - rust-lang#137793 (Stablize anonymous pipe) - rust-lang#138341 (std: Mention clone-on-write mutation in Arc<T>) - rust-lang#138517 (Improve upvar analysis for deref of child capture) - rust-lang#138584 (Update Rust Foundation links in Readme) - rust-lang#138586 (Document `#![register_tool]`) - rust-lang#138590 (Flatten and simplify some control flow 🫓) - rust-lang#138592 (update change entry for rust-lang#137147) r? `@ghost` `@rustbot` modify labels: rollup
DaAlbrecht
left a comment
There was a problem hiding this comment.
Thank you so much for the mention of the bevy lint tool!
| #![feature(register_tool)] | ||
| #![register_tool(bevy)] | ||
| #![deny(bevy::duplicate_bevy_dependencies)] |
There was a problem hiding this comment.
Note that this lint / tool doesn't exist yet, but I think it's a very clear example of where this might be useful.
This specific lint comes in the 0.2.0 release, but yea it's not an official bevy tool yet.
Rollup merge of rust-lang#138586 - jyn514:doc-register-tool, r=jieyouxu Document `#![register_tool]` cc rust-lang#66079
BD103
commented
Mar 17, 2025
Thanks for doing this, this is really cool! If you want any help writing the RFC, I'd be glad to assist, although it would be my first time. :) |
jhpratt
commented
Mar 18, 2025
still in the queue after being merged @bors r- |
jyn514
commented
Mar 18, 2025
@jhpratt this pr has not been merged ?? |
jhpratt
commented
Mar 18, 2025
@jyn514 It was merged as part of #138595. It is present on I noticed it when I created #138636 and saw that a number of PRs had already been merged. |
jieyouxu
commented
Mar 18, 2025
Yeah, bors sometimes has its own ideas... |
jyn514
commented
Mar 18, 2025
oh lmao the github app was showing me a cached version of the pr, incredible |
jhpratt
commented
Mar 18, 2025
🤦 |
cc #66079