Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
7d6e5b9d
R
Rust
项目概览
int
/
Rust
大约 1 年 前同步成功
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
Rust
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
7d6e5b9d
编写于
1月 27, 2018
作者:
B
bors
浏览文件
操作
浏览文件
下载
差异文件
Auto merge of #47420 - davidtwco:issue-46885, r=estebank
Fix off-by-one spans in MIR borrowck errors Fixes #46885. r? @nikomatsakis
上级
6b99adeb
0bd96671
变更
24
隐藏空白更改
内联
并排
Showing
24 changed file
with
137 addition
and
48 deletion
+137
-48
src/librustc/infer/error_reporting/mod.rs
src/librustc/infer/error_reporting/mod.rs
+2
-1
src/librustc_borrowck/borrowck/check_loans.rs
src/librustc_borrowck/borrowck/check_loans.rs
+2
-2
src/librustc_borrowck/borrowck/mod.rs
src/librustc_borrowck/borrowck/mod.rs
+2
-1
src/librustc_mir/borrow_check/mod.rs
src/librustc_mir/borrow_check/mod.rs
+2
-1
src/librustc_mir/build/scope.rs
src/librustc_mir/build/scope.rs
+4
-2
src/librustc_mir/dataflow/impls/borrows.rs
src/librustc_mir/dataflow/impls/borrows.rs
+2
-2
src/librustc_resolve/lib.rs
src/librustc_resolve/lib.rs
+2
-2
src/librustc_typeck/check/mod.rs
src/librustc_typeck/check/mod.rs
+6
-6
src/libsyntax/codemap.rs
src/libsyntax/codemap.rs
+96
-0
src/libsyntax/parse/parser.rs
src/libsyntax/parse/parser.rs
+5
-3
src/libsyntax_pos/lib.rs
src/libsyntax_pos/lib.rs
+0
-14
src/test/ui/issue-46471-1.stderr
src/test/ui/issue-46471-1.stderr
+1
-1
src/test/ui/issue-46471.stderr
src/test/ui/issue-46471.stderr
+1
-1
src/test/ui/issue-46472.stderr
src/test/ui/issue-46472.stderr
+1
-1
src/test/ui/nll/capture-ref-in-struct.stderr
src/test/ui/nll/capture-ref-in-struct.stderr
+1
-1
src/test/ui/nll/closure-requirements/escape-argument.stderr
src/test/ui/nll/closure-requirements/escape-argument.stderr
+1
-1
src/test/ui/nll/closure-requirements/escape-upvar-nested.stderr
...st/ui/nll/closure-requirements/escape-upvar-nested.stderr
+1
-1
src/test/ui/nll/closure-requirements/escape-upvar-ref.stderr
src/test/ui/nll/closure-requirements/escape-upvar-ref.stderr
+1
-1
src/test/ui/nll/drop-no-may-dangle.stderr
src/test/ui/nll/drop-no-may-dangle.stderr
+2
-2
src/test/ui/nll/maybe-initialized-drop-implicit-fragment-drop.stderr
.../nll/maybe-initialized-drop-implicit-fragment-drop.stderr
+1
-1
src/test/ui/nll/maybe-initialized-drop-with-fragment.stderr
src/test/ui/nll/maybe-initialized-drop-with-fragment.stderr
+1
-1
src/test/ui/nll/maybe-initialized-drop-with-uninitialized-fragments.stderr
...aybe-initialized-drop-with-uninitialized-fragments.stderr
+1
-1
src/test/ui/nll/maybe-initialized-drop.stderr
src/test/ui/nll/maybe-initialized-drop.stderr
+1
-1
src/test/ui/nll/return-ref-mut-issue-46557.stderr
src/test/ui/nll/return-ref-mut-issue-46557.stderr
+1
-1
未找到文件。
src/librustc/infer/error_reporting/mod.rs
浏览文件 @
7d6e5b9d
...
...
@@ -958,7 +958,8 @@ pub fn report_generic_bound_failure(&self,
// `sp` only covers `T`, change it so that it covers
// `T:` when appropriate
let
sp
=
if
has_lifetimes
{
sp
.to
(
sp
.next_point
()
.next_point
())
sp
.to
(
self
.tcx.sess
.codemap
()
.next_point
(
self
.tcx.sess
.codemap
()
.next_point
(
sp
)))
}
else
{
sp
};
...
...
src/librustc_borrowck/borrowck/check_loans.rs
浏览文件 @
7d6e5b9d
...
...
@@ -591,8 +591,8 @@ pub fn report_error_if_loan_conflicts_with_restriction(&self,
// 3. Where does old loan expire.
let
previous_end_span
=
Some
(
old_loan
.kill_scope
.span
(
self
.tcx
(),
&
self
.bccx.region_scope_tree
)
.end_point
(
));
Some
(
self
.tcx
()
.sess
.codemap
()
.end_point
(
old_loan
.kill_scope
.span
(
self
.tcx
(),
&
self
.bccx.region_scope_tree
)
));
let
mut
err
=
match
(
new_loan
.kind
,
old_loan
.kind
)
{
(
ty
::
MutBorrow
,
ty
::
MutBorrow
)
=>
...
...
src/librustc_borrowck/borrowck/mod.rs
浏览文件 @
7d6e5b9d
...
...
@@ -1276,7 +1276,8 @@ fn report_out_of_scope_escaping_closure_capture(&self,
fn
region_end_span
(
&
self
,
region
:
ty
::
Region
<
'tcx
>
)
->
Option
<
Span
>
{
match
*
region
{
ty
::
ReScope
(
scope
)
=>
{
Some
(
scope
.span
(
self
.tcx
,
&
self
.region_scope_tree
)
.end_point
())
Some
(
self
.tcx.sess
.codemap
()
.end_point
(
scope
.span
(
self
.tcx
,
&
self
.region_scope_tree
)))
}
_
=>
None
}
...
...
src/librustc_mir/borrow_check/mod.rs
浏览文件 @
7d6e5b9d
...
...
@@ -1112,10 +1112,11 @@ fn check_for_invalidation_at_exit(
debug!
(
"check_for_invalidation_at_exit({:?}): INVALID"
,
place
);
// FIXME: should be talking about the region lifetime instead
// of just a span here.
let
span
=
self
.tcx.sess
.codemap
()
.end_point
(
span
);
self
.report_borrowed_value_does_not_live_long_enough
(
context
,
borrow
,
span
.end_point
()
,
span
,
flow_state
.borrows
.operator
(),
)
}
...
...
src/librustc_mir/build/scope.rs
浏览文件 @
7d6e5b9d
...
...
@@ -695,10 +695,12 @@ pub fn schedule_drop(&mut self,
if
let
DropKind
::
Value
{
..
}
=
drop_kind
{
scope
.needs_cleanup
=
true
;
}
let
region_scope_span
=
region_scope
.span
(
self
.hir
.tcx
(),
&
self
.hir.region_scope_tree
);
// Attribute scope exit drops to scope's closing brace
let
scope_end
=
region_scope_span
.with_lo
(
region_scope_span
.hi
());
// Attribute scope exit drops to scope's closing brace.
let
scope_end
=
self
.hir
.tcx
()
.sess
.codemap
()
.end_point
(
region_scope_span
);
scope
.drops
.push
(
DropData
{
span
:
scope_end
,
location
:
place
.clone
(),
...
...
src/librustc_mir/dataflow/impls/borrows.rs
浏览文件 @
7d6e5b9d
...
...
@@ -537,8 +537,8 @@ pub(crate) fn opt_region_end_span(&self, region: &Region) -> Option<Span> {
Some
(
_
)
=>
None
,
None
=>
{
match
self
.0
.region_span_map
.get
(
region
)
{
Some
(
span
)
=>
Some
(
s
pan
.end_point
(
)),
None
=>
Some
(
self
.0
.
mir.span
.end_point
(
))
Some
(
span
)
=>
Some
(
s
elf
.0
.tcx.sess
.codemap
()
.end_point
(
*
span
)),
None
=>
Some
(
self
.0
.
tcx.sess
.codemap
()
.end_point
(
self
.0
.mir.span
))
}
}
}
...
...
src/librustc_resolve/lib.rs
浏览文件 @
7d6e5b9d
...
...
@@ -2871,8 +2871,8 @@ fn type_ascription_suggestion(&self,
if
let
Some
(
sp
)
=
self
.current_type_ascription
.last
()
{
let
mut
sp
=
*
sp
;
loop
{
// try to find the `:`, bail on first non-':'/non-whitespace
sp
=
sp
.next_point
(
);
if
let
Ok
(
snippet
)
=
cm
.span_to_snippet
(
sp
.to
(
sp
.next_point
(
)))
{
sp
=
cm
.next_point
(
sp
);
if
let
Ok
(
snippet
)
=
cm
.span_to_snippet
(
sp
.to
(
cm
.next_point
(
sp
)))
{
debug!
(
"snippet {:?}"
,
snippet
);
let
line_sp
=
cm
.lookup_char_pos
(
sp
.hi
())
.line
;
let
line_base_sp
=
cm
.lookup_char_pos
(
base_span
.lo
())
.line
;
...
...
src/librustc_typeck/check/mod.rs
浏览文件 @
7d6e5b9d
...
...
@@ -2457,7 +2457,7 @@ fn parameter_count_error<'tcx>(sess: &Session,
err
.span_label
(
def_s
,
"defined here"
);
}
if
sugg_unit
{
let
sugg_span
=
expr_sp
.end_point
(
);
let
sugg_span
=
sess
.codemap
()
.end_point
(
expr_sp
);
// remove closing `)` from the span
let
sugg_span
=
sugg_span
.with_hi
(
sugg_span
.lo
());
err
.span_suggestion
(
...
...
@@ -4446,10 +4446,10 @@ pub fn suggest_mismatched_types_on_tail(&self,
/// statement and the return type has been left as default or has been specified as `()`. If so,
/// it suggests adding a semicolon.
fn
suggest_missing_semicolon
(
&
self
,
err
:
&
mut
DiagnosticBuilder
<
'tcx
>
,
expression
:
&
'gcx
hir
::
Expr
,
expected
:
Ty
<
'tcx
>
,
cause_span
:
Span
)
{
err
:
&
mut
DiagnosticBuilder
<
'tcx
>
,
expression
:
&
'gcx
hir
::
Expr
,
expected
:
Ty
<
'tcx
>
,
cause_span
:
Span
)
{
if
expected
.is_nil
()
{
// `BlockTailExpression` only relevant if the tail expr would be
// useful on its own.
...
...
@@ -4461,7 +4461,7 @@ fn suggest_missing_semicolon(&self,
hir
::
ExprLoop
(
..
)
|
hir
::
ExprMatch
(
..
)
|
hir
::
ExprBlock
(
..
)
=>
{
let
sp
=
cause_span
.next_point
(
);
let
sp
=
self
.tcx.sess
.codemap
()
.next_point
(
cause_span
);
err
.span_suggestion
(
sp
,
"try adding a semicolon"
,
";"
.to_string
());
...
...
src/libsyntax/codemap.rs
浏览文件 @
7d6e5b9d
...
...
@@ -25,6 +25,7 @@
use
rustc_data_structures
::
fx
::
FxHashMap
;
use
rustc_data_structures
::
stable_hasher
::
StableHasher
;
use
std
::
cell
::{
RefCell
,
Ref
};
use
std
::
cmp
;
use
std
::
hash
::
Hash
;
use
std
::
path
::{
Path
,
PathBuf
};
use
std
::
rc
::
Rc
;
...
...
@@ -607,6 +608,101 @@ pub fn def_span(&self, sp: Span) -> Span {
self
.span_until_char
(
sp
,
'{'
)
}
/// Returns a new span representing just the end-point of this span
pub
fn
end_point
(
&
self
,
sp
:
Span
)
->
Span
{
let
pos
=
sp
.hi
()
.0
;
let
width
=
self
.find_width_of_character_at_span
(
sp
,
false
);
let
corrected_end_position
=
pos
.checked_sub
(
width
)
.unwrap_or
(
pos
);
let
end_point
=
BytePos
(
cmp
::
max
(
corrected_end_position
,
sp
.lo
()
.0
));
sp
.with_lo
(
end_point
)
}
/// Returns a new span representing the next character after the end-point of this span
pub
fn
next_point
(
&
self
,
sp
:
Span
)
->
Span
{
let
start_of_next_point
=
sp
.hi
()
.0
;
let
width
=
self
.find_width_of_character_at_span
(
sp
,
true
);
// If the width is 1, then the next span should point to the same `lo` and `hi`. However,
// in the case of a multibyte character, where the width != 1, the next span should
// span multiple bytes to include the whole character.
let
end_of_next_point
=
start_of_next_point
.checked_add
(
width
-
1
)
.unwrap_or
(
start_of_next_point
);
let
end_of_next_point
=
BytePos
(
cmp
::
max
(
sp
.lo
()
.0
+
1
,
end_of_next_point
));
Span
::
new
(
BytePos
(
start_of_next_point
),
end_of_next_point
,
sp
.ctxt
())
}
/// Finds the width of a character, either before or after the provided span.
fn
find_width_of_character_at_span
(
&
self
,
sp
:
Span
,
forwards
:
bool
)
->
u32
{
// Disregard malformed spans and assume a one-byte wide character.
if
sp
.lo
()
>=
sp
.hi
()
{
debug!
(
"find_width_of_character_at_span: early return malformed span"
);
return
1
;
}
let
local_begin
=
self
.lookup_byte_offset
(
sp
.lo
());
let
local_end
=
self
.lookup_byte_offset
(
sp
.hi
());
debug!
(
"find_width_of_character_at_span: local_begin=`{:?}`, local_end=`{:?}`"
,
local_begin
,
local_end
);
let
start_index
=
local_begin
.pos
.to_usize
();
let
end_index
=
local_end
.pos
.to_usize
();
debug!
(
"find_width_of_character_at_span: start_index=`{:?}`, end_index=`{:?}`"
,
start_index
,
end_index
);
// Disregard indexes that are at the start or end of their spans, they can't fit bigger
// characters.
if
(
!
forwards
&&
end_index
==
usize
::
min_value
())
||
(
forwards
&&
start_index
==
usize
::
max_value
())
{
debug!
(
"find_width_of_character_at_span: start or end of span, cannot be multibyte"
);
return
1
;
}
let
source_len
=
(
local_begin
.fm.end_pos
-
local_begin
.fm.start_pos
)
.to_usize
();
debug!
(
"find_width_of_character_at_span: source_len=`{:?}`"
,
source_len
);
// Ensure indexes are also not malformed.
if
start_index
>
end_index
||
end_index
>
source_len
{
debug!
(
"find_width_of_character_at_span: source indexes are malformed"
);
return
1
;
}
// We need to extend the snippet to the end of the src rather than to end_index so when
// searching forwards for boundaries we've got somewhere to search.
let
snippet
=
if
let
Some
(
ref
src
)
=
local_begin
.fm.src
{
let
len
=
src
.len
();
(
&
src
[
start_index
..
len
])
.to_string
()
}
else
if
let
Some
(
src
)
=
local_begin
.fm.external_src
.borrow
()
.get_source
()
{
let
len
=
src
.len
();
(
&
src
[
start_index
..
len
])
.to_string
()
}
else
{
return
1
;
};
debug!
(
"find_width_of_character_at_span: snippet=`{:?}`"
,
snippet
);
let
file_start_pos
=
local_begin
.fm.start_pos
.to_usize
();
let
file_end_pos
=
local_begin
.fm.end_pos
.to_usize
();
debug!
(
"find_width_of_character_at_span: file_start_pos=`{:?}` file_end_pos=`{:?}`"
,
file_start_pos
,
file_end_pos
);
let
mut
target
=
if
forwards
{
end_index
+
1
}
else
{
end_index
-
1
};
debug!
(
"find_width_of_character_at_span: initial target=`{:?}`"
,
target
);
while
!
snippet
.is_char_boundary
(
target
-
start_index
)
&&
target
>=
file_start_pos
&&
target
<=
file_end_pos
{
target
=
if
forwards
{
target
+
1
}
else
{
target
-
1
};
debug!
(
"find_width_of_character_at_span: target=`{:?}`"
,
target
);
}
debug!
(
"find_width_of_character_at_span: final target=`{:?}`"
,
target
);
if
forwards
{
(
target
-
end_index
)
as
u32
}
else
{
(
end_index
-
target
)
as
u32
}
}
pub
fn
get_filemap
(
&
self
,
filename
:
&
FileName
)
->
Option
<
Rc
<
FileMap
>>
{
for
fm
in
self
.files
.borrow
()
.iter
()
{
if
*
filename
==
fm
.name
{
...
...
src/libsyntax/parse/parser.rs
浏览文件 @
7d6e5b9d
...
...
@@ -704,13 +704,15 @@ fn tokens_to_string(tokens: &[TokenType]) -> String {
expect
.clone
()
};
(
format!
(
"expected one of {}, found `{}`"
,
expect
,
actual
),
(
self
.prev_span
.next_point
(),
format!
(
"expected one of {} here"
,
short_expect
)))
(
self
.sess
.codemap
()
.next_point
(
self
.prev_span
),
format!
(
"expected one of {} here"
,
short_expect
)))
}
else
if
expected
.is_empty
()
{
(
format!
(
"unexpected token: `{}`"
,
actual
),
(
self
.prev_span
,
"unexpected token after this"
.to_string
()))
}
else
{
(
format!
(
"expected {}, found `{}`"
,
expect
,
actual
),
(
self
.prev_span
.next_point
(),
format!
(
"expected {} here"
,
expect
)))
(
self
.sess
.codemap
()
.next_point
(
self
.prev_span
),
format!
(
"expected {} here"
,
expect
)))
};
let
mut
err
=
self
.fatal
(
&
msg_exp
);
let
sp
=
if
self
.token
==
token
::
Token
::
Eof
{
...
...
@@ -3190,7 +3192,7 @@ pub fn parse_if_expr(&mut self, attrs: ThinVec<Attribute>) -> PResult<'a, P<Expr
// return. This won't catch blocks with an explicit `return`, but that would be caught by
// the dead code lint.
if
self
.eat_keyword
(
keywords
::
Else
)
||
!
cond
.returns
()
{
let
sp
=
lo
.next_point
(
);
let
sp
=
self
.sess
.codemap
()
.next_point
(
lo
);
let
mut
err
=
self
.diagnostic
()
.struct_span_err
(
sp
,
"missing condition for `if` statemement"
);
err
.span_label
(
sp
,
"expected if condition here"
);
...
...
src/libsyntax_pos/lib.rs
浏览文件 @
7d6e5b9d
...
...
@@ -216,20 +216,6 @@ pub fn with_ctxt(self, ctxt: SyntaxContext) -> Span {
self
.data
()
.with_ctxt
(
ctxt
)
}
/// Returns a new span representing just the end-point of this span
pub
fn
end_point
(
self
)
->
Span
{
let
span
=
self
.data
();
let
lo
=
cmp
::
max
(
span
.hi
.0
-
1
,
span
.lo
.0
);
span
.with_lo
(
BytePos
(
lo
))
}
/// Returns a new span representing the next character after the end-point of this span
pub
fn
next_point
(
self
)
->
Span
{
let
span
=
self
.data
();
let
lo
=
cmp
::
max
(
span
.hi
.0
,
span
.lo
.0
+
1
);
Span
::
new
(
BytePos
(
lo
),
BytePos
(
lo
),
span
.ctxt
)
}
/// Returns `self` if `self` is not the dummy span, and `other` otherwise.
pub
fn
substitute_dummy
(
self
,
other
:
Span
)
->
Span
{
if
self
.source_equal
(
&
DUMMY_SP
)
{
other
}
else
{
self
}
...
...
src/test/ui/issue-46471-1.stderr
浏览文件 @
7d6e5b9d
...
...
@@ -15,7 +15,7 @@ error[E0597]: `z` does not live long enough (Mir)
16 | &mut z
| ^^^^^^ borrowed value does not live long enough
17 | };
|
- `z` dropped here while still borrowed
| - `z` dropped here while still borrowed
...
21 | }
| - borrowed value needs to live until here
...
...
src/test/ui/issue-46471.stderr
浏览文件 @
7d6e5b9d
...
...
@@ -16,7 +16,7 @@ error[E0597]: `x` does not live long enough (Mir)
| ^^ borrowed value does not live long enough
...
18 | }
|
- borrowed value only lives until here
| - borrowed value only lives until here
|
= note: borrowed value must be valid for the static lifetime...
...
...
src/test/ui/issue-46472.stderr
浏览文件 @
7d6e5b9d
...
...
@@ -24,7 +24,7 @@ error[E0597]: borrowed value does not live long enough (Mir)
| ^ temporary value does not live long enough
...
17 | }
|
- temporary value only lives until here
| - temporary value only lives until here
|
note: borrowed value must be valid for the lifetime 'a as defined on the function body at 13:1...
--> $DIR/issue-46472.rs:13:1
...
...
src/test/ui/nll/capture-ref-in-struct.stderr
浏览文件 @
7d6e5b9d
...
...
@@ -5,7 +5,7 @@ error[E0597]: `y` does not live long enough
| ^^ borrowed value does not live long enough
...
38 | }
|
- borrowed value only lives until here
| - borrowed value only lives until here
39 |
40 | deref(p);
| - borrow later used here
...
...
src/test/ui/nll/closure-requirements/escape-argument.stderr
浏览文件 @
7d6e5b9d
...
...
@@ -30,7 +30,7 @@ error[E0597]: `y` does not live long enough
| ^^ borrowed value does not live long enough
38 | //~^ ERROR `y` does not live long enough [E0597]
39 | }
|
- borrowed value only lives until here
| - borrowed value only lives until here
40 |
41 | deref(p);
| - borrow later used here
...
...
src/test/ui/nll/closure-requirements/escape-upvar-nested.stderr
浏览文件 @
7d6e5b9d
...
...
@@ -57,7 +57,7 @@ error[E0597]: `y` does not live long enough
| |_________^ borrowed value does not live long enough
...
36 | }
|
- borrowed value only lives until here
| - borrowed value only lives until here
37 |
38 | deref(p);
| - borrow later used here
...
...
src/test/ui/nll/closure-requirements/escape-upvar-ref.stderr
浏览文件 @
7d6e5b9d
...
...
@@ -34,7 +34,7 @@ error[E0597]: `y` does not live long enough
| ^^^^^^^^^ borrowed value does not live long enough
...
36 | }
|
- borrowed value only lives until here
| - borrowed value only lives until here
37 |
38 | deref(p);
| - borrow later used here
...
...
src/test/ui/nll/drop-no-may-dangle.stderr
浏览文件 @
7d6e5b9d
...
...
@@ -8,7 +8,7 @@ error[E0506]: cannot assign to `v[..]` because it is borrowed
| ^^^^^^^^^ assignment to borrowed `v[..]` occurs here
...
35 | }
|
- borrow later used here, when `p` is dropped
| - borrow later used here, when `p` is dropped
error[E0506]: cannot assign to `v[..]` because it is borrowed
--> $DIR/drop-no-may-dangle.rs:34:5
...
...
@@ -19,7 +19,7 @@ error[E0506]: cannot assign to `v[..]` because it is borrowed
34 | v[0] += 1; //~ ERROR cannot assign to `v[..]` because it is borrowed
| ^^^^^^^^^ assignment to borrowed `v[..]` occurs here
35 | }
|
- borrow later used here, when `p` is dropped
| - borrow later used here, when `p` is dropped
error: aborting due to 2 previous errors
src/test/ui/nll/maybe-initialized-drop-implicit-fragment-drop.stderr
浏览文件 @
7d6e5b9d
...
...
@@ -8,7 +8,7 @@ error[E0506]: cannot assign to `x` because it is borrowed
| ^^^^^ assignment to borrowed `x` occurs here
33 | // FIXME ^ Should not error in the future with implicit dtors, only manually implemented ones
34 | }
|
- borrow later used here, when `foo` is dropped
| - borrow later used here, when `foo` is dropped
error: aborting due to previous error
src/test/ui/nll/maybe-initialized-drop-with-fragment.stderr
浏览文件 @
7d6e5b9d
...
...
@@ -7,7 +7,7 @@ error[E0506]: cannot assign to `x` because it is borrowed
31 | x = 1; //~ ERROR cannot assign to `x` because it is borrowed [E0506]
| ^^^^^ assignment to borrowed `x` occurs here
32 | }
|
- borrow later used here, when `foo` is dropped
| - borrow later used here, when `foo` is dropped
error: aborting due to previous error
src/test/ui/nll/maybe-initialized-drop-with-uninitialized-fragments.stderr
浏览文件 @
7d6e5b9d
...
...
@@ -8,7 +8,7 @@ error[E0506]: cannot assign to `x` because it is borrowed
| ^^^^^ assignment to borrowed `x` occurs here
33 | // FIXME ^ This currently errors and it should not.
34 | }
|
- borrow later used here, when `foo` is dropped
| - borrow later used here, when `foo` is dropped
error: aborting due to previous error
src/test/ui/nll/maybe-initialized-drop.stderr
浏览文件 @
7d6e5b9d
...
...
@@ -6,7 +6,7 @@ error[E0506]: cannot assign to `x` because it is borrowed
26 | x = 1; //~ ERROR cannot assign to `x` because it is borrowed [E0506]
| ^^^^^ assignment to borrowed `x` occurs here
27 | }
|
- borrow later used here, when `wrap` is dropped
| - borrow later used here, when `wrap` is dropped
error: aborting due to previous error
src/test/ui/nll/return-ref-mut-issue-46557.stderr
浏览文件 @
7d6e5b9d
...
...
@@ -5,7 +5,7 @@ error[E0597]: borrowed value does not live long enough
| ^^^^^^^ temporary value does not live long enough
18 | x
19 | }
|
- temporary value only lives until here
| - temporary value only lives until here
|
= note: borrowed value must be valid for lifetime '_#2r...
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录