#![allow(rustc::potential_query_instability)]
#![feature(box_patterns)]
-#![feature(crate_visibility_modifier)]
#![feature(let_chains)]
#![feature(let_else)]
#![feature(min_specialization)]
by_ref: bool,
}
-const DEREF_PROJECTION: &[PlaceElem<'_>; 1] = &[ProjectionElem::Deref];
+/// Associate some local constants with the `'tcx` lifetime
+struct TyCtxtConsts<'tcx>(TyCtxt<'tcx>);
+impl<'tcx> TyCtxtConsts<'tcx> {
+ const DEREF_PROJECTION: &'tcx [PlaceElem<'tcx>; 1] = &[ProjectionElem::Deref];
+}
pub fn provide(providers: &mut Providers) {
*providers = Providers {
.span_suggestion_short(
mut_span,
"remove this `mut`",
- String::new(),
+ "",
Applicability::MachineApplicable,
)
.emit();
TerminatorKind::Call {
ref func,
ref args,
- ref destination,
+ destination,
+ target: _,
cleanup: _,
from_hir_call: _,
fn_span: _,
for arg in args {
self.consume_operand(loc, (arg, span), flow_state);
}
- if let Some((dest, _ /*bb*/)) = *destination {
- self.mutate_place(loc, (dest, span), Deep, flow_state);
- }
+ self.mutate_place(loc, (destination, span), Deep, flow_state);
}
TerminatorKind::Assert { ref cond, expected: _, ref msg, target: _, cleanup: _ } => {
self.consume_operand(loc, (cond, span), flow_state);
// Thread-locals might be dropped after the function exits
// We have to dereference the outer reference because
// borrows don't conflict behind shared references.
- root_place.projection = DEREF_PROJECTION;
+ root_place.projection = TyCtxtConsts::DEREF_PROJECTION;
(true, true)
} else {
(false, self.locals_are_invalidated_at_exit)