Skip to content

Commit

Permalink
Update anon-const-substs.md
Browse files Browse the repository at this point in the history
  • Loading branch information
lcnr authored Jan 17, 2022
1 parent 28b2c9a commit 7436eb9
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions design-docs/anon-const-substs.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Anon consts substs

Currently locked behind `feature(lazy_normalization_consts)` or `feature(const_generics)`, we do not supply anonymous constants
Currently locked behind `feature(generic_const_exprs)`, we do not supply anonymous constants
with their parents generics.

Doing so is needed if we want to ever support more complex generic expressions in anonymous constants.

## Known blockers

Unless said otherwise, "currently" means "with `feature(const_generics)` enabled" for the rest of this document.
Unless said otherwise, "currently" means "with `feature(generic_const_exprs)` enabled" for the rest of this document.

### Unused substs

Expand Down Expand Up @@ -41,16 +41,15 @@ fn main() {

Discussed in the following meetings: [2021.02.09](../meetings/2021.02.09-lazy-norm.md), [2021.02.16](../meetings/2021.02.16-lazy-norm.md), [2021.03.09](../meetings/2021.03.09-unused-substs-impl.md)

A solution has been found and is currently getting implemented in [#87280](https://github.com/rust-lang/rust/pull/87280)
A potential solution has been merged with [#87280](https://github.com/rust-lang/rust/pull/87280) and reverted in [#92805](https://github.com/rust-lang/rust/pull/92805) as the required changes negatively impacted large parts of the compiler, even these unrelated to const generics. A potentially nicer solution would be to forbid all parameters which aren't explicitly mentioned by anonymous constants. It isn't yet clear how to best implement this.

### Consts in where bounds can reference themselves

This causes query cycles for code that should compile and already compiles on stable

[#79356](https://github.com/rust-lang/rust/issues/79356)
```rust
#![feature(const_generics)]
#![allow(incomplete_features)]
#![feature(generic_const_exprs)]

struct Foo<T>(T);

Expand Down

0 comments on commit 7436eb9

Please sign in to comment.