Skip to content

Commit 70f9d23

Browse files
committed
Auto merge of #74117 - Manishearth:rollup-ds7z0kx, r=Manishearth
Rollup of 14 pull requests Successful merges: - #70563 ([rustdoc] Page hash handling) - #73856 (Edit librustc_lexer top-level docs) - #73870 (typeck: adding type information to projection) - #73953 (Audit hidden/short code suggestions) - #73962 (libstd/net/tcp.rs: #![deny(unsafe_op_in_unsafe_fn)]) - #73969 (mir: mark mir construction temporaries as internal) - #73974 (Move A|Rc::as_ptr from feature(weak_into_raw) to feature(rc_as_ptr)) - #74067 (rustdoc: Restore underline text decoration on hover for FQN in header) - #74074 (Fix the return type of Windows' `OpenOptionsExt::security_qos_flags`.) - #74078 (Always resolve type@primitive as a primitive, not a module) - #74089 (Add rust-analyzer to the build manifest) - #74090 (Remove unused RUSTC_DEBUG_ASSERTIONS) - #74102 (Fix const prop ICE) - #74112 (Expand abbreviation in core::ffi description) Failed merges: r? @ghost
2 parents 8981dbb + 73f2069 commit 70f9d23

File tree

193 files changed

+2048
-542
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

193 files changed

+2048
-542
lines changed

