Skip to content

Commit

Permalink
Moved compile-fail tests to ui tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
davidtwco committed Aug 14, 2018
1 parent fe28bcf commit b16a306
Show file tree
Hide file tree
Showing 4,052 changed files with 59,249 additions and 0 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
File renamed without changes.
31 changes: 31 additions & 0 deletions src/test/ui/compile-fail-migration/E0501.ast.nll.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
error[E0501]: cannot borrow `*a` as mutable because previous closure requires unique access
--> $DIR/E0501.rs:28:23
|
LL | let bar = || {
| -- closure construction occurs here
LL | inside_closure(a)
| - first borrow occurs due to use of `a` in closure
LL | };
LL | outside_closure_1(a); //[ast]~ ERROR cannot borrow `*a` as mutable because previous closure requires unique access
| ^ borrow occurs here
...
LL | drop(bar);
| --- borrow later used here

error[E0501]: cannot borrow `*a` as immutable because previous closure requires unique access
--> $DIR/E0501.rs:31:23
|
LL | let bar = || {
| -- closure construction occurs here
LL | inside_closure(a)
| - first borrow occurs due to use of `a` in closure
...
LL | outside_closure_2(a); //[ast]~ ERROR cannot borrow `*a` as immutable because previous closure requires unique access
| ^ borrow occurs here
...
LL | drop(bar);
| --- borrow later used here

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0501`.
31 changes: 31 additions & 0 deletions src/test/ui/compile-fail-migration/E0501.ast.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
error[E0501]: cannot borrow `*a` as mutable because previous closure requires unique access
--> $DIR/E0501.rs:28:23
|
LL | let bar = || {
| -- closure construction occurs here
LL | inside_closure(a)
| - previous borrow occurs due to use of `a` in closure
LL | };
LL | outside_closure_1(a); //[ast]~ ERROR cannot borrow `*a` as mutable because previous closure requires unique access
| ^ borrow occurs here
...
LL | }
| - borrow from closure ends here

error[E0501]: cannot borrow `*a` as immutable because previous closure requires unique access
--> $DIR/E0501.rs:31:23
|
LL | let bar = || {
| -- closure construction occurs here
LL | inside_closure(a)
| - previous borrow occurs due to use of `a` in closure
...
LL | outside_closure_2(a); //[ast]~ ERROR cannot borrow `*a` as immutable because previous closure requires unique access
| ^ borrow occurs here
...
LL | }
| - borrow from closure ends here

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0501`.
31 changes: 31 additions & 0 deletions src/test/ui/compile-fail-migration/E0501.mir.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
error[E0501]: cannot borrow `*a` as mutable because previous closure requires unique access
--> $DIR/E0501.rs:28:23
|
LL | let bar = || {
| -- closure construction occurs here
LL | inside_closure(a)
| - first borrow occurs due to use of `a` in closure
LL | };
LL | outside_closure_1(a); //[ast]~ ERROR cannot borrow `*a` as mutable because previous closure requires unique access
| ^ borrow occurs here
...
LL | drop(bar);
| --- borrow later used here

error[E0501]: cannot borrow `*a` as immutable because previous closure requires unique access
--> $DIR/E0501.rs:31:23
|
LL | let bar = || {
| -- closure construction occurs here
LL | inside_closure(a)
| - first borrow occurs due to use of `a` in closure
...
LL | outside_closure_2(a); //[ast]~ ERROR cannot borrow `*a` as immutable because previous closure requires unique access
| ^ borrow occurs here
...
LL | drop(bar);
| --- borrow later used here

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0501`.
File renamed without changes.
14 changes: 14 additions & 0 deletions src/test/ui/compile-fail-migration/E0506.ast.nll.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
error[E0506]: cannot assign to `fancy_num` because it is borrowed
--> $DIR/E0506.rs:21:5
|
LL | let fancy_ref = &fancy_num;
| ---------- borrow of `fancy_num` occurs here
LL | fancy_num = FancyNum { num: 6 }; //[ast]~ ERROR E0506
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ assignment to borrowed `fancy_num` occurs here
...
LL | println!("Num: {}, Ref: {}", fancy_num.num, fancy_ref.num);
| ------------- borrow later used here

error: aborting due to previous error

For more information about this error, try `rustc --explain E0506`.
11 changes: 11 additions & 0 deletions src/test/ui/compile-fail-migration/E0506.ast.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
error[E0506]: cannot assign to `fancy_num` because it is borrowed
--> $DIR/E0506.rs:21:5
|
LL | let fancy_ref = &fancy_num;
| --------- borrow of `fancy_num` occurs here
LL | fancy_num = FancyNum { num: 6 }; //[ast]~ ERROR E0506
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ assignment to borrowed `fancy_num` occurs here

error: aborting due to previous error

For more information about this error, try `rustc --explain E0506`.
14 changes: 14 additions & 0 deletions src/test/ui/compile-fail-migration/E0506.mir.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
error[E0506]: cannot assign to `fancy_num` because it is borrowed
--> $DIR/E0506.rs:21:5
|
LL | let fancy_ref = &fancy_num;
| ---------- borrow of `fancy_num` occurs here
LL | fancy_num = FancyNum { num: 6 }; //[ast]~ ERROR E0506
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ assignment to borrowed `fancy_num` occurs here
...
LL | println!("Num: {}, Ref: {}", fancy_num.num, fancy_ref.num);
| ------------- borrow later used here

error: aborting due to previous error

For more information about this error, try `rustc --explain E0506`.
File renamed without changes.
12 changes: 12 additions & 0 deletions src/test/ui/compile-fail-migration/E0508.ast.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
error[E0508]: cannot move out of type `[NonCopy; 1]`, a non-copy array
--> $DIR/E0508.rs:18:18
|
LL | let _value = array[0]; //[ast]~ ERROR [E0508]
| ^^^^^^^^
| |
| cannot move out of here
| help: consider using a reference instead: `&array[0]`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0508`.
12 changes: 12 additions & 0 deletions src/test/ui/compile-fail-migration/E0508.mir.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
error[E0508]: cannot move out of type `[NonCopy; 1]`, a non-copy array
--> $DIR/E0508.rs:18:18
|
LL | let _value = array[0]; //[ast]~ ERROR [E0508]
| ^^^^^^^^
| |
| cannot move out of here
| help: consider using a reference instead: `&array[0]`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0508`.
File renamed without changes.
File renamed without changes.
11 changes: 11 additions & 0 deletions src/test/ui/compile-fail-migration/E0583.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
error[E0583]: file not found for module `module_that_doesnt_exist`
--> $DIR/E0583.rs:11:5
|
LL | mod module_that_doesnt_exist; //~ ERROR E0583
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: name the file either module_that_doesnt_exist.rs or module_that_doesnt_exist/mod.rs inside the directory "$DIR"

error: aborting due to previous error

For more information about this error, try `rustc --explain E0583`.
9 changes: 9 additions & 0 deletions src/test/ui/compile-fail-migration/E0594.ast.nll.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
error[E0594]: cannot assign to immutable static item `NUM`
--> $DIR/E0594.rs:17:5
|
LL | NUM = 20; //[ast]~ ERROR E0594
| ^^^^^^^^ cannot assign

error: aborting due to previous error

For more information about this error, try `rustc --explain E0594`.
9 changes: 9 additions & 0 deletions src/test/ui/compile-fail-migration/E0594.ast.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
error[E0594]: cannot assign to immutable static item
--> $DIR/E0594.rs:17:5
|
LL | NUM = 20; //[ast]~ ERROR E0594
| ^^^^^^^^

error: aborting due to previous error

For more information about this error, try `rustc --explain E0594`.
9 changes: 9 additions & 0 deletions src/test/ui/compile-fail-migration/E0594.mir.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
error[E0594]: cannot assign to immutable static item `NUM`
--> $DIR/E0594.rs:17:5
|
LL | NUM = 20; //[ast]~ ERROR E0594
| ^^^^^^^^ cannot assign

error: aborting due to previous error

For more information about this error, try `rustc --explain E0594`.
File renamed without changes.
11 changes: 11 additions & 0 deletions src/test/ui/compile-fail-migration/E0596.ast.nll.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable
--> $DIR/E0596.rs:16:13
|
LL | let x = 1;
| - help: consider changing this to be mutable: `mut x`
LL | let y = &mut x; //[ast]~ ERROR [E0596]
| ^^^^^^ cannot borrow as mutable

error: aborting due to previous error

For more information about this error, try `rustc --explain E0596`.
11 changes: 11 additions & 0 deletions src/test/ui/compile-fail-migration/E0596.ast.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
error[E0596]: cannot borrow immutable local variable `x` as mutable
--> $DIR/E0596.rs:16:18
|
LL | let x = 1;
| - consider changing this to `mut x`
LL | let y = &mut x; //[ast]~ ERROR [E0596]
| ^ cannot borrow mutably

error: aborting due to previous error

For more information about this error, try `rustc --explain E0596`.
11 changes: 11 additions & 0 deletions src/test/ui/compile-fail-migration/E0596.mir.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable
--> $DIR/E0596.rs:16:13
|
LL | let x = 1;
| - help: consider changing this to be mutable: `mut x`
LL | let y = &mut x; //[ast]~ ERROR [E0596]
| ^^^^^^ cannot borrow as mutable

error: aborting due to previous error

For more information about this error, try `rustc --explain E0596`.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
error[E0433]: failed to resolve. crate root in paths can only be used in start position
--> $DIR/absolute-paths-in-nested-use-groups.rs:16:5
|
LL | ::bar, //~ ERROR crate root in paths can only be used in start position
| ^ crate root in paths can only be used in start position

error[E0433]: failed to resolve. `super` in paths can only be used in start position
--> $DIR/absolute-paths-in-nested-use-groups.rs:17:5
|
LL | super::bar, //~ ERROR `super` in paths can only be used in start position
| ^^^^^ `super` in paths can only be used in start position

error[E0433]: failed to resolve. `self` in paths can only be used in start position
--> $DIR/absolute-paths-in-nested-use-groups.rs:18:5
|
LL | self::bar, //~ ERROR `self` in paths can only be used in start position
| ^^^^ `self` in paths can only be used in start position

error: aborting due to 3 previous errors

For more information about this error, try `rustc --explain E0433`.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
error[E0507]: cannot move out of borrowed content
--> $DIR/access-mode-in-closures.rs:19:15
|
LL | match *s { sty(v) => v } //~ ERROR cannot move out
| ^^ - move occurs because v has type `std::vec::Vec<isize>`, which does not implement the `Copy` trait
| |
| cannot move out of borrowed content
| help: consider removing this dereference operator: `s`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0507`.
11 changes: 11 additions & 0 deletions src/test/ui/compile-fail-migration/access-mode-in-closures.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
error[E0507]: cannot move out of borrowed content
--> $DIR/access-mode-in-closures.rs:19:15
|
LL | match *s { sty(v) => v } //~ ERROR cannot move out
| ^^ - hint: to prevent move, use `ref v` or `ref mut v`
| |
| cannot move out of borrowed content

error: aborting due to previous error

For more information about this error, try `rustc --explain E0507`.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
error: return type should be `!`
--> $DIR/alloc-error-handler-bad-signature-1.rs:22:6
|
LL | ) -> () //~ ERROR return type should be `!`
| ^^

error: argument should be `Layout`
--> $DIR/alloc-error-handler-bad-signature-1.rs:21:11
|
LL | info: &Layout, //~ ERROR argument should be `Layout`
| ^^^^^^^

error: aborting due to 2 previous errors

Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
error: return type should be `!`
--> $DIR/alloc-error-handler-bad-signature-2.rs:22:3
|
LL | ) { //~ ERROR return type should be `!`
| ^

error: argument should be `Layout`
--> $DIR/alloc-error-handler-bad-signature-2.rs:21:11
|
LL | info: Layout, //~ ERROR argument should be `Layout`
| ^^^^^^

error: aborting due to 2 previous errors

Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
error: function should have one argument
--> $DIR/alloc-error-handler-bad-signature-3.rs:20:1
|
LL | / fn oom() -> ! { //~ ERROR function should have one argument
LL | | loop {}
LL | | }
| |_^

error: aborting due to previous error

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
error: allocators must be statics
--> $DIR/function-allocator.rs:13:1
|
LL | fn foo() {} //~ ERROR: allocators must be statics
| ^^^^^^^^^^^

error: aborting due to previous error

Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
error[E0277]: the trait bound `usize: std::alloc::GlobalAlloc` is not satisfied
--> $DIR/not-an-allocator.rs:12:1
|
LL | static A: usize = 0;
| ^^^^^^^^^^^^^^^^^^^^ the trait `std::alloc::GlobalAlloc` is not implemented for `usize`
|
= note: required by `std::alloc::GlobalAlloc::alloc`

error[E0277]: the trait bound `usize: std::alloc::GlobalAlloc` is not satisfied
--> $DIR/not-an-allocator.rs:12:1
|
LL | static A: usize = 0;
| ^^^^^^^^^^^^^^^^^^^^ the trait `std::alloc::GlobalAlloc` is not implemented for `usize`
|
= note: required by `std::alloc::GlobalAlloc::dealloc`

error[E0277]: the trait bound `usize: std::alloc::GlobalAlloc` is not satisfied
--> $DIR/not-an-allocator.rs:12:1
|
LL | static A: usize = 0;
| ^^^^^^^^^^^^^^^^^^^^ the trait `std::alloc::GlobalAlloc` is not implemented for `usize`
|
= note: required by `std::alloc::GlobalAlloc::realloc`

error[E0277]: the trait bound `usize: std::alloc::GlobalAlloc` is not satisfied
--> $DIR/not-an-allocator.rs:12:1
|
LL | static A: usize = 0;
| ^^^^^^^^^^^^^^^^^^^^ the trait `std::alloc::GlobalAlloc` is not implemented for `usize`
|
= note: required by `std::alloc::GlobalAlloc::alloc_zeroed`

error: aborting due to 4 previous errors

For more information about this error, try `rustc --explain E0277`.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
error: cannot define more than one #[global_allocator]
--> $DIR/two-allocators.rs:16:1
|
LL | static B: System = System;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to previous error

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
error: the #[global_allocator] in this crate conflicts with global allocator in: system_allocator

error: aborting due to previous error

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
error: the #[global_allocator] in system_allocator conflicts with this global allocator in: system_allocator2

error: aborting due to previous error

Loading

0 comments on commit b16a306

Please sign in to comment.