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

Add simpler entry points to const eval for common usages. #66877

Merged
merged 1 commit into from Dec 22, 2019

Conversation

@skinny121
Copy link
Contributor

skinny121 commented Nov 29, 2019

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

This comment has been minimized.

Copy link
Contributor

matthewjasper commented Nov 29, 2019

@rust-highfive

This comment has been minimized.

Copy link
Collaborator

rust-highfive commented Nov 29, 2019

The job x86_64-gnu-llvm-6.0 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-11-29T20:16:09.2724085Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-11-29T20:16:09.2887227Z ##[command]git config gc.auto 0
2019-11-29T20:16:09.2952066Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-11-29T20:16:10.1083580Z ##[command]git config --get-all http.proxy
2019-11-29T20:16:10.1094395Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/66877/merge:refs/remotes/pull/66877/merge
---
2019-11-29T20:21:45.1084103Z    Compiling serde_json v1.0.40
2019-11-29T20:21:46.6978396Z    Compiling tidy v0.1.0 (/checkout/src/tools/tidy)
2019-11-29T20:21:56.9171684Z     Finished release [optimized] target(s) in 1m 21s
2019-11-29T20:21:56.9262880Z tidy check
2019-11-29T20:21:57.7391025Z tidy error: /checkout/src/librustc/mir/interpret/mod.rs:611: line longer than 100 chars
2019-11-29T20:21:57.7391459Z tidy error: /checkout/src/librustc/mir/interpret/mod.rs: missing trailing newline
2019-11-29T20:21:59.5172759Z some tidy checks failed
2019-11-29T20:21:59.5178863Z Found 486 error codes
2019-11-29T20:21:59.5178934Z Found 0 error codes with no tests
2019-11-29T20:21:59.5178981Z Done!
2019-11-29T20:21:59.5178981Z Done!
2019-11-29T20:21:59.5184647Z 
2019-11-29T20:21:59.5184980Z 
2019-11-29T20:21:59.5185828Z 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"
2019-11-29T20:21:59.5186183Z 
2019-11-29T20:21:59.5186280Z 
2019-11-29T20:21:59.5186567Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test src/tools/tidy
2019-11-29T20:21:59.5186999Z Build completed unsuccessfully in 0:01:24
2019-11-29T20:21:59.5186999Z Build completed unsuccessfully in 0:01:24
2019-11-29T20:21:59.5242662Z == clock drift check ==
2019-11-29T20:21:59.5263961Z   local time: Fri Nov 29 20:21:59 UTC 2019
2019-11-29T20:21:59.8129915Z   network time: Fri, 29 Nov 2019 20:21:59 GMT
2019-11-29T20:21:59.8132404Z == end clock drift check ==
2019-11-29T20:22:01.1054298Z 
2019-11-29T20:22:01.1152256Z ##[error]Bash exited with code '1'.
2019-11-29T20:22:01.1178757Z ##[section]Starting: Checkout
2019-11-29T20:22:01.1180412Z ==============================================================================
2019-11-29T20:22:01.1180667Z Task         : Get sources
2019-11-29T20:22:01.1180723Z 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)

@skinny121 skinny121 force-pushed the skinny121:const-eval-entry-points branch from 19a0666 to da16058 Nov 29, 2019
@@ -554,3 +556,70 @@ pub fn truncate(value: u128, size: Size) -> u128 {
// Truncate (shift left to drop out leftover values, shift right to fill with zeroes).
(value << shift) >> shift
}


