about summary refs log tree commit diff
path: root/compiler/rustc_resolve/src
diff options
context:
space:
mode:
authorJonas Schievink <jonasschievink@gmail.com>2020-11-24 13:17:51 +0100
committerGitHub <noreply@github.com>2020-11-24 13:17:51 +0100
commitf049b0be9695cc87938436b50b982fc6013f8344 (patch)
tree657b3ff7ff74baa3b855bfee35724114b9fb2364 /compiler/rustc_resolve/src
parent95e7af353fbcb44a6bfff775a79843eabb109971 (diff)
parent888055eb4cbd6136d7f7f5d32be98a477fbde749 (diff)
downloadrust-f049b0be9695cc87938436b50b982fc6013f8344.tar.gz
rust-f049b0be9695cc87938436b50b982fc6013f8344.zip
Rollup merge of #79374 - mendess:const-param-expr-diagnostic, r=lcnr
Add note to use nightly when using expr in const generics

As recommended by `@Icnr` in #73899 and in zulip, I've added a note saying that const expressions can be used in nightly.

```
error: generic parameters may not be used in const operations
  --> $DIR/issue-61935.rs:10:23
   |
 6 |         Self:FooImpl<{N==0}>
   |                       ^ cannot perform const operation using `N`
   |
   = help: const parameters may only be used as standalone arguments, i.e. `N`
   = note: use feature(const_generics) and feature(const_evaluatable_checked) to enable this

error: aborting due to previous error
```

I hope the note is well written :sweat_smile:
Diffstat (limited to 'compiler/rustc_resolve/src')
-rw-r--r--compiler/rustc_resolve/src/diagnostics.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/compiler/rustc_resolve/src/diagnostics.rs b/compiler/rustc_resolve/src/diagnostics.rs
index 67491b5bf7e..a0d5b61e8bd 100644
--- a/compiler/rustc_resolve/src/diagnostics.rs
+++ b/compiler/rustc_resolve/src/diagnostics.rs
@@ -481,6 +481,7 @@ impl<'a> Resolver<'a> {
                         name
                     ));
                 }
+                err.help("use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions");
 
                 err
             }