Skip to content

Commit fc90501

Browse files
committed
Auto merge of rust-lang#135746 - GuillaumeGomez:rollup-qprypfy, r=GuillaumeGomez
Rollup of 8 pull requests Successful merges: - rust-lang#135310 (Always force non-trimming of path in `unreachable_patterns` lint) - rust-lang#135446 (further improve panic_immediate_abort by removing rtprintpanic! messages) - rust-lang#135491 (Remove dead rustc_allowed_through_unstable_modules for std::os::fd contents) - rust-lang#135542 (Add the concrete syntax for precise capturing to 1.82 release notes.) - rust-lang#135700 (Emit single privacy error for struct literal with multiple private fields and add test for `default_field_values` privacy) - rust-lang#135729 (Add debug assertions to compiler profile) - rust-lang#135736 (rustdoc: Fix flaky doctest test) - rust-lang#135738 (Replace usages of `map_or(bool, ...)` with `is_{some_and|none_or|ok_and}`) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 9a1d156 + 5aaf9ce commit fc90501

File tree

65 files changed

+348
-161
lines changed

Some content is hidden

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

65 files changed

+348
-161
lines changed

RELEASES.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ Language
359359
- [`addr_of(_mut)!` macros and the newly stabilized `&raw (const|mut)` are now safe to use with all static items](https://github.com/rust-lang/rust/pull/125834)
360360
- [size_of_val_raw: for length 0 this is safe to call](https://github.com/rust-lang/rust/pull/126152/)
361361
- [Reorder trait bound modifiers *after* `for<...>` binder in trait bounds](https://github.com/rust-lang/rust/pull/127054/)
362-
- [Stabilize opaque type precise capturing (RFC 3617)](https://github.com/rust-lang/rust/pull/127672)
362+
- [Stabilize `+ use<'lt>` opaque type precise capturing (RFC 3617)](https://github.com/rust-lang/rust/pull/127672)
363363
- [Stabilize `&raw const` and `&raw mut` operators (RFC 2582)](https://github.com/rust-lang/rust/pull/127679)
364364
- [Stabilize unsafe extern blocks (RFC 3484)](https://github.com/rust-lang/rust/pull/127921)
365365
- [Stabilize nested field access in `offset_of!`](https://github.com/rust-lang/rust/pull/128284)

compiler/rustc_ast_lowering/src/delegation.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
7272
if let Some(local_sig_id) = def_id.as_local() {
7373
// The value may be missing due to recursive delegation.
7474
// Error will be emitted later during HIR ty lowering.
75-
self.resolver.delegation_fn_sigs.get(&local_sig_id).map_or(false, |sig| sig.has_self)
75+
self.resolver.delegation_fn_sigs.get(&local_sig_id).is_some_and(|sig| sig.has_self)
7676
} else {
7777
match self.tcx.def_kind(def_id) {
7878
DefKind::Fn => false,

compiler/rustc_ast_passes/src/feature_gate.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ impl<'a> PostExpansionVisitor<'a> {
8383
feature_err_issue(&self.sess, feature, span, GateIssue::Language, explain).emit();
8484
}
8585
Err(abi::AbiDisabled::Unrecognized) => {
86-
if self.sess.opts.pretty.map_or(true, |ppm| ppm.needs_hir()) {
86+
if self.sess.opts.pretty.is_none_or(|ppm| ppm.needs_hir()) {
8787
self.sess.dcx().span_delayed_bug(
8888
span,
8989
format!(

compiler/rustc_attr_parsing/src/attributes/repr.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ pub fn parse_repr_attr(sess: &Session, attr: &impl AttributeExt) -> Vec<ReprAttr
166166
// the `check_mod_attrs` pass, but this pass doesn't always run
167167
// (e.g. if we only pretty-print the source), so we have to gate
168168
// the `span_delayed_bug` call as follows:
169-
if sess.opts.pretty.map_or(true, |pp| pp.needs_analysis()) {
169+
if sess.opts.pretty.is_none_or(|pp| pp.needs_analysis()) {
170170
dcx.span_delayed_bug(item.span(), "unrecognized representation hint");
171171
}
172172
}

compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2480,7 +2480,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
24802480
// To support cases like `|| { v.call(|this| v.get()) }`
24812481
// FIXME: actually support such cases (need to figure out how to move from the
24822482
// capture place to original local).
2483-
&& self.res.as_ref().map_or(true, |(prev_res, _)| prev_res.span.contains(ex.span))
2483+
&& self.res.as_ref().is_none_or(|(prev_res, _)| prev_res.span.contains(ex.span))
24842484
{
24852485
self.res = Some((ex, closure));
24862486
}

compiler/rustc_borrowck/src/diagnostics/explain_borrow.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,10 @@ impl<'tcx> BorrowExplanation<'tcx> {
131131
&& let Ok(pat) = tcx.sess.source_map().span_to_snippet(pat.span)
132132
{
133133
suggest_rewrite_if_let(tcx, expr, &pat, init, conseq, alt, err);
134-
} else if path_span.map_or(true, |path_span| path_span == var_or_use_span) {
134+
} else if path_span.is_none_or(|path_span| path_span == var_or_use_span) {
135135
// We can use `var_or_use_span` if either `path_span` is not present, or both
136136
// spans are the same.
137-
if borrow_span.map_or(true, |sp| !sp.overlaps(var_or_use_span)) {
137+
if borrow_span.is_none_or(|sp| !sp.overlaps(var_or_use_span)) {
138138
err.span_label(
139139
var_or_use_span,
140140
format!("{borrow_desc}borrow later {message}"),

compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ pub(crate) fn type_di_node<'ll, 'tcx>(cx: &CodegenCx<'ll, 'tcx>, t: Ty<'tcx>) ->
442442
// (or if there is no allocator argument).
443443
ty::Adt(def, args)
444444
if def.is_box()
445-
&& args.get(1).map_or(true, |arg| cx.layout_of(arg.expect_ty()).is_1zst()) =>
445+
&& args.get(1).is_none_or(|arg| cx.layout_of(arg.expect_ty()).is_1zst()) =>
446446
{
447447
build_pointer_or_reference_di_node(cx, t, t.expect_boxed_ty(), unique_type_id)
448448
}

compiler/rustc_errors/src/emitter.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3146,7 +3146,7 @@ impl FileWithAnnotatedLines {
31463146
add_annotation_to_file(&mut output, Lrc::clone(&file), line, ann.as_line());
31473147
}
31483148
let line_end = ann.line_end - 1;
3149-
let end_is_empty = file.get_line(line_end - 1).map_or(false, |s| !filter(&s));
3149+
let end_is_empty = file.get_line(line_end - 1).is_some_and(|s| !filter(&s));
31503150
if middle < line_end && !end_is_empty {
31513151
add_annotation_to_file(&mut output, Lrc::clone(&file), line_end, ann.as_line());
31523152
}

compiler/rustc_errors/src/json.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,8 @@ impl DiagnosticSpan {
463463
// is an empty string, increase the length to include the newline so we don't
464464
// leave an empty line
465465
if start.col.0 == 0
466-
&& suggestion.map_or(false, |(s, _)| s.is_empty())
466+
&& let Some((suggestion, _)) = suggestion
467+
&& suggestion.is_empty()
467468
&& let Ok(after) = je.sm.span_to_next_source(span)
468469
&& after.starts_with('\n')
469470
{

compiler/rustc_errors/src/lib.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ use std::backtrace::{Backtrace, BacktraceStatus};
3535
use std::borrow::Cow;
3636
use std::cell::Cell;
3737
use std::error::Report;
38+
use std::ffi::OsStr;
3839
use std::hash::Hash;
3940
use std::io::Write;
4041
use std::num::NonZero;
@@ -1717,7 +1718,7 @@ impl DiagCtxtInner {
17171718
let bugs: Vec<_> =
17181719
std::mem::take(&mut self.delayed_bugs).into_iter().map(|(b, _)| b).collect();
17191720

1720-
let backtrace = std::env::var_os("RUST_BACKTRACE").map_or(true, |x| &x != "0");
1721+
let backtrace = std::env::var_os("RUST_BACKTRACE").as_deref() != Some(OsStr::new("0"));
17211722
let decorate = backtrace || self.ice_file.is_none();
17221723
let mut out = self
17231724
.ice_file

compiler/rustc_expand/src/config.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ impl<'a> StripUnconfigured<'a> {
391391
validate_attr::deny_builtin_meta_unsafety(&self.sess.psess, &meta_item);
392392

393393
(
394-
parse_cfg(&meta_item, self.sess).map_or(true, |meta_item| {
394+
parse_cfg(&meta_item, self.sess).is_none_or(|meta_item| {
395395
attr::cfg_matches(meta_item, &self.sess, self.lint_node_id, self.features)
396396
}),
397397
Some(meta_item),

compiler/rustc_expand/src/mbe/diagnostics.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ impl<'dcx, 'matcher> Tracker<'matcher> for CollectTrackerAndEmitter<'dcx, 'match
159159
if self
160160
.best_failure
161161
.as_ref()
162-
.map_or(true, |failure| failure.is_better_position(*approx_position))
162+
.is_none_or(|failure| failure.is_better_position(*approx_position))
163163
{
164164
self.best_failure = Some(BestFailure {
165165
token: token.clone(),

compiler/rustc_hir/src/def.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -794,7 +794,7 @@ impl<Id> Res<Id> {
794794

795795
/// Always returns `true` if `self` is `Res::Err`
796796
pub fn matches_ns(&self, ns: Namespace) -> bool {
797-
self.ns().map_or(true, |actual_ns| actual_ns == ns)
797+
self.ns().is_none_or(|actual_ns| actual_ns == ns)
798798
}
799799

800800
/// Returns whether such a resolved path can occur in a tuple struct/variant pattern

compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1210,7 +1210,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
12101210
// - foo((), "current", 42u32, "next")
12111211
// + foo((), 42u32)
12121212
{
1213-
prev_extra_idx.map_or(true, |prev_extra_idx| {
1213+
prev_extra_idx.is_none_or(|prev_extra_idx| {
12141214
prev_extra_idx + 1 == arg_idx.index()
12151215
})
12161216
}

compiler/rustc_hir_typeck/src/fn_ctxt/suggestions.rs

+3-6
Original file line numberDiff line numberDiff line change
@@ -1143,7 +1143,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
11431143
self.may_coerce(found, ty)
11441144
}
11451145
hir::FnRetTy::DefaultReturn(_) if in_closure => {
1146-
self.ret_coercion.as_ref().map_or(false, |ret| {
1146+
self.ret_coercion.as_ref().is_some_and(|ret| {
11471147
let ret_ty = ret.borrow().expected_ty();
11481148
self.may_coerce(found, ret_ty)
11491149
})
@@ -1784,14 +1784,11 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
17841784
let results = self.typeck_results.borrow();
17851785
// First, look for a `Clone::clone` call
17861786
if segment.ident.name == sym::clone
1787-
&& results.type_dependent_def_id(expr.hir_id).map_or(
1788-
false,
1789-
|did| {
1787+
&& results.type_dependent_def_id(expr.hir_id).is_some_and(|did| {
17901788
let assoc_item = self.tcx.associated_item(did);
17911789
assoc_item.container == ty::AssocItemContainer::Trait
17921790
&& assoc_item.container_id(self.tcx) == clone_trait_did
1793-
},
1794-
)
1791+
})
17951792
// If that clone call hasn't already dereferenced the self type (i.e. don't give this
17961793
// diagnostic in cases where we have `(&&T).clone()` and we expect `T`).
17971794
&& !results.expr_adjustments(callee_expr).iter().any(|adj| matches!(adj.kind, ty::adjustment::Adjust::Deref(..)))

compiler/rustc_hir_typeck/src/method/suggest.rs

+13-12
Original file line numberDiff line numberDiff line change
@@ -3761,18 +3761,19 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
37613761
hir::TraitFn::Required([ident, ..]) => {
37623762
ident.name == kw::SelfLower
37633763
}
3764-
hir::TraitFn::Provided(body_id) => {
3765-
self.tcx.hir().body(*body_id).params.first().map_or(
3766-
false,
3767-
|param| {
3768-
matches!(
3769-
param.pat.kind,
3770-
hir::PatKind::Binding(_, _, ident, _)
3771-
if ident.name == kw::SelfLower
3772-
)
3773-
},
3774-
)
3775-
}
3764+
hir::TraitFn::Provided(body_id) => self
3765+
.tcx
3766+
.hir()
3767+
.body(*body_id)
3768+
.params
3769+
.first()
3770+
.is_some_and(|param| {
3771+
matches!(
3772+
param.pat.kind,
3773+
hir::PatKind::Binding(_, _, ident, _)
3774+
if ident.name == kw::SelfLower
3775+
)
3776+
}),
37763777
_ => false,
37773778
};
37783779

compiler/rustc_index/src/interval.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ impl<I: Idx> IntervalSet<I> {
258258
}
259259
current = Some(*end);
260260
}
261-
current.map_or(true, |x| x < self.domain as u32)
261+
current.is_none_or(|x| x < self.domain as u32)
262262
}
263263
}
264264

compiler/rustc_lint/src/expect.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ fn check_expectations(tcx: TyCtxt<'_>, tool_filter: Option<Symbol>) {
5757
let expect_id = canonicalize_id(expect_id);
5858

5959
if !fulfilled_expectations.contains(&expect_id)
60-
&& tool_filter.map_or(true, |filter| expectation.lint_tool == Some(filter))
60+
&& tool_filter.is_none_or(|filter| expectation.lint_tool == Some(filter))
6161
{
6262
let rationale = expectation.reason.map(|rationale| ExpectationNote { rationale });
6363
let note = expectation.is_unfulfilled_lint_expectations;

compiler/rustc_metadata/src/creader.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,8 @@ impl<'a, 'tcx> CrateLoader<'a, 'tcx> {
417417
// Any descendants of `std` should be private. These crates are usually not marked
418418
// private in metadata, so we ignore that field.
419419
if extern_private.is_none()
420-
&& dep_root.map_or(false, |d| STDLIB_STABLE_CRATES.contains(&d.name))
420+
&& let Some(dep) = dep_root
421+
&& STDLIB_STABLE_CRATES.contains(&dep.name)
421422
{
422423
return true;
423424
}

compiler/rustc_middle/src/mir/interpret/allocation/provenance_map.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ impl<Prov: Provenance> ProvenanceMap<Prov> {
9797
debug_assert!(prov.len() <= 1);
9898
if let Some(entry) = prov.first() {
9999
// If it overlaps with this byte, it is on this byte.
100-
debug_assert!(self.bytes.as_ref().map_or(true, |b| b.get(&offset).is_none()));
100+
debug_assert!(self.bytes.as_ref().is_none_or(|b| !b.contains_key(&offset)));
101101
Some(entry.1)
102102
} else {
103103
// Look up per-byte provenance.
@@ -301,7 +301,7 @@ impl<Prov: Provenance> ProvenanceMap<Prov> {
301301
// For really small copies, make sure we don't start before `src` does.
302302
let entry_start = cmp::max(entry.0, src.start);
303303
for offset in entry_start..src.end() {
304-
if bytes.last().map_or(true, |bytes_entry| bytes_entry.0 < offset) {
304+
if bytes.last().is_none_or(|bytes_entry| bytes_entry.0 < offset) {
305305
// The last entry, if it exists, has a lower offset than us.
306306
bytes.push((offset, entry.1));
307307
} else {

compiler/rustc_middle/src/ty/closure.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ pub fn analyze_coroutine_closure_captures<'a, 'tcx: 'a, T>(
433433
// A parent matches a child if they share the same prefix of projections.
434434
// The child may have more, if it is capturing sub-fields out of
435435
// something that is captured by-move in the parent closure.
436-
while child_captures.peek().map_or(false, |(_, child_capture)| {
436+
while child_captures.peek().is_some_and(|(_, child_capture)| {
437437
child_prefix_matches_parent_projections(parent_capture, child_capture)
438438
}) {
439439
let (child_field_idx, child_capture) = child_captures.next().unwrap();

compiler/rustc_middle/src/ty/diagnostics.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ pub fn suggest_constraining_type_params<'a>(
336336
.collect();
337337

338338
constraints
339-
.retain(|(_, def_id, _)| def_id.map_or(true, |def| !bound_trait_defs.contains(&def)));
339+
.retain(|(_, def_id, _)| def_id.is_none_or(|def| !bound_trait_defs.contains(&def)));
340340

341341
if constraints.is_empty() {
342342
continue;

compiler/rustc_middle/src/ty/instance.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ impl<'tcx> InstanceKind<'tcx> {
328328
// We include enums without destructors to allow, say, optimizing
329329
// drops of `Option::None` before LTO. We also respect the intent of
330330
// `#[inline]` on `Drop::drop` implementations.
331-
return ty.ty_adt_def().map_or(true, |adt_def| {
331+
return ty.ty_adt_def().is_none_or(|adt_def| {
332332
match *self {
333333
ty::InstanceKind::DropGlue(..) => adt_def.destructor(tcx).map(|dtor| dtor.did),
334334
ty::InstanceKind::AsyncDropGlueCtorShim(..) => {

compiler/rustc_middle/src/ty/sty.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1894,11 +1894,11 @@ impl<'tcx> Ty<'tcx> {
18941894

18951895
ty::Str | ty::Slice(_) | ty::Dynamic(_, _, ty::Dyn) | ty::Foreign(..) => false,
18961896

1897-
ty::Tuple(tys) => tys.last().map_or(true, |ty| ty.is_trivially_sized(tcx)),
1897+
ty::Tuple(tys) => tys.last().is_none_or(|ty| ty.is_trivially_sized(tcx)),
18981898

18991899
ty::Adt(def, args) => def
19001900
.sized_constraint(tcx)
1901-
.map_or(true, |ty| ty.instantiate(tcx, args).is_trivially_sized(tcx)),
1901+
.is_none_or(|ty| ty.instantiate(tcx, args).is_trivially_sized(tcx)),
19021902

19031903
ty::Alias(..) | ty::Param(_) | ty::Placeholder(..) | ty::Bound(..) => false,
19041904

compiler/rustc_middle/src/values.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ fn find_item_ty_spans(
360360
if let Res::Def(kind, def_id) = path.res
361361
&& matches!(kind, DefKind::Enum | DefKind::Struct | DefKind::Union)
362362
{
363-
let check_params = def_id.as_local().map_or(true, |def_id| {
363+
let check_params = def_id.as_local().is_none_or(|def_id| {
364364
if def_id == needle {
365365
spans.push(ty.span);
366366
}

compiler/rustc_mir_build/src/check_unsafety.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ impl<'a, 'tcx> Visitor<'a, 'tcx> for LayoutConstrainedPlaceVisitor<'a, 'tcx> {
266266
// place, i.e. the expression is a place expression and not a dereference
267267
// (since dereferencing something leads us to a different place).
268268
ExprKind::Deref { .. } => {}
269-
ref kind if ExprCategory::of(kind).map_or(true, |cat| cat == ExprCategory::Place) => {
269+
ref kind if ExprCategory::of(kind).is_none_or(|cat| cat == ExprCategory::Place) => {
270270
visit::walk_expr(self, expr);
271271
}
272272

compiler/rustc_mir_build/src/thir/pattern/check_match.rs

+1-8
Original file line numberDiff line numberDiff line change
@@ -1086,14 +1086,7 @@ fn find_fallback_pattern_typo<'tcx>(
10861086
let vis = cx.tcx.visibility(item.owner_id);
10871087
if vis.is_accessible_from(parent, cx.tcx) {
10881088
accessible.push(item_name);
1089-
let path = if item_name == name {
1090-
// We know that the const wasn't in scope because it has the exact
1091-
// same name, so we suggest the full path.
1092-
with_no_trimmed_paths!(cx.tcx.def_path_str(item.owner_id))
1093-
} else {
1094-
// The const is likely just typoed, and nothing else.
1095-
cx.tcx.def_path_str(item.owner_id)
1096-
};
1089+
let path = with_no_trimmed_paths!(cx.tcx.def_path_str(item.owner_id));
10971090
accessible_path.push(path);
10981091
} else if name == item_name {
10991092
// The const exists somewhere in this crate, but it can't be imported

compiler/rustc_mir_dataflow/src/framework/graphviz.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,7 @@ where
608608
let before = diffs_before.as_mut().map(next_in_dataflow_order);
609609

610610
assert!(diffs_after.is_empty());
611-
assert!(diffs_before.as_ref().map_or(true, ExactSizeIterator::is_empty));
611+
assert!(diffs_before.as_ref().is_none_or(ExactSizeIterator::is_empty));
612612

613613
let terminator = self.cursor.body()[block].terminator();
614614
let mut terminator_str = String::new();

compiler/rustc_mir_transform/src/coverage/graph.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ impl CoverageGraph {
135135
bb_to_bcb[bb] = Some(bcb);
136136
}
137137

138-
let is_out_summable = basic_blocks.last().map_or(false, |&bb| {
138+
let is_out_summable = basic_blocks.last().is_some_and(|&bb| {
139139
bcb_filtered_successors(mir_body[bb].terminator()).is_out_summable()
140140
});
141141
let bcb_data = BasicCoverageBlockData { basic_blocks, is_out_summable };

compiler/rustc_next_trait_solver/src/canonicalizer.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ impl<'a, D: SolverDelegate<Interner = I>, I: Interner> Canonicalizer<'a, D, I> {
273273
//
274274
// For this we set `next_orig_uv` to the next smallest, not yet compressed,
275275
// universe of the input.
276-
if next_orig_uv.map_or(true, |curr_next_uv| uv.cannot_name(curr_next_uv)) {
276+
if next_orig_uv.is_none_or(|curr_next_uv| uv.cannot_name(curr_next_uv)) {
277277
next_orig_uv = Some(uv);
278278
}
279279
}

compiler/rustc_parse/src/parser/expr.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2095,7 +2095,7 @@ impl<'a> Parser<'a> {
20952095
// point literal here, since there's no use of the exponent
20962096
// syntax that also constitutes a valid integer, so we need
20972097
// not check for that.
2098-
if suffix.map_or(true, |s| s == sym::f32 || s == sym::f64)
2098+
if suffix.is_none_or(|s| s == sym::f32 || s == sym::f64)
20992099
&& symbol.as_str().chars().all(|c| c.is_numeric() || c == '_')
21002100
&& self.token.span.hi() == next_token.span.lo()
21012101
{

0 commit comments

Comments
 (0)