Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
0f47327
Remove i686-unknown-dragonfly target
tuxillo Dec 12, 2019
641ccd5
Fix signature of `__wasilibc_find_relpath`
alexcrichton Dec 12, 2019
8f3021b
Get active features dynamically by their `Symbol`
ecstatic-morse Dec 10, 2019
57959b2
Add feature gate for `const_loop`
ecstatic-morse Dec 10, 2019
8f59902
Put MIR checks for loops behind the feature flag
ecstatic-morse Dec 10, 2019
ee233c0
Restructue HIR const-checker to handle features with multiple gates
ecstatic-morse Dec 10, 2019
99e132d
Extend control flow basics tests with loops
ecstatic-morse Dec 11, 2019
1122404
Add qualif smoke tests for const loops
ecstatic-morse Dec 11, 2019
caa7c99
Bless unrelated tests with new help message
ecstatic-morse Dec 11, 2019
3325671
Bless modified tests
ecstatic-morse Dec 11, 2019
2add77d
Improve message when active feature indexing panics
ecstatic-morse Dec 11, 2019
a8e997c
Improve comment
ecstatic-morse Dec 11, 2019
a2a0774
Look for "unstable feature" error code in test
ecstatic-morse Dec 11, 2019
b3aecd0
Fix grammar in test description
ecstatic-morse Dec 11, 2019
2b5ae1c
Apply suggestions from review
ecstatic-morse Dec 11, 2019
80581be
Replace `Index` impl with `enabled` method
ecstatic-morse Dec 11, 2019
34ce0ba
Use better name for local containing required feature gates
ecstatic-morse Dec 11, 2019
598bed6
Ensure test actually uses dataflow, not simulation
ecstatic-morse Dec 11, 2019
029725f
Use correct nightly version for feature
ecstatic-morse Dec 11, 2019
0f0bfc9
Document `Features::enabled`
ecstatic-morse Dec 12, 2019
faa52d1
Correctly mark things as `min_const_fn`
ecstatic-morse Dec 13, 2019
b65c6ec
Fix incorrect example code of OpenOptions::open
pjw91 Dec 13, 2019
f5e9bda
doc comments: Less attribute mimicking
petrochenkov Dec 7, 2019
d720440
Rollup merge of #67151 - petrochenkov:docomm, r=estebank
Centril Dec 14, 2019
0e2fb73
Rollup merge of #67216 - ecstatic-morse:const-loop, r=oli-obk
Centril Dec 14, 2019
393ddd6
Rollup merge of #67255 - tuxillo:remove-i686-unknown-dragonfly, r=ale…
Centril Dec 14, 2019
18cbf24
Rollup merge of #67267 - alexcrichton:update-wasi-libc, r=Dylan-DPC
Centril Dec 14, 2019
389aa5f
Rollup merge of #67282 - pjw91:patch-1, r=Dylan-DPC
Centril Dec 14, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Bless modified tests
  • Loading branch information
ecstatic-morse committed Dec 13, 2019
commit 332567103670935eefa347a87fb87c9153f814b9
14 changes: 10 additions & 4 deletions src/test/ui/consts/control-flow/drop-failure.stderr
Original file line number Diff line number Diff line change
@@ -1,21 +1,27 @@
error[E0493]: destructors cannot be evaluated at compile-time
--> $DIR/drop-failure.rs:6:9
--> $DIR/drop-failure.rs:7:9
|
LL | let x = Some(Vec::new());
| ^ constants cannot evaluate destructors

error[E0493]: destructors cannot be evaluated at compile-time
--> $DIR/drop-failure.rs:19:9
--> $DIR/drop-failure.rs:20:9
|
LL | let vec_tuple = (Vec::new(),);
| ^^^^^^^^^ constants cannot evaluate destructors

error[E0493]: destructors cannot be evaluated at compile-time
--> $DIR/drop-failure.rs:27:9
--> $DIR/drop-failure.rs:28:9
|
LL | let x: Result<_, Vec<i32>> = Ok(Vec::new());
| ^ constants cannot evaluate destructors

