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

second round of refactorings for universes #54858

Merged
merged 12 commits into from Oct 15, 2018

Conversation

@nikomatsakis
Copy link
Contributor

nikomatsakis commented Oct 5, 2018

A second round of (what I believe to be) "no functional change" refactorings, taken from my universes branch.

r? @scalexm

@rust-highfive

This comment has been minimized.

Copy link
Collaborator

rust-highfive commented Oct 5, 2018

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:04:11] travis_fold:start:tidy
travis_time:start:tidy
tidy check
[00:04:11] tidy error: /checkout/src/librustc_traits/dropck_outlives.rs:37: line longer than 100 chars
[00:04:11] tidy error: /checkout/src/librustc_traits/evaluate_obligation.rs:29: line longer than 100 chars
[00:04:11] tidy error: /checkout/src/librustc/infer/mod.rs:515: line longer than 100 chars
[00:04:12] some tidy checks failed
[00:04:12] 
[00:04:12] 
[00:04:12] 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:12] 
[00:04:12] 
[00:04:12] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test src/tools/tidy
[00:04:12] Build completed unsuccessfully in 0:00:46
[00:04:12] Build completed unsuccessfully in 0:00:46
[00:04:12] make: *** [tidy] Error 1
[00:04:12] Makefile:79: recipe for target 'tidy' failed

The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:036ba66c
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
---
travis_time:end:05b627e0:start=1538764766927338529,finish=1538764766932375446,duration=5036917
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:1304fcf0
$ 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:0d1bd67c
travis_time:start:0d1bd67c
$ 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:1d28ea21
$ 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)

@@ -593,7 +593,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
where
T : TypeFoldable<'tcx>,
{
let new_universe = self.create_subuniverse();
let new_universe = self.create_superuniverse();

This comment has been minimized.

Copy link
@arielb1

arielb1 Oct 6, 2018

Contributor

I'm not sure I prefer "superuniverse" to "subuniverse". Universes naturally form a tree, and the "subelement" relationship goes from a universe to its sub/superuniverse.

@nikomatsakis

This comment has been minimized.

Copy link
Contributor Author

nikomatsakis commented Oct 8, 2018

@arielb1

I'm not sure I prefer "superuniverse" to "subuniverse". Universes naturally form a tree, and the "subelement" relationship goes from a universe to its sub/superuniverse.

It seems like the use of "subuniverse" conflicts with methods like is_subset_of -- i.e., U0 is a "subset" of U1. Perhaps we can find some other terminology. I've found it pretty important when writing this code to have something that gives the right intuition.

Maybe "extension" and "extended" is a better terminology?

e.g.,

  • create_subuniverse => create_extended_universe
  • is_subset_of => is_extended_by

and so forth?

(For that matter, create_superuniverse should perhaps just be called create_universe or create_fresh_universe, with the "extension" aspect of it left to doc comments -- i.e., "creates a fresh universe that extends all previous universes")

@nikomatsakis nikomatsakis force-pushed the nikomatsakis:universes-refactor-2 branch from 2c8c2d9 to e3d783e Oct 8, 2018
@nikomatsakis

This comment has been minimized.

Copy link
Contributor Author

nikomatsakis commented Oct 8, 2018

Rebased and tidied. Went and tried the renaming I proposed. I wound up at a slightly different place, as you can see in the comment from the final commit:


remove the sub/super terminology for universes

Instead, we talk about:

  • creating the "next" universe
  • universes "extending" one another
  • and u1.can_name(u2), meaning that u1 contains all names from u2
@nikomatsakis

This comment has been minimized.

Copy link
Contributor Author

nikomatsakis commented Oct 8, 2018

Now I am thinking create_child_universe might be better than "next" universe, to help build on the tree intuition. Unclear how much that matters though.

@rust-highfive

This comment was marked as outdated.

Copy link
Collaborator

rust-highfive commented Oct 8, 2018

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:19:49]    Compiling rustc_tsan v0.0.0 (/checkout/src/librustc_tsan)
[00:19:50]    Compiling rustc_asan v0.0.0 (/checkout/src/librustc_asan)
[00:19:50]    Compiling rustc_msan v0.0.0 (/checkout/src/librustc_msan)
[00:19:51]    Compiling rustc_lsan v0.0.0 (/checkout/src/librustc_lsan)
[00:20:16] error: internal compiler error: librustc/infer/canonical/canonicalizer.rs:175: unexpected region in query response: `ReErased`
[00:20:16] thread 'main' panicked at 'Box<Any>', librustc_errors/lib.rs:599:9
[00:20:16] note: Run with `RUST_BACKTRACE=1` for a backtrace.
[00:20:16] error: aborting due to previous error
[00:20:16] 
[00:20:16] 
[00:20:16] 
[00:20:16] note: the compiler unexpectedly panicked. this is a bug.
[00:20:16] 
[00:20:16] note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
[00:20:16] 
[00:20:16] note: rustc 1.31.0-dev running on x86_64-unknown-linux-gnu
[00:20:16] 
[00:20:16] note: compiler flags: -Z force-unstable-if-unmarked -C opt-level=2 -C prefer-dynamic -C debug-assertions=y -C link-args=-Wl,-rpath,$ORIGIN/../lib --crate-type lib
[00:20:16] note: some of the compiler flags provided by cargo are hidden
[00:20:16] 
[00:20:16] error: Could not compile `core`.
[00:20:16] 
[00:20:16] 
[00:20:16] To learn more, run the command again with --verbose.
[00:20:16] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "build" "--target" "x86_64-unknown-linux-gnu" "-j" "4" "--release" "--locked" "--color" "always" "--features" "panic-unwind jemalloc backtrace" "--manifest-path" "/checkout/src/libstd/Cargo.toml" "--message-format" "json"
[00:20:16] expected success, got: exit code: 101
[00:20:16] thread 'main' panicked at 'cargo must succeed', bootstrap/compile.rs:1112:9
[00:20:16] travis_fold:end:stage1-std

