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

Rollup of 7 pull requests #67526

Closed
wants to merge 28 commits into from
Closed

Conversation

Centril
Copy link
Contributor

@Centril Centril commented Dec 22, 2019

Successful merges:

Failed merges:

r? @ghost

pvdrz and others added 28 commits December 14, 2019 12:13
The contents of this file have been moved in rust-lang#56932 (520e8b0) and the
file should have been removed as well.
When moving the script out of CI configuration and into a proper script
we lost track of the current directory changing (and as such the
parameters of the script needing to be different now).
…r=oli-obk

Add simpler entry points to const eval for common usages.

I found the `tcx.const_eval` API to be complex/awkward to work with, because of the inherent complexity from all of the different situations it is called from. Though it mainly used in one of the following ways:
- Evaluates the value of a constant without any substitutions, e.g. evaluating a static, discriminant, etc.
- Evaluates the value of a resolved instance of a constant. this happens when evaluating unevaluated constants or normalising trait constants.
- Evaluates a promoted constant.

This PR adds three new functions `const_eval_mono`, `const_eval_resolve`, and `const_eval_promoted` to `TyCtxt`, which each cater to one of the three ways `tcx.const_eval`
 is normally used.
…=matthewjasper

Refactorings to borrowck region diagnostic reporting

This PR is a followup to rust-lang#66886 and rust-lang#67404

EDIT: updated

