diff --git a/compiler/erg_compiler/error.rs b/compiler/erg_compiler/error.rs index fbfab343..85620c20 100644 --- a/compiler/erg_compiler/error.rs +++ b/compiler/erg_compiler/error.rs @@ -1465,13 +1465,13 @@ impl LowerError { "traditional_chinese" => format!("表達式評估結果(: {})未使用", expr.ref_t()), "english" => format!("the evaluation result of the expression (: {}) is not used", expr.ref_t()), ); + let discard = StyledString::new("discard", Some(HINT), Some(ATTR)); let hint = switch_lang!( - "japanese" => "値を使わない場合は、discard関数を使用してください", - "simplified_chinese" => "如果您不想使用该值,请使用discard函数", - "traditional_chinese" => "如果您不想使用該值,請使用discard函數", - "english" => "if you don't use the value, use discard function", - ) - .to_owned(); + "japanese" => format!("値を使わない場合は、{discard}関数を使用してください"), + "simplified_chinese" => format!("如果您不想使用该值,请使用{discard}函数"), + "traditional_chinese" => format!("如果您不想使用該值,請使用{discard}函數"), + "english" => format!("if you don't use the value, use {discard} function"), + ); Self::new( ErrorCore::new( vec![SubMessage::ambiguous_new(expr.loc(), vec![], Some(hint))],