We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 11874a0 commit 06abaeeCopy full SHA for 06abaee
src/librustc_resolve/diagnostics.rs
@@ -414,8 +414,8 @@ https://doc.rust-lang.org/reference.html#use-declarations
414
"##,
415
416
E0401: r##"
417
-Inner items do not inherit type parameters from the functions they are embedded
418
-in.
+Inner items do not inherit type or const parameters from the functions
+they are embedded in.
419
420
Erroneous code example:
421
@@ -1642,6 +1642,17 @@ fn main() {
1642
```
1643
1644
1645
+E0670: r##"
1646
+Const parameters cannot depend on type parameters.
1647
+The following is therefore invalid:
1648
+
1649
+```
1650
+fn const_id<T, const N: T>() -> T {
1651
+ N
1652
+}
1653
1654
+"##,
1655
1656
}
1657
1658
register_diagnostics! {
0 commit comments