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

Make the WF check skip less binders #50815

Closed
wants to merge 1 commit into from

Conversation

leoyvens
Copy link
Contributor

@leoyvens leoyvens commented May 17, 2018

Skip the binder in less places during WF check, meaning we check more higher-ranked things. I thought this might help fix the problem in #50781, but it didn't.

This did regressed test project-cache-issue-37154 with this error:

// error[E0271]: type mismatch resolving 
// `for<'a> <<&'a T as std::iter::IntoIterator>::IntoIter as std::iter::Iterator>::Item == <&'a T as std::iter::IntoIterator>::Item`
struct Wrapper<T>(T);
impl<T> Foo for Wrapper<T> where for<'a> &'a T: IntoIterator<Item=&'a ()> {}
//    = note: expected type `&()`
//            found type `<&T as std::iter::IntoIterator>::Item`
//    = note: required by `std::iter::IntoIterator`

And I couldn't fix the test so that it passes, let alone fix the compiler to allow this. Travis shows more regressions. So even if this is theoretically good, for now it's just an amusing experiment and we should continue ignoring these checks. Maybe in a chalky future with lazy normalization we'll be able to do this. Feel free to close after review.

@leoyvens leoyvens changed the title Make the WF skip less binders Make the WF check skip less binders May 17, 2018
@rust-highfive
Copy link
Collaborator

r? @michaelwoerister

(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 May 17, 2018
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-3.9 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:26:45]    Compiling rls-data v0.16.0
[00:26:46]    Compiling backtrace v0.3.6
[00:26:49]    Compiling rustc-rayon v0.1.0
[00:26:55]    Compiling rustc_data_structures v0.0.0 (file:///checkout/src/librustc_data_structures)
[00:26:56] error[E0271]: type mismatch resolving `for<'graph> <<Self as control_flow_graph::GraphPredecessors<'graph>>::Iter as std::iter::Iterator>::Item == <Self as control_flow_graph::GraphPredecessors<'graph>>::Item`
[00:26:56]   --> librustc_data_structures/control_flow_graph/mod.rs:20:1
[00:26:56]    |
[00:26:56] 20 | / pub trait ControlFlowGraph
[00:26:56] 21 | |     where Self: for<'graph> GraphPredecessors<'graph, Item=<Self as ControlFlowGraph>::Node>,
[00:26:56] 22 | |           Self: for<'graph> GraphSuccessors<'graph, Item=<Self as ControlFlowGraph>::Node>
[00:26:56] 23 | | {
[00:26:56] ...  |
[00:26:56] 31 | |                             -> <Self as GraphSuccessors<'graph>>::Iter;
[00:26:56] 32 | | }
[00:26:56]    | |_^ expected contraph>::Node>,
[00:26:56] 22 | |           Self: for<'graph> GraphSuccessors<'graph, Item=<Self as ControlFlowGraph>::Node>
[00:26:56] 23 | | {
[00:26:56] ...  |
[00:26:56] 31 | |                             -> <Self as GraphSuccessors<'graph>>::Iter;
[00:26:56] 32 | | }
[00:26:56]    | |_^ expected control_flow_graph::ControlFlowGraph::Node, found control_flow_graph::GraphSuccessors::Item
[00:26:56]    |
[00:26:56]    = note: expected type `<Self as control_flow_graph::ControlFlowGraph>::Node`
[00:26:56]               found type `<Self as control_flow_graph::GraphSuccessors<'_>>::Item`
[00:26:56] note: required by `control_flow_graph::GraphSuccessors`
[00:26:56]   --> librustc_data_structures/control_flow_graph/mod.rs:39:1
[00:26:56]    |
[00:26:56] 39 | pub trait GraphSuccessors<'graph> {
[00:26:56] 
[00:26:56] 
ssors<'graph>>::Item`
[00:26:56]   --> librustc_data_structures/control_flow_graph/mod.rs:28:5
[00:26:56]    |
[00:26:56] 28 | /     fn predecessors<'graph>(&'graph self, node: Self::Node)
[00:26:56] 29 | |                             -> <Self as GraphPredecessors<'graph>>::Iter;
[00:26:56]    | |_________________________________________________________________________^ expected control_flow_graph::ControlFlowGraph::Node, found control_flow_graph::GraphPredecessors::Item
[00:26:56]    |
[00:26:56]    = note: expected type `<Self as control_flow_graph::ControlFlowGraph>::Node`
[00:26:56]               found type `<Self as control_flow_graph::GraphPredecessors<'_>>::Item`
[00:26:56] note: required by `control_flow_graph::GraphPredecessors`
[00:26:56]   --> librustc_data_structures/control_flow_graph/mod.rs:34:1
[00:26:56]    |
[00:26:56] 34 | pub trait GraphPredecessors<'graph> {
[00:26:56] 
[00:26:56] 
[00:26:56] color" "always" "--features" " jemalloc" "--manifest-path" "/checkout/src/rustc/Cargo.toml" "--message-format" "json"
[00:26:56] expected success, got: exit code: 101
[00:26:56] thread 'main' panicked at 'cargo must succeed', bootstrap/compile.rs:1091:9
[00:26:56] travis_fold:end:stage1-rustc

