-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Rollup of 8 pull requests #89399
Closed
Closed
Rollup of 8 pull requests #89399
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In function arguments and let bindings, do not suggest changing `C` to `Foo::C` unless `C` is the only variant of `Foo`, because it won't work. The general warning is still kept, because code like this is confusing. Fixes rust-lang#88730
Downloading LLVM from CI works for all platforms now.
Fix ICE when `start` lang item has wrong generics In my previous pr rust-lang#87875 I missed the requirements on the `start` lang item due to its relative difficulty to test and opting for more conservative estimates. This fixes that by updating the requirement to be exactly one generic type. The `start` lang item should have exactly one generic type for the return type of the `main` fn ptr passed to it. I believe having zero would previously *sometimes* compile (often with the use of `fn() -> ()` as the fn ptr but it was likely UB to call if the return type of `main` was not `()` as far as I know) however it also sometimes would not for various errors including ICEs and LLVM errors depending on exact situations. Having more than 1 generic has always failed with an ICE because only the one generic type is expected and provided. Fixes rust-lang#79559, fixes rust-lang#73584, fixes rust-lang#83117 (all duplicates) Relevant to rust-lang#9307 r? `@cjgillot`
Resolve infered types when complaining about unexpected call type ``` error[E0618]: expected function, found `{integer}` --> $DIR/call-block.rs:2:13 | LL | let _ = {42}(); | ^^^^-- | | | call expression requires function ``` instead of ``` error[E0618]: expected function, found `_` --> $DIR/call-block.rs:2:13 | LL | let _ = {42}(); | ^^^^-- | | | call expression requires function ```
thread: implements available_concurrency on haiku
…ariant-match, r=davidtwco fix(lint): don't suggest refutable patterns to "fix" irrefutable bind In function arguments and let bindings, do not suggest changing `C` to `Foo::C` unless `C` is the only variant of `Foo`, because it won't work. The general warning is still kept, because code like this is confusing. Fixes rust-lang#88730 p.s. `src/test/ui/lint/lint-uppercase-variables.rs` already tests the one-variant case.
…nkov Improve error message for `printf`-style format strings Fixes rust-lang#89173. The following is actually supported today: ```rust fn main() { let num = 5; let width = 20; print!("%*2$x", num, width); } ``` ``` error: multiple unused formatting arguments --> src/main.rs:4:21 | 4 | print!("%*2$x", num, width); | ------- ^^^ ^^^^^ argument never used | || | | || argument never used | |help: format specifiers use curly braces: `{:1$x}` | multiple missing formatting specifiers | = note: printf formatting not supported; see the documentation for `std::fmt` ``` However, as noted in rust-lang#89173, something like ```rust print!("%0*x", width, num); ``` does not give a helpful suggestion. I think this is partly intended, because there actually _is_ no Rust equivalent to this; you always have to use a positional or named argument to specify the width (instead of just using the "next" argument, as `printf` or even `.*` as a precision specifier in Rust would). Therefore, I have added a note: ``` [...] note: format specifiers use curly braces, and you have to use a positional or named parameter for the width --> t2.rs:4:13 | 4 | print!("%0*x", width, num); | ^^^^ = note: printf formatting not supported; see the documentation for `std::fmt` ``` This is not perfect, but it should at least point the user in the right direction, instead of issuing no explanation at all. cc `@lcnr`
Don't lose binders when printing trait bound suggestion Fixes rust-lang#89333
…li-obk CTFE: tweak aggregate rvalue handling I have not looked at this code in ages... I think Miri does not even hit it, since (most?) aggregate rvalues are lowered somewhere in the MIR pipeline, but CTFE does hit it. So this adds some extra sanity assertions, and removes a ZST special case -- ZST should only be special cased fairly late (when the actual memory access happens); e.g. `!` is a ZST and we still want `copy_op` to be called for it since it will perform validation (and raise UB, since `!` is never valid).
bootstrap: Update comment in config.library.toml. Downloading LLVM from CI works for all platforms now. All other templates in this directory already have the proper comment. Seems this one was neglected.
@bors r+ p=8 |
📌 Commit 1704e19 has been approved by |
bors
added
the
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
label
Sep 30, 2021
⌛ Testing commit 1704e19 with merge e8c090020192b9d524424518ca4416c095d89af5... |
The job Click to see the possible cause of the failure (guessed by this bot)
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
rollup
A PR which is a rollup
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Successful merges:
start
lang item has wrong generics #88782 (Fix ICE whenstart
lang item has wrong generics)printf
-style format strings #89340 (Improve error message forprintf
-style format strings)Failed merges:
r? @ghost
@rustbot modify labels: rollup
Create a similar rollup