[00:20:16] travis_time:end:stage1-std:start=1538998851388341082,finish=1538998888490085661,duration=37101744579


[00:20:16] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap build
[00:20:16] Build completed unsuccessfully in 0:15:49
[00:20:16] make: *** [all] Error 1
[00:20:16] Makefile:28: recipe for target 'all' failed

The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:0613bab3
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)

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)

@nikomatsakis nikomatsakis force-pushed the nikomatsakis:universes-refactor-2 branch from e3d783e to 19c7e55 Oct 8, 2018
@rust-highfive

This comment was marked as resolved.

Copy link
Collaborator

rust-highfive commented Oct 8, 2018

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:46:02] .................................................................................................... 500/4572
[00:46:05] .......................i............................................................................ 600/4572
[00:46:10] .................................................................................................... 700/4572
[00:46:15] ................................i...........i....................................................... 800/4572
[00:46:18] ....................................................iiiii................................F.......... 900/4572
[00:46:23] .................................................................................................... 1100/4572
[00:46:25] .................................................................................................... 1200/4572
[00:46:28] .................................................................................................... 1300/4572
[00:46:30] .................................................................................................... 1400/4572
---
[00:47:34] .................................................................................................... 3300/4572
[00:47:37] ..........................................i......................................................... 3400/4572
[00:47:41] .................................................................................................... 3500/4572
[00:47:43] .................................................................................................... 3600/4572
[00:47:46] ...........F........................................................................................ 3700/4572
[00:47:54] .................................................................................................... 3900/4572
[00:47:57] .................................................................................................... 4000/4572
[00:48:00] .................................................................................................... 4100/4572
[00:48:04] ........................................................i........................................... 4200/4572
---
[00:48:15] failures:
[00:48:15] 
[00:48:15] ---- [ui] ui/dst/dst-bad-coerce3.rs stdout ----
[00:48:15] 
[00:48:15] error: Error: expected failure status (Some(1)) but received status Some(101).
[00:48:15] status: exit code: 101
[00:48:15] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/dst/dst-bad-coerce3.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/ui/dst/dst-bad-coerce3/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/ui/dst/dst-bad-coerce3/auxiliary" "-A" "unused"
[00:48:15]005245640311126,finish=1539005245677868641,duration=37557515
The command "date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
" exited with 0.
travis_fold:start:after_failure.1
travis_time:start:20cad1df
---
travis_time:end:2abd1c50:start=1539005246809770545,finish=1539005246819279450,duration=9508905
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:0ffddae1
$ 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:00f30f38
$ 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)

@nikomatsakis nikomatsakis force-pushed the nikomatsakis:universes-refactor-2 branch from 19c7e55 to bae8a5a Oct 8, 2018
@scalexm
scalexm approved these changes Oct 8, 2018
@scalexm

This comment has been minimized.

Copy link
Member

scalexm commented Oct 8, 2018

@bors r+

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Oct 8, 2018

📌 Commit bae8a5a has been approved by scalexm

Manishearth added a commit to Manishearth/rust that referenced this pull request Oct 10, 2018
…r=scalexm

second round of refactorings for universes

A second round of (what I believe to be) "no functional change" refactorings, taken from my universes branch.

r? @scalexm
Manishearth added a commit to Manishearth/rust that referenced this pull request Oct 10, 2018
…r=scalexm

second round of refactorings for universes

A second round of (what I believe to be) "no functional change" refactorings, taken from my universes branch.

r? @scalexm
bors added a commit that referenced this pull request Oct 10, 2018
Rollup of 9 pull requests

