Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit f7801d6

Browse files
committed
Auto merge of rust-lang#78767 - m-ou-se:rollup-eu5wgxl, r=m-ou-se
Rollup of 15 pull requests Successful merges: - rust-lang#76718 (Move Vec UI tests to unit tests when possible) - rust-lang#78093 (Clean up docs for 'as' keyword) - rust-lang#78425 (Move f64::NAN ui tests into `library`) - rust-lang#78465 (Change as_str → to_string in proc_macro::Ident::span() docs) - rust-lang#78584 (Add keyboard handling to the theme picker menu) - rust-lang#78716 (Array trait impl comment/doc fixes) - rust-lang#78727 ((rustdoc) fix test for trait impl display) - rust-lang#78733 (fix a couple of clippy warnings:) - rust-lang#78735 (Simplify the implementation of `get_mut` (no unsafe)) - rust-lang#78738 (Move range in ui test to ops test in library/core) - rust-lang#78739 (Fix ICE on type error in async function) - rust-lang#78742 (make intern_const_alloc_recursive return error) - rust-lang#78756 (Update cargo) - rust-lang#78757 (Improve and clean up some intra-doc links) - rust-lang#78758 (Fixed typo in comment) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents 8c20701 + 8416e13 commit f7801d6

File tree

51 files changed

+503
-367
lines changed

Some content is hidden

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

51 files changed

+503
-367
lines changed