In this PR:  Clean up how errors are collected from NLL: introduce `borrow_check::diagnostics::RegionErrors` to collect errors. This is later passed to `MirBorrowckCtx::report_region_errors` after the `MirBorrowckCtx` is created. This will allow us to refactor away some of the extra context structs floating around (but we don't do it in this PR).  `borrow_check::region_infer` is now mostly free of diagnostic generating code. The signatures of most of the functions in `region_infer` lose somewhere between 4 and 7 arguments :)

Left for future (feedback appreciated):

- Merge `ErrorRegionCtx` with `MirBorrowckCtx`, as suggested by @matthewjasper in rust-lang#66886 (comment)
- Maybe move the contents of `borrow_check::nll` into `borrow_check` and remove the `nll` submodule altogether.
- Find a way to make `borrow_check::diagnostics::region_errors` less of a strange appendage to `RegionInferenceContext`. I'm not really sure how to do this yet. Ideas welcome.
… r=RalfJung

Add `ImmTy::try_from_(u)int` methods

r? @RalfJung
…-DPC

Remove iter_private.rs

The contents of this file have been moved in rust-lang#56932 (520e8b0) and the file should have been removed as well.
Document why Any is not an unsafe trait

The added documentation is not public (i.e., not in a doc comment) but that seems appropriate for this sort of low-level detail.

Fixes rust-lang#62303
…r, r=Centril

Utilize rust-lang/rust commit hashes in toolstate

When moving the script out of CI configuration and into a proper script
we lost track of the current directory changing (and as such the
parameters of the script needing to be different now).
@Centril
Copy link
Contributor Author

Centril commented Dec 22, 2019

@bors r+ p=200 rollup=never

@bors
Copy link
Contributor

bors commented Dec 22, 2019

📌 Commit 17a6d4e has been approved by Centril

@bors
Copy link
Contributor

bors commented Dec 22, 2019

🌲 The tree is currently closed for pull requests below priority 100, this pull request will be tested once the tree is reopened

@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Dec 22, 2019
@Centril Centril added the rollup A PR which is a rollup label Dec 22, 2019
@bors
Copy link
Contributor

bors commented Dec 22, 2019

⌛ Testing commit 17a6d4e with merge eedc447e0534429662e13cec0e2a05440217f6f6...

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-nopt of your PR failed (pretty log, 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.
2019-12-22T18:40:18.3864612Z ---- [ui (nll)] ui/hrtb/hrtb-perfect-forwarding.rs stdout ----
2019-12-22T18:40:18.3864704Z diff of stderr:
2019-12-22T18:40:18.3864746Z 
2019-12-22T18:40:18.3864822Z 44    |
2019-12-22T18:40:18.3864897Z 45    = help: a `loop` may express intention better if this is on purpose
2019-12-22T18:40:18.3865240Z - error: higher-ranked subtype error
2019-12-22T18:40:18.3865542Z -   --> $DIR/hrtb-perfect-forwarding.rs:46:5
2019-12-22T18:40:18.3865770Z -    |
2019-12-22T18:40:18.3865770Z -    |
2019-12-22T18:40:18.3865996Z - LL |     foo_hrtb_bar_not(&mut t);
2019-12-22T18:40:18.3866445Z - 
2019-12-22T18:40:18.3866527Z 53 error: lifetime may not live long enough
2019-12-22T18:40:18.3866793Z 54   --> $DIR/hrtb-perfect-forwarding.rs:46:5
2019-12-22T18:40:18.3866880Z 55    |
---
2019-12-22T18:40:18.3867635Z + 
2019-12-22T18:40:18.3867874Z + error: higher-ranked subtype error
2019-12-22T18:40:18.3868119Z +   --> $DIR/hrtb-perfect-forwarding.rs:46:5
2019-12-22T18:40:18.3868204Z +    |
2019-12-22T18:40:18.3868262Z + LL |     foo_hrtb_bar_not(&mut t);
2019-12-22T18:40:18.3868421Z 63 
2019-12-22T18:40:18.3868504Z 64 warning: function cannot return without recursing
2019-12-22T18:40:18.3868776Z 65   --> $DIR/hrtb-perfect-forwarding.rs:49:1
2019-12-22T18:40:18.3868825Z 
2019-12-22T18:40:18.3868825Z 
2019-12-22T18:40:18.3868860Z 
2019-12-22T18:40:18.3868943Z The actual stderr differed from the expected stderr.
2019-12-22T18:40:18.3869331Z Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/hrtb/hrtb-perfect-forwarding.nll/hrtb-perfect-forwarding.nll.stderr
2019-12-22T18:40:18.3869656Z To update references, rerun the tests and pass the `--bless` flag
2019-12-22T18:40:18.3869967Z To only update this specific test, also pass `--test-args hrtb/hrtb-perfect-forwarding.rs`
2019-12-22T18:40:18.3870107Z error: 1 errors occurred comparing output.
2019-12-22T18:40:18.3870193Z status: exit code: 1
2019-12-22T18:40:18.3870193Z status: exit code: 1
2019-12-22T18:40:18.3871780Z command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/hrtb/hrtb-perfect-forwarding.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/hrtb/hrtb-perfect-forwarding.nll" "-Zborrowck=mir" "-Crpath" "-Cdebuginfo=0" "-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/hrtb/hrtb-perfect-forwarding.nll/auxiliary" "-A" "unused"
2019-12-22T18:40:18.3872444Z ------------------------------------------
2019-12-22T18:40:18.3872497Z 
2019-12-22T18:40:18.3872751Z ------------------------------------------
2019-12-22T18:40:18.3872835Z stderr:
2019-12-22T18:40:18.3872835Z stderr:
2019-12-22T18:40:18.3873066Z ------------------------------------------
2019-12-22T18:40:18.3873160Z warning: function cannot return without recursing
2019-12-22T18:40:18.3873433Z   --> /checkout/src/test/ui/hrtb/hrtb-perfect-forwarding.rs:22:1
2019-12-22T18:40:18.3873537Z    |
2019-12-22T18:40:18.3873769Z LL | / fn no_hrtb<'b,T>(mut t: T)
2019-12-22T18:40:18.3874016Z LL | |     where T : Bar<&'b isize>
2019-12-22T18:40:18.3874086Z LL | | {
2019-12-22T18:40:18.3874379Z LL | |     // OK -- `T : Bar<&'b isize>`, and thus the impl above ensures that
2019-12-22T18:40:18.3874773Z LL | |     // `&mut T : Bar<&'b isize>`.
2019-12-22T18:40:18.3874861Z LL | |     no_hrtb(&mut t);
2019-12-22T18:40:18.3875119Z    | |     --------------- recursive call site
2019-12-22T18:40:18.3875192Z LL | | }
2019-12-22T18:40:18.3875269Z    | |_^ cannot return without recursing
2019-12-22T18:40:18.3875419Z    = note: `#[warn(unconditional_recursion)]` on by default
2019-12-22T18:40:18.3875419Z    = note: `#[warn(unconditional_recursion)]` on by default
2019-12-22T18:40:18.3875511Z    = help: a `loop` may express intention better if this is on purpose
2019-12-22T18:40:18.3875647Z warning: function cannot return without recursing
2019-12-22T18:40:18.3875948Z   --> /checkout/src/test/ui/hrtb/hrtb-perfect-forwarding.rs:30:1
2019-12-22T18:40:18.3876026Z    |
2019-12-22T18:40:18.3876026Z    |
2019-12-22T18:40:18.3876102Z LL | / fn bar_hrtb<T>(mut t: T)
2019-12-22T18:40:18.3876343Z LL | |     where T : for<'b> Bar<&'b isize>
2019-12-22T18:40:18.3876430Z LL | | {
2019-12-22T18:40:18.3876696Z LL | |     // OK -- `T : for<'b> Bar<&'b isize>`, and thus the impl above
2019-12-22T18:40:18.3876798Z ...  |
2019-12-22T18:40:18.3876858Z LL | |     bar_hrtb(&mut t);
2019-12-22T18:40:18.3877121Z    | |     ---------------- recursive call site
2019-12-22T18:40:18.3877193Z LL | | }
2019-12-22T18:40:18.3877269Z    | |_^ cannot return without recursing
2019-12-22T18:40:18.3877350Z    |
2019-12-22T18:40:18.3877422Z    = help: a `loop` may express intention better if this is on purpose
2019-12-22T18:40:18.3877557Z warning: function cannot return without recursing
2019-12-22T18:40:18.3877831Z   --> /checkout/src/test/ui/hrtb/hrtb-perfect-forwarding.rs:39:1
2019-12-22T18:40:18.3877921Z    |
2019-12-22T18:40:18.3877921Z    |
2019-12-22T18:40:18.3878171Z LL | / fn foo_hrtb_bar_not<'b,T>(mut t: T)
2019-12-22T18:40:18.3878441Z LL | |     where T : for<'a> Foo<&'a isize> + Bar<&'b isize>
2019-12-22T18:40:18.3878531Z LL | | {
2019-12-22T18:40:18.3878804Z LL | |     // Not OK -- The forwarding impl for `Foo` requires that `Bar` also
2019-12-22T18:40:18.3878909Z ...  |
2019-12-22T18:40:18.3878978Z LL | |     foo_hrtb_bar_not(&mut t); //~ ERROR mismatched types
2019-12-22T18:40:18.3879259Z    | |     ------------------------ recursive call site
2019-12-22T18:40:18.3879332Z LL | | }
2019-12-22T18:40:18.3879408Z    | |_^ cannot return without recursing
2019-12-22T18:40:18.3879474Z    |
2019-12-22T18:40:18.3879562Z    = help: a `loop` may express intention better if this is on purpose
2019-12-22T18:40:18.3879692Z error: lifetime may not live long enough
2019-12-22T18:40:18.3879960Z   --> /checkout/src/test/ui/hrtb/hrtb-perfect-forwarding.rs:46:5
2019-12-22T18:40:18.3880050Z    |
2019-12-22T18:40:18.3880050Z    |
2019-12-22T18:40:18.3880276Z LL | fn foo_hrtb_bar_not<'b,T>(mut t: T)
2019-12-22T18:40:18.3880724Z ...
2019-12-22T18:40:18.3880724Z ...
2019-12-22T18:40:18.3880794Z LL |     foo_hrtb_bar_not(&mut t); //~ ERROR mismatched types
2019-12-22T18:40:18.3881118Z    |     ^^^^^^^^^^^^^^^^^^^^^^^^ requires that `'b` must outlive `'static`
2019-12-22T18:40:18.3881464Z    = help: consider replacing `'b` with `'static`
2019-12-22T18:40:18.3881514Z 
2019-12-22T18:40:18.3881747Z error: higher-ranked subtype error
2019-12-22T18:40:18.3882014Z   --> /checkout/src/test/ui/hrtb/hrtb-perfect-forwarding.rs:46:5
2019-12-22T18:40:18.3882014Z   --> /checkout/src/test/ui/hrtb/hrtb-perfect-forwarding.rs:46:5
2019-12-22T18:40:18.3882104Z    |
2019-12-22T18:40:18.3882172Z LL |     foo_hrtb_bar_not(&mut t); //~ ERROR mismatched types
2019-12-22T18:40:18.3882307Z 
2019-12-22T18:40:18.3882388Z warning: function cannot return without recursing
2019-12-22T18:40:18.3882661Z   --> /checkout/src/test/ui/hrtb/hrtb-perfect-forwarding.rs:49:1
2019-12-22T18:40:18.3882760Z    |
2019-12-22T18:40:18.3882760Z    |
2019-12-22T18:40:18.3882822Z LL | / fn foo_hrtb_bar_hrtb<T>(mut t: T)
2019-12-22T18:40:18.3883109Z LL | |     where T : for<'a> Foo<&'a isize> + for<'b> Bar<&'b isize>
2019-12-22T18:40:18.3883188Z LL | | {
2019-12-22T18:40:18.3883511Z LL | |     // OK -- now we have `T : for<'b> Bar&'b isize>`.
2019-12-22T18:40:18.3883680Z LL | |     foo_hrtb_bar_hrtb(&mut t);
2019-12-22T18:40:18.3883976Z    | |     ------------------------- recursive call site
2019-12-22T18:40:18.3884050Z LL | | }
2019-12-22T18:40:18.3884126Z    | |_^ cannot return without recursing
2019-12-22T18:40:18.3884192Z    |
2019-12-22T18:40:18.3884278Z    = help: a `loop` may express intention better if this is on purpose
2019-12-22T18:40:18.3884409Z error: aborting due to 2 previous errors
2019-12-22T18:40:18.3884454Z 
2019-12-22T18:40:18.3884489Z 
2019-12-22T18:40:18.3884738Z ------------------------------------------
---
2019-12-22T18:40:18.3894936Z thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:537:22
2019-12-22T18:40:18.3895057Z note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
2019-12-22T18:40:18.3914631Z 
2019-12-22T18:40:19.3359087Z 
2019-12-22T18:40:19.3364113Z command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "--compile-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" "--run-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--src-base" "/checkout/src/test/ui" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--mode" "ui" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/checkout/obj/build/x86_64-unknown-linux-gnu/llvm/build/bin/FileCheck" "--host-rustcflags" "-Crpath -Cdebuginfo=0 -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--target-rustcflags" "-Crpath -Cdebuginfo=0 -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--docck-python" "/usr/bin/python2.7" "--lldb-python" "/usr/bin/python2.7" "--gdb" "/usr/bin/gdb" "--llvm-version" "9.0.0-rust-1.42.0-nightly\n" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--llvm-cxxflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always" "--compare-mode" "nll"
2019-12-22T18:40:19.3365679Z 
2019-12-22T18:40:19.3365837Z 
2019-12-22T18:40:19.3366146Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
2019-12-22T18:40:19.3366739Z Build completed unsuccessfully in 1:41:53
2019-12-22T18:40:19.3366739Z Build completed unsuccessfully in 1:41:53
2019-12-22T18:40:19.3367000Z == clock drift check ==
2019-12-22T18:40:19.3367206Z   local time: Sun Dec 22 18:40:18 UTC 2019
2019-12-22T18:40:19.3367395Z   network time: Sun, 22 Dec 2019 18:40:18 GMT
2019-12-22T18:40:19.3367597Z == end clock drift check ==
2019-12-22T18:40:19.4682323Z 
2019-12-22T18:40:19.4818236Z ##[error]Bash exited with code '1'.
2019-12-22T18:40:19.4868995Z ##[section]Starting: Checkout
2019-12-22T18:40:19.4870941Z ==============================================================================
2019-12-22T18:40:19.4871032Z Task         : Get sources
2019-12-22T18:40:19.4871432Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.

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)

@bors
Copy link
Contributor

bors commented Dec 22, 2019

💔 Test failed - checks-azure

@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 22, 2019
@Centril Centril closed this Dec 22, 2019
@Centril Centril deleted the rollup-defqbpp branch December 22, 2019 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rollup A PR which is a rollup 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.

8 participants