Skip to content

Commit 2cb5e3d

Browse files
committed
Manually inline trivial function
1 parent 07345f0 commit 2cb5e3d

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

src/librustc_mir/transform/qualify_consts.rs

+5-9
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ impl<'a, 'tcx> Qualifier<'a, 'tcx, 'tcx> {
243243
return;
244244
}
245245

246-
if self.const_let_allowed() {
246+
if self.tcx.features().const_let {
247247
let mut dest = dest;
248248
let index = loop {
249249
match dest {
@@ -320,10 +320,6 @@ impl<'a, 'tcx> Qualifier<'a, 'tcx, 'tcx> {
320320
}
321321
}
322322

323-
fn const_let_allowed(&self) -> bool {
324-
self.tcx.features().const_let
325-
}
326-
327323
/// Qualify a whole const, static initializer or const fn.
328324
fn qualify_const(&mut self) -> (Qualif, Lrc<BitSet<Local>>) {
329325
debug!("qualifying {} {:?}", self.mode, self.def_id);
@@ -361,7 +357,7 @@ impl<'a, 'tcx> Qualifier<'a, 'tcx, 'tcx> {
361357
TerminatorKind::FalseUnwind { .. } => None,
362358

363359
TerminatorKind::Return => {
364-
if !self.const_let_allowed() {
360+
if !self.tcx.features().const_let {
365361
// Check for unused values. This usually means
366362
// there are extra statements in the AST.
367363
for temp in mir.temps_iter() {
@@ -468,7 +464,7 @@ impl<'a, 'tcx> Visitor<'tcx> for Qualifier<'a, 'tcx, 'tcx> {
468464
LocalKind::ReturnPointer => {
469465
self.not_const();
470466
}
471-
LocalKind::Var if !self.const_let_allowed() => {
467+
LocalKind::Var if !self.tcx.features().const_let => {
472468
if self.mode != Mode::Fn {
473469
emit_feature_err(&self.tcx.sess.parse_sess, "const_let",
474470
self.span, GateIssue::Language,
@@ -561,7 +557,7 @@ impl<'a, 'tcx> Visitor<'tcx> for Qualifier<'a, 'tcx, 'tcx> {
561557
this.not_const()
562558
} else {
563559
// just make sure this doesn't get promoted
564-
this.qualif.add(Qualif::NOT_CONST);
560+
this.add(Qualif::NOT_CONST);
565561
}
566562
let base_ty = proj.base.ty(this.mir, this.tcx).to_ty(this.tcx);
567563
match this.mode {
@@ -1168,7 +1164,7 @@ impl<'a, 'tcx> Visitor<'tcx> for Qualifier<'a, 'tcx, 'tcx> {
11681164
if let (Mode::ConstFn, &Place::Local(index)) = (self.mode, dest) {
11691165
if self.mir.local_kind(index) == LocalKind::Var &&
11701166
self.const_fn_arg_vars.insert(index) &&
1171-
!self.const_let_allowed() {
1167+
!self.tcx.features().const_let {
11721168
// Direct use of an argument is permitted.
11731169
match *rvalue {
11741170
Rvalue::Use(Operand::Copy(Place::Local(local))) |

0 commit comments

Comments
 (0)