Skip to content

Commit ea4519e

Browse files
committed
opaque types descr
1 parent b000803 commit ea4519e

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

compiler/rustc_borrowck/src/region_infer/opaque_types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ fn check_opaque_type_parameter_valid(
398398
tcx.sess.emit_err(OpaqueTypeNotDefine {
399399
cause: OpaqueTyDefineErrCause::NonGenericUsed {
400400
span: tcx.def_span(opaque_param.def_id),
401-
descr: opaque_param.kind.descr().to_string(),
401+
descr: &opaque_param.kind.descr(),
402402
arg: arg.to_string(),
403403
},
404404
span,

compiler/rustc_borrowck/src/session_diagnostics.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ pub(crate) enum OpaqueTyDefineErrCause {
462462
NonGenericUsed {
463463
#[primary_span]
464464
span: Span,
465-
descr: String,
465+
descr: &'static str,
466466
arg: String,
467467
},
468468
#[label(borrowck::cannot_use_static_lifetime_here)]

compiler/rustc_error_messages/locales/en-US/borrowck.ftl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,11 @@ borrowck_lifetime_not_used_in_trait_type_alias =
262262
lifetime `{$r}` is part of concrete type but not used in parameter list of the `impl Trait` type alias
263263
264264
borrowck_used_non_generic_for_generic =
265-
used non-generic {$descr} `{$arg}` for generic parameter
265+
used non-generic {$descr ->
266+
[lifetime] lifetime
267+
[type] type
268+
*[constant] constant
269+
} `{$arg}` for generic parameter
266270
267271
borrowck_cannot_use_static_lifetime_here =
268272
cannot use static lifetime; use a bound lifetime instead or remove the lifetime parameter from the opaque type

0 commit comments

Comments
 (0)