-
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 11 pull requests #63575
Rollup of 11 pull requests #63575
Conversation
…it and closures Do not suggest nonsensical types when the type inference is failing on `impl Trait` or anonymous closures.
When encountering a boxed value as expected and a stack allocated value that could be boxed to fulfill the expectation, like in the following snippet, suggest `Box::new` wrapping.
Add lint for excess trailing semicolons Closes rust-lang#60876. A caveat (not necessarily a negative, but something to consider) with this implementation is that excess semicolons after return/continue/break now also cause an 'unreachable statement' warning. For the following example: ``` fn main() { extra_semis(); } fn extra_semis() -> i32 { let mut sum = 0;;; for i in 0..10 { if i == 5 { continue;; } else if i == 9 { break;; } else { sum += i;; } } return sum;; } ``` The output is: ``` warning: unnecessary trailing semicolons --> src/main.rs:5:21 | 5 | let mut sum = 0;;; | ^^ help: remove these semicolons | = note: `#[warn(redundant_semicolon)]` on by default warning: unnecessary trailing semicolon --> src/main.rs:8:22 | 8 | continue;; | ^ help: remove this semicolon warning: unnecessary trailing semicolon --> src/main.rs:10:19 | 10 | break;; | ^ help: remove this semicolon warning: unnecessary trailing semicolon --> src/main.rs:12:22 | 12 | sum += i;; | ^ help: remove this semicolon warning: unnecessary trailing semicolon --> src/main.rs:15:16 | 15 | return sum;; | ^ help: remove this semicolon warning: unreachable statement --> src/main.rs:8:22 | 8 | continue;; | ^ | = note: `#[warn(unreachable_code)]` on by default warning: unreachable statement --> src/main.rs:10:19 | 10 | break;; | ^ warning: unreachable statement --> src/main.rs:15:16 | 15 | return sum;; | ^ ```
Miri: Check that a ptr is aligned and inbounds already when evaluating `*` This syncs Miri with what the Nomicon and the Reference say, and resolves rust-lang/miri#447. Also this would not have worked without rust-lang#62982 due to new cycles. ;) r? @oli-obk
…chenkov libsyntax: cleanup and refactor `pat.rs` A smaller refactoring & cleanup of `pat.rs` (best read commit by commit). r? @petrochenkov
…ntril When needing type annotations in local bindings, account for impl Trait and closures Fix rust-lang#46680, fix rust-lang#63504, fix rust-lang#63506, fix rust-lang#40014, cc rust-lang#63502.
Point at the right enclosing scope when using `await` in non-async fn Fix rust-lang#63398.
syntax: Remove `DummyResult::expr_only` The effect is that if a built-in macro both returns an erroneous AST fragment and is used in unexpected position, then the incorrect position error won't be reported. This combination of two errors should be rare and isn't worth an extra field that makes people ask questions in comments. (There wasn't even a test making sure it worked.) Addresses rust-lang#63468 (comment) r? @estebank
expand: Unimplement `MutVisitor` on `MacroExpander` Each call to `fully_expand_fragment` is something unique, interesting, and requiring attention. It represents a "root" of expansion and its use means that something unusual is happening, like eager expansion or expansion performed outside of the primary expansion pass. So, it shouldn't hide under a generic visitor call. Also, from all the implemented visitor methods only two were actually used. cc rust-lang#63468 (comment)
Add NodeId for Arm, Field and FieldPat Extracted from rust-lang#63468
Merge Variant and Variant_ Extracted from rust-lang#63468.
…henkov move test that shouldn't be in test/run-pass/ We no longer test `src/test/run-pass/`; the proper way now is `// run-pass` in `src/test/ui/` r? @petrochenkov
…fJung Adjust tracking issues for `MaybeUninit<T>` gates cc rust-lang#63566 rust-lang#63567 rust-lang#63568 rust-lang#63569 r? @RalfJung
@bors r+ p=11 rollup=never |
📌 Commit 78cd9d1 has been approved by |
Rollup of 11 pull requests Successful merges: - #62984 (Add lint for excess trailing semicolons) - #63075 (Miri: Check that a ptr is aligned and inbounds already when evaluating `*`) - #63490 (libsyntax: cleanup and refactor `pat.rs`) - #63507 (When needing type annotations in local bindings, account for impl Trait and closures) - #63509 (Point at the right enclosing scope when using `await` in non-async fn) - #63528 (syntax: Remove `DummyResult::expr_only`) - #63537 (expand: Unimplement `MutVisitor` on `MacroExpander`) - #63542 (Add NodeId for Arm, Field and FieldPat) - #63543 (Merge Variant and Variant_) - #63560 (move test that shouldn't be in test/run-pass/) - #63570 (Adjust tracking issues for `MaybeUninit<T>` gates) Failed merges: r? @ghost
☀️ Test successful - checks-azure |
📣 Toolstate changed by #63575! Tested on commit 9e9a136. 💔 clippy-driver on windows: test-fail → build-fail (cc @Manishearth @llogiq @mcarton @oli-obk @phansch, @rust-lang/infra). |
Tested on commit rust-lang/rust@9e9a136. Direct link to PR: <rust-lang/rust#63575> 💔 clippy-driver on windows: test-fail → build-fail (cc @Manishearth @llogiq @mcarton @oli-obk @phansch, @rust-lang/infra). 💔 clippy-driver on linux: test-fail → build-fail (cc @Manishearth @llogiq @mcarton @oli-obk @phansch, @rust-lang/infra). 💔 miri on windows: test-pass → build-fail (cc @oli-obk @RalfJung @eddyb, @rust-lang/infra). 💔 miri on linux: test-pass → build-fail (cc @oli-obk @RalfJung @eddyb, @rust-lang/infra).
Successful merges:
*
#63075 (Miri: Check that a ptr is aligned and inbounds already when evaluating*
)pat.rs
#63490 (libsyntax: cleanup and refactorpat.rs
)await
in non-async fn #63509 (Point at the right enclosing scope when usingawait
in non-async fn)DummyResult::expr_only
#63528 (syntax: RemoveDummyResult::expr_only
)MutVisitor
onMacroExpander
#63537 (expand: UnimplementMutVisitor
onMacroExpander
)MaybeUninit<T>
gates #63570 (Adjust tracking issues forMaybeUninit<T>
gates)Failed merges:
r? @ghost