diff --git a/src/librustc_resolve/diagnostics.rs b/src/librustc_resolve/diagnostics.rs index 0db8689c0c17..a5f9124674a5 100644 --- a/src/librustc_resolve/diagnostics.rs +++ b/src/librustc_resolve/diagnostics.rs @@ -414,8 +414,8 @@ https://doc.rust-lang.org/reference.html#use-declarations "##, E0401: r##" -Inner items do not inherit type parameters from the functions they are embedded -in. +Inner items do not inherit type or const parameters from the functions +they are embedded in. Erroneous code example: @@ -1642,6 +1642,17 @@ fn main() { ``` "##, +E0670: r##" +Const parameters cannot depend on type parameters. +The following is therefore invalid: + +``` +fn const_id() -> T { + N +} +``` +"##, + } register_diagnostics! {