-
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
Rollup of 9 pull requests #101318
Rollup of 9 pull requests #101318
Commits on May 29, 2022
-
This lint checks for statements similar to `let _ = foo`, where `foo` is a type that implements `Drop`. These types of let statements cause the expression in them to be dropped immediately, instead of at the end of the scope. Such behavior can be surprizing, especially if you are relying on the value to be dropped at the end of the scope. Instead, the binding should be an underscore prefixed name (like `_unused`) or the value should explicitly be passed to `std::mem::drop()` if the value really should be dropped immediately.
Configuration menu - View commit details
-
Copy full SHA for 821b32b - Browse repository at this point
Copy the full SHA 821b32bView commit details
Commits on Jun 4, 2022
-
Similar to `let_underscore_drop`, this lint checks for statements similar to `let _ = foo`, where `foo` is a lock guard. These types of let statements are especially problematic because the lock gets released immediately, instead of at the end of the scope. This behavior is almost always the wrong thing.
Configuration menu - View commit details
-
Copy full SHA for ad7587f - Browse repository at this point
Copy the full SHA ad7587fView commit details -
Add
let_underscore_must_use
lint.Similar to `let_underscore_drop`, this lint checks for statements similar to `let _ = foo`, where `foo` is an expression marked `must_use`.
Configuration menu - View commit details
-
Copy full SHA for 758a9fd - Browse repository at this point
Copy the full SHA 758a9fdView commit details -
Move let_underscore tests to their own subfolder.
This was done to pass `tidy`.
Configuration menu - View commit details
-
Copy full SHA for 36b6309 - Browse repository at this point
Copy the full SHA 36b6309View commit details -
Allow
let_underscore_drop
andlet_underscore_must_use
by default.These lints are very noisy and are allow-by-default in clippy anyways. Hence, setting them to allow-by-default here makes more sense than warning constantly on these cases.
Configuration menu - View commit details
-
Copy full SHA for ae2ac3b - Browse repository at this point
Copy the full SHA ae2ac3bView commit details -
Show code suggestions in
let_undescore
lint messages.This commit uses `span_suggestion_verbose` to add what specific code changes can be done as suggested by the lint--in this case, either binding the expression to an unused variable or using `std::mem::drop` to drop the value explicitly.
Configuration menu - View commit details
-
Copy full SHA for eba6c78 - Browse repository at this point
Copy the full SHA eba6c78View commit details -
Set
let_underscore_lock
to Deny by default.Clippy sets this lint to Deny by default, and it having the lint be Deny is useful for when we test the lint against a Crater run.
Configuration menu - View commit details
-
Copy full SHA for 6b179e3 - Browse repository at this point
Copy the full SHA 6b179e3View commit details -
Configuration menu - View commit details
-
Copy full SHA for a7e2b3e - Browse repository at this point
Copy the full SHA a7e2b3eView commit details
Commits on Jun 5, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 7e485bf - Browse repository at this point
Copy the full SHA 7e485bfView commit details -
Configuration menu - View commit details
-
Copy full SHA for 1421cff - Browse repository at this point
Copy the full SHA 1421cffView commit details -
Configuration menu - View commit details
-
Copy full SHA for 30e8adb - Browse repository at this point
Copy the full SHA 30e8adbView commit details -
Bail out early if the type does not has a trivial Drop implementation.
If the type has a trivial Drop implementation, then it is probably irrelevant that the type was dropped immediately, since nothing important happens on drop. Hence, we can bail out early instead of doing some expensive checks.
Configuration menu - View commit details
-
Copy full SHA for e6b6678 - Browse repository at this point
Copy the full SHA e6b6678View commit details -
Use diagnostic items instead of hard coded paths for `let_underscore_…
…lock` Using diagnostic items avoids having to update the paths if the guard types ever get moved around for some reason. Additionally, it also greatly simplifies the `is_sync_lock` check.
Configuration menu - View commit details
-
Copy full SHA for 6342b58 - Browse repository at this point
Copy the full SHA 6342b58View commit details -
Use
check-pass
instead ofrun-pass
We don't actually care about running these programs, only checking the warnings they generate.
Configuration menu - View commit details
-
Copy full SHA for 11663b1 - Browse repository at this point
Copy the full SHA 11663b1View commit details -
Remove
let_underscore_must_use
The `let_underscore_must_use` lint was really only added because clippy included it, but it doesn't actually seem very useful.
Configuration menu - View commit details
-
Copy full SHA for b5b5b54 - Browse repository at this point
Copy the full SHA b5b5b54View commit details -
Add diagnostic items to MutexGuard and RwLock Guards
I forgot to add the diagnostic to the actual types in `std` earlier.
Configuration menu - View commit details
-
Copy full SHA for 321a598 - Browse repository at this point
Copy the full SHA 321a598View commit details -
Configuration menu - View commit details
-
Copy full SHA for 211feb1 - Browse repository at this point
Copy the full SHA 211feb1View commit details
Commits on Jun 9, 2022
-
Use
multipart_suggestion
to create an applicable suggestion.The "consider explicitly droping" can now suggest a machine applicable suggestion now.
Configuration menu - View commit details
-
Copy full SHA for cdf6606 - Browse repository at this point
Copy the full SHA cdf6606View commit details
Commits on Jun 11, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 7237e86 - Browse repository at this point
Copy the full SHA 7237e86View commit details -
Configuration menu - View commit details
-
Copy full SHA for b040666 - Browse repository at this point
Copy the full SHA b040666View commit details -
Make
let_underscore_drop
Deny by default.This is done so that we can check the noisiness of this lint in a Crater run. Note that when I built the compiler, I actually encountered lots of places where this lint will trigger and fail compilation, so I had to also set `RUSTFLAGS_NOT_BOOSTRAP` to `-A let_underscore_drop` when compiling to prevent that.
Configuration menu - View commit details
-
Copy full SHA for 8807c2d - Browse repository at this point
Copy the full SHA 8807c2dView commit details
Commits on Jun 17, 2022
-
Re-allow
let_underscore_drop
by default.This lint is way way too noisy to have it be `Deny` by default.
Configuration menu - View commit details
-
Copy full SHA for a9095ff - Browse repository at this point
Copy the full SHA a9095ffView commit details
Commits on Aug 4, 2022
-
Explain why let-underscoring a lock guard is incorrect.
Currently, the let_underscore_lock lint simply tells what is wrong, but not why it is wrong. We fix this by using a `MultiSpan` to explain specifically that doing `let _ = ` immediately drops the lock guard because it does not assign the lock guard to a binding.
Configuration menu - View commit details
-
Copy full SHA for a9f1b7b - Browse repository at this point
Copy the full SHA a9f1b7bView commit details -
I'm not really sure why this is nessecary to do, but the checks on the PR do not seem to work if do not do this.
Configuration menu - View commit details
-
Copy full SHA for d355ec9 - Browse repository at this point
Copy the full SHA d355ec9View commit details
Commits on Aug 5, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 76c90c3 - Browse repository at this point
Copy the full SHA 76c90c3View commit details
Commits on Aug 23, 2022
-
Support eager and lazy methods for providing references and values
There are times where computing a value may be cheap, or where computing a reference may be expensive, so this fills out the possibilities.
Configuration menu - View commit details
-
Copy full SHA for 38de102 - Browse repository at this point
Copy the full SHA 38de102View commit details -
Add `Provider::{would_be_satisfied_by_value_of,would_be_satisfied_by_…
…ref_of}` While the `provide_*` methods already short-circuit when a value has been provided, there are times where an expensive computation is needed to determine if the `provide_*` method can even be called.
Configuration menu - View commit details
-
Copy full SHA for 260ec93 - Browse repository at this point
Copy the full SHA 260ec93View commit details
Commits on Aug 31, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 1080467 - Browse repository at this point
Copy the full SHA 1080467View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0111fb0 - Browse repository at this point
Copy the full SHA 0111fb0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1171697 - Browse repository at this point
Copy the full SHA 1171697View commit details
Commits on Sep 1, 2022
-
Configuration menu - View commit details
-
Copy full SHA for f5857d5 - Browse repository at this point
Copy the full SHA f5857d5View commit details -
rustc_target: Add a compatibility layer to separate internal and user…
…-facing linker flavors
Configuration menu - View commit details
-
Copy full SHA for 7dc186f - Browse repository at this point
Copy the full SHA 7dc186fView commit details -
rustc_target: Refactor internal linker flavors slightly
Remove one unstable user-facing linker flavor (l4-bender)
Configuration menu - View commit details
-
Copy full SHA for a0e21ff - Browse repository at this point
Copy the full SHA a0e21ffView commit details -
Revert parts of "use derive proc macro to impl SessionDiagnostic"
This reverts parts of commit ac638c1. During rebase, this commit accidentally reverted unrelated changes to the subdiagnostic derive (those allowing multipart_suggestions to be derived). This commit reverts all changes to the subdiagnostic code made in ac638c1, the next commit will reintroduce the actually intended changes.
Configuration menu - View commit details
-
Copy full SHA for 9df75ee - Browse repository at this point
Copy the full SHA 9df75eeView commit details -
Allow deriving multiple subdiagnostics using one SessionSubdiagnostic
This reimplements ac638c1, which had to be reverted in the previous commit because it contains a rebase accident that itself reverted significant unrelated changes to SessionSubdiagnostic.
Configuration menu - View commit details
-
Copy full SHA for d9b874c - Browse repository at this point
Copy the full SHA d9b874cView commit details -
rustdoc: remove unused CSS
#main-content > .since
This rule was added (actually, it was called `#main > .since` back then) with cdca084 and you can see an example of the bug it's intended to fix in <https://doc.rust-lang.org/1.9.0/std/fmt/fn.write.html> by looking at the `1.0.0` version marker. However, a5a2f2b changed it so that `<span class="since">` is always placed in an out-of-band wrapper, so it's never nested directly below `#main` / `#main-content` any more.
Configuration menu - View commit details
-
Copy full SHA for 096efc2 - Browse repository at this point
Copy the full SHA 096efc2View commit details
Commits on Sep 2, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 1cd2863 - Browse repository at this point
Copy the full SHA 1cd2863View commit details -
This commit removes many cases of MIR opt tests emitting `.diff`s for more than one pass. These tests cannot be `unit-test`s, and so they are easy to break, and they also provide little value due to having excessively strong opinions over *how* a piece of code should be optimized. Where reasonable, we instead add separate test files that only emit the `PreCodegen.after` MIR for code where we want to track what the result of the net result of the optimization pipeline's output is.
Configuration menu - View commit details
-
Copy full SHA for e5d60af - Browse repository at this point
Copy the full SHA e5d60afView commit details -
Rollup merge of rust-lang#97739 - a2aaron:let_underscore, r=estebank
Uplift the `let_underscore` lints from clippy into rustc. This PR resolves rust-lang#97241. This PR adds three lints from clippy--`let_underscore_drop`, `let_underscore_lock`, and `let_underscore_must_use`, which are meant to capture likely-incorrect uses of `let _ = ...` bindings (in particular, doing this on a type with a non-trivial `Drop` causes the `Drop` to occur immediately, instead of at the end of the scope. For a type like `MutexGuard`, this effectively releases the lock immediately, which is almost certainly the wrong behavior) In porting the lints from clippy I had to copy over a bunch of utility functions from `clippy_util` that these lints also relied upon. Is that the right approach? Note that I've set the `must_use` and `drop` lints to Allow by default and set `lock` to Deny by default (this matches the same settings that clippy has). In talking with `@estebank` he informed me to do a Crater run (I am not sure what type of Crater run to request here--I think it's just "check only"?) On the linked issue, there's some discussion about using `must_use` and `Drop` together as a heuristic for when to warn--I did not implement this yet. r? `@estebank`
Configuration menu - View commit details
-
Copy full SHA for 07f43a1 - Browse repository at this point
Copy the full SHA 07f43a1View commit details -
Rollup merge of rust-lang#99583 - shepmaster:provider-plus-plus, r=yaahc
Add additional methods to the Demand type This adds on to the original tracking issue rust-lang#96024 r? `````@yaahc`````
Configuration menu - View commit details
-
Copy full SHA for 0e82dc9 - Browse repository at this point
Copy the full SHA 0e82dc9View commit details -
Rollup merge of rust-lang#100147 - Bryanskiy:private-in-public, r=pet…
…rochenkov optimization of access level table construction Refactoring which was mentioned in rust-lang#87487
Configuration menu - View commit details
-
Copy full SHA for 1aaf9ae - Browse repository at this point
Copy the full SHA 1aaf9aeView commit details -
Rollup merge of rust-lang#100552 - petrochenkov:flavorcompat, r=lqd
rustc_target: Add a compatibility layer to separate internal and user-facing linker flavors I want to do some refactorings in `rustc_target` - merge `lld_flavor` and `linker_is_gnu` into `linker_flavor`, support combination gcc+lld (rust-lang#96827). This PR adds some compatibility infra that makes that possible without making any changes to user-facing interfaces - `-Clinker-flavor` values and json target specs. (For json target specs this infra may eventually go away since they are not very stable.) The second commit does some light refactoring of internal linker flavors (applies changes from petrochenkov@53eca42 that don't require mass-editing target specs).
Configuration menu - View commit details
-
Copy full SHA for edf79cb - Browse repository at this point
Copy the full SHA edf79cbView commit details -
Rollup merge of rust-lang#100827 - JakobDegen:better-tests, r=wesleyw…
…iser Simplify MIR opt tests This commit removes many cases of MIR opt tests emitting `.diff`s for more than one pass. These tests cannot be `unit-test`s, and so they are easy to break, and they also provide little value due to having excessively strong opinions over *how* a piece of code should be optimized. Where reasonable, we instead add separate test files that only emit the `PreCodegen.after` MIR for code where we want to track what the end to end effect of the optimization pipeline on the example code is. r? `````@wesleywiser`````
Configuration menu - View commit details
-
Copy full SHA for 203526e - Browse repository at this point
Copy the full SHA 203526eView commit details -
Rollup merge of rust-lang#101166 - GuillaumeGomez:error-index-mdbook,…
… r=notriddle Generate error index with mdbook instead of raw HTML pages This is a follow-up of rust-lang#100922. This comes from a remark from ````@estebank```` who said that the search was a nice thing on the previous version and that it wasn't possible anymore. An easy way to come around this limitation was to use `mdbook`, which is what I did here. Now some explanations on the code. I'll explain how I developed this and why I reached this solution. First I did it very basically by simply setting the source directory and the output directory, generated a `SUMMARY.md` manually which listed all error codes and that was it. Two problems arose from this: 1. A lot of new HTML files were generated at the top level 2. An `index.html` file was generated at the top-level (the summary in short). So for `1.`, it's not great to have too many files at the top-level as it could create file conflicts more easily. And for `2.`, this is actually a huge issue because <doc.rust-lang.org> generates an `index.html` file with a links to a few different resources, so it should never be overwritten. <s>Unfortunately, `mdbook` **always** generates an `index.html` file so the only solution I could see (except for sending them a contribution, I'll maybe do that later) was to temporaly move a potentially existing `index.html` file and then puts it back once done. For this last part, to ensure that we don't return *before* it has been put back, I wrapped the `mdbook` generation code inside `render_html_inner` which is called from `render_html` which in turn handle the "save" of `index.html`.</s> EDIT: `mdbook` completely deletes ALL the content in the target directory so I instead generate into a sub directory and then I move the files to the real target directory. To keep compatibility with the old version, I also put the `<script>` ````@notriddle```` nicely provided in the previous PR only into the `error-index.html` file to prevent unneeded repetition. I didn't use `mdbook` `additional-js` option because the JS is included at the end of all HTML files, which we don't want for two reasons: 1. It's slow. 2. We only want it to be run in `error-index.html` (even if we also ensure in the JS itself too!). <s>Now the last part: why we generate the summary twice. We actually generate it once to tell `mdbook` what the book will look like and a second time because a create a new chapter content which will actually list all the error codes (with the updated paths).</s> EDIT: I removed the need for two summaries. You can test it [here](https://rustdoc.crud.net/imperio/error-index-mdbook/error-index.html). r? ````@notriddle````
Configuration menu - View commit details
-
Copy full SHA for 68d3cfa - Browse repository at this point
Copy the full SHA 68d3cfaView commit details -
Rollup merge of rust-lang#101294 - Xiretza:fix-100844-accident, r=dav…
…idtwco Fix rust-lang#100844 rebase accident This undoes the rebase accident in rust-lang#100844, which accidentally caused rust-lang#100970 to be reverted.
Configuration menu - View commit details
-
Copy full SHA for 4c1b6b5 - Browse repository at this point
Copy the full SHA 4c1b6b5View commit details -
Rollup merge of rust-lang#101298 - notriddle:notriddle/rustdoc-main-s…
…ince, r=GuillaumeGomez rustdoc: remove unused CSS `#main-content > .since` This rule was added (actually, it was called `#main > .since` back then) with cdca084 and you can see an example of the bug it's intended to fix in <https://doc.rust-lang.org/1.9.0/std/fmt/fn.write.html> by looking at the `1.0.0` version marker. However, a5a2f2b changed it so that `<span class="since">` is always placed in an out-of-band wrapper, so it's never nested directly below `#main` / `#main-content` any more.
Configuration menu - View commit details
-
Copy full SHA for 3880925 - Browse repository at this point
Copy the full SHA 3880925View commit details -
Rollup merge of rust-lang#101304 - jyn514:jnelson/tag-query-system, r…
…=Dylan-DPC Add autolabels for `A-query-system` r? `@cjgillot`
Configuration menu - View commit details
-
Copy full SHA for 138121a - Browse repository at this point
Copy the full SHA 138121aView commit details