src/bootstrap/bin/rustdoc.rs

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ fn main() {
1313
let libdir = env::var_os("RUSTDOC_LIBDIR").expect("RUSTDOC_LIBDIR was not set");
1414
let stage = env::var("RUSTC_STAGE").expect("RUSTC_STAGE was not set");
1515
let sysroot = env::var_os("RUSTC_SYSROOT").expect("RUSTC_SYSROOT was not set");
16-
let mut has_unstable = false;
1716

1817
use std::str::FromStr;
1918

@@ -55,22 +54,10 @@ fn main() {
5554
cmd.arg("--crate-version").arg(version);
5655
}
5756

58-
// Needed to be able to run all rustdoc tests.
59-
if env::var_os("RUSTDOC_GENERATE_REDIRECT_PAGES").is_some() {
60-
// This "unstable-options" can be removed when `--generate-redirect-pages` is stabilized
61-
if !has_unstable {
62-
cmd.arg("-Z").arg("unstable-options");
63-
}
64-
cmd.arg("--generate-redirect-pages");
65-
has_unstable = true;
66-
}
67-
6857
// Needed to be able to run all rustdoc tests.
6958
if let Some(ref x) = env::var_os("RUSTDOC_RESOURCE_SUFFIX") {
7059
// This "unstable-options" can be removed when `--resource-suffix` is stabilized
71-
if !has_unstable {
72-
cmd.arg("-Z").arg("unstable-options");
73-
}
60+
cmd.arg("-Z").arg("unstable-options");
7461
cmd.arg("--resource-suffix").arg(x);
7562
}
7663

src/bootstrap/doc.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,6 @@ impl Step for Std {
451451
.arg("--markdown-css")
452452
.arg("rust.css")
453453
.arg("--markdown-no-toc")
454-
.arg("--generate-redirect-pages")
455454
.arg("-Z")
456455
.arg("unstable-options")
457456
.arg("--resource-suffix")

src/bootstrap/test.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -397,8 +397,6 @@ impl Step for Miri {
397397
cargo.env("MIRI", &miri);
398398
// Debug things.
399399
cargo.env("RUST_BACKTRACE", "1");
400-
// Overwrite bootstrap's `rustc` wrapper overwriting our flags.
401-
cargo.env("RUSTC_DEBUG_ASSERTIONS", "true");
402400
// Let cargo-miri know where xargo ended up.
403401
cargo.env("XARGO_CHECK", builder.out.join("bin").join("xargo-check"));
404402

src/liballoc/rc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1701,7 +1701,7 @@ impl<T> Weak<T> {
17011701
/// ```
17021702
///
17031703
/// [`null`]: ../../std/ptr/fn.null.html
1704-
#[stable(feature = "weak_into_raw", since = "1.45.0")]
1704+
#[stable(feature = "rc_as_ptr", since = "1.45.0")]
17051705
pub fn as_ptr(&self) -> *const T {
17061706
let ptr: *mut RcBox<T> = NonNull::as_ptr(self.ptr);
17071707

src/liballoc/sync.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,7 @@ impl<T: ?Sized> Arc<T> {
587587
/// assert_eq!(x_ptr, Arc::as_ptr(&y));
588588
/// assert_eq!(unsafe { &*x_ptr }, "hello");
589589
/// ```
590-
#[stable(feature = "weak_into_raw", since = "1.45.0")]
590+
#[stable(feature = "rc_as_ptr", since = "1.45.0")]
591591
pub fn as_ptr(this: &Self) -> *const T {
592592
let ptr: *mut ArcInner<T> = NonNull::as_ptr(this.ptr);
593593

src/libcore/ffi.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#![stable(feature = "", since = "1.30.0")]
22
#![allow(non_camel_case_types)]
33

4-
//! Utilities related to FFI bindings.
4+
//! Utilities related to foreign function interface (FFI) bindings.
55
66
use crate::fmt;
77
use crate::marker::PhantomData;

src/librustc_builtin_macros/format.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,8 @@ impl<'a, 'b> Context<'a, 'b> {
280280
("x", "LowerHex"),
281281
("X", "UpperHex"),
282282
] {
283+
// FIXME: rustfix (`run-rustfix`) fails to apply suggestions.
284+
// > "Cannot replace slice of data that was already replaced"
283285
err.tool_only_span_suggestion(
284286
sp,
285287
&format!("use the `{}` trait", name),

src/librustc_lexer/src/lib.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,18 @@
66
//! produces simple tokens which are a pair of type-tag and a bit of original text,
77
//! and does not report errors, instead storing them as flags on the token.
88
//!
9-
//! Tokens produced by this lexer are not yet ready for parsing the Rust syntax,
10-
//! for that see `librustc_parse::lexer`, which converts this basic token stream
9+
//! Tokens produced by this lexer are not yet ready for parsing the Rust syntax.
10+
//! For that see [`librustc_parse::lexer`], which converts this basic token stream
1111
//! into wide tokens used by actual parser.
1212
//!
1313
//! The purpose of this crate is to convert raw sources into a labeled sequence
1414
//! of well-known token types, so building an actual Rust token stream will
1515
//! be easier.
1616
//!
17-
//! Main entity of this crate is [`TokenKind`] enum which represents common
17+
//! The main entity of this crate is the [`TokenKind`] enum which represents common
1818
//! lexeme types.
19-
19+
//!
20+
//! [`librustc_parse::lexer`]: ../rustc_parse/lexer/index.html
2021
// We want to be able to build this crate with a stable compiler, so no
2122
// `#![feature]` attributes should be added.
2223

src/librustc_mir/transform/const_prop.rs

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1004,14 +1004,6 @@ impl<'mir, 'tcx> MutVisitor<'tcx> for ConstPropagator<'mir, 'tcx> {
10041004
let expected = ScalarMaybeUninit::from(Scalar::from_bool(*expected));
10051005
let value_const = self.ecx.read_scalar(value).unwrap();
10061006
if expected != value_const {
1007-
// Poison all places this operand references so that further code
1008-
// doesn't use the invalid value
1009-
match cond {
1010-
Operand::Move(ref place) | Operand::Copy(ref place) => {
1011-
Self::remove_const(&mut self.ecx, place.local);
1012-
}
1013-
Operand::Constant(_) => {}
1014-
}
10151007
let mut eval_to_int = |op| {
10161008
let op = self
10171009
.eval_operand(op, source_info)
@@ -1020,27 +1012,37 @@ impl<'mir, 'tcx> MutVisitor<'tcx> for ConstPropagator<'mir, 'tcx> {
10201012
};
10211013
let msg = match msg {
10221014
AssertKind::DivisionByZero(op) => {
1023-
AssertKind::DivisionByZero(eval_to_int(op))
1015+
Some(AssertKind::DivisionByZero(eval_to_int(op)))
10241016
}
10251017
AssertKind::RemainderByZero(op) => {
1026-
AssertKind::RemainderByZero(eval_to_int(op))
1018+
Some(AssertKind::RemainderByZero(eval_to_int(op)))
10271019
}
10281020
AssertKind::BoundsCheck { ref len, ref index } => {
10291021
let len = eval_to_int(len);
10301022
let index = eval_to_int(index);
1031-
AssertKind::BoundsCheck { len, index }
1023+
Some(AssertKind::BoundsCheck { len, index })
10321024
}
10331025
// Overflow is are already covered by checks on the binary operators.
1034-
AssertKind::Overflow(..) | AssertKind::OverflowNeg(_) => return,
1026+
AssertKind::Overflow(..) | AssertKind::OverflowNeg(_) => None,
10351027
// Need proper const propagator for these.
1036-
_ => return,
1028+
_ => None,
10371029
};
1038-
self.report_assert_as_lint(
1039-
lint::builtin::UNCONDITIONAL_PANIC,
1040-
source_info,
1041-
"this operation will panic at runtime",
1042-
msg,
1043-
);
1030+
// Poison all places this operand references so that further code
1031+
// doesn't use the invalid value
1032+
match cond {
1033+
Operand::Move(ref place) | Operand::Copy(ref place) => {
1034+
Self::remove_const(&mut self.ecx, place.local);
1035+
}
1036+
Operand::Constant(_) => {}
1037+
}
1038+
if let Some(msg) = msg {
1039+
self.report_assert_as_lint(
1040+
lint::builtin::UNCONDITIONAL_PANIC,
1041+
source_info,
1042+
"this operation will panic at runtime",
1043+
msg,
1044+
);
1045+
}
10441046
} else {
10451047
if self.should_const_prop(value) {
10461048
if let ScalarMaybeUninit::Scalar(scalar) = value_const {

src/librustc_mir_build/build/misc.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
1515
/// N.B., **No cleanup is scheduled for this temporary.** You should
1616
/// call `schedule_drop` once the temporary is initialized.
1717
crate fn temp(&mut self, ty: Ty<'tcx>, span: Span) -> Place<'tcx> {
18-
let temp = self.local_decls.push(LocalDecl::new(ty, span));
18+
// Mark this local as internal to avoid temporaries with types not present in the
19+
// user's code resulting in ICEs from the generator transform.
20+
let temp = self.local_decls.push(LocalDecl::new(ty, span).internal());
1921
let place = Place::from(temp);
2022
debug!("temp: created temp {:?} with type {:?}", place, self.local_decls[temp].ty);
2123
place

0 commit comments

Comments
 (0)