Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add loops to doc list of things not stable in const fn #61518

Merged
merged 1 commit into from
Jun 12, 2019

Conversation

czipperz
Copy link
Contributor

@czipperz czipperz commented Jun 4, 2019

Closes #61508

@rust-highfive
Copy link
Collaborator

r? @zackmdavis

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 4, 2019
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-6.0 of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
travis_time:end:16259ba6:start=1559658097696605921,finish=1559658186654318424,duration=88957712503
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#pull-requests-and-security-restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
$ export GCP_CACHE_BUCKET=rust-lang-ci-cache
$ export AWS_ACCESS_KEY_ID=AKIA46X5W6CZEJZ6XT55
---

[00:04:54] travis_fold:start:tidy
travis_time:start:tidy
tidy check
[00:04:55] tidy error: /checkout/src/librustc_mir/transform/qualify_min_const_fn.rs:302: line longer than 100 chars
[00:04:55] tidy error: /checkout/src/test/ui/consts/single_variant_match_ice.rs:18: line longer than 100 chars
[00:04:59] some tidy checks failed
[00:04:59] 
[00:04:59] 
[00:04:59] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/tidy" "/checkout/src" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "--no-vendor" "--quiet"
[00:04:59] 
[00:04:59] 
[00:04:59] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test src/tools/tidy
[00:04:59] Build completed unsuccessfully in 0:01:10
---
travis_time:end:14beffc8:start=1559658496971012938,finish=1559658496975710709,duration=4697771
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:007e587c
$ ln -s . checkout && for CORE in obj/cores/core.*; do EXE=$(echo $CORE | sed 's|obj/cores/core\.[0-9]*\.!checkout!\(.*\)|\1|;y|!|/|'); if [ -f "$EXE" ]; then printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" "$CORE"; gdb --batch -q -c "$CORE" "$EXE" -iex 'set auto-load off' -iex 'dir src/' -iex 'set sysroot .' -ex bt -ex q; echo travis_fold":"end:crashlog; fi; done || true
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:07e2be84
travis_time:start:07e2be84
$ cat ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
cat: ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers: No such file or directory
travis_fold:end:after_failure.5
travis_fold:start:after_failure.6
travis_time:start:1ba51308
$ dmesg | grep -i kill

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

Copy link
Member

@zackmdavis zackmdavis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI is complaining about line length.

tidy check
[00:04:55] tidy error: /checkout/src/librustc_mir/transform/qualify_min_const_fn.rs:302: line longer than 100 chars
[00:04:55] tidy error: /checkout/src/test/ui/consts/single_variant_match_ice.rs:18: line longer than 100 chars
[00:04:59] some tidy checks failed

@@ -15,7 +15,7 @@ impl Foo {
use self::Foo::*;

match *self {
Prob => 0x1, //~ ERROR `if`, `match`, `&&` and `||` are not stable in const fn
Prob => 0x1, //~ ERROR `if`, `match`, `while`, `for`, `loop`, `&&` and `||` are not stable in const fn
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move expectation comment to the next line and use the //~^ notation get around tidy

@@ -299,7 +299,7 @@ fn check_terminator(

TerminatorKind::FalseEdges { .. } | TerminatorKind::SwitchInt { .. } => Err((
span,
"`if`, `match`, `&&` and `||` are not stable in const fn".into(),
"`if`, `match`, `while`, `for`, `loop`, `&&` and `||` are not stable in const fn".into(),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use \ continuation to satisfy tidy?

@czipperz
Copy link
Contributor Author

czipperz commented Jun 6, 2019

@zackmdavis Thanks for the feedback. Honestly I think this error message is too long. What do you think about trying to reduce the length? I'm trying to bikeshed some new messages. Maybe:

conditional expressions are not stable in const fn

@Centril
Copy link
Contributor

Centril commented Jun 10, 2019

@czipperz I think:

loops and conditional expressions are not stable in const fn

would do.

r? @Centril r=me with that

@rust-highfive rust-highfive assigned Centril and unassigned zackmdavis Jun 10, 2019
@Centril Centril added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 10, 2019
@czipperz czipperz force-pushed the const-fn-doc-disallow-loops branch from 6488a59 to 8ba8534 Compare June 10, 2019 01:29
@czipperz czipperz force-pushed the const-fn-doc-disallow-loops branch from 8ba8534 to 8e7ade8 Compare June 10, 2019 02:02
@czipperz
Copy link
Contributor Author

@Centril done

@Centril
Copy link
Contributor

Centril commented Jun 11, 2019

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Jun 11, 2019

📌 Commit 8e7ade8 has been approved by Centril

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jun 11, 2019
Centril added a commit to Centril/rust that referenced this pull request Jun 11, 2019
…s, r=Centril

Add loops to doc list of things not stable in const fn

Closes rust-lang#61508
bors added a commit that referenced this pull request Jun 11, 2019
Rollup of 11 pull requests

Successful merges:

 - #61518 (Add loops to doc list of things not stable in const fn)
 - #61526 (move some tests into subfolders)
 - #61550 (Windows 10 SDK is also required now.)
 - #61606 (Remove some legacy proc macro flavors)
 - #61652 (Mention slice patterns in array)
 - #61686 (librustc_errors: Add some more documentation)
 - #61698 (typeck: Fix const generic in repeat param ICE.)
 - #61707 (Azure: retry failed awscli installs)
 - #61715 (make sure make_ascii_lowercase actually leaves upper-case non-ASCII characters alone)
 - #61724 (core: use memcmp optimization for 128 bit integer slices)
 - #61726 (Use `for_each` in `Iterator::partition`)

Failed merges:

r? @ghost
bors added a commit that referenced this pull request Jun 11, 2019
Rollup of 11 pull requests

Successful merges:

 - #61518 (Add loops to doc list of things not stable in const fn)
 - #61526 (move some tests into subfolders)
 - #61550 (Windows 10 SDK is also required now.)
 - #61606 (Remove some legacy proc macro flavors)
 - #61652 (Mention slice patterns in array)
 - #61686 (librustc_errors: Add some more documentation)
 - #61698 (typeck: Fix const generic in repeat param ICE.)
 - #61707 (Azure: retry failed awscli installs)
 - #61715 (make sure make_ascii_lowercase actually leaves upper-case non-ASCII characters alone)
 - #61724 (core: use memcmp optimization for 128 bit integer slices)
 - #61726 (Use `for_each` in `Iterator::partition`)

Failed merges:

r? @ghost
@bors bors merged commit 8e7ade8 into rust-lang:master Jun 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Using while in const fn results in a misleading error message on stable
5 participants