about summary refs log tree commit diff
path: root/compiler/rustc_error_codes/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-03-24 04:13:27 +0000
committerbors <bors@rust-lang.org>2021-03-24 04:13:27 +0000
commit5b33de3340c7b36646af46303a30f7066b4bd7db (patch)
tree1350840ab7e5d4c312507ab81aad245ff328fa5a /compiler/rustc_error_codes/src
parentdb492ecd5ba6bd82205612cebb9034710653f0c2 (diff)
parent33370fd9829c5bb843b117d11cc7e948f4b824f6 (diff)
downloadrust-5b33de3340c7b36646af46303a30f7066b4bd7db.tar.gz
rust-5b33de3340c7b36646af46303a30f7066b4bd7db.zip
Auto merge of #75384 - JulianKnodt:cg_def, r=varkor,lcnr
implement `feature(const_generics_defaults)`

Implements const generics defaults `struct Example<const N: usize=3>`, as well as a query for getting the default of a given const-parameter's def id. There are some remaining FIXME's but they were specified as not blocking for merging this PR. This also puts the defaults behind the unstable feature gate `#![feature(const_generics_defaults)]`.

~~This currently creates a field which is always false on `GenericParamDefKind` for future use when
consts are permitted to have defaults. I'm not sure if this is exactly what is best for adding default parameters, but I mimicked the style of type defaults, so hopefully this is ok.~~

r? `@lcnr`
Diffstat (limited to 'compiler/rustc_error_codes/src')
-rw-r--r--compiler/rustc_error_codes/src/error_codes/E0128.md2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_error_codes/src/error_codes/E0128.md b/compiler/rustc_error_codes/src/error_codes/E0128.md
index 6f8dfe3a73b..2ea8ae68ef8 100644
--- a/compiler/rustc_error_codes/src/error_codes/E0128.md
+++ b/compiler/rustc_error_codes/src/error_codes/E0128.md
@@ -7,7 +7,7 @@ struct Foo<T = U, U = ()> {
     field1: T,
     field2: U,
 }
-// error: type parameters with a default cannot use forward declared
+// error: generic parameters with a default cannot use forward declared
 //        identifiers
 ```