Skip to content

Commit 3afb2bb

Browse files
committed
Auto merge of rust-lang#130253 - workingjubilee:rollup-npqpnaf, r=workingjubilee
Rollup of 10 pull requests Successful merges: - rust-lang#129103 (Don't warn empty branches unreachable for now) - rust-lang#129696 (update stdarch) - rust-lang#129835 (enable const-float-classify test, and test_next_up/down on 32bit x86) - rust-lang#130077 (Fix linking error when compiling for 32-bit watchOS) - rust-lang#130114 (Remove needless returns detected by clippy in the compiler) - rust-lang#130168 (maint: update docs for change_time ext and doc links) - rust-lang#130228 (notify Miri when intrinsics are changed) - rust-lang#130239 (miri: fix overflow detection for unsigned pointer offset) - rust-lang#130244 (Use the same span for attributes and Try expansion of ?) - rust-lang#130248 (Limit `libc::link` usage to `nto70` target only, not NTO OS) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 8d6b88b + b4201d3 commit 3afb2bb

File tree

83 files changed

+504
-861
lines changed

Some content is hidden

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

83 files changed

+504
-861
lines changed

compiler/rustc_ast/src/ast_traits.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ impl HasTokens for StmtKind {
153153
StmtKind::Let(local) => local.tokens.as_ref(),
154154
StmtKind::Item(item) => item.tokens(),
155155
StmtKind::Expr(expr) | StmtKind::Semi(expr) => expr.tokens(),
156-
StmtKind::Empty => return None,
156+
StmtKind::Empty => None,
157157
StmtKind::MacCall(mac) => mac.tokens.as_ref(),
158158
}
159159
}
@@ -162,7 +162,7 @@ impl HasTokens for StmtKind {
162162
StmtKind::Let(local) => Some(&mut local.tokens),
163163
StmtKind::Item(item) => item.tokens_mut(),
164164
StmtKind::Expr(expr) | StmtKind::Semi(expr) => expr.tokens_mut(),
165-
StmtKind::Empty => return None,
165+
StmtKind::Empty => None,
166166
StmtKind::MacCall(mac) => Some(&mut mac.tokens),
167167
}
168168
}

compiler/rustc_ast_lowering/src/expr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1837,7 +1837,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
18371837
Safety::Default,
18381838
sym::allow,
18391839
sym::unreachable_code,
1840-
self.lower_span(span),
1840+
try_span,
18411841
);
18421842
let attrs: AttrVec = thin_vec![attr];
18431843

compiler/rustc_attr/src/builtin.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1240,5 +1240,5 @@ pub fn parse_confusables(attr: &Attribute) -> Option<Vec<Symbol>> {
12401240
candidates.push(meta_lit.symbol);
12411241
}
12421242

1243-
return Some(candidates);
1243+
Some(candidates)
12441244
}

compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3669,7 +3669,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
36693669
reinits.push(location);
36703670
return true;
36713671
}
3672-
return false;
3672+
false
36733673
};
36743674

36753675
while let Some(location) = stack.pop() {

compiler/rustc_borrowck/src/type_check/relate_tys.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ impl<'me, 'bccx, 'tcx> NllTypeRelating<'me, 'bccx, 'tcx> {
214214
let delegate = FnMutDelegate {
215215
regions: &mut |br: ty::BoundRegion| {
216216
if let Some(ex_reg_var) = reg_map.get(&br) {
217-
return *ex_reg_var;
217+
*ex_reg_var
218218
} else {
219219
let ex_reg_var = self.next_existential_region_var(true, br.kind.get_name());
220220
debug!(?ex_reg_var);

compiler/rustc_codegen_llvm/src/llvm_util.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ pub(crate) fn check_tied_features(
290290
}
291291
}
292292
}
293-
return None;
293+
None
294294
}
295295

296296
/// Used to generate cfg variables and apply features

compiler/rustc_codegen_ssa/src/back/link.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ fn link_rlib<'a>(
438438
ab.add_file(&lib)
439439
}
440440

441-
return Ok(ab);
441+
Ok(ab)
442442
}
443443

444444
/// Extract all symbols defined in raw-dylib libraries, collated by library name.
@@ -1319,15 +1319,15 @@ fn link_sanitizer_runtime(
13191319
fn find_sanitizer_runtime(sess: &Session, filename: &str) -> PathBuf {
13201320
let path = sess.target_tlib_path.dir.join(filename);
13211321
if path.exists() {
1322-
return sess.target_tlib_path.dir.clone();
1322+
sess.target_tlib_path.dir.clone()
13231323
} else {
13241324
let default_sysroot =
13251325
filesearch::get_or_default_sysroot().expect("Failed finding sysroot");
13261326
let default_tlib = filesearch::make_target_lib_path(
13271327
&default_sysroot,
13281328
sess.opts.target_triple.triple(),
13291329
);
1330-
return default_tlib;
1330+
default_tlib
13311331
}
13321332
}
13331333

compiler/rustc_codegen_ssa/src/back/linker.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1484,7 +1484,6 @@ impl<'a> Linker for L4Bender<'a> {
14841484
fn export_symbols(&mut self, _: &Path, _: CrateType, _: &[String]) {
14851485
// ToDo, not implemented, copy from GCC
14861486
self.sess.dcx().emit_warn(errors::L4BenderExportingSymbolsUnimplemented);
1487-
return;
14881487
}
14891488

14901489
fn subsystem(&mut self, subsystem: &str) {

compiler/rustc_codegen_ssa/src/back/metadata.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,10 +171,10 @@ pub(super) fn get_metadata_xcoff<'a>(path: &Path, data: &'a [u8]) -> Result<&'a
171171
"Metadata at offset {offset} with size {len} is beyond .info section"
172172
));
173173
}
174-
return Ok(&info_data[offset..(offset + len)]);
174+
Ok(&info_data[offset..(offset + len)])
175175
} else {
176-
return Err(format!("Unable to find symbol {AIX_METADATA_SYMBOL_NAME}"));
177-
};
176+
Err(format!("Unable to find symbol {AIX_METADATA_SYMBOL_NAME}"))
177+
}
178178
}
179179

180180
pub(crate) fn create_object_file(sess: &Session) -> Option<write::Object<'static>> {
@@ -413,7 +413,7 @@ fn macho_object_build_version_for_target(target: &Target) -> object::write::Mach
413413

414414
/// Is Apple's CPU subtype `arm64e`s
415415
fn macho_is_arm64e(target: &Target) -> bool {
416-
return target.llvm_target.starts_with("arm64e");
416+
target.llvm_target.starts_with("arm64e")
417417
}
418418

419419
pub enum MetadataPosition {

compiler/rustc_const_eval/src/interpret/call.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,13 +235,13 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
235235
if self.layout_compat(caller_abi.layout, callee_abi.layout)? {
236236
// Ensure that our checks imply actual ABI compatibility for this concrete call.
237237
assert!(caller_abi.eq_abi(callee_abi));
238-
return Ok(true);
238+
Ok(true)
239239
} else {
240240
trace!(
241241
"check_argument_compat: incompatible ABIs:\ncaller: {:?}\ncallee: {:?}",
242242
caller_abi, callee_abi
243243
);
244-
return Ok(false);
244+
Ok(false)
245245
}
246246
}
247247

0 commit comments

Comments
 (0)