Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
9a0020a8
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,发现更多精彩内容 >>
提交
9a0020a8
编写于
8月 13, 2018
作者:
A
ashtneoi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Bless UI tests
上级
d6dbdee7
变更
13
隐藏空白更改
内联
并排
Showing
13 changed file
with
231 addition
and
121 deletion
+231
-121
src/test/ui/borrowck/borrowck-move-error-with-note.nll.stderr
...test/ui/borrowck/borrowck-move-error-with-note.nll.stderr
+29
-10
src/test/ui/borrowck/borrowck-move-out-of-vec-tail.nll.stderr
...test/ui/borrowck/borrowck-move-out-of-vec-tail.nll.stderr
+13
-4
src/test/ui/borrowck/borrowck-vec-pattern-nesting.nll.stderr
src/test/ui/borrowck/borrowck-vec-pattern-nesting.nll.stderr
+43
-19
src/test/ui/borrowck/issue-51415.nll.stderr
src/test/ui/borrowck/issue-51415.nll.stderr
+6
-1
src/test/ui/codemap_tests/overlapping_spans.nll.stderr
src/test/ui/codemap_tests/overlapping_spans.nll.stderr
+7
-4
src/test/ui/issues/issue-12567.nll.stderr
src/test/ui/issues/issue-12567.nll.stderr
+16
-14
src/test/ui/issues/issue-20801.nll.stderr
src/test/ui/issues/issue-20801.nll.stderr
+4
-4
src/test/ui/issues/issue-40402-ref-hints/issue-40402-1.nll.stderr
.../ui/issues/issue-40402-ref-hints/issue-40402-1.nll.stderr
+1
-1
src/test/ui/issues/issue-40402-ref-hints/issue-40402-2.nll.stderr
.../ui/issues/issue-40402-ref-hints/issue-40402-2.nll.stderr
+9
-3
src/test/ui/moves/moves-based-on-type-block-bad.nll.stderr
src/test/ui/moves/moves-based-on-type-block-bad.nll.stderr
+8
-2
src/test/ui/nll/cannot-move-block-spans.nll.stderr
src/test/ui/nll/cannot-move-block-spans.nll.stderr
+9
-9
src/test/ui/nll/move-errors.stderr
src/test/ui/nll/move-errors.stderr
+65
-29
src/test/ui/suggestions/dont-suggest-ref.stderr
src/test/ui/suggestions/dont-suggest-ref.stderr
+21
-21
未找到文件。
src/test/ui/borrowck/borrowck-move-error-with-note.nll.stderr
浏览文件 @
9a0020a8
...
...
@@ -5,14 +5,24 @@ LL | match *f { //~ ERROR cannot move out of
| ^^
| |
| cannot move out of borrowed content
| help: consider removing th
is dereference operator
: `f`
| help: consider removing th
e `*`
: `f`
LL | //~| cannot move out
LL | Foo::Foo1(num1,
| ----
move occurs because num1 has type `std::boxed::Box<u32>`, which does not implement the `Copy` trait
| ----
data moved here
LL | num2) => (),
| ----
move occurs because num2 has type `std::boxed::Box<u32>`, which does not implement the `Copy` trait
| ----
...and here
LL | Foo::Foo2(num) => (),
| --- move occurs because num has type `std::boxed::Box<u32>`, which does not implement the `Copy` trait
| --- ...and here
|
note: move occurs because these variables have types that don't implement the `Copy` trait
--> $DIR/borrowck-move-error-with-note.rs:23:19
|
LL | Foo::Foo1(num1,
| ^^^^
LL | num2) => (),
| ^^^^
LL | Foo::Foo2(num) => (),
| ^^^
error[E0509]: cannot move out of type `S`, which implements the `Drop` trait
--> $DIR/borrowck-move-error-with-note.rs:39:11
...
...
@@ -23,12 +33,15 @@ LL | match (S {f: "foo".to_string(), g: "bar".to_string()}) {
LL | f: _s,
| -- data moved here
LL | g: _t
| -- ... and here
help: to prevent move, use ref or ref mut
| -- ...and here
|
LL | f: ref _s,
LL | g: ref _t
note: move occurs because these variables have types that don't implement the `Copy` trait
--> $DIR/borrowck-move-error-with-note.rs:42:16
|
LL | f: _s,
| ^^
LL | g: _t
| ^^
error[E0507]: cannot move out of borrowed content
--> $DIR/borrowck-move-error-with-note.rs:57:11
...
...
@@ -37,10 +50,16 @@ LL | match a.a { //~ ERROR cannot move out of
| ^^^
| |
| cannot move out of borrowed content
| help: consider
using a reference instead
: `&a.a`
| help: consider
borrowing here
: `&a.a`
LL | //~| cannot move out
LL | n => {
| - move occurs because n has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait
| - data moved here
|
note: move occurs because `n` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait
--> $DIR/borrowck-move-error-with-note.rs:59:9
|
LL | n => {
| ^
error: aborting due to 3 previous errors
...
...
src/test/ui/borrowck/borrowck-move-out-of-vec-tail.nll.stderr
浏览文件 @
9a0020a8
...
...
@@ -7,14 +7,23 @@ LL | &[Foo { string: a },
| - data moved here
...
LL | Foo { string: b }] => {
| - ... and here
help: to prevent move, use ref or ref mut
| - ...and here
|
LL | &[Foo { string: ref a },
note: move occurs because these variables have types that don't implement the `Copy` trait
--> $DIR/borrowck-move-out-of-vec-tail.rs:30:33
|
LL | &[Foo { string: a },
| ^
...
LL | Foo { string: b }] => {
| ^
help: consider removing the `&`
|
LL | [Foo { string: a },
LL | //~^ ERROR cannot move out of type `[Foo]`
LL | //~| cannot move out
LL | //~| to prevent move
LL | Foo { string:
ref
b }] => {
LL | Foo { string: b }] => {
|
error: aborting due to previous error
...
...
src/test/ui/borrowck/borrowck-vec-pattern-nesting.nll.stderr
浏览文件 @
9a0020a8
...
...
@@ -28,10 +28,21 @@ error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy sli
LL | match vec {
| ^^^ cannot move out of here
LL | &mut [_a, //~ ERROR cannot move out
| --
| |
| data moved here
| help: to prevent move, use ref or ref mut: `ref _a`
| -- data moved here
|
note: move occurs because `_a` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait
--> $DIR/borrowck-vec-pattern-nesting.rs:44:15
|
LL | &mut [_a, //~ ERROR cannot move out
| ^^
help: consider removing the `&mut`
|
LL | [_a, //~ ERROR cannot move out
LL | //~| cannot move out
LL | //~| to prevent move
LL | ..
LL | ] => {
|
error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy slice
--> $DIR/borrowck-vec-pattern-nesting.rs:57:13
...
...
@@ -40,7 +51,7 @@ LL | let a = vec[0]; //~ ERROR cannot move out
| ^^^^^^
| |
| cannot move out of here
| help: consider
using a reference instead
: `&vec[0]`
| help: consider
borrowing here
: `&vec[0]`
error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy slice
--> $DIR/borrowck-vec-pattern-nesting.rs:64:11
...
...
@@ -49,10 +60,19 @@ LL | match vec {
| ^^^ cannot move out of here
...
LL | _b] => {}
| --
| |
| data moved here
| help: to prevent move, use ref or ref mut: `ref _b`
| -- data moved here
|
note: move occurs because `_b` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait
--> $DIR/borrowck-vec-pattern-nesting.rs:67:10
|
LL | _b] => {}
| ^^
help: consider removing the `&mut`
|
LL | [ //~ ERROR cannot move out
LL | //~^ cannot move out
LL | _b] => {}
|
error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy slice
--> $DIR/borrowck-vec-pattern-nesting.rs:70:13
...
...
@@ -61,7 +81,7 @@ LL | let a = vec[0]; //~ ERROR cannot move out
| ^^^^^^
| |
| cannot move out of here
| help: consider
using a reference instead
: `&vec[0]`
| help: consider
borrowing here
: `&vec[0]`
error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy slice
--> $DIR/borrowck-vec-pattern-nesting.rs:77:11
...
...
@@ -69,14 +89,18 @@ error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy sli
LL | match vec {
| ^^^ cannot move out of here
LL | &mut [_a, _b, _c] => {} //~ ERROR cannot move out
| -- -- -- ... and here
| | |
| | ... and here
| data moved here
help: to prevent move, use ref or ref mut
|
LL | &mut [ref _a, ref _b, ref _c] => {} //~ ERROR cannot move out
| ^^^^^^ ^^^^^^ ^^^^^^
| -----------------
| | | | |
| | | | ...and here
| | | ...and here
| | data moved here
| help: consider removing the `&mut`: `[_a, _b, _c]`
|
note: move occurs because these variables have types that don't implement the `Copy` trait
--> $DIR/borrowck-vec-pattern-nesting.rs:78:15
|
LL | &mut [_a, _b, _c] => {} //~ ERROR cannot move out
| ^^ ^^ ^^
error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy slice
--> $DIR/borrowck-vec-pattern-nesting.rs:82:13
...
...
@@ -85,7 +109,7 @@ LL | let a = vec[0]; //~ ERROR cannot move out
| ^^^^^^
| |
| cannot move out of here
| help: consider
using a reference instead
: `&vec[0]`
| help: consider
borrowing here
: `&vec[0]`
error: aborting due to 8 previous errors
...
...
src/test/ui/borrowck/issue-51415.nll.stderr
浏览文件 @
9a0020a8
...
...
@@ -5,8 +5,13 @@ LL | let opt = a.iter().enumerate().find(|(_, &s)| {
| ^^^^^-^
| | |
| | data moved here
| | help: to prevent move, use ref or ref mut: `ref s`
| cannot move out of borrowed content
|
note: move occurs because `s` has type `std::string::String`, which does not implement the `Copy` trait
--> $DIR/issue-51415.rs:16:47
|
LL | let opt = a.iter().enumerate().find(|(_, &s)| {
| ^
error: aborting due to previous error
...
...
src/test/ui/codemap_tests/overlapping_spans.nll.stderr
浏览文件 @
9a0020a8
...
...
@@ -4,10 +4,13 @@ error[E0509]: cannot move out of type `S`, which implements the `Drop` trait
LL | match (S {f:"foo".to_string()}) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of here
LL | S {f:_s} => {} //~ ERROR cannot move out
| --
| |
| data moved here
| help: to prevent move, use ref or ref mut: `ref _s`
| -- data moved here
|
note: move occurs because `_s` has type `std::string::String`, which does not implement the `Copy` trait
--> $DIR/overlapping_spans.rs:21:14
|
LL | S {f:_s} => {} //~ ERROR cannot move out
| ^^
error: aborting due to previous error
...
...
src/test/ui/issues/issue-12567.nll.stderr
浏览文件 @
9a0020a8
...
...
@@ -8,15 +8,16 @@ LL | (&[], &[hd, ..]) | (&[hd, ..], &[])
| -- data moved here
...
LL | (&[hd1, ..], &[hd2, ..])
| --- ... and here
help: to prevent move, use ref or ref mut
| --- ...and here
|
LL | (&[], &[ref hd, ..]) | (&[hd, ..], &[])
LL | => println!("one empty"),
LL | //~^^ ERROR: cannot move out of type `[T]`, a non-copy slice
LL | //~^^^ ERROR: cannot move out of type `[T]`, a non-copy slice
LL | (&[hd1, ..], &[ref hd2, ..])
note: move occurs because these variables have types that don't implement the `Copy` trait
--> $DIR/issue-12567.rs:16:17
|
LL | (&[], &[hd, ..]) | (&[hd, ..], &[])
| ^^
...
LL | (&[hd1, ..], &[hd2, ..])
| ^^^
error[E0508]: cannot move out of type `[T]`, a non-copy slice
--> $DIR/issue-12567.rs:14:11
...
...
@@ -28,15 +29,16 @@ LL | (&[], &[hd, ..]) | (&[hd, ..], &[])
| -- data moved here
...
LL | (&[hd1, ..], &[hd2, ..])
| --- ... and here
help: to prevent move, use ref or ref mut
| --- ...and here
|
LL | (&[], &[ref hd, ..]) | (&[hd, ..], &[])
LL | => println!("one empty"),
LL | //~^^ ERROR: cannot move out of type `[T]`, a non-copy slice
LL | //~^^^ ERROR: cannot move out of type `[T]`, a non-copy slice
LL | (&[ref hd1, ..], &[hd2, ..])
note: move occurs because these variables have types that don't implement the `Copy` trait
--> $DIR/issue-12567.rs:16:17
|
LL | (&[], &[hd, ..]) | (&[hd, ..], &[])
| ^^
...
LL | (&[hd1, ..], &[hd2, ..])
| ^^^
error: aborting due to 2 previous errors
...
...
src/test/ui/issues/issue-20801.nll.stderr
浏览文件 @
9a0020a8
...
...
@@ -5,7 +5,7 @@ LL | let a = unsafe { *mut_ref() };
| ^^^^^^^^^^
| |
| cannot move out of borrowed content
| help: consider
using a reference instead: `&*
mut_ref()`
| help: consider
removing the `*`: `
mut_ref()`
error[E0507]: cannot move out of borrowed content
--> $DIR/issue-20801.rs:39:22
...
...
@@ -14,7 +14,7 @@ LL | let b = unsafe { *imm_ref() };
| ^^^^^^^^^^
| |
| cannot move out of borrowed content
| help: consider
using a reference instead: `&*
imm_ref()`
| help: consider
removing the `*`: `
imm_ref()`
error[E0507]: cannot move out of borrowed content
--> $DIR/issue-20801.rs:42:22
...
...
@@ -23,7 +23,7 @@ LL | let c = unsafe { *mut_ptr() };
| ^^^^^^^^^^
| |
| cannot move out of borrowed content
| help: consider
using a reference instead: `&*
mut_ptr()`
| help: consider
removing the `*`: `
mut_ptr()`
error[E0507]: cannot move out of borrowed content
--> $DIR/issue-20801.rs:45:22
...
...
@@ -32,7 +32,7 @@ LL | let d = unsafe { *const_ptr() };
| ^^^^^^^^^^^^
| |
| cannot move out of borrowed content
| help: consider
using a reference instead: `&*
const_ptr()`
| help: consider
removing the `*`: `
const_ptr()`
error: aborting due to 4 previous errors
...
...
src/test/ui/issues/issue-40402-ref-hints/issue-40402-1.nll.stderr
浏览文件 @
9a0020a8
...
...
@@ -5,7 +5,7 @@ LL | let e = f.v[0]; //~ ERROR cannot move out of indexed content
| ^^^^^^
| |
| cannot move out of borrowed content
| help: consider
using a reference instead
: `&f.v[0]`
| help: consider
borrowing here
: `&f.v[0]`
error: aborting due to previous error
...
...
src/test/ui/issues/issue-40402-ref-hints/issue-40402-2.nll.stderr
浏览文件 @
9a0020a8
...
...
@@ -5,9 +5,15 @@ LL | let (a, b) = x[0]; //~ ERROR cannot move out of indexed content
| - - ^^^^
| | | |
| | | cannot move out of borrowed content
| | | help: consider using a reference instead: `&x[0]`
| | move occurs because b has type `std::string::String`, which does not implement the `Copy` trait
| move occurs because a has type `std::string::String`, which does not implement the `Copy` trait
| | | help: consider borrowing here: `&x[0]`
| | ...and here
| data moved here
|
note: move occurs because these variables have types that don't implement the `Copy` trait
--> $DIR/issue-40402-2.rs:15:10
|
LL | let (a, b) = x[0]; //~ ERROR cannot move out of indexed content
| ^ ^
error: aborting due to previous error
...
...
src/test/ui/moves/moves-based-on-type-block-bad.nll.stderr
浏览文件 @
9a0020a8
...
...
@@ -5,10 +5,16 @@ LL | match hellothere.x { //~ ERROR cannot move out
| ^^^^^^^^^^^^
| |
| cannot move out of borrowed content
| help: consider
using a reference instead
: `&hellothere.x`
| help: consider
borrowing here
: `&hellothere.x`
...
LL | box E::Bar(x) => println!("{}", x.to_string()),
| - move occurs because x has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait
| - data moved here
|
note: move occurs because `x` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait
--> $DIR/moves-based-on-type-block-bad.rs:37:28
|
LL | box E::Bar(x) => println!("{}", x.to_string()),
| ^
error: aborting due to previous error
...
...
src/test/ui/nll/cannot-move-block-spans.nll.stderr
浏览文件 @
9a0020a8
...
...
@@ -5,7 +5,7 @@ LL | let x = { *r }; //~ ERROR
| ^^
| |
| cannot move out of borrowed content
| help: consider removing th
is dereference operator
: `r`
| help: consider removing th
e `*`
: `r`
error[E0507]: cannot move out of borrowed content
--> $DIR/cannot-move-block-spans.rs:16:22
...
...
@@ -14,7 +14,7 @@ LL | let y = unsafe { *r }; //~ ERROR
| ^^
| |
| cannot move out of borrowed content
| help: consider removing th
is dereference operator
: `r`
| help: consider removing th
e `*`
: `r`
error[E0507]: cannot move out of borrowed content
--> $DIR/cannot-move-block-spans.rs:17:26
...
...
@@ -23,7 +23,7 @@ LL | let z = loop { break *r; }; //~ ERROR
| ^^
| |
| cannot move out of borrowed content
| help: consider removing th
is dereference operator
: `r`
| help: consider removing th
e `*`
: `r`
error[E0508]: cannot move out of type `[std::string::String; 2]`, a non-copy array
--> $DIR/cannot-move-block-spans.rs:21:15
...
...
@@ -32,7 +32,7 @@ LL | let x = { arr[0] }; //~ ERROR
| ^^^^^^
| |
| cannot move out of here
| help: consider
using a reference instead
: `&arr[0]`
| help: consider
borrowing here
: `&arr[0]`
error[E0508]: cannot move out of type `[std::string::String; 2]`, a non-copy array
--> $DIR/cannot-move-block-spans.rs:22:22
...
...
@@ -41,7 +41,7 @@ LL | let y = unsafe { arr[0] }; //~ ERROR
| ^^^^^^
| |
| cannot move out of here
| help: consider
using a reference instead
: `&arr[0]`
| help: consider
borrowing here
: `&arr[0]`
error[E0508]: cannot move out of type `[std::string::String; 2]`, a non-copy array
--> $DIR/cannot-move-block-spans.rs:23:26
...
...
@@ -50,7 +50,7 @@ LL | let z = loop { break arr[0]; }; //~ ERROR
| ^^^^^^
| |
| cannot move out of here
| help: consider
using a reference instead
: `&arr[0]`
| help: consider
borrowing here
: `&arr[0]`
error[E0507]: cannot move out of borrowed content
--> $DIR/cannot-move-block-spans.rs:27:38
...
...
@@ -59,7 +59,7 @@ LL | let x = { let mut u = 0; u += 1; *r }; //~ ERROR
| ^^
| |
| cannot move out of borrowed content
| help: consider removing th
is dereference operator
: `r`
| help: consider removing th
e `*`
: `r`
error[E0507]: cannot move out of borrowed content
--> $DIR/cannot-move-block-spans.rs:28:45
...
...
@@ -68,7 +68,7 @@ LL | let y = unsafe { let mut u = 0; u += 1; *r }; //~ ERROR
| ^^
| |
| cannot move out of borrowed content
| help: consider removing th
is dereference operator
: `r`
| help: consider removing th
e `*`
: `r`
error[E0507]: cannot move out of borrowed content
--> $DIR/cannot-move-block-spans.rs:29:49
...
...
@@ -77,7 +77,7 @@ LL | let z = loop { let mut u = 0; u += 1; break *r; u += 2; }; //~ ERROR
| ^^
| |
| cannot move out of borrowed content
| help: consider removing th
is dereference operator
: `r`
| help: consider removing th
e `*`
: `r`
error: aborting due to 9 previous errors
...
...
src/test/ui/nll/move-errors.stderr
浏览文件 @
9a0020a8
...
...
@@ -5,7 +5,7 @@ LL | let b = *a;
| ^^
| |
| cannot move out of borrowed content
| help: consider removing th
is dereference operator
: `a`
| help: consider removing th
e `*`
: `a`
error[E0508]: cannot move out of type `[A; 1]`, a non-copy array
--> $DIR/move-errors.rs:25:13
...
...
@@ -14,7 +14,7 @@ LL | let b = a[0];
| ^^^^
| |
| cannot move out of here
| help: consider
using a reference instead
: `&a[0]`
| help: consider
borrowing here
: `&a[0]`
error[E0507]: cannot move out of borrowed content
--> $DIR/move-errors.rs:32:13
...
...
@@ -23,7 +23,7 @@ LL | let s = **r;
| ^^^
| |
| cannot move out of borrowed content
| help: consider
using a reference instead: `&*
*r`
| help: consider
removing the `*`: `
*r`
error[E0507]: cannot move out of borrowed content
--> $DIR/move-errors.rs:40:13
...
...
@@ -32,7 +32,7 @@ LL | let s = *r;
| ^^
| |
| cannot move out of borrowed content
| help: consider
using a reference instead: `&*
r`
| help: consider
removing the `*`: `
r`
error[E0508]: cannot move out of type `[A; 1]`, a non-copy array
--> $DIR/move-errors.rs:45:13
...
...
@@ -41,7 +41,7 @@ LL | let a = [A("".to_string())][0];
| ^^^^^^^^^^^^^^^^^^^^^^
| |
| cannot move out of here
| help: consider
using a reference instead
: `&[A("".to_string())][0]`
| help: consider
borrowing here
: `&[A("".to_string())][0]`
error[E0507]: cannot move out of borrowed content
--> $DIR/move-errors.rs:51:16
...
...
@@ -50,8 +50,14 @@ LL | let A(s) = *a;
| - ^^
| | |
| | cannot move out of borrowed content
| | help: consider removing this dereference operator: `a`
| move occurs because s has type `std::string::String`, which does not implement the `Copy` trait
| | help: consider removing the `*`: `a`
| data moved here
|
note: move occurs because `s` has type `std::string::String`, which does not implement the `Copy` trait
--> $DIR/move-errors.rs:51:11
|
LL | let A(s) = *a;
| ^
error[E0509]: cannot move out of type `D`, which implements the `Drop` trait
--> $DIR/move-errors.rs:57:19
...
...
@@ -60,7 +66,12 @@ LL | let C(D(s)) = c;
| - ^ cannot move out of here
| |
| data moved here
| help: to prevent move, use ref or ref mut: `ref s`
|
note: move occurs because `s` has type `std::string::String`, which does not implement the `Copy` trait
--> $DIR/move-errors.rs:57:13
|
LL | let C(D(s)) = c;
| ^
error[E0507]: cannot move out of borrowed content
--> $DIR/move-errors.rs:64:9
...
...
@@ -75,12 +86,20 @@ LL | match x[0] {
| ^^^^
| |
| cannot move out of here
| help: consider
using a reference instead
: `&x[0]`
| help: consider
borrowing here
: `&x[0]`
LL | //~^ ERROR
LL | B::U(d) => (),
| -
move occurs because d has type `D`, which does not implement the `Copy` trait
| -
data moved here
LL | B::V(s) => (),
| - move occurs because s has type `std::string::String`, which does not implement the `Copy` trait
| - ...and here
|
note: move occurs because these variables have types that don't implement the `Copy` trait
--> $DIR/move-errors.rs:89:14
|
LL | B::U(d) => (),
| ^
LL | B::V(s) => (),
| ^
error[E0509]: cannot move out of type `D`, which implements the `Drop` trait
--> $DIR/move-errors.rs:96:11
...
...
@@ -89,10 +108,13 @@ LL | match x {
| ^ cannot move out of here
...
LL | B::U(D(s)) => (),
| -
| |
| data moved here
| help: to prevent move, use ref or ref mut: `ref s`
| - data moved here
|
note: move occurs because `s` has type `std::string::String`, which does not implement the `Copy` trait
--> $DIR/move-errors.rs:99:16
|
LL | B::U(D(s)) => (),
| ^
error[E0509]: cannot move out of type `D`, which implements the `Drop` trait
--> $DIR/move-errors.rs:105:11
...
...
@@ -101,10 +123,13 @@ LL | match x {
| ^ cannot move out of here
...
LL | (D(s), &t) => (),
| -
| |
| data moved here
| help: to prevent move, use ref or ref mut: `ref s`
| - data moved here
|
note: move occurs because `s` has type `std::string::String`, which does not implement the `Copy` trait
--> $DIR/move-errors.rs:108:12
|
LL | (D(s), &t) => (),
| ^
error[E0507]: cannot move out of borrowed content
--> $DIR/move-errors.rs:105:11
...
...
@@ -113,10 +138,13 @@ LL | match x {
| ^ cannot move out of borrowed content
...
LL | (D(s), &t) => (),
| -
| |
| data moved here
| help: to prevent move, use ref or ref mut: `ref t`
| - data moved here
|
note: move occurs because `t` has type `std::string::String`, which does not implement the `Copy` trait
--> $DIR/move-errors.rs:108:17
|
LL | (D(s), &t) => (),
| ^
error[E0509]: cannot move out of type `F`, which implements the `Drop` trait
--> $DIR/move-errors.rs:115:11
...
...
@@ -125,13 +153,15 @@ LL | match x {
| ^ cannot move out of here
LL | //~^ ERROR
LL | F(s, mut t) => (),
| - ----- ...
and here
| - ----- ...and here
| |
| data moved here
help: to prevent move, use ref or ref mut
|
LL | F(ref s, ref mut t) => (),
| ^^^^^ ^^^^^^^^^
note: move occurs because these variables have types that don't implement the `Copy` trait
--> $DIR/move-errors.rs:117:11
|
LL | F(s, mut t) => (),
| ^ ^^^^^
error[E0507]: cannot move out of borrowed content
--> $DIR/move-errors.rs:123:11
...
...
@@ -140,10 +170,16 @@ LL | match *x {
| ^^
| |
| cannot move out of borrowed content
| help: consider removing th
is dereference operator
: `x`
| help: consider removing th
e `*`
: `x`
LL | //~^ ERROR
LL | Ok(s) | Err(s) => (),
| - move occurs because s has type `std::string::String`, which does not implement the `Copy` trait
| - data moved here
|
note: move occurs because `s` has type `std::string::String`, which does not implement the `Copy` trait
--> $DIR/move-errors.rs:125:12
|
LL | Ok(s) | Err(s) => (),
| ^
error: aborting due to 14 previous errors
...
...
src/test/ui/suggestions/dont-suggest-ref.stderr
浏览文件 @
9a0020a8
...
...
@@ -524,7 +524,7 @@ LL | &mut Either::One(_t) => (),
| -- data moved here
...
LL | &mut Either::Two(_t) => (),
| -- ...
and here
| -- ...and here
|
note: move occurs because these variables have types that don't implement the `Copy` trait
--> $DIR/dont-suggest-ref.rs:233:26
...
...
@@ -705,7 +705,7 @@ LL | //~^ ERROR cannot move
LL | (&mut Either::One(_t),) => (),
| -- data moved here
LL | (&mut Either::Two(_t),) => (),
| -- ...
and here
| -- ...and here
|
note: move occurs because these variables have types that don't implement the `Copy` trait
--> $DIR/dont-suggest-ref.rs:290:27
...
...
@@ -937,7 +937,7 @@ error[E0507]: cannot move out of borrowed content
LL | let &(X(_t), X(_u)) = &(x.clone(), x.clone());
| --------------- ^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of borrowed content
| | | |
| | | ...
and here
| | | ...and here
| | data moved here
| help: consider removing the `&`: `(X(_t), X(_u))`
|
...
...
@@ -953,7 +953,7 @@ error[E0507]: cannot move out of borrowed content
LL | if let &(Either::One(_t), Either::Two(_u)) = &(e.clone(), e.clone()) { }
| ----------------------------------- ^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of borrowed content
| | | |
| | | ...
and here
| | | ...and here
| | data moved here
| help: consider removing the `&`: `(Either::One(_t), Either::Two(_u))`
|
...
...
@@ -969,7 +969,7 @@ error[E0507]: cannot move out of borrowed content
LL | while let &(Either::One(_t), Either::Two(_u)) = &(e.clone(), e.clone()) { }
| ----------------------------------- ^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of borrowed content
| | | |
| | | ...
and here
| | | ...and here
| | data moved here
| help: consider removing the `&`: `(Either::One(_t), Either::Two(_u))`
|
...
...
@@ -986,12 +986,12 @@ LL | match &(e.clone(), e.clone()) {
| ^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of borrowed content
LL | //~^ ERROR cannot move
LL | &(Either::One(_t), Either::Two(_u)) => (),
| -- -- ...
and here
| -- -- ...and here
| |
| data moved here
...
LL | &(Either::Two(_t), Either::One(_u)) => (),
| -- ...
and here -- ...
and here
| -- ...
and here -- ...
and here
|
note: move occurs because these variables have types that don't implement the `Copy` trait
--> $DIR/dont-suggest-ref.rs:391:23
...
...
@@ -1019,7 +1019,7 @@ LL | //~^ ERROR cannot move
LL | &(Either::One(_t), Either::Two(_u))
| -----------------------------------
| | | |
| | | ...
and here
| | | ...and here
| | data moved here
| help: consider removing the `&`: `(Either::One(_t), Either::Two(_u))`
|
...
...
@@ -1038,7 +1038,7 @@ LL | //~^ ERROR cannot move
LL | &(Either::One(_t), Either::Two(_u)) => (),
| -----------------------------------
| | | |
| | | ...
and here
| | | ...and here
| | data moved here
| help: consider removing the `&`: `(Either::One(_t), Either::Two(_u))`
|
...
...
@@ -1057,7 +1057,7 @@ LL | //~^ ERROR cannot move
LL | &(Either::One(_t), Either::Two(_u)) => (),
| -----------------------------------
| | | |
| | | ...
and here
| | | ...and here
| | data moved here
| help: consider removing the `&`: `(Either::One(_t), Either::Two(_u))`
|
...
...
@@ -1073,7 +1073,7 @@ error[E0507]: cannot move out of borrowed content
LL | let &mut (X(_t), X(_u)) = &mut (xm.clone(), xm.clone());
| ------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of borrowed content
| | | |
| | | ...
and here
| | | ...and here
| | data moved here
| help: consider removing the `&mut`: `(X(_t), X(_u))`
|
...
...
@@ -1089,7 +1089,7 @@ error[E0507]: cannot move out of borrowed content
LL | if let &mut (Either::One(_t), Either::Two(_u)) = &mut (em.clone(), em.clone()) { }
| --------------------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of borrowed content
| | | |
| | | ...
and here
| | | ...and here
| | data moved here
| help: consider removing the `&mut`: `(Either::One(_t), Either::Two(_u))`
|
...
...
@@ -1105,7 +1105,7 @@ error[E0507]: cannot move out of borrowed content
LL | while let &mut (Either::One(_t), Either::Two(_u)) = &mut (em.clone(), em.clone()) { }
| --------------------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of borrowed content
| | | |
| | | ...
and here
| | | ...and here
| | data moved here
| help: consider removing the `&mut`: `(Either::One(_t), Either::Two(_u))`
|
...
...
@@ -1122,12 +1122,12 @@ LL | match &mut (em.clone(), em.clone()) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of borrowed content
LL | //~^ ERROR cannot move
LL | &mut (Either::One(_t), Either::Two(_u)) => (),
| -- -- ...
and here
| -- -- ...and here
| |
| data moved here
...
LL | &mut (Either::Two(_t), Either::One(_u)) => (),
| -- ...
and here -- ...
and here
| -- ...
and here -- ...
and here
|
note: move occurs because these variables have types that don't implement the `Copy` trait
--> $DIR/dont-suggest-ref.rs:443:27
...
...
@@ -1155,7 +1155,7 @@ LL | //~^ ERROR cannot move
LL | &mut (Either::One(_t), Either::Two(_u))
| ---------------------------------------
| | | |
| | | ...
and here
| | | ...and here
| | data moved here
| help: consider removing the `&mut`: `(Either::One(_t), Either::Two(_u))`
|
...
...
@@ -1174,7 +1174,7 @@ LL | //~^ ERROR cannot move
LL | &mut (Either::One(_t), Either::Two(_u)) => (),
| ---------------------------------------
| | | |
| | | ...
and here
| | | ...and here
| | data moved here
| help: consider removing the `&mut`: `(Either::One(_t), Either::Two(_u))`
|
...
...
@@ -1193,7 +1193,7 @@ LL | //~^ ERROR cannot move
LL | &mut (Either::One(_t), Either::Two(_u)) => (),
| ---------------------------------------
| | | |
| | | ...
and here
| | | ...and here
| | data moved here
| help: consider removing the `&mut`: `(Either::One(_t), Either::Two(_u))`
|
...
...
@@ -1212,7 +1212,7 @@ LL | //~^ ERROR cannot move
LL | &mut (Either::One(_t), Either::Two(_u)) => (),
| ---------------------------------------
| | | |
| | | ...
and here
| | | ...and here
| | data moved here
| help: consider removing the `&mut`: `(Either::One(_t), Either::Two(_u))`
|
...
...
@@ -1290,7 +1290,7 @@ error[E0507]: cannot move out of borrowed content
LL | fn f5(&(X(_t), X(_u)): &(X, X)) { }
| ^^^^--^^^^^--^^
| | | |
| | | ...
and here
| | | ...and here
| | data moved here
| cannot move out of borrowed content
| help: consider removing the `&`: `(X(_t), X(_u))`
...
...
@@ -1307,7 +1307,7 @@ error[E0507]: cannot move out of borrowed content
LL | fn f6(&mut (X(_t), X(_u)): &mut (X, X)) { }
| ^^^^^^^^--^^^^^--^^
| | | |
| | | ...
and here
| | | ...and here
| | data moved here
| cannot move out of borrowed content
| help: consider removing the `&mut`: `(X(_t), X(_u))`
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录