-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
fix the suggestion of format for asm_sub_register #101253
Conversation
lyming2007
commented
Aug 31, 2022
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @davidtwco (or someone else) soon. Please see the contribution instructions for more information. |
This comment has been minimized.
This comment has been minimized.
r? @Amanieu |
)); | ||
err.help(&format!( | ||
"or use the `{default_modifier}` modifier to keep the default formatting of `{default_result}`", | ||
"or use the `0:{default_modifier}` modifier to keep the default formatting of `{default_result}`", |
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.
"or use the `0:{default_modifier}` modifier to keep the default formatting of `{default_result}`", | |
"or use `0:{default_modifier}` to keep the default formatting of `{default_result}`", |
9129ac4
to
aa662c2
Compare
This comment has been minimized.
This comment has been minimized.
aa662c2
to
b912436
Compare
@Amanieu Could you help me take a look at CI?
But I have checked in the type-check-1.stderr:
|
This comment has been minimized.
This comment has been minimized.
Try putting it in type-check-3.rs instead of type-check-1.rs. |
Actually we already have checks for this lint in type-check-3.rs, you don't need to add a new case. |
b912436
to
ac117ae
Compare
The stderr file for aarch64 also needs to be updated, otherwise CI will fail.
|
Already did. Now CI passed. Thank you for your suggestions. |
No, the file still has the old error messages: https://github.com/lyming2007/rust/blob/issue-101163/src/test/ui/asm/aarch64/type-check-3.stderr#L62 You need to run this command (note the
|
ac117ae
to
c129601
Compare
done |
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.
I suggest some minor changes to make the message more readable.
@@ -333,10 +333,10 @@ impl<'a, 'tcx> InlineAsmCtxt<'a, 'tcx> { | |||
let mut err = lint.build(msg); | |||
err.span_label(expr.span, "for this argument"); | |||
err.help(&format!( | |||
"use the `{suggested_modifier}` modifier to have the register formatted as `{suggested_result}`", | |||
"use `{idx}:{suggested_modifier}` modifier to have the register formatted as `{suggested_result}`", |
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.
"use `{idx}:{suggested_modifier}` modifier to have the register formatted as `{suggested_result}`", | |
"use `{{{idx}:{suggested_modifier}}}` to have the register formatted as `{suggested_result}`", |
)); | ||
err.help(&format!( | ||
"or use the `{default_modifier}` modifier to keep the default formatting of `{default_result}`", | ||
"or use `{idx}:{default_modifier}` modifier to keep the default formatting of `{default_result}`", |
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.
"or use `{idx}:{default_modifier}` modifier to keep the default formatting of `{default_result}`", | |
"or use `{{{idx}:{default_modifier}}}` to keep the default formatting of `{default_result}`", |
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.
Sounds good.
Fix was pushed
modified: compiler/rustc_typeck/src/check/intrinsicck.rs modified: src/test/ui/asm/bad-template.aarch64_mirunsafeck.stderr modified: src/test/ui/asm/bad-template.aarch64_thirunsafeck.stderr modified: src/test/ui/asm/bad-template.x86_64_mirunsafeck.stderr modified: src/test/ui/asm/bad-template.x86_64_thirunsafeck.stderr modified: src/test/ui/asm/type-check-1.rs modified: src/test/ui/asm/type-check-1.stderr modified: src/test/ui/asm/x86_64/type-check-3.stderr
c129601
to
28c62d2
Compare
@bors r+ |
…iaskrgr Rollup of 6 pull requests Successful merges: - rust-lang#99207 (Enable eager checks for memory sanitizer) - rust-lang#101253 (fix the suggestion of format for asm_sub_register) - rust-lang#101450 (Add `const_extern_fn` to 1.62 release notes.) - rust-lang#101556 (Tweak future opaque ty pretty printing) - rust-lang#101563 (Link UEFI target documentation from target list) - rust-lang#101593 (Cleanup themes (tooltip)) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup