Rename ClearCrossCrate::assert_crate_local
.
As `unwrap_crate_local`, because it follows exactly the standard form of an `unwrap` function.
This commit is contained in:
parent
2f695dc64e
commit
5d2d11fd5d
12 changed files with 15 additions and 15 deletions
|
@ -79,7 +79,7 @@ impl<'tcx> ConstMutationChecker<'_, 'tcx> {
|
|||
let lint_root = self.body.source_scopes[source_info.scope]
|
||||
.local_data
|
||||
.as_ref()
|
||||
.assert_crate_local()
|
||||
.unwrap_crate_local()
|
||||
.lint_root;
|
||||
|
||||
Some((lint_root, source_info.span, self.tcx.def_span(const_item)))
|
||||
|
|
|
@ -945,7 +945,7 @@ fn compute_layout<'tcx>(
|
|||
let decl = &body.local_decls[local];
|
||||
debug!(?decl);
|
||||
|
||||
// Do not `assert_crate_local` here, as post-borrowck cleanup may have already cleared
|
||||
// Do not `unwrap_crate_local` here, as post-borrowck cleanup may have already cleared
|
||||
// the information. This is alright, since `ignore_for_traits` is only relevant when
|
||||
// this code runs on pre-cleanup MIR, and `ignore_for_traits = false` is the safer
|
||||
// default.
|
||||
|
|
|
@ -85,7 +85,7 @@ fn has_ffi_unwind_calls(tcx: TyCtxt<'_>, local_def_id: LocalDefId) -> bool {
|
|||
let lint_root = body.source_scopes[terminator.source_info.scope]
|
||||
.local_data
|
||||
.as_ref()
|
||||
.assert_crate_local()
|
||||
.unwrap_crate_local()
|
||||
.lint_root;
|
||||
let span = terminator.source_info.span;
|
||||
|
||||
|
|
|
@ -154,7 +154,7 @@ impl<'tcx> FunctionItemRefChecker<'_, 'tcx> {
|
|||
let lint_root = self.body.source_scopes[source_info.scope]
|
||||
.local_data
|
||||
.as_ref()
|
||||
.assert_crate_local()
|
||||
.unwrap_crate_local()
|
||||
.lint_root;
|
||||
// FIXME: use existing printing routines to print the function signature
|
||||
let fn_sig = self.tcx.fn_sig(fn_id).instantiate(self.tcx, fn_args);
|
||||
|
|
|
@ -158,7 +158,7 @@ impl<'tcx> MirPatch<'tcx> {
|
|||
let index = self.next_local;
|
||||
self.next_local += 1;
|
||||
let mut new_decl = LocalDecl::new(ty, span);
|
||||
**new_decl.local_info.as_mut().assert_crate_local() = local_info;
|
||||
**new_decl.local_info.as_mut().unwrap_crate_local() = local_info;
|
||||
self.new_locals.push(new_decl);
|
||||
Local::new(index)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue