-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Added default target cpu to --print target-cpus
output and updated docs
#110876
Conversation
r? @b-naber (rustbot has picked a reviewer for you, use r? to override) |
Can you show how this actually renders, so the reviewer doesn't need to test it themself? |
Sure thing. Running
and running
|
Changing |
8f21430
to
6b8870d
Compare
I think the comment #110647 (comment) was asking for this to be rendered inline, as a note after the default CPU flavor. I agree with that comment. How hard is it to change the behavior to act like that instead? |
Got it, working on this now, I think I just need to pass the default target cpu into |
6b8870d
to
ce47954
Compare
This is the new output: rustc --print target-cpus
Let me know if I did something wrong with the C++, I don't have much experience there. Thanks! |
Maybe the text should read |
also I need to capitalize CPU again lol |
Updated the output to |
PrintRequest::TargetCPUs => { | ||
let cpu_cstring = CString::new(handle_native(sess.target.cpu.as_ref())) | ||
.unwrap_or_else(|e| bug!("failed to convert to cstring: {}", e)); | ||
unsafe { llvm::LLVMRustPrintTargetCPUs(tm, cpu_cstring.as_ptr()) }; |
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: Maybe a SAFETY
comment here explaining why this is ok (had to look at the docs for CString to check that it is)?
Thanks. @bors r+ rollup |
Rollup of 6 pull requests Successful merges: - rust-lang#103056 (Fix `checked_{add,sub}_duration` incorrectly returning `None` when `other` has more than `i64::MAX` seconds) - rust-lang#108801 (Implement RFC 3348, `c"foo"` literals) - rust-lang#110773 (Reduce MIR dump file count for MIR-opt tests) - rust-lang#110876 (Added default target cpu to `--print target-cpus` output and updated docs) - rust-lang#111068 (Improve check-cfg implementation) - rust-lang#111238 (btree_map: `Cursor{,Mut}::peek_prev` must agree) Failed merges: - rust-lang#110694 (Implement builtin # syntax and use it for offset_of!(...)) r? `@ghost` `@rustbot` modify labels: rollup
Added default target cpu info as requested in issue #110647 and noted the new output in the documentation