error: aborting due to 3 previous errors
error[E0493]: destructors cannot be evaluated at compile-time
--> $DIR/drop-failure.rs:38:9
|
LL | let mut tmp = None;
| ^^^^^^^ constants cannot evaluate destructors

error: aborting due to 4 previous errors

For more information about this error, try `rustc --explain E0493`.
19 changes: 15 additions & 4 deletions src/test/ui/consts/control-flow/interior-mutability.stderr
Original file line number Diff line number Diff line change
@@ -1,24 +1,35 @@
error[E0716]: temporary value dropped while borrowed
--> $DIR/interior-mutability.rs:25:26
--> $DIR/interior-mutability.rs:40:26
|
LL | let x: &'static _ = &X;
| ---------- ^ creates a temporary which is freed while still in use
| |
| type annotation requires that borrow lasts for `'static`
LL | let y: &'static _ = &Y;
...
LL | }
| - temporary value is freed at the end of this statement

error[E0716]: temporary value dropped while borrowed
--> $DIR/interior-mutability.rs:26:26
--> $DIR/interior-mutability.rs:41:26
|
LL | let y: &'static _ = &Y;
| ---------- ^ creates a temporary which is freed while still in use
| |
| type annotation requires that borrow lasts for `'static`
LL | let z: &'static _ = &Z;
LL | }
| - temporary value is freed at the end of this statement

error[E0716]: temporary value dropped while borrowed
--> $DIR/interior-mutability.rs:42:26
|
LL | let z: &'static _ = &Z;
| ---------- ^ creates a temporary which is freed while still in use
| |
| type annotation requires that borrow lasts for `'static`
LL | }
| - temporary value is freed at the end of this statement

error: aborting due to 2 previous errors
error: aborting due to 3 previous errors

For more information about this error, try `rustc --explain E0716`.
19 changes: 19 additions & 0 deletions src/test/ui/consts/control-flow/loop.both.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
error[E0744]: `for` is not allowed in a `const`
--> $DIR/loop.rs:63:5
|
LL | / for i in 0..4 {
LL | | x += i;
LL | | }
| |_____^

error[E0744]: `for` is not allowed in a `const`
--> $DIR/loop.rs:67:5
|
LL | / for i in 0..4 {
LL | | x += i;
LL | | }
| |_____^

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0744`.
98 changes: 69 additions & 29 deletions src/test/ui/consts/control-flow/loop.if_match.stderr
Original file line number Diff line number Diff line change
@@ -1,67 +1,88 @@
error[E0744]: `loop` is not allowed in a `const`
--> $DIR/loop.rs:8:15
error[E0658]: `loop` is not allowed in a `const`
--> $DIR/loop.rs:10:15
|
LL | const _: () = loop {};
| ^^^^^^^
|
= note: for more information, see https://github.com/rust-lang/rust/issues/52000
= help: add `#![feature(const_loop)]` to the crate attributes to enable

error[E0744]: `loop` is not allowed in a `static`
--> $DIR/loop.rs:10:19
error[E0658]: `loop` is not allowed in a `static`
--> $DIR/loop.rs:12:19
|
LL | static FOO: i32 = loop { break 4; };
| ^^^^^^^^^^^^^^^^^
|
= note: for more information, see https://github.com/rust-lang/rust/issues/52000
= help: add `#![feature(const_loop)]` to the crate attributes to enable

error[E0744]: `loop` is not allowed in a `const fn`
--> $DIR/loop.rs:13:5
error[E0658]: `loop` is not allowed in a `const fn`
--> $DIR/loop.rs:15:5
|
LL | loop {}
| ^^^^^^^
|
= note: for more information, see https://github.com/rust-lang/rust/issues/52000
= help: add `#![feature(const_loop)]` to the crate attributes to enable

error[E0744]: `loop` is not allowed in a `const fn`
--> $DIR/loop.rs:26:9
error[E0658]: `loop` is not allowed in a `const fn`
--> $DIR/loop.rs:28:9
|
LL | loop {}
| ^^^^^^^
|
= note: for more information, see https://github.com/rust-lang/rust/issues/52000
= help: add `#![feature(const_loop)]` to the crate attributes to enable

error[E0744]: `while` is not allowed in a `const`
--> $DIR/loop.rs:38:9
error[E0658]: `while` is not allowed in a `const`
--> $DIR/loop.rs:40:9
|
LL | while false {}
| ^^^^^^^^^^^^^^
|
= note: for more information, see https://github.com/rust-lang/rust/issues/52000
= help: add `#![feature(const_loop)]` to the crate attributes to enable

error[E0744]: `while` is not allowed in a `const`
--> $DIR/loop.rs:47:5
error[E0658]: `while` is not allowed in a `const`
--> $DIR/loop.rs:49:5
|
LL | / while x < 4 {
LL | | x += 1;
LL | | }
| |_____^
|
= note: for more information, see https://github.com/rust-lang/rust/issues/52000
= help: add `#![feature(const_loop)]` to the crate attributes to enable

error[E0744]: `while` is not allowed in a `const`
--> $DIR/loop.rs:51:5
error[E0658]: `while` is not allowed in a `const`
--> $DIR/loop.rs:53:5
|
LL | / while x < 8 {
LL | | x += 1;
LL | | }
| |_____^
|
= note: for more information, see https://github.com/rust-lang/rust/issues/52000
= help: add `#![feature(const_loop)]` to the crate attributes to enable

error[E0744]: `for` is not allowed in a `const`
--> $DIR/loop.rs:61:5
--> $DIR/loop.rs:63:5
|
LL | / for i in 0..4 {
LL | | x += i;
LL | | }
| |_____^

error[E0744]: `for` is not allowed in a `const`
--> $DIR/loop.rs:65:5
--> $DIR/loop.rs:67:5
|
LL | / for i in 0..4 {
LL | | x += i;
LL | | }
| |_____^

error[E0744]: `loop` is not allowed in a `const`
--> $DIR/loop.rs:75:5
error[E0658]: `loop` is not allowed in a `const`
--> $DIR/loop.rs:77:5
|
LL | / loop {
LL | | x += 1;
Expand All @@ -70,9 +91,12 @@ LL | | break;
LL | | }
LL | | }
| |_____^
|
= note: for more information, see https://github.com/rust-lang/rust/issues/52000
= help: add `#![feature(const_loop)]` to the crate attributes to enable

error[E0744]: `loop` is not allowed in a `const`
--> $DIR/loop.rs:82:5
error[E0658]: `loop` is not allowed in a `const`
--> $DIR/loop.rs:84:5
|
LL | / loop {
LL | | x += 1;
Expand All @@ -81,31 +105,47 @@ LL | | break;
LL | | }
LL | | }
| |_____^
|
= note: for more information, see https://github.com/rust-lang/rust/issues/52000
= help: add `#![feature(const_loop)]` to the crate attributes to enable

