diff options
| author | bors <bors@rust-lang.org> | 2022-11-20 23:03:20 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-11-20 23:03:20 +0000 |
| commit | a102dc806da3bc9c59b3594368a14e7d2632bf9c (patch) | |
| tree | 81e596d41b4f9c2bcec911abb5bf29f5ec0abf2b /src | |
| parent | a28f3c88e50a77bc2a91889241248c4543854e61 (diff) | |
| parent | 846574828a60eac8974011d60addd981634733a1 (diff) | |
| download | rust-a102dc806da3bc9c59b3594368a14e7d2632bf9c.tar.gz rust-a102dc806da3bc9c59b3594368a14e7d2632bf9c.zip | |
Auto merge of #104655 - matthiaskrgr:rollup-r5kfffy, r=matthiaskrgr
Rollup of 9 pull requests
Successful merges:
- #101310 (Clarify and restrict when `{Arc,Rc}::get_unchecked_mut` is allowed.)
- #104461 (Fix building of `aarch64-pc-windows-gnullvm`)
- #104487 (update ntapi dep to remove future-incompat warning)
- #104504 (Add a detailed note for missing comma typo w/ FRU syntax)
- #104581 (rustdoc: remove unused JS IIFE from main.js)
- #104632 (avoid non-strict-provenance casts in libcore tests)
- #104634 (move core::arch into separate file)
- #104641 (replace unusual grammar)
- #104643 (add examples to chunks remainder methods. )
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'src')
| -rw-r--r-- | src/bootstrap/Cargo.lock | 8 | ||||
| -rw-r--r-- | src/bootstrap/Cargo.toml | 2 | ||||
| -rw-r--r-- | src/bootstrap/metrics.rs | 2 | ||||
| -rw-r--r-- | src/librustdoc/html/static/js/main.js | 9 | ||||
| -rw-r--r-- | src/test/ui/structs/multi-line-fru-suggestion.rs | 22 | ||||
| -rw-r--r-- | src/test/ui/structs/multi-line-fru-suggestion.stderr | 25 | ||||
| -rw-r--r-- | src/test/ui/structs/struct-record-suggestion.fixed | 7 | ||||
| -rw-r--r-- | src/test/ui/structs/struct-record-suggestion.rs | 3 | ||||
| -rw-r--r-- | src/test/ui/structs/struct-record-suggestion.stderr | 27 |
9 files changed, 74 insertions, 31 deletions
diff --git a/src/bootstrap/Cargo.lock b/src/bootstrap/Cargo.lock index e1a108cea95..a59dc4f87a6 100644 --- a/src/bootstrap/Cargo.lock +++ b/src/bootstrap/Cargo.lock @@ -383,9 +383,9 @@ dependencies = [ [[package]] name = "ntapi" -version = "0.3.7" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c28774a7fd2fbb4f0babd8237ce554b73af68021b5f695a3cebd6c59bac0980f" +checksum = "bc51db7b362b205941f71232e56c625156eb9a929f8cf74a428fd5bc094a4afc" dependencies = [ "winapi", ] @@ -607,9 +607,9 @@ dependencies = [ [[package]] name = "sysinfo" -version = "0.24.2" +version = "0.26.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2809487b962344ca55d9aea565f9ffbcb6929780802217acc82561f6746770" +checksum = "c375d5fd899e32847b8566e10598d6e9f1d9b55ec6de3cdf9e7da4bdc51371bc" dependencies = [ "cfg-if", "core-foundation-sys", diff --git a/src/bootstrap/Cargo.toml b/src/bootstrap/Cargo.toml index f74738437ea..813c8075605 100644 --- a/src/bootstrap/Cargo.toml +++ b/src/bootstrap/Cargo.toml @@ -54,7 +54,7 @@ xz2 = "0.1" walkdir = "2" # Dependencies needed by the build-metrics feature -sysinfo = { version = "0.24.1", optional = true } +sysinfo = { version = "0.26.0", optional = true } [target.'cfg(windows)'.dependencies.winapi] version = "0.3" diff --git a/src/bootstrap/metrics.rs b/src/bootstrap/metrics.rs index 451febddc88..c823dc79684 100644 --- a/src/bootstrap/metrics.rs +++ b/src/bootstrap/metrics.rs @@ -97,7 +97,7 @@ impl BuildMetrics { cpu_threads_count: system.cpus().len(), cpu_model: system.cpus()[0].brand().into(), - memory_total_bytes: system.total_memory() * 1024, + memory_total_bytes: system.total_memory(), }; let steps = std::mem::take(&mut state.finished_steps); diff --git a/src/librustdoc/html/static/js/main.js b/src/librustdoc/html/static/js/main.js index 75b3dce2eda..2a109ffbc60 100644 --- a/src/librustdoc/html/static/js/main.js +++ b/src/librustdoc/html/static/js/main.js @@ -723,12 +723,9 @@ function loadCss(cssUrl) { }); }; - (function() { - // To avoid checking on "rustdoc-line-numbers" value on every loop... - if (getSettingValue("line-numbers") === "true") { - window.rustdoc_add_line_numbers_to_examples(); - } - }()); + if (getSettingValue("line-numbers") === "true") { + window.rustdoc_add_line_numbers_to_examples(); + } let oldSidebarScrollPosition = null; diff --git a/src/test/ui/structs/multi-line-fru-suggestion.rs b/src/test/ui/structs/multi-line-fru-suggestion.rs new file mode 100644 index 00000000000..7b2b139142e --- /dev/null +++ b/src/test/ui/structs/multi-line-fru-suggestion.rs @@ -0,0 +1,22 @@ +#[derive(Default)] +struct Inner { + a: u8, + b: u8, +} + +#[derive(Default)] +struct Outer { + inner: Inner, + defaulted: u8, +} + +fn main(){ + Outer { + //~^ ERROR missing field `defaulted` in initializer of `Outer` + inner: Inner { + a: 1, + b: 2, + } + ..Default::default() + }; +} diff --git a/src/test/ui/structs/multi-line-fru-suggestion.stderr b/src/test/ui/structs/multi-line-fru-suggestion.stderr new file mode 100644 index 00000000000..8bbd3ace7d2 --- /dev/null +++ b/src/test/ui/structs/multi-line-fru-suggestion.stderr @@ -0,0 +1,25 @@ +error[E0063]: missing field `defaulted` in initializer of `Outer` + --> $DIR/multi-line-fru-suggestion.rs:14:5 + | +LL | Outer { + | ^^^^^ missing `defaulted` + | +note: this expression may have been misinterpreted as a `..` range expression + --> $DIR/multi-line-fru-suggestion.rs:16:16 + | +LL | inner: Inner { + | ________________^ +LL | | a: 1, +LL | | b: 2, +LL | | } + | |_________^ this expression does not end in a comma... +LL | ..Default::default() + | ^^^^^^^^^^^^^^^^^^^^ ... so this is interpreted as a `..` range expression, instead of functional record update syntax +help: to set the remaining fields from `Default::default()`, separate the last named field with a comma + | +LL | }, + | + + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0063`. diff --git a/src/test/ui/structs/struct-record-suggestion.fixed b/src/test/ui/structs/struct-record-suggestion.fixed index 49e38b196de..d93a62185b3 100644 --- a/src/test/ui/structs/struct-record-suggestion.fixed +++ b/src/test/ui/structs/struct-record-suggestion.fixed @@ -7,9 +7,8 @@ struct A { } fn a() { - let q = A { c: 5,..Default::default() }; - //~^ ERROR mismatched types - //~| ERROR missing fields + let q = A { c: 5, ..Default::default() }; + //~^ ERROR missing fields //~| HELP separate the last named field with a comma let r = A { c: 5, ..Default::default() }; assert_eq!(q, r); @@ -21,7 +20,7 @@ struct B { } fn b() { - let q = B { b: 1,..Default::default() }; + let q = B { b: 1, ..Default::default() }; //~^ ERROR mismatched types //~| HELP separate the last named field with a comma let r = B { b: 1 }; diff --git a/src/test/ui/structs/struct-record-suggestion.rs b/src/test/ui/structs/struct-record-suggestion.rs index 901f310c8bd..f0fd1c94e9a 100644 --- a/src/test/ui/structs/struct-record-suggestion.rs +++ b/src/test/ui/structs/struct-record-suggestion.rs @@ -8,8 +8,7 @@ struct A { fn a() { let q = A { c: 5..Default::default() }; - //~^ ERROR mismatched types - //~| ERROR missing fields + //~^ ERROR missing fields //~| HELP separate the last named field with a comma let r = A { c: 5, ..Default::default() }; assert_eq!(q, r); diff --git a/src/test/ui/structs/struct-record-suggestion.stderr b/src/test/ui/structs/struct-record-suggestion.stderr index 66e9f021ed6..f4fd655e698 100644 --- a/src/test/ui/structs/struct-record-suggestion.stderr +++ b/src/test/ui/structs/struct-record-suggestion.stderr @@ -1,37 +1,38 @@ -error[E0308]: mismatched types - --> $DIR/struct-record-suggestion.rs:10:20 - | -LL | let q = A { c: 5..Default::default() }; - | ^^^^^^^^^^^^^^^^^^^^^ expected `u64`, found struct `std::ops::Range` - | - = note: expected type `u64` - found struct `std::ops::Range<{integer}>` - error[E0063]: missing fields `b` and `d` in initializer of `A` --> $DIR/struct-record-suggestion.rs:10:13 | LL | let q = A { c: 5..Default::default() }; | ^ missing `b` and `d` | +note: this expression may have been misinterpreted as a `..` range expression + --> $DIR/struct-record-suggestion.rs:10:20 + | +LL | let q = A { c: 5..Default::default() }; + | ^^^^^^^^^^^^^^^^^^^^^ help: to set the remaining fields from `Default::default()`, separate the last named field with a comma | -LL | let q = A { c: 5,..Default::default() }; +LL | let q = A { c: 5, ..Default::default() }; | + error[E0308]: mismatched types - --> $DIR/struct-record-suggestion.rs:24:20 + --> $DIR/struct-record-suggestion.rs:23:20 | LL | let q = B { b: 1..Default::default() }; | ^^^^^^^^^^^^^^^^^^^^^ expected `u32`, found struct `std::ops::Range` | = note: expected type `u32` found struct `std::ops::Range<{integer}>` +note: this expression may have been misinterpreted as a `..` range expression + --> $DIR/struct-record-suggestion.rs:23:20 + | +LL | let q = B { b: 1..Default::default() }; + | ^^^^^^^^^^^^^^^^^^^^^ help: to set the remaining fields from `Default::default()`, separate the last named field with a comma | -LL | let q = B { b: 1,..Default::default() }; +LL | let q = B { b: 1, ..Default::default() }; | + -error: aborting due to 3 previous errors +error: aborting due to 2 previous errors Some errors have detailed explanations: E0063, E0308. For more information about an error, try `rustc --explain E0063`. |