Cargo.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,9 @@ dependencies = [
9191

9292
[[package]]
9393
name = "anyhow"
94-
version = "1.0.32"
94+
version = "1.0.34"
9595
source = "registry+https://github.com/rust-lang/crates.io-index"
96-
checksum = "6b602bfe940d21c130f3895acd65221e8a61270debe89d628b9cb4e3ccb8569b"
96+
checksum = "bf8dcb5b4bbaa28653b647d8c77bd4ed40183b48882e130c1f1ffb73de069fd7"
9797

9898
[[package]]
9999
name = "arc-swap"

compiler/rustc_ast/src/attr/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ pub fn list_contains_name(items: &[NestedMetaItem], name: Symbol) -> bool {
360360
impl MetaItem {
361361
fn token_trees_and_spacings(&self) -> Vec<TreeAndSpacing> {
362362
let mut idents = vec![];
363-
let mut last_pos = BytePos(0 as u32);
363+
let mut last_pos = BytePos(0_u32);
364364
for (i, segment) in self.path.segments.iter().enumerate() {
365365
let is_first = i == 0;
366366
if !is_first {

compiler/rustc_infer/src/infer/error_reporting/need_type_info.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -739,7 +739,6 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
739739
"cannot infer {} {} {} `{}`{}",
740740
kind_str, preposition, descr, type_name, parent_desc
741741
)
742-
.into()
743742
}
744743
}
745744
}

compiler/rustc_interface/src/util.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -246,10 +246,10 @@ pub fn get_codegen_backend(sopts: &config::Options) -> Box<dyn CodegenBackend> {
246246

247247
INIT.call_once(|| {
248248
#[cfg(feature = "llvm")]
249-
const DEFAULT_CODEGEN_BACKEND: &'static str = "llvm";
249+
const DEFAULT_CODEGEN_BACKEND: &str = "llvm";
250250

251251
#[cfg(not(feature = "llvm"))]
252-
const DEFAULT_CODEGEN_BACKEND: &'static str = "cranelift";
252+
const DEFAULT_CODEGEN_BACKEND: &str = "cranelift";
253253

254254
let codegen_name = sopts
255255
.debugging_opts
@@ -414,11 +414,10 @@ pub fn get_codegen_sysroot(backend_name: &str) -> fn() -> Box<dyn CodegenBackend
414414
let libdir = filesearch::relative_target_lib_path(&sysroot, &target);
415415
sysroot.join(libdir).with_file_name("codegen-backends")
416416
})
417-
.filter(|f| {
417+
.find(|f| {
418418
info!("codegen backend candidate: {}", f.display());
419419
f.exists()
420-
})
421-
.next();
420+
});
422421
let sysroot = sysroot.unwrap_or_else(|| {
423422
let candidates = sysroot_candidates
424423
.iter()

compiler/rustc_middle/src/middle/stability.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ impl<'tcx> TyCtxt<'tcx> {
399399
def_id: DefId,
400400
id: Option<HirId>,
401401
span: Span,
402-
unmarked: impl FnOnce(Span, DefId) -> (),
402+
unmarked: impl FnOnce(Span, DefId),
403403
) {
404404
let soft_handler = |lint, span, msg: &_| {
405405
self.struct_span_lint_hir(lint, id.unwrap_or(hir::CRATE_HIR_ID), span, |lint| {

compiler/rustc_middle/src/mir/interpret/error.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,12 @@ impl From<ErrorHandled> for InterpErrorInfo<'_> {
8181
}
8282
}
8383

84+
impl From<ErrorReported> for InterpErrorInfo<'_> {
85+
fn from(err: ErrorReported) -> Self {
86+
InterpError::InvalidProgram(InvalidProgramInfo::AlreadyReported(err)).into()
87+
}
88+
}
89+
8490
impl<'tcx> From<InterpError<'tcx>> for InterpErrorInfo<'tcx> {
8591
fn from(kind: InterpError<'tcx>) -> Self {
8692
let capture_backtrace = tls::with_opt(|tcx| {
@@ -115,8 +121,8 @@ pub enum InvalidProgramInfo<'tcx> {
115121
/// Cannot compute this constant because it depends on another one
116122
/// which already produced an error.
117123
ReferencedConstant,
118-
/// Abort in case type errors are reached.
119-
TypeckError(ErrorReported),
124+
/// Abort in case errors are already reported.
125+
AlreadyReported(ErrorReported),
120126
/// An error occurred during layout computation.
121127
Layout(layout::LayoutError<'tcx>),
122128
/// An invalid transmute happened.
@@ -129,7 +135,7 @@ impl fmt::Display for InvalidProgramInfo<'_> {
129135
match self {
130136
TooGeneric => write!(f, "encountered overly generic constant"),
131137
ReferencedConstant => write!(f, "referenced constant has errors"),
132-
TypeckError(ErrorReported) => {
138+
AlreadyReported(ErrorReported) => {
133139
write!(f, "encountered constants with type errors, stopping evaluation")
134140
}
135141
Layout(ref err) => write!(f, "{}", err),

compiler/rustc_middle/src/mir/terminator.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ impl SwitchTargets {
4646
pub fn new(targets: impl Iterator<Item = (u128, BasicBlock)>, otherwise: BasicBlock) -> Self {
4747
let (values, mut targets): (SmallVec<_>, SmallVec<_>) = targets.unzip();
4848
targets.push(otherwise);
49-
Self { values: values.into(), targets }
49+
Self { values, targets }
5050
}
5151

5252
/// Builds a switch targets definition that jumps to `then` if the tested value equals `value`,

compiler/rustc_middle/src/ty/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1641,7 +1641,7 @@ pub type PlaceholderConst = Placeholder<BoundVar>;
16411641
#[derive(Hash, HashStable)]
16421642
pub struct WithOptConstParam<T> {
16431643
pub did: T,
1644-
/// The `DefId` of the corresponding generic paramter in case `did` is
1644+
/// The `DefId` of the corresponding generic parameter in case `did` is
16451645
/// a const argument.
16461646
///
16471647
/// Note that even if `did` is a const argument, this may still be `None`.

compiler/rustc_mir/src/borrow_check/diagnostics/conflict_errors.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
120120
let move_out = self.move_data.moves[(*move_site).moi];
121121
let moved_place = &self.move_data.move_paths[move_out.path].place;
122122
// `*(_1)` where `_1` is a `Box` is actually a move out.
123-
let is_box_move = moved_place.as_ref().projection == &[ProjectionElem::Deref]
123+
let is_box_move = moved_place.as_ref().projection == [ProjectionElem::Deref]
124124
&& self.body.local_decls[moved_place.local].ty.is_box();
125125

126126
!is_box_move

compiler/rustc_mir/src/const_eval/error.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ impl<'tcx> ConstEvalErr<'tcx> {
141141
err_inval!(Layout(LayoutError::Unknown(_))) | err_inval!(TooGeneric) => {
142142
return ErrorHandled::TooGeneric;
143143
}
144-
err_inval!(TypeckError(error_reported)) => {
144+
err_inval!(AlreadyReported(error_reported)) => {
145145
return ErrorHandled::Reported(error_reported);
146146
}
147147
// We must *always* hard error on these, even if the caller wants just a lint.

0 commit comments

Comments
 (0)