Remove LocalKind::Var.
This commit is contained in:
parent
d31386a52b
commit
50d0959a2f
7 changed files with 17 additions and 18 deletions
|
@ -1985,16 +1985,18 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
|
|||
let (place_desc, note) = if let Some(place_desc) = opt_place_desc {
|
||||
let local_kind = if let Some(local) = borrow.borrowed_place.as_local() {
|
||||
match self.body.local_kind(local) {
|
||||
LocalKind::ReturnPointer | LocalKind::Temp => {
|
||||
bug!("temporary or return pointer with a name")
|
||||
LocalKind::Temp if self.body.local_decls[local].is_user_variable() => {
|
||||
"local variable "
|
||||
}
|
||||
LocalKind::Var => "local variable ",
|
||||
LocalKind::Arg
|
||||
if !self.upvars.is_empty() && local == ty::CAPTURE_STRUCT_LOCAL =>
|
||||
{
|
||||
"variable captured by `move` "
|
||||
}
|
||||
LocalKind::Arg => "function parameter ",
|
||||
LocalKind::ReturnPointer | LocalKind::Temp => {
|
||||
bug!("temporary or return pointer with a name")
|
||||
}
|
||||
}
|
||||
} else {
|
||||
"local data "
|
||||
|
@ -2008,16 +2010,16 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
|
|||
self.prefixes(borrow.borrowed_place.as_ref(), PrefixSet::All).last().unwrap();
|
||||
let local = root_place.local;
|
||||
match self.body.local_kind(local) {
|
||||
LocalKind::ReturnPointer | LocalKind::Temp => {
|
||||
("temporary value".to_string(), "temporary value created here".to_string())
|
||||
}
|
||||
LocalKind::Arg => (
|
||||
"function parameter".to_string(),
|
||||
"function parameter borrowed here".to_string(),
|
||||
),
|
||||
LocalKind::Var => {
|
||||
LocalKind::Temp if self.body.local_decls[local].is_user_variable() => {
|
||||
("local binding".to_string(), "local binding introduced here".to_string())
|
||||
}
|
||||
LocalKind::ReturnPointer | LocalKind::Temp => {
|
||||
("temporary value".to_string(), "temporary value created here".to_string())
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue