about summary refs log tree commit diff
path: root/compiler/rustc_resolve/messages.ftl
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-02-06 22:45:39 +0100
committerGitHub <noreply@github.com>2024-02-06 22:45:39 +0100
commit3c52832375ddb2a4ef1001eead5e49e7a91f7e04 (patch)
treee18bc3d2cd6cf3c296586a306b414555800aaf18 /compiler/rustc_resolve/messages.ftl
parent0d531351e848ad69a03c704d40985c9003847427 (diff)
parent2cfc81766c37eb0f6696d50f9207876293fa7732 (diff)
downloadrust-3c52832375ddb2a4ef1001eead5e49e7a91f7e04.tar.gz
rust-3c52832375ddb2a4ef1001eead5e49e7a91f7e04.zip
Rollup merge of #119939 - clubby789:static-const-generic-note, r=compiler-errors
Improve 'generic param from outer item' error for `Self` and inside `static`/`const` items

Fixes #109596
Fixes #119936
Diffstat (limited to 'compiler/rustc_resolve/messages.ftl')
-rw-r--r--compiler/rustc_resolve/messages.ftl14
1 files changed, 12 insertions, 2 deletions
diff --git a/compiler/rustc_resolve/messages.ftl b/compiler/rustc_resolve/messages.ftl
index 769c469a5ab..0747685c35c 100644
--- a/compiler/rustc_resolve/messages.ftl
+++ b/compiler/rustc_resolve/messages.ftl
@@ -118,17 +118,27 @@ resolve_forward_declared_generic_param =
     .label = defaulted generic parameters cannot be forward declared
 
 resolve_generic_params_from_outer_item =
-    can't use generic parameters from outer item
-    .label = use of generic parameter from outer item
+    can't use {$is_self ->
+        [true] `Self`
+        *[false] generic parameters
+    } from outer item
+    .label = use of {$is_self ->
+        [true] `Self`
+        *[false] generic parameter
+    } from outer item
     .refer_to_type_directly = refer to the type directly here instead
     .suggestion = try introducing a local generic parameter here
 
+resolve_generic_params_from_outer_item_const = a `const` is a separate item from the item that contains it
+
 resolve_generic_params_from_outer_item_const_param = const parameter from outer item
 
 resolve_generic_params_from_outer_item_self_ty_alias = `Self` type implicitly declared here, by this `impl`
 
 resolve_generic_params_from_outer_item_self_ty_param = can't use `Self` here
 
+resolve_generic_params_from_outer_item_static = a `static` is a separate item from the item that contains it
+
 resolve_generic_params_from_outer_item_ty_param = type parameter from outer item