File tree Expand file tree Collapse file tree 3 files changed +19
-1
lines changed Expand file tree Collapse file tree 3 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -622,7 +622,7 @@ fn determine_rp_in_ty(ty: @ast::Ty,
622
622
& & cx: determine_rp_ctxt ,
623
623
visitor : visit:: vt < determine_rp_ctxt > ) {
624
624
625
- // we are only interesting in types that will require an item to
625
+ // we are only interested in types that will require an item to
626
626
// be region-parameterized. if cx.item_id is zero, then this type
627
627
// is not a member of a type defn nor is it a constitutent of an
628
628
// impl etc. So we can ignore it and its components.
Original file line number Diff line number Diff line change @@ -82,6 +82,9 @@ fn explain_region_and_span(cx: ctxt, region: ty::Region)
82
82
_ => explain_span ( cx, "expression" , expr. span )
83
83
}
84
84
}
85
+ Some ( ast_map:: node_stmt( stmt) ) => {
86
+ explain_span ( cx, "statement" , stmt. span )
87
+ }
85
88
Some ( _) | None => {
86
89
// this really should not happen
87
90
( fmt ! ( "unknown scope: %d. Please report a bug." , node_id) ,
Original file line number Diff line number Diff line change
1
+ // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
2
+ // file at the top-level directory of this distribution and at
3
+ // http://rust-lang.org/COPYRIGHT.
4
+ //
5
+ // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6
+ // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7
+ // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8
+ // option. This file may not be copied, modified, or distributed
9
+ // except according to those terms.
10
+
11
+ fn main ( ) {
12
+ let mut _p: & int = & 4 ;
13
+ _p = ~3 ; //~ ERROR illegal borrow: borrowed value does not live long enough
14
+ //~^ NOTE ...but borrowed value is only valid for the statement
15
+ }
You can’t perform that action at this time.
0 commit comments