diff options
| author | bors <bors@rust-lang.org> | 2021-07-27 13:31:40 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-07-27 13:31:40 +0000 |
| commit | 3bc9dd0dd293ab82945e35888ed6d7ab802761ef (patch) | |
| tree | 402059c4b8c50e38d886784306f72494a7488771 /src | |
| parent | 99d6692f6c1cebd6c56a67eb21f6aae26c12a145 (diff) | |
| parent | af6c95f14ddd146e918b28a710f4d514b5091f20 (diff) | |
Auto merge of #87509 - JohnTitor:rollup-8iqn6cl, r=JohnTitor
Rollup of 10 pull requests
Successful merges:
- #86450 (Add flag to configure `large_assignments` lint)
- #86764 (Avoid ICE on type error recovery)
- #87354 (Update VxWork's UNIX support)
- #87427 (get rid of NoMirFor error variant)
- #87446 (macos current_exe using directly libc instead.)
- #87494 (fix typo: whenver -> whenever)
- #87497 (Add long explanation for E0544.)
- #87499 (Remove ASCII fast path from `rustc_lexer::{is_id_continue, is_id_start}`)
- #87502 (Update cargo)
- #87503 (Update books)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'src')
| m--------- | src/doc/book | 0 | ||||
| m--------- | src/doc/edition-guide | 0 | ||||
| m--------- | src/doc/nomicon | 0 | ||||
| m--------- | src/doc/reference | 0 | ||||
| m--------- | src/doc/rust-by-example | 0 | ||||
| m--------- | src/doc/rustc-dev-guide | 0 | ||||
| -rw-r--r-- | src/doc/unstable-book/src/compiler-flags/move-size-limit.md | 10 | ||||
| -rw-r--r-- | src/test/ui/async-await/large_moves.attribute.stderr (renamed from src/test/ui/async-await/large_moves.stderr) | 8 | ||||
| -rw-r--r-- | src/test/ui/async-await/large_moves.option.stderr | 38 | ||||
| -rw-r--r-- | src/test/ui/async-await/large_moves.rs | 4 | ||||
| -rw-r--r-- | src/test/ui/issues/issue-86756.rs | 12 | ||||
| -rw-r--r-- | src/test/ui/issues/issue-86756.stderr | 46 | ||||
| -rw-r--r-- | src/test/ui/stability-attribute/stability-attribute-sanity.stderr | 2 | ||||
| m--------- | src/tools/cargo | 0 |
14 files changed, 114 insertions, 6 deletions
diff --git a/src/doc/book b/src/doc/book -Subproject eac55314210519238652f12b30fec9daea61f7f +Subproject a07036f864b37896b31eb996cd7aedb489f69a1 diff --git a/src/doc/edition-guide b/src/doc/edition-guide -Subproject af696ce8ea526445590ae0ca66a8128d2a95a69 +Subproject 3710b0cae783d0bcd2b42452a63b081473f5970 diff --git a/src/doc/nomicon b/src/doc/nomicon -Subproject 7a13537f96af4b9b8e3ea296d6e5c3c7ab72ce9 +Subproject f51734eb5566c826b471977747ea3d7d6915bbe diff --git a/src/doc/reference b/src/doc/reference -Subproject 82d75cf423e4a7824fb36e73ccb18519d690061 +Subproject 3b7be075af5d6e402a18efff672a8a265b4596f diff --git a/src/doc/rust-by-example b/src/doc/rust-by-example -Subproject 1db6bb483cc87ad3b424d9aba764fe622960a1b +Subproject 0dc9cd4e89f00cb5230f120e1a083916386e422 diff --git a/src/doc/rustc-dev-guide b/src/doc/rustc-dev-guide -Subproject 93422c21baca585dc88357ec886a48f6ddc7d66 +Subproject 09343d6f921d2a07c66f8c41ec3d65bf1fa5255 diff --git a/src/doc/unstable-book/src/compiler-flags/move-size-limit.md b/src/doc/unstable-book/src/compiler-flags/move-size-limit.md new file mode 100644 index 00000000000..88f022af2ec --- /dev/null +++ b/src/doc/unstable-book/src/compiler-flags/move-size-limit.md @@ -0,0 +1,10 @@ +# `move_size_limit` + +-------------------- + +The `-Zmove-size-limit=N` compiler flag enables `large_assignments` lints which +will warn when moving objects whose size exceeds `N` bytes. + +Lint warns only about moves in functions that participate in code generation. +Consequently it will be ineffective for compiler invocatation that emit +metadata only, i.e., `cargo check` like workflows. diff --git a/src/test/ui/async-await/large_moves.stderr b/src/test/ui/async-await/large_moves.attribute.stderr index 8c47ec0ed9d..39b7e7cb345 100644 --- a/src/test/ui/async-await/large_moves.stderr +++ b/src/test/ui/async-await/large_moves.attribute.stderr @@ -1,5 +1,5 @@ error: moving 10024 bytes - --> $DIR/large_moves.rs:10:13 + --> $DIR/large_moves.rs:12:13 | LL | let x = async { | _____________^ @@ -17,19 +17,19 @@ LL | #![deny(large_assignments)] | ^^^^^^^^^^^^^^^^^ error: moving 10024 bytes - --> $DIR/large_moves.rs:16:14 + --> $DIR/large_moves.rs:18:14 | LL | let z = (x, 42); | ^ value moved from here error: moving 10024 bytes - --> $DIR/large_moves.rs:16:13 + --> $DIR/large_moves.rs:18:13 | LL | let z = (x, 42); | ^^^^^^^ value moved from here error: moving 10024 bytes - --> $DIR/large_moves.rs:18:13 + --> $DIR/large_moves.rs:20:13 | LL | let a = z.0; | ^^^ value moved from here diff --git a/src/test/ui/async-await/large_moves.option.stderr b/src/test/ui/async-await/large_moves.option.stderr new file mode 100644 index 00000000000..39b7e7cb345 --- /dev/null +++ b/src/test/ui/async-await/large_moves.option.stderr @@ -0,0 +1,38 @@ +error: moving 10024 bytes + --> $DIR/large_moves.rs:12:13 + | +LL | let x = async { + | _____________^ +LL | | let y = [0; 9999]; +LL | | dbg!(y); +LL | | thing(&y).await; +LL | | dbg!(y); +LL | | }; + | |_____^ value moved from here + | +note: the lint level is defined here + --> $DIR/large_moves.rs:1:9 + | +LL | #![deny(large_assignments)] + | ^^^^^^^^^^^^^^^^^ + +error: moving 10024 bytes + --> $DIR/large_moves.rs:18:14 + | +LL | let z = (x, 42); + | ^ value moved from here + +error: moving 10024 bytes + --> $DIR/large_moves.rs:18:13 + | +LL | let z = (x, 42); + | ^^^^^^^ value moved from here + +error: moving 10024 bytes + --> $DIR/large_moves.rs:20:13 + | +LL | let a = z.0; + | ^^^ value moved from here + +error: aborting due to 4 previous errors + diff --git a/src/test/ui/async-await/large_moves.rs b/src/test/ui/async-await/large_moves.rs index 4fac046beef..18bb538a81e 100644 --- a/src/test/ui/async-await/large_moves.rs +++ b/src/test/ui/async-await/large_moves.rs @@ -1,8 +1,10 @@ #![deny(large_assignments)] #![feature(large_assignments)] -#![move_size_limit = "1000"] +#![cfg_attr(attribute, move_size_limit = "1000")] // build-fail // only-x86_64 +// revisions: attribute option +// [option]compile-flags: -Zmove-size-limit=1000 // edition:2018 diff --git a/src/test/ui/issues/issue-86756.rs b/src/test/ui/issues/issue-86756.rs new file mode 100644 index 00000000000..7f864eb2850 --- /dev/null +++ b/src/test/ui/issues/issue-86756.rs @@ -0,0 +1,12 @@ +trait Foo<T, T = T> {} +//~^ ERROR the name `T` is already used for a generic parameter in this item's generic parameters + +fn eq<A, B>() { + eq::<dyn, Foo> + //~^ ERROR cannot find type `dyn` in this scope + //~| ERROR missing generics for trait `Foo` + //~| WARN trait objects without an explicit `dyn` are deprecated + //~| WARN this is accepted in the current edition +} + +fn main() {} diff --git a/src/test/ui/issues/issue-86756.stderr b/src/test/ui/issues/issue-86756.stderr new file mode 100644 index 00000000000..1ef21986726 --- /dev/null +++ b/src/test/ui/issues/issue-86756.stderr @@ -0,0 +1,46 @@ +error[E0403]: the name `T` is already used for a generic parameter in this item's generic parameters + --> $DIR/issue-86756.rs:1:14 + | +LL | trait Foo<T, T = T> {} + | - ^ already used + | | + | first use of `T` + +error[E0412]: cannot find type `dyn` in this scope + --> $DIR/issue-86756.rs:5:10 + | +LL | fn eq<A, B>() { + | - help: you might be missing a type parameter: `, dyn` +LL | eq::<dyn, Foo> + | ^^^ not found in this scope + +warning: trait objects without an explicit `dyn` are deprecated + --> $DIR/issue-86756.rs:5:15 + | +LL | eq::<dyn, Foo> + | ^^^ help: use `dyn`: `dyn Foo` + | + = note: `#[warn(bare_trait_objects)]` on by default + = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! + = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165> + +error[E0107]: missing generics for trait `Foo` + --> $DIR/issue-86756.rs:5:15 + | +LL | eq::<dyn, Foo> + | ^^^ expected at least 1 generic argument + | +note: trait defined here, with at least 1 generic parameter: `T` + --> $DIR/issue-86756.rs:1:7 + | +LL | trait Foo<T, T = T> {} + | ^^^ - +help: add missing generic argument + | +LL | eq::<dyn, Foo<T>> + | ^^^^^^ + +error: aborting due to 3 previous errors; 1 warning emitted + +Some errors have detailed explanations: E0107, E0403, E0412. +For more information about an error, try `rustc --explain E0107`. diff --git a/src/test/ui/stability-attribute/stability-attribute-sanity.stderr b/src/test/ui/stability-attribute/stability-attribute-sanity.stderr index ddf65f3a7ee..4dc68662033 100644 --- a/src/test/ui/stability-attribute/stability-attribute-sanity.stderr +++ b/src/test/ui/stability-attribute/stability-attribute-sanity.stderr @@ -122,5 +122,5 @@ LL | #[rustc_deprecated(since = "a", reason = "text")] error: aborting due to 19 previous errors -Some errors have detailed explanations: E0539, E0541, E0542, E0543, E0546, E0547, E0549, E0550. +Some errors have detailed explanations: E0539, E0541, E0542, E0543, E0544, E0546, E0547, E0549, E0550. For more information about an error, try `rustc --explain E0539`. diff --git a/src/tools/cargo b/src/tools/cargo -Subproject cebef2951ee69617852844894164b54ed478a7d +Subproject d21c22870e58499d6c31f1bef3bf1255eb02166 |
