@@ -220,7 +220,7 @@ file_names.iter().map(|x| x.as_str()).join(", "))]
220220 #[ error( "warnings are not permitted" ) ]
221221 ForbiddenWarnings { count : usize } ,
222222
223- #[ error( "Invalid runtime for { target} target: {invalid_runtime}" ) ]
223+ #[ error( "Invalid runtime for target { target:?}: {invalid_runtime:? }" ) ]
224224 InvalidRuntime {
225225 target : Target ,
226226 invalid_runtime : Runtime ,
@@ -963,7 +963,8 @@ forward slash and must not end with a slash."
963963 title: "Target not supported" . into( ) ,
964964 text: wrap_format!(
965965 "`{module}` has a main function, but it does not support the {target} \
966- target, so it cannot be run."
966+ target, so it cannot be run.",
967+ target = target. as_presentable_str( ) ,
967968 ) ,
968969 level: Level :: Error ,
969970 location: None ,
@@ -3110,7 +3111,8 @@ a size are only allowed at the end of a bin pattern.",
31103111 "Unsupported endianness" ,
31113112 vec ! [ wrap_format!(
31123113 "The {target} target does not support the `native` \
3113- endianness option."
3114+ endianness option.",
3115+ target = target. as_presentable_str( ) ,
31143116 ) ] ,
31153117 ) ,
31163118 bit_array:: ErrorType :: OptionNotSupportedForTarget {
@@ -3120,7 +3122,8 @@ endianness option."
31203122 "UTF-codepoint pattern matching is not supported" ,
31213123 vec ! [ wrap_format!(
31223124 "The {target} target does not support \
3123- UTF-codepoint pattern matching."
3125+ UTF-codepoint pattern matching.",
3126+ target = target. as_presentable_str( ) ,
31243127 ) ] ,
31253128 ) ,
31263129 } ;
@@ -4539,7 +4542,11 @@ satisfying {required_version} but you are using v{gleam_version}.",
45394542 target,
45404543 invalid_runtime,
45414544 } => {
4542- let text = format ! ( "Invalid runtime for {target} target: {invalid_runtime}" ) ;
4545+ let text = format ! (
4546+ "Invalid runtime for {target} target: {invalid_runtime}" ,
4547+ target = target. as_presentable_str( ) ,
4548+ invalid_runtime = invalid_runtime. as_presentable_str( ) ,
4549+ ) ;
45434550
45444551 let hint = match target {
45454552 Target :: JavaScript => {
@@ -4552,7 +4559,10 @@ satisfying {required_version} but you are using v{gleam_version}.",
45524559 } ;
45534560
45544561 vec ! [ Diagnostic {
4555- title: format!( "Invalid runtime for {target}" ) ,
4562+ title: format!(
4563+ "Invalid runtime for {target}" ,
4564+ target = target. as_presentable_str( ) ,
4565+ ) ,
45564566 text,
45574567 hint,
45584568 location: None ,
0 commit comments