diff options
| author | bors <bors@rust-lang.org> | 2020-11-12 23:23:56 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2020-11-12 23:23:56 +0000 |
| commit | e80ee05bfc135d7d800f3fcc89bc005d6858cd9b (patch) | |
| tree | 4b8950bc77d07a409c0c444ac07d6816785eede1 /src/tools | |
| parent | 9722952f0bed5815cb22cb4878be09fb39f92804 (diff) | |
| parent | 38ca6e3561dbd2465cd604feeed93cf82580745c (diff) | |
| download | rust-e80ee05bfc135d7d800f3fcc89bc005d6858cd9b.tar.gz rust-e80ee05bfc135d7d800f3fcc89bc005d6858cd9b.zip | |
Auto merge of #78998 - m-ou-se:rollup-6r4pt9m, r=m-ou-se
Rollup of 7 pull requests Successful merges: - #76730 (Fix rustdoc rendering of by-value mutable arguments in async fn) - #78836 (Implement destructuring assignment for structs and slices) - #78857 (Improve BinaryHeap performance) - #78950 (Add asm register information for SPIR-V) - #78970 (update rustfmt to v1.4.25) - #78972 (Update cargo) - #78987 (extend min_const_generics param ty tests) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'src/tools')
| m--------- | src/tools/cargo | 0 | ||||
| -rw-r--r-- | src/tools/clippy/clippy_lints/src/utils/ast_utils.rs | 11 | ||||
| -rw-r--r-- | src/tools/clippy/tests/ui/crashes/ice-6250.stderr | 29 | ||||
| m--------- | src/tools/rustfmt | 10 |
4 files changed, 37 insertions, 13 deletions
diff --git a/src/tools/cargo b/src/tools/cargo -Subproject d5556aeb8405b1fe696adb6e297ad7a1f2989b6 +Subproject 8662ab427a8d6ad8047811cc4d78dbd20dd0769 diff --git a/src/tools/clippy/clippy_lints/src/utils/ast_utils.rs b/src/tools/clippy/clippy_lints/src/utils/ast_utils.rs index b68e33f101d..9050b9b2d9a 100644 --- a/src/tools/clippy/clippy_lints/src/utils/ast_utils.rs +++ b/src/tools/clippy/clippy_lints/src/utils/ast_utils.rs @@ -107,6 +107,15 @@ pub fn eq_expr_opt(l: &Option<P<Expr>>, r: &Option<P<Expr>>) -> bool { both(l, r, |l, r| eq_expr(l, r)) } +pub fn eq_struct_rest(l: &StructRest, r: &StructRest) -> bool { + match (l, r) { + (StructRest::Base(lb), StructRest::Base(rb)) => eq_expr(lb, rb), + (StructRest::Rest(_), StructRest::Rest(_)) => true, + (StructRest::None, StructRest::None) => true, + _ => false, + } +} + pub fn eq_expr(l: &Expr, r: &Expr) -> bool { use ExprKind::*; if !over(&l.attrs, &r.attrs, |l, r| eq_attr(l, r)) { @@ -150,7 +159,7 @@ pub fn eq_expr(l: &Expr, r: &Expr) -> bool { (Path(lq, lp), Path(rq, rp)) => both(lq, rq, |l, r| eq_qself(l, r)) && eq_path(lp, rp), (MacCall(l), MacCall(r)) => eq_mac_call(l, r), (Struct(lp, lfs, lb), Struct(rp, rfs, rb)) => { - eq_path(lp, rp) && eq_expr_opt(lb, rb) && unordered_over(lfs, rfs, |l, r| eq_field(l, r)) + eq_path(lp, rp) && eq_struct_rest(lb, rb) && unordered_over(lfs, rfs, |l, r| eq_field(l, r)) }, _ => false, } diff --git a/src/tools/clippy/tests/ui/crashes/ice-6250.stderr b/src/tools/clippy/tests/ui/crashes/ice-6250.stderr index 8241dcd8feb..c38727316cd 100644 --- a/src/tools/clippy/tests/ui/crashes/ice-6250.stderr +++ b/src/tools/clippy/tests/ui/crashes/ice-6250.stderr @@ -1,3 +1,14 @@ +error[E0658]: destructuring assignments are unstable + --> $DIR/ice-6250.rs:12:25 + | +LL | Some(reference) = cache.data.get(key) { + | --------------- ^ + | | + | cannot assign to this expression + | + = note: see issue #71126 <https://github.com/rust-lang/rust/issues/71126> for more information + = help: add `#![feature(destructuring_assignment)]` to the crate attributes to enable + error[E0601]: `main` function not found in crate `ice_6250` --> $DIR/ice-6250.rs:4:1 | @@ -11,17 +22,21 @@ LL | | } | |_^ consider adding a `main` function to `$DIR/ice-6250.rs` error[E0308]: mismatched types + --> $DIR/ice-6250.rs:12:14 + | +LL | Some(reference) = cache.data.get(key) { + | ^^^^^^^^^ + | | + | expected integer, found `&i32` + | help: consider dereferencing the borrow: `*reference` + +error[E0308]: mismatched types --> $DIR/ice-6250.rs:12:9 | LL | Some(reference) = cache.data.get(key) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found `()` - | -help: you might have meant to use pattern matching - | -LL | let Some(reference) = cache.data.get(key) { - | ^^^ -error: aborting due to 2 previous errors +error: aborting due to 4 previous errors -Some errors have detailed explanations: E0308, E0601. +Some errors have detailed explanations: E0308, E0601, E0658. For more information about an error, try `rustc --explain E0308`. diff --git a/src/tools/rustfmt b/src/tools/rustfmt -Subproject eb894d53708122a67762de9489881c11aa8ce25 +Subproject 0f29ff6da0c5ff622e739beb8fc3bbe77119b3c |
