rust/compiler/rustc_resolve/src
bors 58bdb08947 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`
2021-04-25 14:00:49 +00:00
..
late Auto merge of #83729 - JohnTitor:issue-43913, r=estebank 2021-04-23 23:44:49 +00:00
build_reduced_graph.rs ast/hir: Rename field-related structures 2021-03-16 11:41:24 +03:00
check_unused.rs Attach TokenStream to ast::Visibility 2020-09-10 17:33:06 -04:00
def_collector.rs ast/hir: Rename field-related structures 2021-03-16 11:41:24 +03:00
diagnostics.rs fix name resolution for param defaults 2021-04-21 15:25:32 +02:00
imports.rs Fix ICE with use clippy:🅰️:b; 2021-03-21 14:20:28 -07:00
late.rs fix name resolution for param defaults 2021-04-21 15:25:32 +02:00
lib.rs fix name resolution for param defaults 2021-04-21 15:25:32 +02:00
macros.rs resolve: Stable order for derive helper attributes 2021-04-04 17:51:41 +03:00