Auto merge of #90235 - matthiaskrgr:rollup-7pqtevk, r=matthiaskrgr
Rollup of 6 pull requests Successful merges: - #89558 (Add rustc lint, warning when iterating over hashmaps) - #90100 (Skip documentation for tier 2 targets on dist-x86_64-apple-darwin) - #90155 (Fix alignment of method headings for scannability) - #90162 (Mark `{array, slice}::{from_ref, from_mut}` as const fn) - #90221 (Fix ICE when forgetting to `Box` a parameter to a `Self::func` call) - #90234 (Temporarily turn overflow checks off for rustc-rayon-core) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
This commit is contained in:
commit
00d5e42e77
58 changed files with 409 additions and 98 deletions
|
|
@ -448,9 +448,11 @@ jobs:
|
|||
# macOS Builders #
|
||||
####################
|
||||
|
||||
# Only generate documentation for x86_64-apple-darwin, not other
|
||||
# tier 2 targets produced by this builder.
|
||||
- name: dist-x86_64-apple
|
||||
env:
|
||||
SCRIPT: ./x.py dist
|
||||
SCRIPT: ./x.py dist --exclude src/doc --exclude extended && ./x.py dist --target=x86_64-apple-darwin src/doc && ./x.py dist extended
|
||||
RUST_CONFIGURE_ARGS: --host=x86_64-apple-darwin --target=x86_64-apple-darwin,aarch64-apple-ios,x86_64-apple-ios,aarch64-apple-ios-sim --enable-full-tools --enable-sanitizers --enable-profiler --set rust.jemalloc --set llvm.ninja=false
|
||||
RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
|
||||
MACOSX_DEPLOYMENT_TARGET: 10.7
|
||||
|
|
@ -670,7 +672,17 @@ jobs:
|
|||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- *dist-x86_64-linux
|
||||
- name: dist-x86_64-apple
|
||||
env:
|
||||
SCRIPT: ./x.py dist --exclude src/doc --exclude extended && ./x.py dist --target=x86_64-apple-darwin src/doc && ./x.py dist extended
|
||||
RUST_CONFIGURE_ARGS: --host=x86_64-apple-darwin --target=x86_64-apple-darwin,aarch64-apple-ios,x86_64-apple-ios,aarch64-apple-ios-sim --enable-full-tools --enable-sanitizers --enable-profiler --set rust.jemalloc --set llvm.ninja=false
|
||||
RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
|
||||
MACOSX_DEPLOYMENT_TARGET: 10.7
|
||||
NO_LLVM_ASSERTIONS: 1
|
||||
NO_DEBUG_ASSERTIONS: 1
|
||||
DIST_REQUIRE_ALL_TOOLS: 1
|
||||
<<: *job-macos-xl
|
||||
|
||||
|
||||
master:
|
||||
name: master
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ else
|
|||
PYTHON="python2"
|
||||
fi
|
||||
|
||||
if ! isCI || isCiBranch auto || isCiBranch beta; then
|
||||
if ! isCI || isCiBranch auto || isCiBranch beta || isCiBranch try; then
|
||||
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --set build.print-step-timings --enable-verbose-tests"
|
||||
fi
|
||||
|
||||
|
|
|
|||
|
|
@ -152,10 +152,15 @@ h1.fqn > .in-band > a:hover {
|
|||
h2, h3, h4 {
|
||||
border-bottom: 1px solid;
|
||||
}
|
||||
h3.code-header, h4.code-header {
|
||||
h3.code-header {
|
||||
font-size: 1.1em;
|
||||
}
|
||||
h4.code-header {
|
||||
font-size: 1em;
|
||||
}
|
||||
h3.code-header, h4.code-header {
|
||||
font-weight: 600;
|
||||
border: none;
|
||||
border-bottom-style: none;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
|
@ -174,12 +179,6 @@ h3.code-header, h4.code-header {
|
|||
margin-bottom: 10px;
|
||||
position: relative;
|
||||
}
|
||||
.impl, .method.trait-impl,
|
||||
.type.trait-impl,
|
||||
.associatedconstant.trait-impl,
|
||||
.associatedtype.trait-impl {
|
||||
padding-left: 15px;
|
||||
}
|
||||
|
||||
div.impl-items > div {
|
||||
padding-left: 0;
|
||||
|
|
@ -674,13 +673,6 @@ nav.sub {
|
|||
left: -19px;
|
||||
}
|
||||
|
||||
.content .impl-items .method, .content .impl-items > .type, .impl-items > .associatedconstant,
|
||||
.impl-items > .associatedtype, .content .impl-items details > summary > .type,
|
||||
.impl-items details > summary > .associatedconstant,
|
||||
.impl-items details > summary > .associatedtype {
|
||||
margin-left: 20px;
|
||||
}
|
||||
|
||||
.content .impl-items .docblock, .content .impl-items .item-info {
|
||||
margin-bottom: .6em;
|
||||
}
|
||||
|
|
@ -751,7 +743,7 @@ a {
|
|||
.anchor {
|
||||
display: none;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
left: -0.5em;
|
||||
background: none !important;
|
||||
}
|
||||
.anchor.field {
|
||||
|
|
@ -1584,14 +1576,14 @@ details.rustdoc-toggle > summary.hideme::before {
|
|||
|
||||
details.rustdoc-toggle > summary:not(.hideme)::before {
|
||||
position: absolute;
|
||||
left: -23px;
|
||||
left: -24px;
|
||||
top: 3px;
|
||||
}
|
||||
|
||||
.impl-items > details.rustdoc-toggle > summary:not(.hideme)::before,
|
||||
.undocumented > details.rustdoc-toggle > summary:not(.hideme)::before {
|
||||
position: absolute;
|
||||
left: -2px;
|
||||
left: -24px;
|
||||
}
|
||||
|
||||
/* When a "hideme" summary is open and the "Expand description" or "Show
|
||||
|
|
|
|||
11
src/test/rustdoc-gui/anchor-navigable.goml
Normal file
11
src/test/rustdoc-gui/anchor-navigable.goml
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
// The `impl Foo` heading underneath `Implementations` has a §
|
||||
// anchor to its left (used for linking to that heading). The anchor only shows
|
||||
// up when hovering the `impl Foo`. This test ensures there's no gap between the
|
||||
// anchor and the `impl Foo`. If there were a gap, this would cause an annoying
|
||||
// problem: you hover `impl Foo` to see the anchor, then when you move your
|
||||
// mouse to the left, the anchor disappears before you reach it.
|
||||
goto: file://|DOC_PATH|/test_docs/struct.Foo.html
|
||||
// We check that ".item-info" is bigger than its content.
|
||||
move-cursor-to: ".impl"
|
||||
assert-property: (".impl > a.anchor", {"offsetWidth": "9"})
|
||||
assert-css: (".impl > a.anchor", {"left": "-8px"})
|
||||
24
src/test/ui-fulldeps/internal-lints/query_stability.rs
Normal file
24
src/test/ui-fulldeps/internal-lints/query_stability.rs
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
// compile-flags: -Z unstable-options
|
||||
|
||||
#![feature(rustc_private)]
|
||||
#![deny(rustc::potential_query_instability)]
|
||||
|
||||
extern crate rustc_data_structures;
|
||||
|
||||
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
|
||||
|
||||
fn main() {
|
||||
let mut x = FxHashMap::<u32, i32>::default();
|
||||
|
||||
for _ in x.drain() {}
|
||||
//~^ ERROR using `drain` can result in unstable
|
||||
|
||||
for _ in x.iter() {}
|
||||
//~^ ERROR using `iter`
|
||||
|
||||
for _ in Some(&mut x).unwrap().iter_mut() {}
|
||||
//~^ ERROR using `iter_mut`
|
||||
|
||||
for _ in x {}
|
||||
//~^ ERROR using `into_iter`
|
||||
}
|
||||
39
src/test/ui-fulldeps/internal-lints/query_stability.stderr
Normal file
39
src/test/ui-fulldeps/internal-lints/query_stability.stderr
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
error: using `drain` can result in unstable query results
|
||||
--> $DIR/query_stability.rs:13:16
|
||||
|
|
||||
LL | for _ in x.drain() {}
|
||||
| ^^^^^
|
||||
|
|
||||
note: the lint level is defined here
|
||||
--> $DIR/query_stability.rs:4:9
|
||||
|
|
||||
LL | #![deny(rustc::potential_query_instability)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
= note: if you believe this case to be fine, allow this lint and add a comment explaining your rationale
|
||||
|
||||
error: using `iter` can result in unstable query results
|
||||
--> $DIR/query_stability.rs:16:16
|
||||
|
|
||||
LL | for _ in x.iter() {}
|
||||
| ^^^^
|
||||
|
|
||||
= note: if you believe this case to be fine, allow this lint and add a comment explaining your rationale
|
||||
|
||||
error: using `iter_mut` can result in unstable query results
|
||||
--> $DIR/query_stability.rs:19:36
|
||||
|
|
||||
LL | for _ in Some(&mut x).unwrap().iter_mut() {}
|
||||
| ^^^^^^^^
|
||||
|
|
||||
= note: if you believe this case to be fine, allow this lint and add a comment explaining your rationale
|
||||
|
||||
error: using `into_iter` can result in unstable query results
|
||||
--> $DIR/query_stability.rs:22:14
|
||||
|
|
||||
LL | for _ in x {}
|
||||
| ^
|
||||
|
|
||||
= note: if you believe this case to be fine, allow this lint and add a comment explaining your rationale
|
||||
|
||||
error: aborting due to 4 previous errors
|
||||
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
// compile-flags: -Z unstable-options
|
||||
|
||||
#![feature(rustc_attrs)]
|
||||
|
||||
#[rustc_lint_query_instability]
|
||||
//~^ ERROR attribute should be applied to a function
|
||||
struct Foo;
|
||||
|
||||
impl Foo {
|
||||
#[rustc_lint_query_instability(a)]
|
||||
//~^ ERROR malformed `rustc_lint_query_instability`
|
||||
fn bar() {}
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
error: malformed `rustc_lint_query_instability` attribute input
|
||||
--> $DIR/query_stability_incorrect.rs:10:5
|
||||
|
|
||||
LL | #[rustc_lint_query_instability(a)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: must be of the form: `#[rustc_lint_query_instability]`
|
||||
|
||||
error: attribute should be applied to a function
|
||||
--> $DIR/query_stability_incorrect.rs:5:1
|
||||
|
|
||||
LL | #[rustc_lint_query_instability]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
LL |
|
||||
LL | struct Foo;
|
||||
| ----------- not a function
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
// Checks that we do not ICE when comparing `Self` to `Pin`
|
||||
// edition:2021
|
||||
|
||||
struct S;
|
||||
|
||||
impl S {
|
||||
fn foo(_: Box<Option<S>>) {}
|
||||
fn bar() {
|
||||
Self::foo(None) //~ ERROR mismatched types
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
error[E0308]: mismatched types
|
||||
--> $DIR/issue-90213-expected-boxfuture-self-ice.rs:9:19
|
||||
|
|
||||
LL | Self::foo(None)
|
||||
| ^^^^ expected struct `Box`, found enum `Option`
|
||||
|
|
||||
= note: expected struct `Box<Option<S>>`
|
||||
found enum `Option<_>`
|
||||
= note: for more on the distinction between the stack and the heap, read https://doc.rust-lang.org/book/ch15-01-box.html, https://doc.rust-lang.org/rust-by-example/std/box.html, and https://doc.rust-lang.org/std/boxed/index.html
|
||||
help: store this in the heap by calling `Box::new`
|
||||
|
|
||||
LL | Self::foo(Box::new(None))
|
||||
| +++++++++ +
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0308`.
|
||||
Loading…
Add table
Add a link
Reference in a new issue