[00:26:56] travis_time:end:stage1-rustc:start=1526519020161639596,finish=1526519062654287402,duration=42492647806


[00:26:56] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap build
[00:26:56] Build completed unsuccessfully in 0:21:37
[00:26:56] make: *** [all] Error 1
[00:26:56] Makefile:28: recipe for target 'all' failed

The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:3acb07c5
$ 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)

Skip the binder in less places during WF check. I thought this might help fix rust-lang#50781, but I couldn't actually observe any effect for this changes. Maybe it's still a worthwhile refactoring since skipping binders is generally a bad thing. There is a (manageble) conflict with rust-lang#50183.
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-3.9 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:23:23]    Compiling parking_lot v0.5.5
[00:23:25]    Compiling flate2 v1.0.1
[00:23:25]    Compiling backtrace v0.3.6
[00:23:31]    Compiling rustc-rayon v0.1.0
aph>::Node>,
[00:23:35] 22 | |           Self: for<'graph> GraphSuccessors<'graph, Item=<Self as ControlFlowGraph>::Node>
[00:23:35] 23 | | {
[00:23:35] ...  |
[00:23:35] 31 | |                             -> <Self as GraphSuccessors<'graph>>::Iter;
[00:23:35] 32 | | }
[00:23:35]    | |_^ expected control_flow_graph::ControlFlowGraph::Node, found control_flow_graph::GraphSuccessors::Item
[00:23:35]    |
[00:23:35]    = note: expected type `<Self as control_flow_graph::ControlFlowGraph>::Node`
[00:23:35]               found type `<Self as control_flow_graph::GraphSuccessors<'_>>::Item`
[00:23:35] note: required by `control_flow_graph::GraphSuccessors`
[00:23:35]   --> librustc_data_structures/control_flow_graph/mod.rs:39:1
[00:23:35]    |
[00:23:35] 39 | pub trait GraphSuccessors<'graph> {
[00:23:35] 
[00:23:35] 
[00:23:35] error[E0271]: type mismatch resolving `for<'graph> <<Self as control_flow_graph::GraphPredecessors<'graph>>::Iter as std::iter::Iterator>::Item == <Self as control_flow_graph::GraphPredecessors<'graph>>::Item`
[00:23:35]   --> librustc_data_structures/control_flow_graph/mod.rs:26:5
[00:23:35]    |
[00:23:35] 26 |     fn num_nodes(&self) -> usize;
[00:23:35]    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected control_flow_graph::ControlFlowGraph::Node, found control_flow_graph::GraphPredecessors::Item
[00:23:35]    |
[00:23:35]    = note: expected type `<Self as control_flow_graph::ControlFlowGraph>::Node`
[00:23:35]               found type `<Self as control_flow_graph::GraphPredecessors<'_>>::Item`
[00:23:35] note: required by `control_flow_graph::GraphPredecessors`
[00:23:35]   --> librustc_data_structures/control_flow_graph/mod.rs:34:1
[00:23:35]    |
[00:23:35] 34 | pub trait GraphPredecessors<'graph> {
[00:23:35] 
[00:23:35] 
[00:23:35] error[E0271]: type mismatch resolving `for<'graph> <<Self as control_flow_graph::GraphSuccessors<'graph>>::Iter as std::iter::Iterator>::Item == <Self as control_flow_graph::GraphSuccessors<'graph>>::Item`
[00:23:35]   --> librustc_data_structures/control_flow_graph/mod.rs:26:5
[00:23:35]    |
[00:23:35] 26 |     fn num_nodes(&self) -> usize;
[00:23:35]    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected control_flow_graph::ControlFlowGraph::Node, found control_flow_graph::GraphSuccessors::Item
[00:23:35]    |
[00:23:35]    = note: expected type `<Self as control_flow_graph::ControlFlowGraph>::Node`
[00:23:35]               found type `<Self as control_flow_graph::GraphSuccessors<'_>>::Item`
[00:23:35] note: required by `control_flow_graph::GraphSuccessors`
[00:23:35]   --> librustc_data_structures/control_flow_graph/mod.rs:39:1
[00:23:35]    |
[00:23:35] 39 | pub trait GraphSuccessors<'graph> {
[00:23:35] 
[00:23:35] 
[00:23:35] error[E0271]: type mismatch resolving `for<'graph> <<Self as control_flow_graph::GraphPredecessors<'graph>>::Iter as std::iter::Iterator>::Item == <Self as control_flow_graph::GraphPredecessors<'graph>>::Item`
[00:23:35]   --> librustc_data_structures/control_flow_graph/mod.rs:27:5
[00:23:35]    |
[00:23:35] 27 |     fn start_node(&self) -> Self::Node;
[00:23:35]    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected control_flow_graph::ControlFlowGraph::Node, found control_flow_graph::GraphPredecessors::Item
[00:23:35]    |
[00:23:35]    = note: expected type `<Self as control_flow_graph::ControlFlowGraph>::Node`
[00:23:35]               found type `<Self as control_flow_graph::GraphPredecessors<'_>>::Item`
[00:23:35] note: required by `control_flow_graph::GraphPredecessors`
[00:23:35]   --> librustc_data_structures/control_flow_graph/mod.rs:34:1
[00:23:35]    |
[00:23:35] 34 | pub trait GraphPredecessors<'graph> {
[00:23:35] 
[00:23:35] 
[00:23:35] error[E0271]: type mismatch resolving `for<'graph> <<Self as control_flo^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[00:23:35] 
[00:23:35] error[E0271]: type mismatch resolving `for<'graph> <<Self as control_flow_graph::GraphSuccessors<'graph>>::Iter as std::iter::Iterator>::Item == <Self as control_flow_graph::GraphSuccessors<'graph>>::Item`
[00:23:35]   --> librustc_data_structures/control_flow_graph/mod.rs:28:5
[00:23:35]    |
[00:23:35] 28 | /     fn predecessors<'graph>(&'graph self, node: Self::Node)
[00:23:35] 29 | |                             -> <Self as GraphPredecessors<'graph>>::Iter;
[00:23:35]    | |_________________________________________________________________________^ expected control_flow_graph::ControlFlowGraph::Node, found control_flow_graph::GraphSuccessors::Item
[00:23:35]    |
[00:23:35]    = note: expected type `<Self as control_flow_graph::ControlFlowGraph>::Node`
[00:23:35]               found type `<Self as control_flow_graph::GraphSuccessors<'_>>::Item`
[00:23:35] note: required by `control_flow_graph::GraphSuccessors`
[00:23:35]   --> librustc_data_structures/control_flow_graph/mod.rs:39:1
[00:23:35] 
[00:23:35] For more information about this error, try `rustc --explain E0271`.
[00:23:35] error: Could not compile `rustc_data_structures`.
[00:23:35] 
[00:23:35] 
[00:23:35] Caused by:
[00:23:35]   process didn't exit successfully: `/checkout/obj/build/bootstrap/debug/rustc --crate-name rustc_data_structures librustc_data_structures/lib.rs --color always --error-format json --crate-type dylib --emit=dep-info,link -C prefer-dynamic -C opt-level=3 -C metadata=ec2ad06f18660d2e -C extra-filename=-ec2ad06f18660d2e --out-dir /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps --target x86_64-unknown-linux-gnu -L dependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps -L dependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/release/deps --extern rustc_cratesio_shim=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_cratesio_shim-a8b86095ac289705.so --extern ena=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/libena-75092fb9537b4804.rlib --extern stable_deref_trait=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/libstable_deref_trait-fee7d6c5c9c3b040.rlib --extern rustc_rayon=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_rayon-c14546c9879586fd.rlib --extern log=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/liblog-c485a7f1a48de680.rlib --extern serialize=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/libserialize-09bdd144093f3a08.so --extern serialize=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/libserialize-09bdd144093f3a08.rlib --extern parking_lot_core=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/libparking_lot_core-1b979a7cb32e7a25.rlib --extern parking_lot=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/libparking_lot-9090f533a9ec98a5.rlib --extern cfg_if=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/libcfg_if-b413daa63d1ce253.rlib` (exit code: 101)
[00:23:35] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "build" "--target" "x86_64-unknown-linux-gnu" "--release" "--locked" "--color" "always" "--features" " jemalloc" "--manifest-path" "/checkout/src/rustc/Cargo.toml" "--message-format" "json"
[00:23:35] expected success, got: exit code: 101
[00:23:35] thread 'main' panicked at 'cargo must succeed', bootstrap/compile.rs:1091:9
[00:23:35] travis_fold:end:stage1-rustc

[00:23:35] travis_time:end:stage1-rustc:start=1526521189383890676,finish=1526521226781895510,duration=37398004834


[00:23:35] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap build
[00:23:35] Build completed unsuccessfully in 0:18:34
[00:23:35] Makefile:28: recipe for target 'all' failed
[00:23:35] make: *** [all] Error 1

The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:05dd599c
$ 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)

@michaelwoerister
Copy link
Member

r? @nikomatsakis for re-assignment

@pietroalbini
Copy link
Member

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

@leoyvens
Copy link
Contributor Author

This isn't actionable right now due to regressions so I've opened #50935 to track this.

@leoyvens leoyvens closed this May 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants