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

Lazy normalization of constants (Reprise) #71973

Merged
merged 16 commits into from
May 19, 2020
Merged

Conversation

lcnr
Copy link
Contributor

@lcnr lcnr commented May 7, 2020

Continuation of #67890 by @Skinny121.

Initial implementation of #60471 for constants.

Perform normalization/evaluation of constants lazily, which is known as lazy normalization. Lazy normalization is only enabled when using #![feature(const_generics)], by default constants are still evaluated eagerly as there are currently.

Lazy normalization of constants is achieved with a new ConstEquate predicate which type inferences uses to delay checking whether constants are equal to each other until later, avoiding cycle errors.

Note this doesn't allow the use of generics within repeat count expressions as that is still evaluated during conversion to mir. There are also quite a few other known problems with lazy normalization which will be fixed in future PRs.

r? @nikomatsakis

fixes #71922, fixes #71986

@lcnr lcnr force-pushed the lazy-norm branch 4 times, most recently from aac9109 to 7cd013c Compare May 7, 2020 11:13
src/librustc_feature/active.rs Outdated Show resolved Hide resolved
@varkor varkor added the F-const_generics `#![feature(const_generics)]` label May 7, 2020
@varkor
Copy link
Member

varkor commented May 7, 2020

I'll try to take a look at this again soon.

@nikomatsakis
Copy link
Contributor

I will also be attempting to do another review tomorrow! Sorry, Thursday is my most meeting-full day.

@varkor varkor self-assigned this May 7, 2020
Copy link
Member

@varkor varkor left a comment

Choose a reason for hiding this comment

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

I just had a brief look through. The main thing that concerns me are all the unimplemented!()s: if these should never be hit, we should add a comment explaining why and use bug!(). But possibly the old ConstEquateRelation was a cleaner solution.

@@ -671,6 +671,10 @@ impl<'tcx> TypeRelatingDelegate<'tcx> for QueryTypeRelatingDelegate<'_, 'tcx> {
});
}

fn const_equate(&mut self, _a: &'tcx Const<'tcx>, _b: &'tcx Const<'tcx>) {
unimplemented!()
Copy link
Member

Choose a reason for hiding this comment

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

Is this intended for a follow up? Do we know what's blocking this?

Copy link
Contributor Author

@lcnr lcnr May 8, 2020

Choose a reason for hiding this comment

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

This was is from @Skinny121, will have to look into this.

Copy link
Contributor Author

@lcnr lcnr May 8, 2020

Choose a reason for hiding this comment

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

This seems like it is unreachable rn. QueryTypeRelatingDelegate is only used with TypeRelating. TypeRelating should never use const_equate afaict.

Replaced it with a span_bug 🤔 We can probably ignore this for now.

edit: It can actually be reached. I would still keep the span_bug here to see what would actually use this code path.

src/librustc_infer/infer/combine.rs Outdated Show resolved Hide resolved
src/librustc_middle/ty/_match.rs Outdated Show resolved Hide resolved
src/librustc_middle/ty/relate.rs Outdated Show resolved Hide resolved
src/librustc_middle/ty/relate.rs Outdated Show resolved Hide resolved
src/librustc_trait_selection/traits/object_safety.rs Outdated Show resolved Hide resolved
src/librustc_typeck/check/dropck.rs Outdated Show resolved Hide resolved
src/librustc_typeck/check/mod.rs Outdated Show resolved Hide resolved
src/test/ui/const-generics/trait-const-args.rs Outdated Show resolved Hide resolved
@lcnr
Copy link
Contributor Author

lcnr commented May 8, 2020

Reverted the changes moving ConstEquateRelation in TypeRelation.

@lcnr lcnr mentioned this pull request May 8, 2020
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request May 8, 2020
Add const-generics test

Taken from rust-lang#71973 as this apparently already compiles.

r? @varkor
// FIXME(lazy_normalization_consts) We currenctly don't detect lifetimes within substs
// which would violate this check. Even though the particular substitution is not used
// within the const, this should still be fixed.
return false;
Copy link
Contributor Author

@lcnr lcnr May 8, 2020

Choose a reason for hiding this comment

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

I updated this FIXME but am not completely certain this is actually correct.

Is this statement correct? Especially the "Even though the particular substitution is not used within the const" part?

Copy link
Contributor

Choose a reason for hiding this comment

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

I sort of have no idea what this FIXME is trying to say, yeah. Why don't we do this? I guess it's because the check would basically always fail for any constant, even though a lot of the constants are like {22}. In other words, we really have to normalize the constant (evaluate it) to do this check.

@nikomatsakis
Copy link
Contributor

For reference, here are the lazy normalization notes I prepared that were background for the original PR.

@nikomatsakis
Copy link
Contributor

Although they don't include all the updates, in that I remember having some thoughts about how we can just "not equate" for bound regions to side-step for now the leak-check question, but that doesn't appear to be in the notes. Might've been on Zulip.

Copy link
Contributor

@nikomatsakis nikomatsakis left a comment

Choose a reason for hiding this comment

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

This is looking very good. I did a run through. Left some nits mostly but I think it's mostly in a shape that it could be landed. I do think we should merge the feature gates and extract out some follow-up issues.

// Do not walk substitutions of unevaluated consts, as they contain `Self`, even
// though the const expression doesn't necessary use it. Currently type variables
// inside array length expressions are forbidden, so they can't break the above
// rules.
Copy link
Contributor

Choose a reason for hiding this comment

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

If I'm not mistaken, the code that's needed here is very similar to the code for associated type projections above, and could probably be factored out fairly easily? I think it's fine to leave for later, though I agree that before landing this PR, we should make a tracking issue and add these FIXMEs to it to help us keep sight of them. Ideally, I'd like to see tests that show the problem, too

src/librustc_infer/infer/combine.rs Outdated Show resolved Hide resolved
@lcnr
Copy link
Contributor Author

lcnr commented May 8, 2020

We currently get a stack overflow in a test due to incorrect handling of Res::Err in type_of.

let res = segment.res.filter(|&r| r != Res::Err).unwrap_or(path.res);

I think that I can quickly fix this myself

edit: isn't as simple as I though, there may be a more difficult underlying problem here

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-8 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.
##[section]Starting: Linux x86_64-gnu-llvm-8
##[section]Starting: Initialize job
Agent name: 'Azure Pipelines 46'
Agent machine name: 'fv-az578'
Current agent version: '2.168.2'
##[group]Operating System
16.04.6
LTS
LTS
##[endgroup]
##[group]Virtual Environment
Environment: ubuntu-16.04
Version: 20200430.2
Included Software: https://github.com/actions/virtual-environments/blob/ubuntu16/20200430.2/images/linux/Ubuntu1604-README.md
##[endgroup]
Agent running as: 'vsts'
Prepare build directory.
Set build variables.
Download all required tasks.
Download all required tasks.
Downloading task: Bash (3.163.1)
Checking job knob settings.
   Knob: AgentToolsDirectory = /opt/hostedtoolcache Source: ${AGENT_TOOLSDIRECTORY} 
   Knob: AgentPerflog = /home/vsts/perflog Source: ${VSTS_AGENT_PERFLOG} 
Start tracking orphan processes.
##[section]Finishing: Initialize job
##[section]Starting: Configure Job Name
==============================================================================
---
========================== Starting Command Output ===========================
[command]/bin/bash --noprofile --norc /home/vsts/work/_temp/760fd2c5-d926-44cb-a00f-cf377a16e133.sh

##[section]Finishing: Disable git automatic line ending conversion
##[section]Starting: Checkout rust-lang/rust@refs/pull/71973/merge to s
Task         : Get sources
Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
Version      : 1.0.0
Author       : Microsoft
---
##[command]git remote add origin https://github.com/rust-lang/rust
##[command]git config gc.auto 0
##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
##[command]git config --get-all http.proxy
##[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/71973/merge:refs/remotes/pull/71973/merge
---
 ---> cb2676f08729
Step 5/8 : ENV RUST_CONFIGURE_ARGS       --build=x86_64-unknown-linux-gnu       --llvm-root=/usr/lib/llvm-8       --enable-llvm-link-shared       --set rust.thin-lto-import-instr-limit=10
 ---> Using cache
 ---> df25ce111862
Step 6/8 : ENV SCRIPT python2.7 ../x.py test --exclude src/tools/tidy &&            python2.7 ../x.py test src/test/mir-opt --pass=build                                   --target=armv5te-unknown-linux-gnueabi &&            python2.7 ../x.py test src/tools/tidy
 ---> 599b9ac96b27
Step 7/8 : ENV NO_DEBUG_ASSERTIONS=1
 ---> Using cache
 ---> 091087e35a36
---
   Compiling rustc_feature v0.0.0 (/checkout/src/librustc_feature)
   Compiling fmt_macros v0.0.0 (/checkout/src/libfmt_macros)
   Compiling rustc_ast_pretty v0.0.0 (/checkout/src/librustc_ast_pretty)
   Compiling rustc_hir v0.0.0 (/checkout/src/librustc_hir)
   Compiling rustc_query_system v0.0.0 (/checkout/src/librustc_query_system)
   Compiling rustc_hir_pretty v0.0.0 (/checkout/src/librustc_hir_pretty)
   Compiling rustc_parse v0.0.0 (/checkout/src/librustc_parse)
   Compiling rustc_ast_lowering v0.0.0 (/checkout/src/librustc_ast_lowering)
   Compiling rustc_ast_passes v0.0.0 (/checkout/src/librustc_ast_passes)
---
   Compiling rustc_feature v0.0.0 (/checkout/src/librustc_feature)
   Compiling fmt_macros v0.0.0 (/checkout/src/libfmt_macros)
   Compiling rustc_ast_pretty v0.0.0 (/checkout/src/librustc_ast_pretty)
   Compiling rustc_hir v0.0.0 (/checkout/src/librustc_hir)
   Compiling rustc_query_system v0.0.0 (/checkout/src/librustc_query_system)
   Compiling rustc_hir_pretty v0.0.0 (/checkout/src/librustc_hir_pretty)
   Compiling rustc_parse v0.0.0 (/checkout/src/librustc_parse)
   Compiling rustc_ast_lowering v0.0.0 (/checkout/src/librustc_ast_lowering)
   Compiling rustc_ast_passes v0.0.0 (/checkout/src/librustc_ast_passes)
---
............................i....................................................................... 1800/10001
.................................................................................................... 1900/10001
.............................................i...................................................... 2000/10001
.................................................................................................... 2100/10001
...................................iiiii............................................................ 2200/10001
.................................................................................................... 2400/10001
.................................................................................................... 2500/10001
.................................................................................................... 2600/10001
.................................................................................................... 2700/10001
---
..........................i................i........................................................ 5100/10001
.................................................................................................... 5200/10001
........................................................................i........................... 5300/10001
................................................................i................................... 5400/10001
.....................................................................ii.ii........i...i............. 5500/10001
...........i........................................................................................ 5700/10001
.................i.................................................................................. 5800/10001
.....................................................ii.....................................i....... 5900/10001
.................................................................................................... 6000/10001
.................................................................................................... 6000/10001
.................................................................................................... 6100/10001
.........................................................................................ii...i..ii. 6200/10001
.................................................................................................... 6400/10001
.................................................................................................... 6500/10001
.................................................................................................... 6600/10001
.................................................................................................... 6600/10001
.....................i..ii.......................................................................... 6700/10001
.................................................................................................... 6900/10001
......................i............................................................................. 7000/10001
.................................................................................................... 7100/10001
................................................................i................................... 7200/10001
---
.................................................................................................... 7900/10001
.................................................................................................... 8000/10001
.................................................................................................... 8100/10001
................................i................................................................... 8200/10001
......................................................................................iiiiii.iiiii.i 8300/10001
.......................................i............................................................ 8500/10001
.................................................................................................... 8600/10001
.................................................................................................... 8700/10001
.................................................................................................... 8800/10001
---
failures:

---- [ui] ui/const-generics/issues/issue-69654.rs stdout ----

error: Error: expected failure status (Some(1)) but received status None.
status: signal: 6
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/const-generics/issues/issue-69654.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/const-generics/issues/issue-69654" "-A" "unused" "-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/const-generics/issues/issue-69654/auxiliary"
------------------------------------------

------------------------------------------
stderr:
stderr:
------------------------------------------
error[E0423]: expected value, found type parameter `T`
  --> /checkout/src/test/ui/const-generics/issues/issue-69654.rs:5:25
   |
LL | impl<T> Bar<T> for [u8; T] {}


thread 'rustc' has overflowed its stack
fatal runtime error: stack overflow
fatal runtime error: stack overflow

------------------------------------------


---- [ui] ui/type-alias-impl-trait/generic_nondefining_use.rs stdout ----
diff of stderr:

25 LL | fn concrete_const() -> OneConst<{123}> {
27    |
- note: used non-generic constant `123usize` for generic parameter
+ note: used non-generic constant `{123}` for generic parameter
29   --> $DIR/generic_nondefining_use.rs:10:21
29   --> $DIR/generic_nondefining_use.rs:10:21
30    |
31 LL | type OneConst<const X: usize> = impl Debug;

The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/type-alias-impl-trait/generic_nondefining_use/generic_nondefining_use.stderr
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/type-alias-impl-trait/generic_nondefining_use/generic_nondefining_use.stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args type-alias-impl-trait/generic_nondefining_use.rs`
error: 1 errors occurred comparing output.
status: exit code: 1
status: exit code: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/type-alias-impl-trait/generic_nondefining_use.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/type-alias-impl-trait/generic_nondefining_use" "-A" "unused" "-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/type-alias-impl-trait/generic_nondefining_use/auxiliary"
------------------------------------------

------------------------------------------
stderr:
stderr:
------------------------------------------
error: non-defining opaque type use in defining scope
  --> /checkout/src/test/ui/type-alias-impl-trait/generic_nondefining_use.rs:14:21
   |
LL | fn concrete_ty() -> OneTy<u32> {
   |
note: used non-generic type `u32` for generic parameter
  --> /checkout/src/test/ui/type-alias-impl-trait/generic_nondefining_use.rs:8:12
   |
   |
LL | type OneTy<T> = impl Debug;
   |            ^

error: non-defining opaque type use in defining scope
  --> /checkout/src/test/ui/type-alias-impl-trait/generic_nondefining_use.rs:19:27
   |
LL | type OneLifetime<'a> = impl Debug;
   |                  -- cannot use static lifetime; use a bound lifetime instead or remove the lifetime parameter from the opaque type
...
LL | fn concrete_lifetime() -> OneLifetime<'static> {

error: non-defining opaque type use in defining scope
  --> /checkout/src/test/ui/type-alias-impl-trait/generic_nondefining_use.rs:24:24
   |
   |
LL | fn concrete_const() -> OneConst<{123}> {
   |
note: used non-generic constant `{123}` for generic parameter
  --> /checkout/src/test/ui/type-alias-impl-trait/generic_nondefining_use.rs:10:21
   |
   |
LL | type OneConst<const X: usize> = impl Debug;

error: aborting due to 3 previous errors


---
thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:348:22
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


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-8/bin/FileCheck" "--nodejs" "/usr/bin/node" "--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" "8.0.0" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"


failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test --exclude src/tools/tidy
Build completed unsuccessfully in 1:01:01
Build completed unsuccessfully in 1:01:01
== clock drift check ==
  local time: Fri May  8 22:19:47 UTC 2020
  network time: Fri, 08 May 2020 22:19:47 GMT
== end clock drift check ==

##[error]Bash exited with code '1'.
##[section]Finishing: Run build
##[section]Starting: Checkout rust-lang/rust@refs/pull/71973/merge to s
Task         : Get sources
Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
Version      : 1.0.0
Author       : Microsoft
Author       : Microsoft
Help         : [More Information](https://go.microsoft.com/fwlink/?LinkId=798199)
==============================================================================
Cleaning any cached credential from repository: rust-lang/rust (GitHub)
##[section]Finishing: Checkout rust-lang/rust@refs/pull/71973/merge to s
Cleaning up task key
Start cleaning up orphan processes.
Terminate orphan process: pid (3544) (python)
##[section]Finishing: Finalize Job

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 @rust-lang/infra. (Feature Requests)

@crlf0710 crlf0710 added A-lazy-normalization Area: Lazy normalization (tracking issue: #60471) S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels May 9, 2020
@nikomatsakis
Copy link
Contributor

@bors r+

I don't have a strong opinion about how many feature gates we have, but splitting into a "pseudo-feature-gate" seems like a reasonable compromise to me.

@bors
Copy link
Contributor

bors commented May 18, 2020

📌 Commit 9da8a5b has been approved by nikomatsakis

@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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels May 18, 2020
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request May 18, 2020
Lazy normalization of constants (Reprise)

Continuation of rust-lang#67890 by @Skinny121.

Initial implementation of rust-lang#60471 for constants.

Perform normalization/evaluation of constants lazily, which is known as lazy normalization. Lazy normalization is only enabled when using `#![feature(lazy_normalization_consts)]`, by default constants are still evaluated eagerly as there are currently.

Lazy normalization of constants is achieved with a new ConstEquate predicate which type inferences uses to delay checking whether constants are equal to each other until later, avoiding cycle errors.

Note this doesn't allow the use of generics within repeat count expressions as that is still evaluated during conversion to mir. There are also quite a few other known problems with lazy normalization which will be fixed in future PRs.

r? @nikomatsakis

fixes rust-lang#71922, fixes rust-lang#71986
This was referenced May 18, 2020
bors added a commit to rust-lang-ci/rust that referenced this pull request May 18, 2020
Rollup of 5 pull requests

Successful merges:

 - rust-lang#71599 (Support coercion between (FnDef | Closure) and (FnDef | Closure))
 - rust-lang#71973 (Lazy normalization of constants (Reprise))
 - rust-lang#72283 (Drop Elaboration Elaboration)
 - rust-lang#72290 (Add newer rust versions to linker-plugin-lto.md)
 - rust-lang#72318 (Add help text for remote-test-client)

Failed merges:

r? @ghost
@bors bors merged commit c6030c9 into rust-lang:master May 19, 2020
@lcnr lcnr deleted the lazy-norm branch May 19, 2020 07:27
@lcnr lcnr mentioned this pull request May 19, 2020
Manishearth added a commit to Manishearth/rust that referenced this pull request Jul 4, 2020
…arkor

add `lazy_normalization_consts` feature gate

In rust-lang#71973 I underestimated the amount of code which is influenced by lazy normalization of consts
and decided against having a separate feature flag for this.

Looking a bit more into this, the following issues are already working with lazy norm in its current state rust-lang#47814 rust-lang#57739 rust-lang#73980

I therefore think it is worth it to enable lazy norm separately. Note that `#![feature(const_generics)]` still automatically activates
this feature, so using `#![feature(const_generics, lazy_normalization_consts)]` is redundant.

r? @varkor @nikomatsakis
Manishearth added a commit to Manishearth/rust that referenced this pull request Jul 5, 2020
…arkor

add `lazy_normalization_consts` feature gate

In rust-lang#71973 I underestimated the amount of code which is influenced by lazy normalization of consts
and decided against having a separate feature flag for this.

Looking a bit more into this, the following issues are already working with lazy norm in its current state rust-lang#47814 rust-lang#57739 rust-lang#73980

I therefore think it is worth it to enable lazy norm separately. Note that `#![feature(const_generics)]` still automatically activates
this feature, so using `#![feature(const_generics, lazy_normalization_consts)]` is redundant.

r? @varkor @nikomatsakis
Manishearth added a commit to Manishearth/rust that referenced this pull request Jul 5, 2020
…arkor

add `lazy_normalization_consts` feature gate

In rust-lang#71973 I underestimated the amount of code which is influenced by lazy normalization of consts
and decided against having a separate feature flag for this.

Looking a bit more into this, the following issues are already working with lazy norm in its current state rust-lang#47814 rust-lang#57739 rust-lang#73980

I therefore think it is worth it to enable lazy norm separately. Note that `#![feature(const_generics)]` still automatically activates
this feature, so using `#![feature(const_generics, lazy_normalization_consts)]` is redundant.

r? @varkor @nikomatsakis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lazy-normalization Area: Lazy normalization (tracking issue: #60471) F-const_generics `#![feature(const_generics)]` 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.

Const generics: Bounds like T: Foo<{ value }> don't work [ICE] with const generics in subst.rs
7 participants