Skip to content

Commit 2270544

Browse files
committed
Auto merge of rust-lang#3153 - rust-lang:rustup-2023-11-02, r=RalfJung
Automatic Rustup
2 parents e16087f + 731ff65 commit 2270544

File tree

4 files changed

+12
-19
lines changed

4 files changed

+12
-19
lines changed

clippy_lints/src/suspicious_operation_groupings.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,7 @@ fn ident_difference_expr_with_base_location(
578578
| (Assign(_, _, _), Assign(_, _, _))
579579
| (TryBlock(_), TryBlock(_))
580580
| (Await(_, _), Await(_, _))
581-
| (Async(_, _), Async(_, _))
581+
| (Gen(_, _, _), Gen(_, _, _))
582582
| (Block(_, _), Block(_, _))
583583
| (Closure(_), Closure(_))
584584
| (Match(_, _), Match(_, _))

clippy_utils/src/ast_utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ pub fn eq_expr(l: &Expr, r: &Expr) -> bool {
211211
&& eq_fn_decl(lf, rf)
212212
&& eq_expr(le, re)
213213
},
214-
(Async(lc, lb), Async(rc, rb)) => lc == rc && eq_block(lb, rb),
214+
(Gen(lc, lb, lk), Gen(rc, rb, rk)) => lc == rc && eq_block(lb, rb) && lk == rk,
215215
(Range(lf, lt, ll), Range(rf, rt, rl)) => ll == rl && eq_expr_opt(lf, rf) && eq_expr_opt(lt, rt),
216216
(AddrOf(lbk, lm, le), AddrOf(rbk, rm, re)) => lbk == rbk && lm == rm && eq_expr(le, re),
217217
(Path(lq, lp), Path(rq, rp)) => both(lq, rq, eq_qself) && eq_path(lp, rp),

clippy_utils/src/qualify_min_const_fn.rs

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
use crate::msrvs::Msrv;
77
use hir::LangItem;
8-
use rustc_attr::{Since, CURRENT_RUSTC_VERSION};
8+
use rustc_attr::StableSince;
99
use rustc_const_eval::transform::check_consts::ConstCx;
1010
use rustc_hir as hir;
1111
use rustc_hir::def_id::DefId;
@@ -372,23 +372,16 @@ fn is_const_fn(tcx: TyCtxt<'_>, def_id: DefId, msrv: &Msrv) -> bool {
372372
// as a part of an unimplemented MSRV check https://github.com/rust-lang/rust/issues/65262.
373373

374374
let const_stab_rust_version = match since {
375-
Since::Version(version) => RustcVersion::new(
376-
u32::from(version.major),
377-
u32::from(version.minor),
378-
u32::from(version.patch),
379-
),
380-
Since::Current => {
381-
// HACK(nilstrieb): CURRENT_RUSTC_VERSION can return versions like 1.66.0-dev.
382-
// `rustc-semver` doesn't accept the `-dev` version number so we have to strip it off.
383-
let short_version = CURRENT_RUSTC_VERSION.split('-').next().unwrap();
384-
RustcVersion::parse(short_version).unwrap_or_else(|err| {
385-
panic!("`rustc_attr::StabilityLevel::Stable::since` is ill-formatted: `{CURRENT_RUSTC_VERSION}`, {err:?}")
386-
})
387-
},
388-
Since::Err => return false,
375+
StableSince::Version(version) => version,
376+
StableSince::Current => rustc_session::RustcVersion::CURRENT,
377+
StableSince::Err => return false,
389378
};
390379

391-
msrv.meets(const_stab_rust_version)
380+
msrv.meets(RustcVersion::new(
381+
u32::from(const_stab_rust_version.major),
382+
u32::from(const_stab_rust_version.minor),
383+
u32::from(const_stab_rust_version.patch),
384+
))
392385
} else {
393386
// Unstable const fn with the feature enabled.
394387
msrv.current().is_none()

clippy_utils/src/sugg.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ impl<'a> Sugg<'a> {
190190
(snip, false) => Sugg::MaybeParen(snip),
191191
(snip, true) => Sugg::NonParen(snip),
192192
},
193-
ast::ExprKind::Async(..)
193+
ast::ExprKind::Gen(..)
194194
| ast::ExprKind::Block(..)
195195
| ast::ExprKind::Break(..)
196196
| ast::ExprKind::Call(..)

0 commit comments

Comments
 (0)