about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-04-25 14:00:49 +0000
committerbors <bors@rust-lang.org>2021-04-25 14:00:49 +0000
commit58bdb08947f5b3c18a2fbafc5cf36af7b5677d83 (patch)
tree0d765ee7eb8eeb41cf8e285dc319bc0c8c71836c /compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
parent06f0adb34570ba83fee391abeb0bec0eec28a234 (diff)
parentd3e0d2f53dd69bf10b4260760e5fbaddc77c2a3d (diff)
downloadrust-58bdb08947f5b3c18a2fbafc5cf36af7b5677d83.tar.gz
rust-58bdb08947f5b3c18a2fbafc5cf36af7b5677d83.zip
Auto merge of #84299 - lcnr:const-generics-defaults-name-res, r=varkor
various const parameter defaults improvements

Actually resolve names in const parameter defaults, fixing `struct Foo<const N: usize = { usize::MAX }>`.

---
Split generic parameter ban rib for types and consts, allowing
```rust
#![feature(const_generics_defaults)]
struct Q;
struct Foo<T = Q, const Q: usize = 3>(T);
```

---
Remove the type/const ordering restriction if `const_generics_defaults` is active, even if `const_generics` is not. allowing us to stabilize and test const param defaults separately.

---
Check well formedness of const parameter defaults, eagerly emitting an error for `struct Foo<const N: usize = { 0 - 1 }>`

---
Do not forbid const parameters in param defaults, allowing `struct Foo<const N: usize, T = [u8; N]>(T)` and `struct Foo<const N: usize, const M: usize = N>`. Note that this should not change anything which is stabilized, as on stable, type parameters must be in front of const parameters, which means that type parameter defaults are only allowed if no const parameters exist.

We still forbid generic parameters inside of const param types.

r? `@varkor` `@petrochenkov`
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions