-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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 5 pull requests #81718
Rollup of 5 pull requests #81718
Commits on Jan 17, 2021
-
Configuration menu - View commit details
-
Copy full SHA for 70704db - Browse repository at this point
Copy the full SHA 70704dbView commit details
Commits on Jan 24, 2021
-
Configuration menu - View commit details
-
Copy full SHA for 0518911 - Browse repository at this point
Copy the full SHA 0518911View commit details
Commits on Jan 25, 2021
-
Configuration menu - View commit details
-
Copy full SHA for 69f2b8f - Browse repository at this point
Copy the full SHA 69f2b8fView commit details
Commits on Jan 26, 2021
-
Configuration menu - View commit details
-
Copy full SHA for 52fabbf - Browse repository at this point
Copy the full SHA 52fabbfView commit details
Commits on Jan 30, 2021
-
Fix let_and_return false positive
The issue: See this Rust playground link: https://play.rust-lang.org/?edition=2018&gist=12cb5d1e7527f8c37743b87fc4a53748 Run the above with clippy to see the following warning: ``` warning: returning the result of a `let` binding from a block --> src/main.rs:24:5 | 23 | let value = Foo::new(&x).value(); | --------------------------------- unnecessary `let` binding 24 | value | ^^^^^ | = note: `#[warn(clippy::let_and_return)]` on by default = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return help: return the expression directly | 23 | 24 | Foo::new(&x).value() | ``` Implementing the suggested fix, removing the temporary let binding, yields a compiler error: ``` error[E0597]: `x` does not live long enough --> src/main.rs:23:14 | 23 | Foo::new(&x).value() | ---------^^- | | | | | borrowed value does not live long enough | a temporary with access to the borrow is created here ... 24 | } | - | | | `x` dropped here while still borrowed | ... and the borrow might be used here, when that temporary is dropped and runs the `Drop` code for type `Foo` | = note: the temporary is part of an expression at the end of a block; consider forcing this temporary to be dropped sooner, before the block's local variables are dropped help: for example, you could save the expression's value in a new local variable `x` and then make `x` be the expression at the end of the block | 23 | let x = Foo::new(&x).value(); x | ^^^^^^^ ^^^ ``` The fix: Of course, clippy looks like it should already handle this edge case; however, it appears `utils::fn_def_id` is not returning a `DefId` for `Foo::new`. Changing the `qpath_res` lookup to use the child Path `hir_id` instead of the parent Call `hir_id` fixes the issue.
Configuration menu - View commit details
-
Copy full SHA for 7f1595e - Browse repository at this point
Copy the full SHA 7f1595eView commit details -
Configuration menu - View commit details
-
Copy full SHA for ac912be - Browse repository at this point
Copy the full SHA ac912beView commit details -
Configuration menu - View commit details
-
Copy full SHA for 3a0ae08 - Browse repository at this point
Copy the full SHA 3a0ae08View commit details
Commits on Jan 31, 2021
-
Configuration menu - View commit details
-
Copy full SHA for da26b21 - Browse repository at this point
Copy the full SHA da26b21View commit details -
Auto merge of rust-lang#6656 - phansch:command-failed-print-stderr, r…
…=flip1995 clippy_dev: Pass stderr to CommandFailed This improves error reporting when running `rustfmt` fails for some reason, as seen [on Zulip](https://rust-lang.zulipchat.com/#narrow/stream/257328-clippy/topic/Issue.20with.20rustfmt). It will now include the stderr output in the `CliError::CommandFailed` error. changelog: none
Configuration menu - View commit details
-
Copy full SHA for ed11274 - Browse repository at this point
Copy the full SHA ed11274View commit details -
Auto merge of rust-lang#6603 - ThibsG:MatchOverlappingArm5986, r=flip…
…1995 Do not lint when range is completely included into another one This fix has been developed following this [comment](rust-lang/rust-clippy#5986 (comment)). So this will be linted: ``` |----------| |-----------| ``` Now this won't be linted: ``` |---| |--------------------| ``` and this will still lint: ``` |--------| |--------------| ``` Fixes: rust-lang#5986 changelog: Fix FPs in match_overlapping_arm, when first arm is completely included in second arm
Configuration menu - View commit details
-
Copy full SHA for c5f3f9d - Browse repository at this point
Copy the full SHA c5f3f9dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 939136d - Browse repository at this point
Copy the full SHA 939136dView commit details
Commits on Feb 1, 2021
-
Configuration menu - View commit details
-
Copy full SHA for 6fd01e0 - Browse repository at this point
Copy the full SHA 6fd01e0View commit details -
Auto merge of rust-lang#80851 - m-ou-se:panic-2021, r=petrochenkov
Implement Rust 2021 panic This implements the Rust 2021 versions of `panic!()`. See rust-lang#80162 and rust-lang/rfcs#3007. It does so by replacing `{std, core}::panic!()` by a bulitin macro that expands to either `$crate::panic::panic_2015!(..)` or `$crate::panic::panic_2021!(..)` depending on the edition of the caller. This does not yet make std's panic an alias for core's panic on Rust 2021 as the RFC proposes. That will be a separate change: rust-lang@c5273bd That change is blocked on figuring out what to do with rust-lang#80846 first.
Configuration menu - View commit details
-
Copy full SHA for 9607b5c - Browse repository at this point
Copy the full SHA 9607b5cView commit details
Commits on Feb 2, 2021
-
Configuration menu - View commit details
-
Copy full SHA for 0fb09d6 - Browse repository at this point
Copy the full SHA 0fb09d6View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4a13c8c - Browse repository at this point
Copy the full SHA 4a13c8cView commit details -
Auto merge of rust-lang#6661 - Manishearth:exhaustive-fix, r=flip1995
exhaustive_structs: don't trigger for structs with private fields changelog: Restrict `exhaustive_structs` to structs with all-public fields
Configuration menu - View commit details
-
Copy full SHA for 8d82ac5 - Browse repository at this point
Copy the full SHA 8d82ac5View commit details -
Auto merge of rust-lang#6659 - phlip9:let_and_return_fix, r=phansch
Fix let_and_return false positive The issue: See this Rust playground link: https://play.rust-lang.org/?edition=2018&gist=12cb5d1e7527f8c37743b87fc4a53748 Run the above with clippy to see the following warning: ``` warning: returning the result of a `let` binding from a block --> src/main.rs:24:5 | 23 | let value = Foo::new(&x).value(); | --------------------------------- unnecessary `let` binding 24 | value | ^^^^^ | = note: `#[warn(clippy::let_and_return)]` on by default = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return help: return the expression directly | 23 | 24 | Foo::new(&x).value() | ``` Implementing the suggested fix, removing the temporary let binding, yields a compiler error: ``` error[E0597]: `x` does not live long enough --> src/main.rs:23:14 | 23 | Foo::new(&x).value() | ---------^^- | | | | | borrowed value does not live long enough | a temporary with access to the borrow is created here ... 24 | } | - | | | `x` dropped here while still borrowed | ... and the borrow might be used here, when that temporary is dropped and runs the `Drop` code for type `Foo` | = note: the temporary is part of an expression at the end of a block; consider forcing this temporary to be dropped sooner, before the block's local variables are dropped help: for example, you could save the expression's value in a new local variable `x` and then make `x` be the expression at the end of the block | 23 | let x = Foo::new(&x).value(); x | ^^^^^^^ ^^^ ``` The fix: Of course, clippy looks like it should already handle this edge case; however, it appears `utils::fn_def_id` is not returning a `DefId` for `Foo::new`. Changing the `qpath_res` lookup to use the child Path `hir_id` instead of the parent Call `hir_id` fixes the issue. changelog: none
Configuration menu - View commit details
-
Copy full SHA for f870876 - Browse repository at this point
Copy the full SHA f870876View commit details -
Configuration menu - View commit details
-
Copy full SHA for bde667a - Browse repository at this point
Copy the full SHA bde667aView commit details -
Auto merge of rust-lang#6523 - brightly-salty:missing-panic-doc, r=fl…
…ip1995 Add new lint "missing_panics_doc" fixes rust-lang#1974 changelog: Added the "missing_panics_doc" lint which lints when public functions that may panic are missing "# Panics" in their doc comment
Configuration menu - View commit details
-
Copy full SHA for 28794e9 - Browse repository at this point
Copy the full SHA 28794e9View commit details -
Auto merge of rust-lang#6664 - camsteffen:path-to-res, r=Manishearth
Remove Option from `path_to_res` return type changelog: none Tiny cleanup for `path_to_res` to return `Res` instead of `Option<Res>`.
Configuration menu - View commit details
-
Copy full SHA for 9fd4f3e - Browse repository at this point
Copy the full SHA 9fd4f3eView commit details -
Editorconfig is a lightweight specification that helps maintaining consistent coding/formatting style accross editors, especially those editors that are not explicitly aware of Rust and rustfmt. https://editorconfig.org/
Configuration menu - View commit details
-
Copy full SHA for e05e477 - Browse repository at this point
Copy the full SHA e05e477View commit details -
Auto merge of rust-lang#81405 - bugadani:ast, r=cjgillot
Box the biggest ast::ItemKind variants This PR is a different approach on rust-lang#81400, aiming to save memory in humongous ASTs. The three affected item kind enums are: - `ast::ItemKind` (208 -> 112 bytes) - `ast::AssocItemKind` (176 -> 72 bytes) - `ast::ForeignItemKind` (176 -> 72 bytes)
Configuration menu - View commit details
-
Copy full SHA for 448a97b - Browse repository at this point
Copy the full SHA 448a97bView commit details -
Configuration menu - View commit details
-
Copy full SHA for a2d2aee - Browse repository at this point
Copy the full SHA a2d2aeeView commit details -
Auto merge of rust-lang#6639 - xFrednet:0000-configuration-documentat…
…ion-some-nits, r=flip1995 Updated some NITs in the documentation from rust-lang#6630 I've implemented the two suggestions from rust-lang#6630 that were added after the merge. This PR also changes the example code to use `register_*_pass` instead of `register_late_pass`. I'm not sure if this is better or worse, but it makes it clearer in my opinion. Let me know if I should change it back. --- changelog: none r? `@flip1995`
Configuration menu - View commit details
-
Copy full SHA for 11edf92 - Browse repository at this point
Copy the full SHA 11edf92View commit details -
Rollup merge of rust-lang#81260 - vn971:restore-editorconfig, r=Mark-…
…Simulacrum Add .editorconfig This adds a .editorconfig file to rust-lang/rust, matching Clippy's. It's not clear that this will benefit many people, but the cost is low and the rewards are potentially meaningful.
Configuration menu - View commit details
-
Copy full SHA for b56b751 - Browse repository at this point
Copy the full SHA b56b751View commit details
Commits on Feb 3, 2021
-
Configuration menu - View commit details
-
Copy full SHA for 5c957b8 - Browse repository at this point
Copy the full SHA 5c957b8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6fb1075 - Browse repository at this point
Copy the full SHA 6fb1075View commit details -
Configuration menu - View commit details
-
Copy full SHA for a31e5f5 - Browse repository at this point
Copy the full SHA a31e5f5View commit details -
Configuration menu - View commit details
-
Copy full SHA for 741259b - Browse repository at this point
Copy the full SHA 741259bView commit details -
Auto merge of rust-lang#6667 - Manishearth:rustup, r=Manishearth
Rustup Pulling in AST changes changelog: none
Configuration menu - View commit details
-
Copy full SHA for 3e41797 - Browse repository at this point
Copy the full SHA 3e41797View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5889312 - Browse repository at this point
Copy the full SHA 5889312View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8477d35 - Browse repository at this point
Copy the full SHA 8477d35View commit details -
Remove incorrect
delay_span_bug
The following code is supposed to compile ```rust use std::ops::BitOr; pub trait IntWrapper { type InternalStorage; } impl<T> BitOr for dyn IntWrapper<InternalStorage = T> where Self: Sized, T: BitOr + BitOr<Output = T>, { type Output = Self; fn bitor(self, _other: Self) -> Self { todo!() } } ``` Before this change it would ICE. In rust-lang#70998 the removed logic was added to provide better suggestions, and the `delay_span_bug` guard was added to protect against a potential logic error when returning traits. As it happens, there are cases, like the one above, where traits can indeed be returned, so valid code was being rejected. Fix rust-lang#80207.
Configuration menu - View commit details
-
Copy full SHA for ede0a71 - Browse repository at this point
Copy the full SHA ede0a71View commit details -
Reduce tab formatting assertions to debug only
The tab replacement for diagnostics added in rust-lang#79757 included a few assertions to ensure all tab characters are handled appropriately. We've started getting reports of these assertions firing (rust-lang#81614). Since it's only a cosmetic issue, this downgrades the assertions to debug only, so we at least continue compiling even if the diagnostics might be a tad wonky. Fixes rust-lang#81614
Configuration menu - View commit details
-
Copy full SHA for 18f6cc6 - Browse repository at this point
Copy the full SHA 18f6cc6View commit details -
Fix non-existent-field ICE for generic fields.
Co-authored-by: eddyb <eddyb@lyken.rs>
Configuration menu - View commit details
-
Copy full SHA for 68cc12a - Browse repository at this point
Copy the full SHA 68cc12aView commit details -
Rollup merge of rust-lang#80394 - RalfJung:const-err-future, r=oli-obk
make const_err a future incompat lint This is the first step for rust-lang#71800: make const_err a future-incompat lint. I also rewrote the const_err lint description as the old one seemed wrong. This has the unfortunate side-effect of making const-eval error even more verbose by making the const_err message longer without fixing the redundancy caused by additionally emitting an error on each use site of the constant. We cannot fix that redundancy until const_err is a *hard* error (at that point the error-on-use-site can be turned into a `delay_span_bug!` for uses of monomorphic consts, and into a nicely rendered error for [lazily / post-monomorhization evaluated] associated consts). ~~The one annoying effect of this PR is that `let _x = &(1/(1-1));` now also shows the future-incompat warning, even though of course we will *not* make this a hard error. We'll instead (hopefully) stop promoting it -- see rust-lang/rfcs#3027. The only way I see to avoid the future-incompat warning is to use a different lint for "failure to evaluate promoted".~~ Cc `@rust-lang/wg-const-eval`
Configuration menu - View commit details
-
Copy full SHA for 00dabfb - Browse repository at this point
Copy the full SHA 00dabfbView commit details -
Rollup merge of rust-lang#81532 - estebank:ice-ice-baby, r=pnkfelix
Remove incorrect `delay_span_bug` The following code is supposed to compile ```rust use std::ops::BitOr; pub trait IntWrapper { type InternalStorage; } impl<T> BitOr for dyn IntWrapper<InternalStorage = T> where Self: Sized, T: BitOr + BitOr<Output = T>, { type Output = Self; fn bitor(self, _other: Self) -> Self { todo!() } } ``` Before this change it would ICE. In rust-lang#70998 the removed logic was added to provide better suggestions, and the `delay_span_bug` guard was added to protect against a potential logic error when returning traits. As it happens, there are cases, like the one above, where traits can indeed be returned, so valid code was being rejected. Fix (but not close) rust-lang#80207.
Configuration menu - View commit details
-
Copy full SHA for 6695944 - Browse repository at this point
Copy the full SHA 6695944View commit details -
Rollup merge of rust-lang#81692 - Manishearth:clippyup, r=tmandry
Update clippy r? `@flip1995`
Configuration menu - View commit details
-
Copy full SHA for 508b470 - Browse repository at this point
Copy the full SHA 508b470View commit details -
Rollup merge of rust-lang#81715 - jryans:tab-handling-ice-81614, r=es…
…tebank Reduce tab formatting assertions to debug only The tab replacement for diagnostics added in rust-lang#79757 included a few assertions to ensure all tab characters are handled appropriately. We've started getting reports of these assertions firing (rust-lang#81614). Since it's only a cosmetic issue, this downgrades the assertions to debug only, so we at least continue compiling even if the diagnostics might be a tad wonky. Minimizes the impact of rust-lang#81614
Configuration menu - View commit details
-
Copy full SHA for 65b3c0c - Browse repository at this point
Copy the full SHA 65b3c0cView commit details -
Rollup merge of rust-lang#81716 - m-ou-se:fix-ice, r=eddyb
Fix non-existent-field ICE for generic fields. I mentioned this ICE in a chat and it took about 3 milliseconds before `@eddyb` found the problem and said this change would fix it. :) This also changes one the field types in the related test to one that triggered the ICE. Fixes rust-lang#81627. Fixes rust-lang#81672. Fixes rust-lang#81709. Cc rust-lang#81480 `@b-naber` `@estebank.`
Configuration menu - View commit details
-
Copy full SHA for 4617418 - Browse repository at this point
Copy the full SHA 4617418View commit details