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

A lot of refactoring to remove more Binder::binds #80106

Merged
merged 2 commits into from
Dec 19, 2020

Conversation

jackh726
Copy link
Member

Split out from #76814

@rust-highfive
Copy link
Collaborator

r? @varkor

(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 Dec 17, 2020
@jackh726
Copy link
Member Author

Probably either @lcnr, @matthewjasper, or @nikomatsakis are most interested/best to review this. But there aren't really any specific semantic changes here, so anyone should feel free to review.

@lcnr
Copy link
Contributor

lcnr commented Dec 17, 2020

r? @lcnr

@rust-highfive rust-highfive assigned lcnr and unassigned varkor Dec 17, 2020
@jackh726 jackh726 force-pushed the binder-refactor-part-2 branch 3 times, most recently from 5f4dec5 to 5472be2 Compare December 17, 2020 17:38
@jackh726
Copy link
Member Author

Was able to get away with not adding rebind(()) since Ty is Copy. Which means that there's no need to add the bound_vars() function yet.

@jackh726 jackh726 force-pushed the binder-refactor-part-2 branch 2 times, most recently from 9362618 to c60e2d0 Compare December 18, 2020 18:56
@rust-log-analyzer
Copy link
Collaborator

The job mingw-check failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
GITHUB_ENV=/home/runner/work/_temp/_runner_file_commands/set_env_1ed70fe0-d9a5-40fb-a218-7ddcf281212a
GITHUB_EVENT_NAME=pull_request
GITHUB_EVENT_PATH=/home/runner/work/_temp/_github_workflow/event.json
GITHUB_GRAPHQL_URL=https://api.github.com/graphql
GITHUB_HEAD_REF=binder-refactor-part-2
GITHUB_JOB=pr
GITHUB_PATH=/home/runner/work/_temp/_runner_file_commands/add_path_1ed70fe0-d9a5-40fb-a218-7ddcf281212a
GITHUB_REF=refs/pull/80106/merge
GITHUB_REPOSITORY_OWNER=rust-lang
GITHUB_RETENTION_DAYS=90
GITHUB_RUN_ID=431138358
GITHUB_RUN_NUMBER=21630
---
Collecting six>=1.5 (from python-dateutil<3.0.0,>=2.1; python_version >= "2.7"->botocore==1.12.197->awscli)
Building wheels for collected packages: PyYAML
  Running setup.py bdist_wheel for PyYAML: started
  Running setup.py bdist_wheel for PyYAML: finished with status 'error'
  Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-kuz7vgqn/PyYAML/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmpjx4n_7l2pip-wheel- --python-tag cp36:
     or: -c --help [cmd1 cmd2 ...]
     or: -c --help-commands
     or: -c cmd --help
  
---
    Checking rustc_codegen_ssa v0.0.0 (/checkout/compiler/rustc_codegen_ssa)
    Checking rustc_resolve v0.0.0 (/checkout/compiler/rustc_resolve)
    Checking rustc_trait_selection v0.0.0 (/checkout/compiler/rustc_trait_selection)
    Checking rustc_codegen_llvm v0.0.0 (/checkout/compiler/rustc_codegen_llvm)
error[E0599]: no method named `has_escaping_bound_vars` found for reference `&TyS<'_>` in the current scope
   --> compiler/rustc_trait_selection/src/traits/select/confirmation.rs:263:32
    |
263 |         debug_assert!(!self_ty.has_escaping_bound_vars());
    |                                ^^^^^^^^^^^^^^^^^^^^^^^ method not found in `&TyS<'_>`
    = help: items from traits can only be used if the trait is in scope
    = note: the following trait is implemented but not in scope; perhaps add a `use` for it:
    = note: the following trait is implemented but not in scope; perhaps add a `use` for it:
            `use crate::rustc_middle::ty::TypeFoldable;`
error: aborting due to previous error

For more information about this error, try `rustc --explain E0599`.
error: could not compile `rustc_trait_selection`
error: could not compile `rustc_trait_selection`

To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: build failed
command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "check" "--target" "x86_64-unknown-linux-gnu" "-Zbinary-dep-depinfo" "-j" "16" "--release" "--color" "always" "--features" " llvm max_level_info" "--manifest-path" "/checkout/compiler/rustc/Cargo.toml" "-p" "rustc-main" "-p" "rustc_codegen_ssa" "-p" "rustc_apfloat" "-p" "rustc_target" "-p" "rustc_session" "-p" "rustc_lint_defs" "-p" "rustc_feature" "-p" "rustc_middle" "-p" "rustc_query_system" "-p" "rustc_type_ir" "-p" "rustc_arena" "-p" "rustc_data_structures" "-p" "rustc_graphviz" "-p" "rustc_serialize" "-p" "rustc_errors" "-p" "rustc_incremental" "-p" "rustc_index" "-p" "rustc_span" "-p" "rustc_symbol_mangling" "-p" "rustc_ast" "-p" "rustc_lexer" "-p" "rustc_fs_util" "-p" "rustc_attr" "-p" "rustc_ast_pretty" "-p" "rustc_hir" "-p" "rustc_macros" "-p" "rustc_driver" "-p" "rustc_parse" "-p" "rustc_mir" "-p" "rustc_trait_selection" "-p" "rustc_parse_format" "-p" "rustc_infer" "-p" "coverage_test_macros" "-p" "rustc_lint" "-p" "rustc_hir_pretty" "-p" "rustc_error_codes" "-p" "rustc_metadata" "-p" "rustc_expand" "-p" "rustc_ast_passes" "-p" "rustc_save_analysis" "-p" "rustc_interface" "-p" "rustc_privacy" "-p" "rustc_builtin_macros" "-p" "rustc_mir_build" "-p" "rustc_codegen_llvm" "-p" "rustc_llvm" "-p" "rustc_passes" "-p" "rustc_ast_lowering" "-p" "rustc_typeck" "-p" "rustc_ty_utils" "-p" "rustc_traits" "-p" "rustc_resolve" "-p" "rustc_plugin_impl" "--message-format" "json-render-diagnostics"
failed to run: /checkout/obj/build/bootstrap/debug/bootstrap check
Build completed unsuccessfully in 0:02:42
== clock drift check ==
  local time: Fri Dec 18 19:00:55 UTC 2020

@lcnr
Copy link
Contributor

lcnr commented Dec 18, 2020

@bors r+ rollup=never

@bors
Copy link
Contributor

bors commented Dec 18, 2020

📌 Commit 2ac76ad3fd3ce2b8e2c5714f0b4c3a0ee3991f16 has been approved by lcnr

@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-review Status: Awaiting review from the assignee but also interested parties. labels Dec 18, 2020
@bors
Copy link
Contributor

bors commented Dec 18, 2020

⌛ Testing commit 2ac76ad3fd3ce2b8e2c5714f0b4c3a0ee3991f16 with merge 5552e6dba4a042e086ba03a9c99218994810e93a...

@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
Collecting six>=1.5 (from python-dateutil<3.0.0,>=2.1; python_version >= "2.7"->botocore==1.12.197->awscli)
Building wheels for collected packages: PyYAML
  Running setup.py bdist_wheel for PyYAML: started
  Running setup.py bdist_wheel for PyYAML: finished with status 'error'
  Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-orpsf3ft/PyYAML/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmppxhro4ixpip-wheel- --python-tag cp36:
     or: -c --help [cmd1 cmd2 ...]
     or: -c --help-commands
     or: -c cmd --help
  
---
[RUSTC-TIMING] rustc_save_analysis test:false 1.297
[RUSTC-TIMING] rustc_incremental test:false 1.511
    Checking rustc_codegen_ssa v0.0.0 (/checkout/compiler/rustc_codegen_ssa)
 Documenting rustc_codegen_ssa v0.0.0 (/checkout/compiler/rustc_codegen_ssa)
thread 'rustc' panicked at 'assertion failed: !self_ty.has_escaping_bound_vars()', compiler/rustc_trait_selection/src/traits/select/confirmation.rs:263:9

error: internal compiler error: unexpected panic

error: Unrecognized option: 'crate-version'
error: Unrecognized option: 'crate-version'

error: could not document `rustc_metadata`

Caused by:
  process didn't exit successfully: `/checkout/obj/build/bootstrap/debug/rustdoc --edition=2018 --crate-type lib --crate-name rustc_metadata compiler/rustc_metadata/src/lib.rs --target x86_64-unknown-linux-gnu -o /checkout/obj/build/x86_64-unknown-linux-gnu/stage2-rustc/x86_64-unknown-linux-gnu/doc --error-format=json --json=diagnostic-rendered-ansi -L dependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-rustc/x86_64-unknown-linux-gnu/release/deps -L dependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-rustc/release/deps --extern libc=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-rustc/x86_64-unknown-linux-gnu/release/deps/liblibc-e2e5f95c94b9ebe5.rmeta --extern memmap=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-rustc/x86_64-unknown-linux-gnu/release/deps/libmemmap-655c7a611c44abfb.rmeta --extern rustc_ast=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_ast-7d8cf70f368f78a6.rmeta --extern rustc_attr=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_attr-e9be6cb5925fb9a6.rmeta --extern rustc_data_structures=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_data_structures-a42cc08968175487.rmeta --extern rustc_errors=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_errors-6ebdab326bc0f697.rmeta --extern rustc_expand=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_expand-63ac5e2c8532b5ec.rmeta --extern rustc_feature=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_feature-197248a062a3bda0.rmeta --extern rustc_hir=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_hir-a8d75fa202cc88c6.rmeta --extern rustc_hir_pretty=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_hir_pretty-949b2f67ab30ae6e.rmeta --extern rustc_index=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_index-0ffc706890ac3289.rmeta --extern rustc_macros=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-rustc/release/deps/librustc_macros-80027740aa89c402.so --extern rustc_middle=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_middle-196ec2a62a9bf4e4.rmeta --extern rustc_serialize=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_serialize-9542c872d89f7c93.rmeta --extern rustc_session=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_session-51b48621a0a0480f.rmeta --extern rustc_span=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_span-11509a0f2f7ec719.rmeta --extern rustc_target=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_target-27d5c8b6ce7a9912.rmeta --extern smallvec=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-rustc/x86_64-unknown-linux-gnu/release/deps/libsmallvec-4ff2fc836b87e217.rmeta --extern snap=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-rustc/x86_64-unknown-linux-gnu/release/deps/libsnap-160a126f92fdbe47.rmeta --extern stable_deref_trait=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-rustc/x86_64-unknown-linux-gnu/release/deps/libstable_deref_trait-e43bdbdfe3c1fc3d.rmeta --extern tracing=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-rustc/x86_64-unknown-linux-gnu/release/deps/libtracing-ff5b6f9179259ca1.rmeta -Dwarnings -Winvalid_codeblock_attributes --crate-version '1.50.0-nightly
  (5552e6dba
  2020-12-18)' --document-private-items --enable-index-page -Zunstable-options -Znormalize-docs` (exit code: 1)
[RUSTC-TIMING] rustc_metadata test:false 4.507
[RUSTC-TIMING] rustc_infer test:false 6.609
[RUSTC-TIMING] rustc_codegen_ssa test:false 5.785
error: build failed
error: build failed


command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "doc" "--target" "x86_64-unknown-linux-gnu" "-Zbinary-dep-depinfo" "-j" "16" "--release" "--locked" "--color" "always" "--features" " llvm" "--manifest-path" "/checkout/compiler/rustc/Cargo.toml" "--no-deps" "-p" "rustc_target" "-p" "rustc_lexer" "-p" "rustc_metadata" "-p" "rustc_builtin_macros" "-p" "rustc_macros" "-p" "coverage_test_macros" "-p" "rustc_plugin_impl" "-p" "rustc_lint_defs" "-p" "rustc_infer" "-p" "rustc_codegen_ssa" "-p" "rustc_symbol_mangling" "-p" "rustc_ast" "-p" "rustc_type_ir" "-p" "rustc_typeck" "-p" "rustc_ast_lowering" "-p" "rustc_parse_format" "-p" "rustc_hir" "-p" "rustc_serialize" "-p" "rustc_hir_pretty" "-p" "rustc_llvm" "-p" "rustc_error_codes" "-p" "rustc_middle" "-p" "rustc_index" "-p" "rustc_arena" "-p" "rustc_driver" "-p" "rustc_span" "-p" "rustc_ast_pretty" "-p" "rustc_query_system" "-p" "rustc_ast_passes" "-p" "rustc_session" "-p" "rustc_ty_utils" "-p" "rustc_graphviz" "-p" "rustc_save_analysis" "-p" "rustc_mir_build" "-p" "rustc_parse" "-p" "rustc_interface" "-p" "rustc_data_structures" "-p" "rustc_trait_selection" "-p" "rustc_incremental" "-p" "rustc_errors" "-p" "rustc_expand" "-p" "rustc_apfloat" "-p" "rustc_codegen_llvm" "-p" "rustc_attr" "-p" "rustc_mir" "-p" "rustc_traits" "-p" "rustc_fs_util" "-p" "rustc_passes" "-p" "rustc_privacy" "-p" "rustc_resolve" "-p" "rustc_lint" "-p" "rustc_feature"


failed to run: /checkout/obj/build/bootstrap/debug/bootstrap --stage 2 test
Build completed unsuccessfully in 0:44:34

@bors
Copy link
Contributor

bors commented Dec 18, 2020

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Dec 18, 2020
@@ -1648,8 +1648,8 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
/// Bar<i32> where struct Bar<T> { x: T, y: u32 } -> [i32, u32]
/// Zed<i32> where enum Zed { A(T), B(u32) } -> [i32, u32]
/// ```
fn constituent_types_for_ty(&self, t: Ty<'tcx>) -> Vec<Ty<'tcx>> {
match *t.kind() {
fn constituent_types_for_ty(&self, t: ty::Binder<Ty<'tcx>>) -> ty::Binder<Vec<Ty<'tcx>>> {
Copy link
Member Author

Choose a reason for hiding this comment

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

@lcnr so as I was a little worried about, t can have bound vars. Not sure why the ty::Binder::dummy wasn't catching this. But now we're more explicit about this.

@lcnr
Copy link
Contributor

lcnr commented Dec 19, 2020

It looks like this only happens during cargo doc though and it seems relevant enough to pull out into a separate test. Do you have the time to extract a test case here? I sadly won't be able to in the next few weeks

@jackh726
Copy link
Member Author

It looks like this only happens during cargo doc though and it seems relevant enough to pull out into a separate test. Do you have the time to extract a test case here? I sadly won't be able to in the next few weeks

I can try this weekend, but I'd like to do that in separate PR.

@lcnr
Copy link
Contributor

lcnr commented Dec 19, 2020

@bors r+ rollup=never

@bors
Copy link
Contributor

bors commented Dec 19, 2020

📌 Commit 5e70958 has been approved by lcnr

@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-review Status: Awaiting review from the assignee but also interested parties. labels Dec 19, 2020
@bors
Copy link
Contributor

bors commented Dec 19, 2020

⌛ Testing commit 5e70958 with merge 8bb302d...

@bors
Copy link
Contributor

bors commented Dec 19, 2020

☀️ Test successful - checks-actions
Approved by: lcnr
Pushing 8bb302d to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Dec 19, 2020
@bors bors merged commit 8bb302d into rust-lang:master Dec 19, 2020
@rustbot rustbot added this to the 1.50.0 milestone Dec 19, 2020
@jackh726 jackh726 deleted the binder-refactor-part-2 branch December 19, 2020 18:33
JohnTitor added a commit to JohnTitor/rust-semverver that referenced this pull request Mar 31, 2021
JohnTitor added a commit to JohnTitor/rust-semverver that referenced this pull request Mar 31, 2021
JohnTitor added a commit to JohnTitor/rust-semverver that referenced this pull request Mar 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. 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.

7 participants