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

[WIP] Preliminary work splitting const qualification into separate passes #52518

Closed
wants to merge 10 commits into from

Conversation

alexreg
Copy link
Contributor

@alexreg alexreg commented Jul 19, 2018

@rust-highfive
Copy link
Collaborator

r? @nikomatsakis

(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 Jul 19, 2018
@rust-highfive

This comment has been minimized.

@@ -101,7 +101,9 @@ struct Qualifier<'a, 'gcx: 'a+'tcx, 'tcx: 'a> {
rpo: ReversePostorder<'a, 'tcx>,
tcx: TyCtxt<'a, 'gcx, 'tcx>,
param_env: ty::ParamEnv<'tcx>,
local_qualif: IndexVec<Local, Option<Qualif>>,
Copy link
Contributor

Choose a reason for hiding this comment

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

The commit message isn't up to date anymore. The temp + return merge is already in master

@@ -175,6 +176,7 @@ pub enum EvalErrorKind<'tcx, O> {
NoMirFor(String),
UnterminatedCString(Pointer),
DanglingPointerDeref,
ExternStaticRead(DefId),
Copy link
Contributor

Choose a reason for hiding this comment

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

This is introduced here and removed two commits later. Merge the commits into each other?

@rust-highfive

This comment has been minimized.

@rust-highfive

This comment has been minimized.

@rust-highfive

This comment has been minimized.

@nikomatsakis
Copy link
Contributor

r? @eddyb

@rust-highfive rust-highfive assigned eddyb and unassigned nikomatsakis Jul 19, 2018
@alexreg alexreg force-pushed the const-qualif branch 2 times, most recently from d3af745 to 55e384f Compare July 20, 2018 23:51
@rust-highfive

This comment has been minimized.

let store = |this: &mut Self, index| {
this.local_mut_interior.set_member(&index, this.qualif.mut_interior);
this.local_needs_drop.set_member(&index, this.qualif.needs_drop);
this.local_not_const.set_member(&index, this.qualif.not_const);
};

// Only handle promotable temps in non-const functions.
if self.mode == Mode::Fn {
if let Place::Local(index) = *dest {
if self.mir.local_kind(index) == LocalKind::Temp
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe the failure here is due to this not also entering this arm in case of LocalKind::ReturnPointer. Although I don't see how that worked before!?

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-5.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.

[00:03:57] travis_fold:start:tidy
travis_time:start:tidy
tidy check
[00:03:57] tidy error: /checkout/src/test/ui/issue-14227.rs:24: line longer than 100 chars
[00:03:57] tidy error: /checkout/src/librustc_mir/transform/qualify_consts.rs:1076: line longer than 100 chars
[00:03:59] some tidy checks failed
[00:03:59] 
[00:03:59] 
[00:03: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:03:59] 
[00:03:59] 
[00:03:59] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test src/tools/tidy
[00:03:59] Build completed unsuccessfully in 0:00:54
[00:03:59] Build completed unsuccessfully in 0:00:54
[00:03:59] Makefile:79: recipe for target 'tidy' failed
[00:03:59] make: *** [tidy] Error 1

The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:067949db
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
---
travis_time:end:01a85238:start=1532193485462531910,finish=1532193485469597926,duration=7066016
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:05d88ddf
$ 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 -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:192a8690
travis_time:start:192a8690
$ 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:05005e51
$ 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)

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-5.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.
[00:48:59] ....................................................................................................
[00:49:02] ....................................................................................................
[00:49:05] ....................................................................................................
[00:49:07] ....................................................................................................
[00:49:11] ....................................................FFF................FF..................i........
[00:49:16] ....................................................................................i...............
[00:49:19] .............................i......................................................................
[00:49:19] .............................i......................................................................
[00:49:23] ....................................F...............................................................
[00:49:31] .......................................................i..ii........................................
[00:49:35] ....................................................................................................
[00:49:38] ....................................................................................................
[00:49:40] ....................................................................................................
[00:49:40] ....................................................................................................
[00:49:43] .......................................i............................................................
[00:49:46] ....................................................................................................
[00:49:49] ....................................................................................................
          Error
[00:49:53]         ),
[00:49:53]         msg: "22:1: 22:35: statements in constants are unstable (see issue #48821) [E0658]"
[00:49:53] ]
[00:49:53] 
[00:49:53] not found errors (from test file): [
[00:49:53]     Error {
---
[00:49:53] note: Run with `RUST_BACKTRACE=1` for a backtrace.
[00:49:53] 
[00:49:53] ---- [compile-fail] compile-fail/const-block-non-item-statement-3.rs stdout ----
[00:49:53] 
[00:49:53] error: /checkout/src/test/compile-fail/const-block-non-item-statement-3.rs:11: unexpected error: '11:20: 11:37: let bindings in constants are unstable (see issue #48821) [E0658]'
[00:49:53] 
[00:49:53] error: /checkout/src/test/compile-fail/const-block-non-item-statement-3.rs:11: unexpected error: '11:20: 11:37: statements in constants are unstable (see issuheckout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/compile-fail/const-fn-destructuring-arg.rs" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/compile-fail/const-fn-destructuring-arg/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/compile-fail/const-fn-destructuring-arg/auxiliary" "-A" "unused"
[00:49:53]     Error {
[00:49:53]         line_num: 17,
[00:49:53]         kind: Some(
[00:49:53]             Error
[00:49:53]             Error
[00:49:53]         ),
[00:49:53]         msg: "17:13: 17:14: let bindings in constant functions are unstable (see issue #48821) [E0658]"
[00:49:53]     Error {
[00:49:53]         line_num: 17,
[00:49:53]         kind: Some(
[00:49:53]             Error
[00:49:53]             Error
[00:49:53]         ),
[00:49:53]         msg: "17:13: 17:14: statements in constant functions are unstable (see issue #48821) [E0658]"
[00:49:53]     Error {
[00:49:53]         line_num: 19,
[00:49:53]         kind: Some(
[00:49:53]             Error
[00:49:53]             Error
[00:49:53]         ),
[00:49:53]         msg: "19:13: 19:14: let bindings in constant functions are unstable (see issue #48821) [E0658]"
[00:49:53]     Error {
[00:49:53]         line_num: 19,
[00:49:53]         kind: Some(
[00:49:53]             Error
[00:49:53]             Error
[00:49:53]         ),
[00:49:53]         msg: "19:13: 19:14: statements in constant funcn-linux-gnu/release
121696 ./obj/build/x86_64-unknown-linux-gnu/stage0-bootstrap-tools/x86_64-unknown-linux-gnu/release/deps
111564 ./obj/build/x86_64-unknown-linux-gnu/stage1-std
107600 ./src/llvm/test/CodeGen
102364 ./obj/cores

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)

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-5.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.

[00:03:53] travis_fold:start:tidy
travis_time:start:tidy
tidy check
[00:03:53] tidy error: /checkout/src/librustc_data_structures/indexed_set.rs:212: trailing whitespace
[00:03:54] some tidy checks failed
[00:03:54] 
[00:03:54] 
[00:03:54] 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:03:54] 
[00:03:54] 
[00:03:54] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test src/tools/tidy
[00:03:54] Build completed unsuccessfully in 0:00:47
[00:03:54] Build completed unsuccessfully in 0:00:47
[00:03:54] Makefile:79: recipe for target 'tidy' failed
[00:03:54] make: *** [tidy] Error 1

The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:0a23fe20
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
---
travis_time:end:0a484264:start=1532208823101840621,finish=1532208823109019494,duration=7178873
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:25e17e11
$ 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 -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:00378078
travis_time:start:00378078
$ 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:02b839b0
$ 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)

@TimNN
Copy link
Contributor

TimNN commented Aug 7, 2018

Ping from triage, @alexreg. It looks like some changes have been requested to your PR.

@alexreg
Copy link
Contributor Author

alexreg commented Aug 7, 2018

@TimNN Yeah, I was away on holiday, but just getting to them now. Hopefully will have them resolved in the next day or two. :-)

@XAMPPRocky
Copy link
Member

Triage: @alexreg Hope you had a good holiday. Can you give a status update on this PR?

@mark-i-m
Copy link
Member

@Aaronepower

It looks like @eddyb is needed: #49146 (comment)

@XAMPPRocky XAMPPRocky added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Aug 21, 2018
@XAMPPRocky
Copy link
Member

@mark-i-m Thank you, I've updated the status of the PR to reflect this.

@alexreg
Copy link
Contributor Author

alexreg commented Aug 21, 2018

@Aaronepower Yep. I've been pestering @eddyb about this for a while. I think he'll finally get around to it soon. :-)

@pietroalbini
Copy link
Member

Ping from triage @eddyb! This PR needs your review.

@TimNN
Copy link
Contributor

TimNN commented Sep 4, 2018

Ping from triage @eddyb / @rust-lang/compiler: This PR requires your review.

1 similar comment
@TimNN
Copy link
Contributor

TimNN commented Sep 11, 2018

Ping from triage @eddyb / @rust-lang/compiler: This PR requires your review.

@alexreg
Copy link
Contributor Author

alexreg commented Sep 12, 2018

@TimNN Appreciate your efforts to try to get @eddyb to review this... I've spoken with him on Discord though, and he's too busy with 2018 Edition stuff at this moment. That said, a week today (or tomorrow) he should be able to tackle this! :-)

@RalfJung
Copy link
Member

Conflict ahead: #54424

@alexreg
Copy link
Contributor Author

alexreg commented Sep 29, 2018

@RalfJung Okay thanks for the notice. I don't think it will matter too much, since @eddyb will either be significantly reworking this or redoing it from scratch shortly.

@TimNN
Copy link
Contributor

TimNN commented Oct 16, 2018

Ping from triage @eddyb / @alexreg: What is the status of this PR?

@alexreg
Copy link
Contributor Author

alexreg commented Oct 16, 2018

@eddyb Still waiting on @eddyb... he's been AWOL for a little while now.

@TimNN TimNN added A-allocators Area: Custom and system allocators and removed A-allocators Area: Custom and system allocators labels Oct 30, 2018
@TimNN
Copy link
Contributor

TimNN commented Nov 13, 2018

Ping from triage @eddyb / @rust-lang/compiler: What are your plans for this PR?

@estebank
Copy link
Contributor

Side note: please do not leave merge commits in the PR.

@alexreg
Copy link
Contributor Author

alexreg commented Nov 14, 2018

@estebank That's a rebase gone wrong I think. :-P

@TimNN
Copy link
Contributor

TimNN commented Nov 20, 2018

Ping from triage @eddyb: This PR requires your review!

@TimNN
Copy link
Contributor

TimNN commented Nov 27, 2018

Ping from triage @eddyb / @rust-lang/compiler! This PR requires your review.

@Centril Centril added S-waiting-on-team Status: Awaiting decision from the relevant subteam (see the T-<team> label). and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 1, 2018
@Centril
Copy link
Contributor

Centril commented Dec 1, 2018

Ping from triage @eddyb / @rust-lang/compiler -- we are eagerly awaiting your review.

@alexreg
Copy link
Contributor Author

alexreg commented Feb 12, 2019

Closing this PR in favour of @eddyb's new one #58403.

@alexreg alexreg closed this Feb 12, 2019
@apiraino apiraino removed the S-waiting-on-team Status: Awaiting decision from the relevant subteam (see the T-<team> label). label May 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.