impl<'tcx> TyCtxt<'tcx> {

This comment has been minimized.

Copy link
@RalfJung

RalfJung Nov 29, 2019

Member

Why are these added in this file, as opposed to next to const_eval or so?

Scrolling over this file, the only coherent description of it that I can come up with is "random stuff".^^

This comment has been minimized.

Copy link
@skinny121

skinny121 Nov 30, 2019

Author Contributor

They need to be within librustc as they are used inside it. I'm not sure where the best place is.

This comment has been minimized.

Copy link
@oli-obk

oli-obk Dec 20, 2019

Contributor

maybe just put them into a submodule of this module. queries could work as a name.

@skinny121 skinny121 force-pushed the skinny121:const-eval-entry-points branch from da16058 to 15dbbe1 Nov 30, 2019
Copy link
Contributor

oli-obk left a comment

Maybe rename the query to const_eval_global_id (or if it is unused except forin the three wrappers, name it const_eval_internal and leave a comment on it suggesting the use of the wrappers).

I worry that otherwise we'll just reintroduce calls to it that manually do all the boilerplate

src/librustc/mir/interpret/mod.rs Outdated Show resolved Hide resolved
@skinny121

This comment has been minimized.

Copy link
Contributor Author

skinny121 commented Nov 30, 2019

I introduced another wrapper const_eval_instance so I could rename the query to const_eval_internal, which is only used by these wrappers and also inside const_eval_internal itself. Although I'm not sure that const_eval_instance is even needed as the only uses of it is for the type_name intrinsic, which could use const_eval_resolve, but we already have the instance.

@rust-highfive

This comment was marked as resolved.

Copy link
Collaborator

rust-highfive commented Nov 30, 2019

The job x86_64-gnu-llvm-6.0 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-11-30T21:34:25.3299406Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-11-30T21:34:25.3483919Z ##[command]git config gc.auto 0
2019-11-30T21:34:25.3561567Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-11-30T21:34:25.3621918Z ##[command]git config --get-all http.proxy
2019-11-30T21:34:26.1856222Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/66877/merge:refs/remotes/pull/66877/merge
---
2019-11-30T22:31:54.0636402Z ................................................F................................................... 1600/9312
2019-11-30T22:31:58.6454717Z .................................................................................................... 1700/9312
2019-11-30T22:32:10.8948671Z ........................................i........................................................... 1800/9312
2019-11-30T22:32:18.7015201Z .................................................................................................... 1900/9312
2019-11-30T22:32:32.2725618Z .........................iiiii...................................................................... 2000/9312
2019-11-30T22:32:42.2076635Z .................................................................................................... 2200/9312
2019-11-30T22:32:44.7347369Z .................................................................................................... 2300/9312
2019-11-30T22:32:49.2775076Z .................................................................................................... 2400/9312
2019-11-30T22:33:10.5709879Z .................................................................................................... 2500/9312
---
2019-11-30T22:35:47.4864695Z ...........................i...............i........................................................ 4800/9312
2019-11-30T22:35:57.9164011Z .................................................................................................... 4900/9312
2019-11-30T22:36:03.7362102Z .................................................................................................... 5000/9312
2019-11-30T22:36:11.6655775Z .................................................................................................... 5100/9312
2019-11-30T22:36:19.1294620Z ................................ii.ii...........i................................................... 5200/9312
2019-11-30T22:36:28.4674214Z .................................................................................................... 5400/9312
2019-11-30T22:36:38.4218962Z .................................................................................................... 5500/9312
2019-11-30T22:36:45.3733213Z ..............i..................................................................................... 5600/9312
2019-11-30T22:36:51.5529855Z .................................................................................................... 5700/9312
2019-11-30T22:36:51.5529855Z .................................................................................................... 5700/9312
2019-11-30T22:37:02.3870521Z .................................................................................................... 5800/9312
2019-11-30T22:37:14.4431384Z ii...i..ii...........i.............................................................................. 5900/9312
2019-11-30T22:37:32.4680872Z .................................................................................................... 6100/9312
2019-11-30T22:37:38.3472543Z .................................................................................................... 6200/9312
2019-11-30T22:37:38.3472543Z .................................................................................................... 6200/9312
2019-11-30T22:37:51.8202813Z .......................i..ii........................................................................ 6300/9312
2019-11-30T22:38:11.0822381Z ...........................................................................................i........ 6500/9312
2019-11-30T22:38:13.3235364Z .................................................................................................... 6600/9312
2019-11-30T22:38:15.5495519Z ..................................................................................i................. 6700/9312
2019-11-30T22:38:18.2372071Z .................................................................................................... 6800/9312
---
2019-11-30T22:43:00.8582392Z 
2019-11-30T22:43:00.8583391Z ---- [ui] ui/consts/const-size_of-cycle.rs stdout ----
2019-11-30T22:43:00.8583700Z diff of stderr:
2019-11-30T22:43:00.8583883Z 
2019-11-30T22:43:00.8584390Z 17 note: ...which requires const-evaluating `std::mem::size_of`...
2019-11-30T22:43:00.8584845Z 18   --> $SRC_DIR/libcore/mem/mod.rs:LL:COL
2019-11-30T22:43:00.8585097Z 19    |
2019-11-30T22:43:00.8585669Z - LL |     intrinsics::size_of::<T>()
2019-11-30T22:43:00.8586271Z -    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^
2019-11-30T22:43:00.8587413Z + LL | pub const fn size_of<T>() -> usize {
2019-11-30T22:43:00.8588167Z +    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2019-11-30T22:43:00.8588766Z 22 note: ...which requires const-evaluating + checking `std::intrinsics::size_of`...
2019-11-30T22:43:00.8589339Z 23   --> $SRC_DIR/libcore/intrinsics.rs:LL:COL
2019-11-30T22:43:00.8589862Z 
2019-11-30T22:43:00.8590057Z 
2019-11-30T22:43:00.8590309Z The actual stderr differed from the expected stderr.
2019-11-30T22:43:00.8591259Z Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/consts/const-size_of-cycle/const-size_of-cycle.stderr
2019-11-30T22:43:00.8591259Z Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/consts/const-size_of-cycle/const-size_of-cycle.stderr
2019-11-30T22:43:00.8591755Z To update references, rerun the tests and pass the `--bless` flag
2019-11-30T22:43:00.8592257Z To only update this specific test, also pass `--test-args consts/const-size_of-cycle.rs`
2019-11-30T22:43:00.8592696Z error: 1 errors occurred comparing output.
2019-11-30T22:43:00.8592886Z status: exit code: 1
2019-11-30T22:43:00.8592886Z status: exit code: 1
2019-11-30T22:43:00.8593946Z command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/consts/const-size_of-cycle.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/consts/const-size_of-cycle" "-Crpath" "-O" "-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/consts/const-size_of-cycle/auxiliary" "-A" "unused"
2019-11-30T22:43:00.8594657Z ------------------------------------------
2019-11-30T22:43:00.8595497Z 
2019-11-30T22:43:00.8595965Z ------------------------------------------
2019-11-30T22:43:00.8596142Z stderr:
2019-11-30T22:43:00.8596142Z stderr:
2019-11-30T22:43:00.8596465Z ------------------------------------------
2019-11-30T22:43:00.8597232Z error[E0391]: cycle detected when const-evaluating + checking `Foo::bytes::{{constant}}#0`
2019-11-30T22:43:00.8597968Z    |
2019-11-30T22:43:00.8597968Z    |
2019-11-30T22:43:00.8598115Z LL |     bytes: [u8; std::mem::size_of::<Foo>()]
2019-11-30T22:43:00.8598608Z    |
2019-11-30T22:43:00.8598608Z    |
2019-11-30T22:43:00.8599103Z note: ...which requires const-evaluating + checking `Foo::bytes::{{constant}}#0`...
2019-11-30T22:43:00.8599751Z    |
2019-11-30T22:43:00.8599751Z    |
2019-11-30T22:43:00.8599900Z LL |     bytes: [u8; std::mem::size_of::<Foo>()]
2019-11-30T22:43:00.8600068Z    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^
2019-11-30T22:43:00.8601130Z note: ...which requires const-evaluating `Foo::bytes::{{constant}}#0`...
2019-11-30T22:43:00.8602181Z    |
2019-11-30T22:43:00.8602181Z    |
2019-11-30T22:43:00.8602302Z LL |     bytes: [u8; std::mem::size_of::<Foo>()]
2019-11-30T22:43:00.8602747Z note: ...which requires const-evaluating `std::mem::size_of`...
2019-11-30T22:43:00.8603083Z   --> /checkout/src/libcore/mem/mod.rs:274:1
2019-11-30T22:43:00.8603254Z    |
2019-11-30T22:43:00.8603254Z    |
2019-11-30T22:43:00.8603744Z LL | pub const fn size_of<T>() -> usize {
2019-11-30T22:43:00.8603910Z    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2019-11-30T22:43:00.8604271Z note: ...which requires const-evaluating + checking `std::intrinsics::size_of`...
2019-11-30T22:43:00.8604785Z    |
2019-11-30T22:43:00.8605083Z LL |     pub fn size_of<T>() -> usize;
2019-11-30T22:43:00.8605418Z    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2019-11-30T22:43:00.8605561Z    = note: ...which requires computing layout of `Foo`...
2019-11-30T22:43:00.8605561Z    = note: ...which requires computing layout of `Foo`...
2019-11-30T22:43:00.8605691Z    = note: ...which requires normalizing `ParamEnvAnd { param_env: ParamEnv { caller_bounds: [], reveal: All, def_id: None }, value: [u8; _] }`...
2019-11-30T22:43:00.8606064Z    = note: ...which again requires const-evaluating + checking `Foo::bytes::{{constant}}#0`, completing the cycle
2019-11-30T22:43:00.8606279Z note: cycle used when processing `Foo`
2019-11-30T22:43:00.8607409Z    |
2019-11-30T22:43:00.8607561Z LL | struct Foo {
2019-11-30T22:43:00.8607701Z    | ^^^^^^^^^^
2019-11-30T22:43:00.8607840Z 
---
2019-11-30T22:43:00.8623339Z thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:537:22
2019-11-30T22:43:00.8623632Z note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
2019-11-30T22:43:00.8639015Z 
2019-11-30T22:43:00.8639550Z 
2019-11-30T22:43:00.8644503Z command did not execute successfully: "/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" "/usr/lib/llvm-6.0/bin/FileCheck" "--host-rustcflags" "-Crpath -O -Cdebuginfo=0 -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--target-rustcflags" "-Crpath -O -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" "--quiet" "--llvm-version" "6.0.0\n" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--llvm-cxxflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
2019-11-30T22:43:00.8645260Z 
2019-11-30T22:43:00.8645386Z 
2019-11-30T22:43:00.8649283Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
2019-11-30T22:43:00.8649552Z Build completed unsuccessfully in 1:02:43
2019-11-30T22:43:00.8649552Z Build completed unsuccessfully in 1:02:43
2019-11-30T22:43:00.8700822Z == clock drift check ==
2019-11-30T22:43:00.8728287Z   local time: Sat Nov 30 22:43:00 UTC 2019
2019-11-30T22:43:01.1563548Z   network time: Sat, 30 Nov 2019 22:43:01 GMT
2019-11-30T22:43:01.1564070Z == end clock drift check ==
2019-11-30T22:43:02.0316236Z 
2019-11-30T22:43:02.0432604Z ##[error]Bash exited with code '1'.
2019-11-30T22:43:02.0478186Z ##[section]Starting: Checkout
2019-11-30T22:43:02.0480118Z ==============================================================================
2019-11-30T22:43:02.0480175Z Task         : Get sources
2019-11-30T22:43:02.0480223Z 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)

@skinny121 skinny121 force-pushed the skinny121:const-eval-entry-points branch from 88af3a9 to 150f5a9 Dec 1, 2019
@RalfJung

This comment has been minimized.

Copy link
Member

RalfJung commented Dec 1, 2019

So we have const_eval_raw and const_eval_internal? That seems potentially confusing. Please make sure that at least both some with extensive doc comments explaining their difference.

@joelpalmer

This comment has been minimized.

Copy link

joelpalmer commented Dec 9, 2019

Ping from Triage: Hi @skinny121 - any updates?

@skinny121 skinny121 force-pushed the skinny121:const-eval-entry-points branch from 150f5a9 to f84e972 Dec 11, 2019
@skinny121

This comment has been minimized.

Copy link
Contributor Author

skinny121 commented Dec 11, 2019

@RalfJung I have added to the doc comments explaining the difference between both of these queries.

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Dec 11, 2019

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

src/librustc/query/mod.rs Outdated Show resolved Hide resolved
@skinny121 skinny121 force-pushed the skinny121:const-eval-entry-points branch from f84e972 to 8707e98 Dec 11, 2019
@skinny121

This comment has been minimized.

Copy link
Contributor Author

skinny121 commented Dec 20, 2019

@RalfJung @oli-obk Is there anything more I need to change?

@skinny121 skinny121 force-pushed the skinny121:const-eval-entry-points branch from 8707e98 to c010d84 Dec 21, 2019
@oli-obk

This comment has been minimized.

Copy link
Contributor

oli-obk commented Dec 22, 2019

@bors r+

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Dec 22, 2019

📌 Commit c010d84 has been approved by oli-obk

@bors

This comment has been minimized.

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

Centril added a commit to Centril/rust that referenced this pull request Dec 22, 2019
…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.
Centril added a commit to Centril/rust that referenced this pull request Dec 22, 2019
…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.
bors added a commit that referenced this pull request Dec 22, 2019
Rollup of 7 pull requests

Successful merges:

 - #66877 (Add simpler entry points to const eval for common usages.)
 - #67241 (Refactorings to borrowck region diagnostic reporting)
 - #67299 (Add `ImmTy::try_from_(u)int` methods)
 - #67499 (Misc MIR building cleanups)
 - #67506 (Remove iter_private.rs)
 - #67519 (Document why Any is not an unsafe trait)
 - #67525 (Utilize rust-lang/rust commit hashes in toolstate)

Failed merges:

r? @ghost
Centril added a commit to Centril/rust that referenced this pull request Dec 22, 2019
…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.
bors added a commit that referenced this pull request Dec 22, 2019
Rollup of 8 pull requests

Successful merges:

 - #66877 (Add simpler entry points to const eval for common usages.)
 - #67299 (Add `ImmTy::try_from_(u)int` methods)
 - #67487 (Rustdoc mutability removal)
 - #67499 (Misc MIR building cleanups)
 - #67506 (Remove iter_private.rs)
 - #67508 (Fix typo in path parser name)
 - #67519 (Document why Any is not an unsafe trait)
 - #67525 (Utilize rust-lang/rust commit hashes in toolstate)

Failed merges:

r? @ghost
@bors bors merged commit c010d84 into rust-lang:master Dec 22, 2019
4 checks passed
4 checks passed
pr Build #20191221.65 succeeded
Details
pr (Linux mingw-check) Linux mingw-check succeeded
Details
pr (Linux x86_64-gnu-llvm-7) Linux x86_64-gnu-llvm-7 succeeded
Details
pr (Linux x86_64-gnu-tools) Linux x86_64-gnu-tools succeeded
Details
matthiaskrgr added a commit to matthiaskrgr/rust-clippy that referenced this pull request Dec 22, 2019
JohnTitor added a commit to JohnTitor/rust-clippy that referenced this pull request Dec 23, 2019
bors added a commit to rust-lang/rust-clippy that referenced this pull request Dec 23, 2019
Rustup to rust-lang/rust#66877

changelog: none
@varkor varkor mentioned this pull request Jan 2, 2020
1 of 15 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.