diff options
| author | bors <bors@rust-lang.org> | 2019-08-13 06:25:52 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2019-08-13 06:25:52 +0000 |
| commit | eae3437dfe991621e8afdc82734f4a172d7ddf9b (patch) | |
| tree | 8936a353a9fe2195322baf40de256354626bbbcc /src/librustc_mir/borrow_check | |
| parent | 3f55461efb25b3c8b5c5c3d829065cb032ec953b (diff) | |
| parent | c9be294d11352614f6f0eaa7161df325b9300de2 (diff) | |
| download | rust-1.37.0.tar.gz rust-1.37.0.zip | |
Auto merge of #63498 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum 1.37.0
1.37.0 stable This promotes beta to stable and backports a few PRs: - Avoid ICE when referencing desugared local binding in borrow error (#63051) - Don't access a static just for its size and alignment (#62982) via 331e09b143aebfcf82dc1f9b69b31ee0083cbf0b
Diffstat (limited to 'src/librustc_mir/borrow_check')
| -rw-r--r-- | src/librustc_mir/borrow_check/conflict_errors.rs | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/src/librustc_mir/borrow_check/conflict_errors.rs b/src/librustc_mir/borrow_check/conflict_errors.rs index f23cffeda68..b9cd1f07e83 100644 --- a/src/librustc_mir/borrow_check/conflict_errors.rs +++ b/src/librustc_mir/borrow_check/conflict_errors.rs @@ -1116,19 +1116,18 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> { bug!("try_report_cannot_return_reference_to_local: not a 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 => bug!("local variable without a name"), + 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 => ( + "local binding".to_string(), + "local binding introduced here".to_string(), + ), } }; |