error[E0744]: `while` is not allowed in a `const`
--> $DIR/loop.rs:94:5
error[E0658]: `while` is not allowed in a `const`
--> $DIR/loop.rs:96:5
|
LL | while let None = Some(x) { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: for more information, see https://github.com/rust-lang/rust/issues/52000
= help: add `#![feature(const_loop)]` to the crate attributes to enable

error[E0744]: `while` is not allowed in a `const`
--> $DIR/loop.rs:95:5
error[E0658]: `while` is not allowed in a `const`
--> $DIR/loop.rs:97:5
|
LL | while let None = Some(x) { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: for more information, see https://github.com/rust-lang/rust/issues/52000
= help: add `#![feature(const_loop)]` to the crate attributes to enable

error[E0744]: `loop` is not allowed in a `const`
--> $DIR/loop.rs:17:22
error[E0658]: `loop` is not allowed in a `const`
--> $DIR/loop.rs:19:22
|
LL | const BAR: i32 = loop { break 4; };
| ^^^^^^^^^^^^^^^^^
|
= note: for more information, see https://github.com/rust-lang/rust/issues/52000
= help: add `#![feature(const_loop)]` to the crate attributes to enable

error[E0744]: `loop` is not allowed in a `const`
--> $DIR/loop.rs:21:22
error[E0658]: `loop` is not allowed in a `const`
--> $DIR/loop.rs:23:22
|
LL | const BAR: i32 = loop { break 4; };
| ^^^^^^^^^^^^^^^^^
|
= note: for more information, see https://github.com/rust-lang/rust/issues/52000
= help: add `#![feature(const_loop)]` to the crate attributes to enable

error: aborting due to 15 previous errors

For more information about this error, try `rustc --explain E0744`.
Some errors have detailed explanations: E0658, E0744.
For more information about an error, try `rustc --explain E0658`.
96 changes: 96 additions & 0 deletions src/test/ui/consts/control-flow/loop.loop_.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
error[E0658]: `while` is not allowed in a `const`
--> $DIR/loop.rs:40:9
|
LL | while false {}
| ^^^^^^^^^^^^^^
|
= note: for more information, see https://github.com/rust-lang/rust/issues/49146
= help: add `#![feature(const_if_match)]` to the crate attributes to enable
= note: `#![feature(const_loop)]` alone is not sufficient, since this loop expression contains an implicit conditional

error[E0658]: `while` is not allowed in a `const`
--> $DIR/loop.rs:49:5
|
LL | / while x < 4 {
LL | | x += 1;
LL | | }
| |_____^
|
= note: for more information, see https://github.com/rust-lang/rust/issues/49146
= help: add `#![feature(const_if_match)]` to the crate attributes to enable
= note: `#![feature(const_loop)]` alone is not sufficient, since this loop expression contains an implicit conditional

error[E0658]: `while` is not allowed in a `const`
--> $DIR/loop.rs:53:5
|
LL | / while x < 8 {
LL | | x += 1;
LL | | }
| |_____^
|
= note: for more information, see https://github.com/rust-lang/rust/issues/49146
= help: add `#![feature(const_if_match)]` to the crate attributes to enable
= note: `#![feature(const_loop)]` alone is not sufficient, since this loop expression contains an implicit conditional

error[E0744]: `for` is not allowed in a `const`
--> $DIR/loop.rs:63:5
|
LL | / for i in 0..4 {
LL | | x += i;
LL | | }
| |_____^

error[E0744]: `for` is not allowed in a `const`
--> $DIR/loop.rs:67:5
|
LL | / for i in 0..4 {
LL | | x += i;
LL | | }
| |_____^

error[E0658]: `if` is not allowed in a `const`
--> $DIR/loop.rs:79:9
|
LL | / if x == 4 {
LL | | break;
LL | | }
| |_________^
|
= note: for more information, see https://github.com/rust-lang/rust/issues/49146
= help: add `#![feature(const_if_match)]` to the crate attributes to enable

error[E0658]: `if` is not allowed in a `const`
--> $DIR/loop.rs:86:9
|
LL | / if x == 8 {
LL | | break;
LL | | }
| |_________^
|
= note: for more information, see https://github.com/rust-lang/rust/issues/49146
= help: add `#![feature(const_if_match)]` to the crate attributes to enable

error[E0658]: `while` is not allowed in a `const`
--> $DIR/loop.rs:96:5
|
LL | while let None = Some(x) { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: for more information, see https://github.com/rust-lang/rust/issues/49146
= help: add `#![feature(const_if_match)]` to the crate attributes to enable
= note: `#![feature(const_loop)]` alone is not sufficient, since this loop expression contains an implicit conditional

error[E0658]: `while` is not allowed in a `const`
--> $DIR/loop.rs:97:5
|
LL | while let None = Some(x) { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: for more information, see https://github.com/rust-lang/rust/issues/49146
= help: add `#![feature(const_if_match)]` to the crate attributes to enable
= note: `#![feature(const_loop)]` alone is not sufficient, since this loop expression contains an implicit conditional

error: aborting due to 9 previous errors

Some errors have detailed explanations: E0658, E0744.
For more information about an error, try `rustc --explain E0658`.
Loading