Successful merges:

 - #54747 (codegen_llvm: verify that inline assembly operands are scalars)
 - #54848 (Better Diagnostic for Trait Object Capture)
 - #54850 (Fix #54707 - parse_trait_item_ now handles interpolated blocks as function body decls)
 - #54858 (second round of refactorings for universes)
 - #54862 (Implement RFC 2539: cfg_attr with multiple attributes)
 - #54869 (Fix mobile docs)
 - #54870 (Stabilize tool lints)
 - #54893 (Fix internal compiler error on malformed match arm pattern.)
 - #54904 (Stabilize the `Option::replace` method)

Failed merges:

 - #54909 ( Add chalk rules related to associated type defs)

r? @ghost
@Manishearth

This comment has been minimized.

Copy link
Member

Manishearth commented Oct 10, 2018

seems to be broken?

error: internal compiler error: librustc\infer\canonical\canonicalizer.rs:175: unexpected region in query response: `ReEarlyBound(0, 'i)`

in the rollup

https://ci.appveyor.com/project/rust-lang/rust/builds/19415197/job/kex1uawo1pxeg0ml

bors added a commit that referenced this pull request Oct 11, 2018
Rollup of 9 pull requests

Successful merges:

 - #54747 (codegen_llvm: verify that inline assembly operands are scalars)
 - #54848 (Better Diagnostic for Trait Object Capture)
 - #54850 (Fix #54707 - parse_trait_item_ now handles interpolated blocks as function body decls)
 - #54858 (second round of refactorings for universes)
 - #54862 (Implement RFC 2539: cfg_attr with multiple attributes)
 - #54869 (Fix mobile docs)
 - #54870 (Stabilize tool lints)
 - #54893 (Fix internal compiler error on malformed match arm pattern.)
 - #54904 (Stabilize the `Option::replace` method)

Failed merges:

 - #54909 ( Add chalk rules related to associated type defs)

r? @ghost
bors added a commit that referenced this pull request Oct 11, 2018
Rollup of 9 pull requests

Successful merges:

 - #54747 (codegen_llvm: verify that inline assembly operands are scalars)
 - #54848 (Better Diagnostic for Trait Object Capture)
 - #54850 (Fix #54707 - parse_trait_item_ now handles interpolated blocks as function body decls)
 - #54858 (second round of refactorings for universes)
 - #54862 (Implement RFC 2539: cfg_attr with multiple attributes)
 - #54869 (Fix mobile docs)
 - #54870 (Stabilize tool lints)
 - #54893 (Fix internal compiler error on malformed match arm pattern.)
 - #54904 (Stabilize the `Option::replace` method)

Failed merges:

 - #54909 ( Add chalk rules related to associated type defs)

r? @ghost
@bors

This comment has been minimized.

Copy link
Contributor

bors commented Oct 11, 2018

☔️ The latest upstream changes (presumably #54969) made this pull request unmergeable. Please resolve the merge conflicts.

@nikomatsakis nikomatsakis force-pushed the nikomatsakis:universes-refactor-2 branch from bae8a5a to 560d954 Oct 15, 2018
@nikomatsakis

This comment has been minimized.

Copy link
Contributor Author

nikomatsakis commented Oct 15, 2018

@bors r=scalexm

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Oct 15, 2018

📌 Commit 5be9513 has been approved by scalexm

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Oct 15, 2018

⌛️ Testing commit 5be9513 with merge 0e86b36...

bors added a commit that referenced this pull request Oct 15, 2018
second round of refactorings for universes

A second round of (what I believe to be) "no functional change" refactorings, taken from my universes branch.

r? @scalexm
@bors

This comment has been minimized.

Copy link
Contributor

bors commented Oct 15, 2018

💔 Test failed - status-appveyor

The only name was silly. U1 can contain everything from U0 *plus* more
things.
Instead, we talk about:

- creating the "next" universe
- universes "extending" one another
- and `u1.can_name(u2)`, meaning that `u1` contains all names from `u2`
@nikomatsakis nikomatsakis force-pushed the nikomatsakis:universes-refactor-2 branch from 5be9513 to 05f67ca Oct 15, 2018
@nikomatsakis

This comment has been minimized.

Copy link
Contributor Author

nikomatsakis commented Oct 15, 2018

Whoops, I thought I had patched that problem.

@nikomatsakis

This comment has been minimized.

Copy link
Contributor Author

nikomatsakis commented Oct 15, 2018

@bors r=scalexm

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Oct 15, 2018

📌 Commit 05f67ca has been approved by scalexm

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Oct 15, 2018

⌛️ Testing commit 05f67ca with merge 5a52983...

bors added a commit that referenced this pull request Oct 15, 2018
second round of refactorings for universes

A second round of (what I believe to be) "no functional change" refactorings, taken from my universes branch.

r? @scalexm
@bors

This comment has been minimized.

Copy link
Contributor

bors commented Oct 15, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: scalexm
Pushing 5a52983 to master...

@bors bors merged commit 05f67ca into rust-lang:master Oct 15, 2018
2 checks passed
2 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.