Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
58e4b54b
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,发现更多精彩内容 >>
提交
58e4b54b
编写于
8月 14, 2018
作者:
N
Niko Matsakis
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
move tests to borrowck directory, remove feature(nll)
now compare-mode can show us the differences
上级
4e50c5b6
变更
16
隐藏空白更改
内联
并排
Showing
16 changed file
with
173 addition
and
52 deletion
+173
-52
src/test/ui/borrowck/assign_mutable_fields.nll.stderr
src/test/ui/borrowck/assign_mutable_fields.nll.stderr
+1
-1
src/test/ui/borrowck/assign_mutable_fields.rs
src/test/ui/borrowck/assign_mutable_fields.rs
+2
-4
src/test/ui/borrowck/assign_mutable_fields.stderr
src/test/ui/borrowck/assign_mutable_fields.stderr
+21
-0
src/test/ui/borrowck/reassignment_immutable_fields.nll.stderr
...test/ui/borrowck/reassignment_immutable_fields.nll.stderr
+5
-5
src/test/ui/borrowck/reassignment_immutable_fields.rs
src/test/ui/borrowck/reassignment_immutable_fields.rs
+2
-4
src/test/ui/borrowck/reassignment_immutable_fields.stderr
src/test/ui/borrowck/reassignment_immutable_fields.stderr
+56
-0
src/test/ui/borrowck/reassignment_immutable_fields_overlapping.nll.stderr
...owck/reassignment_immutable_fields_overlapping.nll.stderr
+2
-2
src/test/ui/borrowck/reassignment_immutable_fields_overlapping.rs
.../ui/borrowck/reassignment_immutable_fields_overlapping.rs
+0
-2
src/test/ui/borrowck/reassignment_immutable_fields_overlapping.stderr
...borrowck/reassignment_immutable_fields_overlapping.stderr
+20
-0
src/test/ui/borrowck/reassignment_immutable_fields_twice.nll.stderr
...i/borrowck/reassignment_immutable_fields_twice.nll.stderr
+4
-4
src/test/ui/borrowck/reassignment_immutable_fields_twice.rs
src/test/ui/borrowck/reassignment_immutable_fields_twice.rs
+0
-2
src/test/ui/borrowck/reassignment_immutable_fields_twice.stderr
...st/ui/borrowck/reassignment_immutable_fields_twice.stderr
+38
-0
src/test/ui/immut-function-arguments.ast.nll.stderr
src/test/ui/immut-function-arguments.ast.nll.stderr
+7
-7
src/test/ui/immut-function-arguments.mir.stderr
src/test/ui/immut-function-arguments.mir.stderr
+7
-7
src/test/ui/mut/mutable-class-fields.ast.nll.stderr
src/test/ui/mut/mutable-class-fields.ast.nll.stderr
+4
-7
src/test/ui/mut/mutable-class-fields.mir.stderr
src/test/ui/mut/mutable-class-fields.mir.stderr
+4
-7
未找到文件。
src/test/ui/
nll/assign_mutable_fields
.stderr
→
src/test/ui/
borrowck/assign_mutable_fields.nll
.stderr
浏览文件 @
58e4b54b
error[E0381]: use of possibly uninitialized variable: `x`
--> $DIR/assign_mutable_fields.rs:
31
:10
--> $DIR/assign_mutable_fields.rs:
29
:10
|
LL | drop(x); //~ ERROR
| ^ use of possibly uninitialized `x`
...
...
src/test/ui/
nll
/assign_mutable_fields.rs
→
src/test/ui/
borrowck
/assign_mutable_fields.rs
浏览文件 @
58e4b54b
...
...
@@ -14,14 +14,12 @@
//
// FIXME(#21232)
#![feature(nll)]
fn
assign_both_fields_and_use
()
{
let
mut
x
:
(
u32
,
u32
);
x
.0
=
1
;
x
.1
=
22
;
drop
(
x
.0
);
drop
(
x
.1
);
drop
(
x
.0
);
//~ ERROR
drop
(
x
.1
);
//~ ERROR
}
fn
assign_both_fields_the_use_var
()
{
...
...
src/test/ui/borrowck/assign_mutable_fields.stderr
0 → 100644
浏览文件 @
58e4b54b
error[E0381]: use of possibly uninitialized variable: `x.0`
--> $DIR/assign_mutable_fields.rs:21:10
|
LL | drop(x.0); //~ ERROR
| ^^^ use of possibly uninitialized `x.0`
error[E0381]: use of possibly uninitialized variable: `x.1`
--> $DIR/assign_mutable_fields.rs:22:10
|
LL | drop(x.1); //~ ERROR
| ^^^ use of possibly uninitialized `x.1`
error[E0381]: use of possibly uninitialized variable: `x`
--> $DIR/assign_mutable_fields.rs:29:10
|
LL | drop(x); //~ ERROR
| ^ use of possibly uninitialized `x`
error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0381`.
src/test/ui/
nll/reassignment_immutable_fields
.stderr
→
src/test/ui/
borrowck/reassignment_immutable_fields.nll
.stderr
浏览文件 @
58e4b54b
error[E0594]: cannot assign to `x.0`, as `x` is not declared as mutable
--> $DIR/reassignment_immutable_fields.rs:1
9
:5
--> $DIR/reassignment_immutable_fields.rs:1
7
:5
|
LL | let x: (u32, u32);
| - help: consider changing this to be mutable: `mut x`
...
...
@@ -7,7 +7,7 @@ LL | x.0 = 1; //~ ERROR
| ^^^^^^^ cannot assign
error[E0594]: cannot assign to `x.1`, as `x` is not declared as mutable
--> $DIR/reassignment_immutable_fields.rs:
20
:5
--> $DIR/reassignment_immutable_fields.rs:
18
:5
|
LL | let x: (u32, u32);
| - help: consider changing this to be mutable: `mut x`
...
...
@@ -16,7 +16,7 @@ LL | x.1 = 22; //~ ERROR
| ^^^^^^^^ cannot assign
error[E0594]: cannot assign to `x.0`, as `x` is not declared as mutable
--> $DIR/reassignment_immutable_fields.rs:2
7
:5
--> $DIR/reassignment_immutable_fields.rs:2
5
:5
|
LL | let x: (u32, u32);
| - help: consider changing this to be mutable: `mut x`
...
...
@@ -24,7 +24,7 @@ LL | x.0 = 1; //~ ERROR
| ^^^^^^^ cannot assign
error[E0594]: cannot assign to `x.1`, as `x` is not declared as mutable
--> $DIR/reassignment_immutable_fields.rs:2
8
:5
--> $DIR/reassignment_immutable_fields.rs:2
6
:5
|
LL | let x: (u32, u32);
| - help: consider changing this to be mutable: `mut x`
...
...
@@ -33,7 +33,7 @@ LL | x.1 = 22; //~ ERROR
| ^^^^^^^^ cannot assign
error[E0381]: use of possibly uninitialized variable: `x`
--> $DIR/reassignment_immutable_fields.rs:2
9
:10
--> $DIR/reassignment_immutable_fields.rs:2
7
:10
|
LL | drop(x); //~ ERROR
| ^ use of possibly uninitialized `x`
...
...
src/test/ui/
nll
/reassignment_immutable_fields.rs
→
src/test/ui/
borrowck
/reassignment_immutable_fields.rs
浏览文件 @
58e4b54b
...
...
@@ -12,14 +12,12 @@
//
// FIXME(#21232)
#![feature(nll)]
fn
assign_both_fields_and_use
()
{
let
x
:
(
u32
,
u32
);
x
.0
=
1
;
//~ ERROR
x
.1
=
22
;
//~ ERROR
drop
(
x
.0
);
drop
(
x
.1
);
drop
(
x
.0
);
//~ ERROR
drop
(
x
.1
);
//~ ERROR
}
fn
assign_both_fields_the_use_var
()
{
...
...
src/test/ui/borrowck/reassignment_immutable_fields.stderr
0 → 100644
浏览文件 @
58e4b54b
error[E0594]: cannot assign to field `x.0` of immutable binding
--> $DIR/reassignment_immutable_fields.rs:17:5
|
LL | let x: (u32, u32);
| - consider changing this to `mut x`
LL | x.0 = 1; //~ ERROR
| ^^^^^^^ cannot mutably borrow field of immutable binding
error[E0594]: cannot assign to field `x.1` of immutable binding
--> $DIR/reassignment_immutable_fields.rs:18:5
|
LL | let x: (u32, u32);
| - consider changing this to `mut x`
LL | x.0 = 1; //~ ERROR
LL | x.1 = 22; //~ ERROR
| ^^^^^^^^ cannot mutably borrow field of immutable binding
error[E0381]: use of possibly uninitialized variable: `x.0`
--> $DIR/reassignment_immutable_fields.rs:19:10
|
LL | drop(x.0); //~ ERROR
| ^^^ use of possibly uninitialized `x.0`
error[E0381]: use of possibly uninitialized variable: `x.1`
--> $DIR/reassignment_immutable_fields.rs:20:10
|
LL | drop(x.1); //~ ERROR
| ^^^ use of possibly uninitialized `x.1`
error[E0594]: cannot assign to field `x.0` of immutable binding
--> $DIR/reassignment_immutable_fields.rs:25:5
|
LL | let x: (u32, u32);
| - consider changing this to `mut x`
LL | x.0 = 1; //~ ERROR
| ^^^^^^^ cannot mutably borrow field of immutable binding
error[E0594]: cannot assign to field `x.1` of immutable binding
--> $DIR/reassignment_immutable_fields.rs:26:5
|
LL | let x: (u32, u32);
| - consider changing this to `mut x`
LL | x.0 = 1; //~ ERROR
LL | x.1 = 22; //~ ERROR
| ^^^^^^^^ cannot mutably borrow field of immutable binding
error[E0381]: use of possibly uninitialized variable: `x`
--> $DIR/reassignment_immutable_fields.rs:27:10
|
LL | drop(x); //~ ERROR
| ^ use of possibly uninitialized `x`
error: aborting due to 7 previous errors
Some errors occurred: E0381, E0594.
For more information about an error, try `rustc --explain E0381`.
src/test/ui/
nll/reassignment_immutable_fields_overlapping
.stderr
→
src/test/ui/
borrowck/reassignment_immutable_fields_overlapping.nll
.stderr
浏览文件 @
58e4b54b
error[E0594]: cannot assign to `x.a`, as `x` is not declared as mutable
--> $DIR/reassignment_immutable_fields_overlapping.rs:2
4
:5
--> $DIR/reassignment_immutable_fields_overlapping.rs:2
2
:5
|
LL | let x: Foo;
| - help: consider changing this to be mutable: `mut x`
...
...
@@ -7,7 +7,7 @@ LL | x.a = 1; //~ ERROR
| ^^^^^^^ cannot assign
error[E0594]: cannot assign to `x.b`, as `x` is not declared as mutable
--> $DIR/reassignment_immutable_fields_overlapping.rs:2
5
:5
--> $DIR/reassignment_immutable_fields_overlapping.rs:2
3
:5
|
LL | let x: Foo;
| - help: consider changing this to be mutable: `mut x`
...
...
src/test/ui/
nll
/reassignment_immutable_fields_overlapping.rs
→
src/test/ui/
borrowck
/reassignment_immutable_fields_overlapping.rs
浏览文件 @
58e4b54b
...
...
@@ -12,8 +12,6 @@
// overlapping, so since `x` is not `mut` we should not permit
// reassignment.
#![feature(nll)]
union
Foo
{
a
:
u32
,
b
:
u32
,
...
...
src/test/ui/borrowck/reassignment_immutable_fields_overlapping.stderr
0 → 100644
浏览文件 @
58e4b54b
error[E0594]: cannot assign to field `x.a` of immutable binding
--> $DIR/reassignment_immutable_fields_overlapping.rs:22:5
|
LL | let x: Foo;
| - consider changing this to `mut x`
LL | x.a = 1; //~ ERROR
| ^^^^^^^ cannot mutably borrow field of immutable binding
error[E0594]: cannot assign to field `x.b` of immutable binding
--> $DIR/reassignment_immutable_fields_overlapping.rs:23:5
|
LL | let x: Foo;
| - consider changing this to `mut x`
LL | x.a = 1; //~ ERROR
LL | x.b = 22; //~ ERROR
| ^^^^^^^^ cannot mutably borrow field of immutable binding
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0594`.
src/test/ui/
nll/reassignment_immutable_fields_twice
.stderr
→
src/test/ui/
borrowck/reassignment_immutable_fields_twice.nll
.stderr
浏览文件 @
58e4b54b
error[E0594]: cannot assign to `x.0`, as `x` is not declared as mutable
--> $DIR/reassignment_immutable_fields_twice.rs:1
9
:5
--> $DIR/reassignment_immutable_fields_twice.rs:1
7
:5
|
LL | let x: (u32, u32);
| - help: consider changing this to be mutable: `mut x`
...
...
@@ -8,7 +8,7 @@ LL | x.0 = 1; //~ ERROR
| ^^^^^^^ cannot assign
error[E0594]: cannot assign to `x.0`, as `x` is not declared as mutable
--> $DIR/reassignment_immutable_fields_twice.rs:2
4
:5
--> $DIR/reassignment_immutable_fields_twice.rs:2
2
:5
|
LL | let x: (u32, u32);
| - help: consider changing this to be mutable: `mut x`
...
...
@@ -16,7 +16,7 @@ LL | x.0 = 1; //~ ERROR
| ^^^^^^^ cannot assign
error[E0594]: cannot assign to `x.0`, as `x` is not declared as mutable
--> $DIR/reassignment_immutable_fields_twice.rs:2
5
:5
--> $DIR/reassignment_immutable_fields_twice.rs:2
3
:5
|
LL | let x: (u32, u32);
| - help: consider changing this to be mutable: `mut x`
...
...
@@ -25,7 +25,7 @@ LL | x.0 = 22; //~ ERROR
| ^^^^^^^^ cannot assign
error[E0594]: cannot assign to `x.1`, as `x` is not declared as mutable
--> $DIR/reassignment_immutable_fields_twice.rs:2
6
:5
--> $DIR/reassignment_immutable_fields_twice.rs:2
4
:5
|
LL | let x: (u32, u32);
| - help: consider changing this to be mutable: `mut x`
...
...
src/test/ui/
nll
/reassignment_immutable_fields_twice.rs
→
src/test/ui/
borrowck
/reassignment_immutable_fields_twice.rs
浏览文件 @
58e4b54b
...
...
@@ -11,8 +11,6 @@
// This should never be allowed -- since `x` is not `mut`, so `x.0`
// cannot be assigned twice.
#![feature(nll)]
fn
var_then_field
()
{
let
x
:
(
u32
,
u32
);
x
=
(
22
,
44
);
...
...
src/test/ui/borrowck/reassignment_immutable_fields_twice.stderr
0 → 100644
浏览文件 @
58e4b54b
error[E0594]: cannot assign to field `x.0` of immutable binding
--> $DIR/reassignment_immutable_fields_twice.rs:17:5
|
LL | let x: (u32, u32);
| - consider changing this to `mut x`
LL | x = (22, 44);
LL | x.0 = 1; //~ ERROR
| ^^^^^^^ cannot mutably borrow field of immutable binding
error[E0594]: cannot assign to field `x.0` of immutable binding
--> $DIR/reassignment_immutable_fields_twice.rs:22:5
|
LL | let x: (u32, u32);
| - consider changing this to `mut x`
LL | x.0 = 1; //~ ERROR
| ^^^^^^^ cannot mutably borrow field of immutable binding
error[E0594]: cannot assign to field `x.0` of immutable binding
--> $DIR/reassignment_immutable_fields_twice.rs:23:5
|
LL | let x: (u32, u32);
| - consider changing this to `mut x`
LL | x.0 = 1; //~ ERROR
LL | x.0 = 22; //~ ERROR
| ^^^^^^^^ cannot mutably borrow field of immutable binding
error[E0594]: cannot assign to field `x.1` of immutable binding
--> $DIR/reassignment_immutable_fields_twice.rs:24:5
|
LL | let x: (u32, u32);
| - consider changing this to `mut x`
...
LL | x.1 = 44; //~ ERROR
| ^^^^^^^^ cannot mutably borrow field of immutable binding
error: aborting due to 4 previous errors
For more information about this error, try `rustc --explain E0594`.
src/test/ui/immut-function-arguments.ast.nll.stderr
浏览文件 @
58e4b54b
error[E0
384]: cannot assign to immutable argument `y`
error[E0
594]: cannot assign to `*y`, as `y` is not declared as mutable
--> $DIR/immut-function-arguments.rs:15:5
|
LL | fn f(y: Box<isize>) {
| -
consider changing this to
`mut y`
| -
help: consider changing this to be mutable:
`mut y`
LL | *y = 5; //[ast]~ ERROR cannot assign
| ^^^^^^ cannot assign
to immutable argument
| ^^^^^^ cannot assign
error[E0
384]: cannot assign to immutable argument `q`
error[E0
594]: cannot assign to `*q`, as `q` is not declared as mutable
--> $DIR/immut-function-arguments.rs:20:35
|
LL | let _frob = |q: Box<isize>| { *q = 2; }; //[ast]~ ERROR cannot assign
| - ^^^^^^ cannot assign
to immutable argument
| - ^^^^^^ cannot assign
| |
|
consider changing this to
`mut q`
|
help: consider changing this to be mutable:
`mut q`
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0
38
4`.
For more information about this error, try `rustc --explain E0
59
4`.
src/test/ui/immut-function-arguments.mir.stderr
浏览文件 @
58e4b54b
error[E0
384]: cannot assign to immutable argument `y`
error[E0
594]: cannot assign to `*y`, as `y` is not declared as mutable
--> $DIR/immut-function-arguments.rs:15:5
|
LL | fn f(y: Box<isize>) {
| -
consider changing this to
`mut y`
| -
help: consider changing this to be mutable:
`mut y`
LL | *y = 5; //[ast]~ ERROR cannot assign
| ^^^^^^ cannot assign
to immutable argument
| ^^^^^^ cannot assign
error[E0
384]: cannot assign to immutable argument `q`
error[E0
594]: cannot assign to `*q`, as `q` is not declared as mutable
--> $DIR/immut-function-arguments.rs:20:35
|
LL | let _frob = |q: Box<isize>| { *q = 2; }; //[ast]~ ERROR cannot assign
| - ^^^^^^ cannot assign
to immutable argument
| - ^^^^^^ cannot assign
| |
|
consider changing this to
`mut q`
|
help: consider changing this to be mutable:
`mut q`
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0
38
4`.
For more information about this error, try `rustc --explain E0
59
4`.
src/test/ui/mut/mutable-class-fields.ast.nll.stderr
浏览文件 @
58e4b54b
error[E0
384]: cannot assign twice to immutable variable `nyan`
error[E0
594]: cannot assign to `nyan.how_hungry`, as `nyan` is not declared as mutable
--> $DIR/mutable-class-fields.rs:28:3
|
LL | let nyan : cat = cat(52, 99);
| ----
| |
| first assignment to `nyan`
| consider changing this to `mut nyan`
| ---- help: consider changing this to be mutable: `mut nyan`
LL | nyan.how_hungry = 0; //[ast]~ ERROR cannot assign
| ^^^^^^^^^^^^^^^^^^^ cannot assign
twice to immutable variable
| ^^^^^^^^^^^^^^^^^^^ cannot assign
error: aborting due to previous error
For more information about this error, try `rustc --explain E0
38
4`.
For more information about this error, try `rustc --explain E0
59
4`.
src/test/ui/mut/mutable-class-fields.mir.stderr
浏览文件 @
58e4b54b
error[E0
384]: cannot assign twice to immutable variable `nyan`
error[E0
594]: cannot assign to `nyan.how_hungry`, as `nyan` is not declared as mutable
--> $DIR/mutable-class-fields.rs:28:3
|
LL | let nyan : cat = cat(52, 99);
| ----
| |
| first assignment to `nyan`
| consider changing this to `mut nyan`
| ---- help: consider changing this to be mutable: `mut nyan`
LL | nyan.how_hungry = 0; //[ast]~ ERROR cannot assign
| ^^^^^^^^^^^^^^^^^^^ cannot assign
twice to immutable variable
| ^^^^^^^^^^^^^^^^^^^ cannot assign
error: aborting due to previous error
For more information about this error, try `rustc --explain E0
38
4`.
For more information about this error, try `rustc --explain E0
59
4`.
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录