diff options
author | David Malcolm <dmalcolm@redhat.com> | 2024-11-27 19:21:15 -0500 |
---|---|---|
committer | David Malcolm <dmalcolm@redhat.com> | 2024-11-27 19:21:15 -0500 |
commit | 9f06b910a840d8ed06e27942bc23f260a0e0ccf3 (patch) | |
tree | fe00f4931125a682b60d912a8db67ca415bff924 /gcc/rust | |
parent | 7a656d7461c226eab1255cb5f76086bbe9e41a66 (diff) | |
download | gcc-9f06b910a840d8ed06e27942bc23f260a0e0ccf3.zip gcc-9f06b910a840d8ed06e27942bc23f260a0e0ccf3.tar.gz gcc-9f06b910a840d8ed06e27942bc23f260a0e0ccf3.tar.bz2 |
diagnostics: replace %<%s%> with %qs [PR104896]
No functional change intended.
gcc/analyzer/ChangeLog:
PR c/104896
* sm-malloc.cc: Replace "%<%s%>" with "%qs" in message wording.
gcc/c-family/ChangeLog:
PR c/104896
* c-lex.cc (c_common_lex_availability_macro): Replace "%<%s%>"
with "%qs" in message wording.
* c-opts.cc (c_common_handle_option): Likewise.
* c-warn.cc (warn_parm_array_mismatch): Likewise.
gcc/ChangeLog:
PR c/104896
* common/config/ia64/ia64-common.cc (ia64_handle_option): Replace
"%<%s%>" with "%qs" in message wording.
* common/config/rs6000/rs6000-common.cc (rs6000_handle_option):
Likewise.
* config/aarch64/aarch64.cc (aarch64_validate_sls_mitigation):
Likewise.
(aarch64_override_options): Likewise.
(aarch64_process_target_attr): Likewise.
* config/arm/aarch-common.cc (aarch_validate_mbranch_protection):
Likewise.
* config/pru/pru.cc (pru_insert_attributes): Likewise.
* config/riscv/riscv-target-attr.cc
(riscv_target_attr_parser::parse_arch): Likewise.
* omp-general.cc (oacc_verify_routine_clauses): Likewise.
* tree-ssa-uninit.cc (maybe_warn_read_write_only): Likewise.
(maybe_warn_pass_by_reference): Likewise.
gcc/cp/ChangeLog:
PR c/104896
* cvt.cc (maybe_warn_nodiscard): Replace "%<%s%>" with "%qs" in
message wording.
gcc/fortran/ChangeLog:
PR c/104896
* resolve.cc (resolve_operator): Replace "%<%s%>" with "%qs" in
message wording.
gcc/go/ChangeLog:
PR c/104896
* gofrontend/embed.cc (Gogo::initializer_for_embeds): Replace
"%<%s%>" with "%qs" in message wording.
* gofrontend/expressions.cc
(Selector_expression::lower_method_expression): Likewise.
* gofrontend/gogo.cc (Gogo::set_package_name): Likewise.
(Named_object::export_named_object): Likewise.
* gofrontend/parse.cc (Parse::struct_type): Likewise.
(Parse::parameter_list): Likewise.
gcc/rust/ChangeLog:
PR c/104896
* backend/rust-compile-expr.cc
(CompileExpr::compile_integer_literal): Replace "%<%s%>" with
"%qs" in message wording.
(CompileExpr::compile_float_literal): Likewise.
* backend/rust-compile-intrinsic.cc (Intrinsics::compile):
Likewise.
* backend/rust-tree.cc (maybe_warn_nodiscard): Likewise.
* checks/lints/rust-lint-scan-deadcode.h: Likewise.
* lex/rust-lex.cc (Lexer::parse_partial_unicode_escape): Likewise.
(Lexer::parse_raw_byte_string): Likewise.
* lex/rust-token.cc (Token::get_str): Likewise.
* metadata/rust-export-metadata.cc
(PublicInterface::write_to_path): Likewise.
* parse/rust-parse.cc
(peculiar_fragment_match_compatible_fragment): Likewise.
(peculiar_fragment_match_compatible): Likewise.
* resolve/rust-ast-resolve-path.cc (ResolvePath::resolve_path):
Likewise.
* resolve/rust-ast-resolve-toplevel.h: Likewise.
* resolve/rust-ast-resolve-type.cc (ResolveRelativeTypePath::go):
Likewise.
* rust-session-manager.cc (validate_crate_name): Likewise.
(Session::load_extern_crate): Likewise.
* typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit):
Likewise.
(TypeCheckExpr::resolve_fn_trait_call): Likewise.
* typecheck/rust-hir-type-check-implitem.cc
(TypeCheckImplItemWithTrait::visit): Likewise.
* typecheck/rust-hir-type-check-item.cc
(TypeCheckItem::validate_trait_impl_block): Likewise.
* typecheck/rust-hir-type-check-struct.cc
(TypeCheckStructExpr::visit): Likewise.
* typecheck/rust-tyty-call.cc (TypeCheckCallExpr::visit):
Likewise.
* typecheck/rust-tyty.cc (BaseType::bounds_compatible): Likewise.
* typecheck/rust-unify.cc (UnifyRules::emit_abi_mismatch):
Likewise.
* util/rust-attributes.cc (AttributeChecker::visit): Likewise.
libcpp/ChangeLog:
PR c/104896
* pch.cc (cpp_valid_state): Replace "%<%s%>" with "%qs" in message
wording.
Signed-off-by: David Malcolm <dmalcolm@redhat.com>
Diffstat (limited to 'gcc/rust')
-rw-r--r-- | gcc/rust/backend/rust-compile-expr.cc | 4 | ||||
-rw-r--r-- | gcc/rust/backend/rust-compile-intrinsic.cc | 2 | ||||
-rw-r--r-- | gcc/rust/backend/rust-tree.cc | 4 | ||||
-rw-r--r-- | gcc/rust/checks/lints/rust-lint-scan-deadcode.h | 10 | ||||
-rw-r--r-- | gcc/rust/lex/rust-lex.cc | 4 | ||||
-rw-r--r-- | gcc/rust/lex/rust-token.cc | 2 | ||||
-rw-r--r-- | gcc/rust/metadata/rust-export-metadata.cc | 20 | ||||
-rw-r--r-- | gcc/rust/parse/rust-parse.cc | 4 | ||||
-rw-r--r-- | gcc/rust/resolve/rust-ast-resolve-path.cc | 10 | ||||
-rw-r--r-- | gcc/rust/resolve/rust-ast-resolve-toplevel.h | 2 | ||||
-rw-r--r-- | gcc/rust/resolve/rust-ast-resolve-type.cc | 4 | ||||
-rw-r--r-- | gcc/rust/rust-session-manager.cc | 6 | ||||
-rw-r--r-- | gcc/rust/typecheck/rust-hir-type-check-expr.cc | 6 | ||||
-rw-r--r-- | gcc/rust/typecheck/rust-hir-type-check-implitem.cc | 10 | ||||
-rw-r--r-- | gcc/rust/typecheck/rust-hir-type-check-item.cc | 2 | ||||
-rw-r--r-- | gcc/rust/typecheck/rust-hir-type-check-struct.cc | 6 | ||||
-rw-r--r-- | gcc/rust/typecheck/rust-tyty-call.cc | 2 | ||||
-rw-r--r-- | gcc/rust/typecheck/rust-tyty.cc | 2 | ||||
-rw-r--r-- | gcc/rust/typecheck/rust-unify.cc | 2 | ||||
-rw-r--r-- | gcc/rust/util/rust-attributes.cc | 2 |
20 files changed, 52 insertions, 52 deletions
diff --git a/gcc/rust/backend/rust-compile-expr.cc b/gcc/rust/backend/rust-compile-expr.cc index 6a9bb73..c8e4339 100644 --- a/gcc/rust/backend/rust-compile-expr.cc +++ b/gcc/rust/backend/rust-compile-expr.cc @@ -1501,7 +1501,7 @@ CompileExpr::compile_integer_literal (const HIR::LiteralExpr &expr, if (mpz_cmp (ival, type_min) < 0 || mpz_cmp (ival, type_max) > 0) { rust_error_at (expr.get_locus (), - "integer overflows the respective type %<%s%>", + "integer overflows the respective type %qs", tyty->get_name ().c_str ()); return error_mark_node; } @@ -1547,7 +1547,7 @@ CompileExpr::compile_float_literal (const HIR::LiteralExpr &expr, if (TREE_OVERFLOW (real_value) || real_value_overflow) { rust_error_at (expr.get_locus (), - "decimal overflows the respective type %<%s%>", + "decimal overflows the respective type %qs", tyty->get_name ().c_str ()); return error_mark_node; } diff --git a/gcc/rust/backend/rust-compile-intrinsic.cc b/gcc/rust/backend/rust-compile-intrinsic.cc index 49ee4c0..f94659c 100644 --- a/gcc/rust/backend/rust-compile-intrinsic.cc +++ b/gcc/rust/backend/rust-compile-intrinsic.cc @@ -271,7 +271,7 @@ Intrinsics::compile (TyTy::FnType *fntype) location_t locus = ctx->get_mappings ()->lookup_location (fntype->get_ref ()); rust_error_at (locus, ErrorCode::E0093, - "unrecognized intrinsic function: %<%s%>", + "unrecognized intrinsic function: %qs", fntype->get_identifier ().c_str ()); return error_mark_node; diff --git a/gcc/rust/backend/rust-tree.cc b/gcc/rust/backend/rust-tree.cc index 3dc6b07..48b3c5f 100644 --- a/gcc/rust/backend/rust-tree.cc +++ b/gcc/rust/backend/rust-tree.cc @@ -613,7 +613,7 @@ maybe_warn_nodiscard (tree expr, impl_conv_void implicit) if (args) msg.escape (TREE_STRING_POINTER (TREE_VALUE (args))); const char *format - = (msg ? G_ ("ignoring return value of %qD, that must be used: %<%s%>") + = (msg ? G_ ("ignoring return value of %qD, that must be used: %qs") : G_ ("ignoring return value of %qD, that must be used")); const char *raw_msg = msg ? (const char *) msg : ""; auto_diagnostic_group d; @@ -630,7 +630,7 @@ maybe_warn_nodiscard (tree expr, impl_conv_void implicit) msg.escape (TREE_STRING_POINTER (TREE_VALUE (args))); const char *format = (msg ? G_ ( - "ignoring returned value of type %qT, that must be used: %<%s%>") + "ignoring returned value of type %qT, that must be used: %qs") : G_ ("ignoring returned value of type %qT, that must be used")); const char *raw_msg = msg ? (const char *) msg : ""; auto_diagnostic_group d; diff --git a/gcc/rust/checks/lints/rust-lint-scan-deadcode.h b/gcc/rust/checks/lints/rust-lint-scan-deadcode.h index 44373bf..58a7070 100644 --- a/gcc/rust/checks/lints/rust-lint-scan-deadcode.h +++ b/gcc/rust/checks/lints/rust-lint-scan-deadcode.h @@ -61,7 +61,7 @@ public: { rust_warning_at ( function.get_function_name ().get_locus (), 0, - "associated function is never used: %<%s%>", + "associated function is never used: %qs", function.get_function_name ().as_string ().c_str ()); } } @@ -69,7 +69,7 @@ public: { rust_warning_at ( function.get_function_name ().get_locus (), 0, - "function is never used: %<%s%>", + "function is never used: %qs", function.get_function_name ().as_string ().c_str ()); } } @@ -84,7 +84,7 @@ public: = stct.get_identifier ().as_string ().at (0) == '_'; if (!name_starts_underscore) rust_warning_at (stct.get_locus (), 0, - "struct is never constructed: %<%s%>", + "struct is never constructed: %qs", stct.get_identifier ().as_string ().c_str ()); } else @@ -97,7 +97,7 @@ public: && !field.get_visibility ().is_public ()) { rust_warning_at (field.get_locus (), 0, - "field is never read: %<%s%>", + "field is never read: %qs", field.get_field_name ().as_string ().c_str ()); } } @@ -111,7 +111,7 @@ public: if (should_warn (hirId) && !stct.get_visibility ().is_public ()) { rust_warning_at (stct.get_locus (), 0, - "struct is never constructed: %<%s%>", + "struct is never constructed: %qs", stct.get_identifier ().as_string ().c_str ()); } } diff --git a/gcc/rust/lex/rust-lex.cc b/gcc/rust/lex/rust-lex.cc index e5c9148..b8f5776 100644 --- a/gcc/rust/lex/rust-lex.cc +++ b/gcc/rust/lex/rust-lex.cc @@ -1631,7 +1631,7 @@ Lexer::parse_partial_unicode_escape () else { rust_error_at (get_current_location (), - "invalid character %<%s%> in unicode escape", + "invalid character %qs in unicode escape", current_char.as_string ().c_str ()); // TODO use utf-8 codepoint to skip whitespaces while (current_char != '}' && current_char != '{' @@ -1896,7 +1896,7 @@ Lexer::parse_raw_byte_string (location_t loc) else if (current_char.value > 127) { rust_error_at (get_current_location (), - "character %<%s%> in raw byte string out of range", + "character %qs in raw byte string out of range", current_char.as_string ().c_str ()); current_char = 0; } diff --git a/gcc/rust/lex/rust-token.cc b/gcc/rust/lex/rust-token.cc index 7bb3273..0180dbe 100644 --- a/gcc/rust/lex/rust-token.cc +++ b/gcc/rust/lex/rust-token.cc @@ -191,7 +191,7 @@ Token::get_str () const if (str == NULL) { rust_error_at (get_locus (), - "attempted to get string for %<%s%>, which has no string. " + "attempted to get string for %qs, which has no string. " "returning empty string instead", get_token_description ()); return empty; diff --git a/gcc/rust/metadata/rust-export-metadata.cc b/gcc/rust/metadata/rust-export-metadata.cc index 589511e..4d67dc8 100644 --- a/gcc/rust/metadata/rust-export-metadata.cc +++ b/gcc/rust/metadata/rust-export-metadata.cc @@ -244,7 +244,7 @@ PublicInterface::write_to_path (const std::string &path) const { rust_error_at (UNDEF_LOCATION, "expected metadata-output path to have base file name of: " - "%<%s%> got %<%s%>", + "%qs got %qs", expected_file_name.c_str (), path_base_name); return; } @@ -269,7 +269,7 @@ PublicInterface::write_to_path (const std::string &path) const if (nfd == NULL) { rust_error_at (UNDEF_LOCATION, - "failed to open file %<%s%> for writing: %s", + "failed to open file %qs for writing: %s", path.c_str (), xstrerror (errno)); return; } @@ -277,7 +277,7 @@ PublicInterface::write_to_path (const std::string &path) const // write data if (fwrite (kMagicHeader, sizeof (kMagicHeader), 1, nfd) < 1) { - rust_error_at (UNDEF_LOCATION, "failed to write to file %<%s%>: %s", + rust_error_at (UNDEF_LOCATION, "failed to write to file %qs: %s", path.c_str (), xstrerror (errno)); fclose (nfd); return; @@ -285,7 +285,7 @@ PublicInterface::write_to_path (const std::string &path) const if (fwrite (checksum, sizeof (checksum), 1, nfd) < 1) { - rust_error_at (UNDEF_LOCATION, "failed to write to file %<%s%>: %s", + rust_error_at (UNDEF_LOCATION, "failed to write to file %qs: %s", path.c_str (), xstrerror (errno)); fclose (nfd); return; @@ -293,7 +293,7 @@ PublicInterface::write_to_path (const std::string &path) const if (fwrite (kSzDelim, sizeof (kSzDelim), 1, nfd) < 1) { - rust_error_at (UNDEF_LOCATION, "failed to write to file %<%s%>: %s", + rust_error_at (UNDEF_LOCATION, "failed to write to file %qs: %s", path.c_str (), xstrerror (errno)); fclose (nfd); return; @@ -302,7 +302,7 @@ PublicInterface::write_to_path (const std::string &path) const if (fwrite (current_crate_name.c_str (), current_crate_name.size (), 1, nfd) < 1) { - rust_error_at (UNDEF_LOCATION, "failed to write to file %<%s%>: %s", + rust_error_at (UNDEF_LOCATION, "failed to write to file %qs: %s", path.c_str (), xstrerror (errno)); fclose (nfd); return; @@ -310,7 +310,7 @@ PublicInterface::write_to_path (const std::string &path) const if (fwrite (kSzDelim, sizeof (kSzDelim), 1, nfd) < 1) { - rust_error_at (UNDEF_LOCATION, "failed to write to file %<%s%>: %s", + rust_error_at (UNDEF_LOCATION, "failed to write to file %qs: %s", path.c_str (), xstrerror (errno)); fclose (nfd); return; @@ -318,7 +318,7 @@ PublicInterface::write_to_path (const std::string &path) const if (fwrite (size_buffer.c_str (), size_buffer.size (), 1, nfd) < 1) { - rust_error_at (UNDEF_LOCATION, "failed to write to file %<%s%>: %s", + rust_error_at (UNDEF_LOCATION, "failed to write to file %qs: %s", path.c_str (), xstrerror (errno)); fclose (nfd); return; @@ -326,7 +326,7 @@ PublicInterface::write_to_path (const std::string &path) const if (fwrite (kSzDelim, sizeof (kSzDelim), 1, nfd) < 1) { - rust_error_at (UNDEF_LOCATION, "failed to write to file %<%s%>: %s", + rust_error_at (UNDEF_LOCATION, "failed to write to file %qs: %s", path.c_str (), xstrerror (errno)); fclose (nfd); return; @@ -335,7 +335,7 @@ PublicInterface::write_to_path (const std::string &path) const if (!buf.empty ()) if (fwrite (buf.c_str (), buf.size (), 1, nfd) < 1) { - rust_error_at (UNDEF_LOCATION, "failed to write to file %<%s%>: %s", + rust_error_at (UNDEF_LOCATION, "failed to write to file %qs: %s", path.c_str (), xstrerror (errno)); fclose (nfd); return; diff --git a/gcc/rust/parse/rust-parse.cc b/gcc/rust/parse/rust-parse.cc index 504a409..9aca781 100644 --- a/gcc/rust/parse/rust-parse.cc +++ b/gcc/rust/parse/rust-parse.cc @@ -146,7 +146,7 @@ peculiar_fragment_match_compatible_fragment ( if (!is_valid) rust_error_at ( match_locus, - "fragment specifier %<%s%> is not allowed after %<%s%> fragments", + "fragment specifier %qs is not allowed after %qs fragments", spec.as_string ().c_str (), last_spec.as_string ().c_str ()); return is_valid; @@ -299,7 +299,7 @@ peculiar_fragment_match_compatible (const AST::MacroMatchFragment &last_match, break; } - rust_error_at (error_locus, "%s is not allowed after %<%s%> fragment", + rust_error_at (error_locus, "%s is not allowed after %qs fragment", kind_str.c_str (), last_match.get_frag_spec ().as_string ().c_str ()); auto allowed_toks_str diff --git a/gcc/rust/resolve/rust-ast-resolve-path.cc b/gcc/rust/resolve/rust-ast-resolve-path.cc index ec59030..ca826bc 100644 --- a/gcc/rust/resolve/rust-ast-resolve-path.cc +++ b/gcc/rust/resolve/rust-ast-resolve-path.cc @@ -63,7 +63,7 @@ ResolvePath::resolve_path (AST::PathInExpression &expr) if (in_middle_of_path && segment.is_lower_self_seg ()) { rust_error_at (segment.get_locus (), ErrorCode::E0433, - "failed to resolve: %<%s%> in paths can only be used " + "failed to resolve: %qs in paths can only be used " "in start position", segment.as_string ().c_str ()); return UNKNOWN_NODEID; @@ -187,7 +187,7 @@ ResolvePath::resolve_path (AST::PathInExpression &expr) else { rust_error_at (segment.get_locus (), - "Cannot find path %<%s%> in this scope", + "Cannot find path %qs in this scope", segment.as_string ().c_str ()); return UNKNOWN_NODEID; } @@ -207,7 +207,7 @@ ResolvePath::resolve_path (AST::PathInExpression &expr) else if (is_first_segment) { rust_error_at (segment.get_locus (), ErrorCode::E0433, - "Cannot find path %<%s%> in this scope", + "Cannot find path %qs in this scope", segment.as_string ().c_str ()); return UNKNOWN_NODEID; } @@ -326,7 +326,7 @@ ResolvePath::resolve_path (AST::SimplePath &expr) else { rust_error_at (segment.get_locus (), - "Cannot find path %<%s%> in this scope", + "Cannot find path %qs in this scope", segment.as_string ().c_str ()); return UNKNOWN_NODEID; } @@ -374,7 +374,7 @@ ResolvePath::resolve_path (AST::SimplePath &expr) if (resolved_node_id == UNKNOWN_NODEID) { rust_error_at (segment.get_locus (), - "cannot find simple path segment %<%s%> in this scope", + "cannot find simple path segment %qs in this scope", segment.as_string ().c_str ()); return UNKNOWN_NODEID; } diff --git a/gcc/rust/resolve/rust-ast-resolve-toplevel.h b/gcc/rust/resolve/rust-ast-resolve-toplevel.h index 7576928..f70cfcf 100644 --- a/gcc/rust/resolve/rust-ast-resolve-toplevel.h +++ b/gcc/rust/resolve/rust-ast-resolve-toplevel.h @@ -440,7 +440,7 @@ public: found_crate_num); if (!found) { - rust_error_at (extern_crate.get_locus (), "unknown crate %<%s%>", + rust_error_at (extern_crate.get_locus (), "unknown crate %qs", extern_crate.get_referenced_crate ().c_str ()); return; } diff --git a/gcc/rust/resolve/rust-ast-resolve-type.cc b/gcc/rust/resolve/rust-ast-resolve-type.cc index df1e7ee..b20098e 100644 --- a/gcc/rust/resolve/rust-ast-resolve-type.cc +++ b/gcc/rust/resolve/rust-ast-resolve-type.cc @@ -99,7 +99,7 @@ ResolveRelativeTypePath::go (AST::TypePath &path, NodeId &resolved_node_id) if (in_middle_of_path && segment->is_lower_self_seg ()) { rust_error_at (segment->get_locus (), ErrorCode::E0433, - "failed to resolve: %<%s%> in paths can only be used " + "failed to resolve: %qs in paths can only be used " "in start position", segment->as_string ().c_str ()); return false; @@ -221,7 +221,7 @@ ResolveRelativeTypePath::go (AST::TypePath &path, NodeId &resolved_node_id) else { rust_error_at (segment->get_locus (), - "Cannot find path %<%s%> in this scope", + "Cannot find path %qs in this scope", segment->as_string ().c_str ()); return false; } diff --git a/gcc/rust/rust-session-manager.cc b/gcc/rust/rust-session-manager.cc index 1c7e276..18d0484 100644 --- a/gcc/rust/rust-session-manager.cc +++ b/gcc/rust/rust-session-manager.cc @@ -147,7 +147,7 @@ validate_crate_name (const std::string &crate_name, Error &error) if (!(is_alphabetic (c.value) || is_numeric (c.value) || c.value == '_')) { error = Error (UNDEF_LOCATION, - "invalid character %<%s%> in crate name: %<%s%>", + "invalid character %qs in crate name: %qs", c.as_string ().c_str (), crate_name.c_str ()); return false; } @@ -1086,7 +1086,7 @@ Session::load_extern_crate (const std::string &crate_name, location_t locus) if (stream == NULL // No stream and && proc_macros.empty ()) // no proc macros { - rust_error_at (locus, "failed to locate crate %<%s%>", + rust_error_at (locus, "failed to locate crate %qs", import_name.c_str ()); return UNKNOWN_NODEID; } @@ -1110,7 +1110,7 @@ Session::load_extern_crate (const std::string &crate_name, location_t locus) const std::string current_crate_name = mappings->get_current_crate_name (); if (current_crate_name.compare (extern_crate.get_crate_name ()) == 0) { - rust_error_at (locus, "current crate name %<%s%> collides with this", + rust_error_at (locus, "current crate name %qs collides with this", current_crate_name.c_str ()); return UNKNOWN_NODEID; } diff --git a/gcc/rust/typecheck/rust-hir-type-check-expr.cc b/gcc/rust/typecheck/rust-hir-type-check-expr.cc index 224d2ff..5f99ae6 100644 --- a/gcc/rust/typecheck/rust-hir-type-check-expr.cc +++ b/gcc/rust/typecheck/rust-hir-type-check-expr.cc @@ -921,7 +921,7 @@ TypeCheckExpr::visit (HIR::ArrayIndexExpr &expr) r.add_range (expr.get_array_expr ()->get_locus ()); r.add_range (expr.get_index_expr ()->get_locus ()); rust_error_at (r, ErrorCode::E0277, - "the type %<%s%> cannot be indexed by %<%s%>", + "the type %qs cannot be indexed by %qs", array_expr_ty->get_name ().c_str (), index_expr_ty->get_name ().c_str ()); } @@ -1593,7 +1593,7 @@ TypeCheckExpr::visit (HIR::ClosureExpr &expr) // FIXME // we need to have a unified way or error'ing when we are missing lang // items that is useful - rust_fatal_error (expr.get_locus (), "unable to find lang item: %<%s%>", + rust_fatal_error (expr.get_locus (), "unable to find lang item: %qs", LangItem::ToString (lang_item_type).c_str ()); } rust_assert (lang_item_defined); @@ -1904,7 +1904,7 @@ TypeCheckExpr::resolve_fn_trait_call (HIR::CallExpr &expr, r.add_range (c.candidate.locus); rust_error_at ( - r, "multiple candidates found for function trait method call %<%s%>", + r, "multiple candidates found for function trait method call %qs", method_name.as_string ().c_str ()); return false; } diff --git a/gcc/rust/typecheck/rust-hir-type-check-implitem.cc b/gcc/rust/typecheck/rust-hir-type-check-implitem.cc index 8a9a3f3..542c380 100644 --- a/gcc/rust/typecheck/rust-hir-type-check-implitem.cc +++ b/gcc/rust/typecheck/rust-hir-type-check-implitem.cc @@ -610,7 +610,7 @@ TypeCheckImplItemWithTrait::visit (HIR::ConstantItem &constant) r.add_range (resolved_trait_item.get_locus ()); rust_error_at ( - r, "constant %<%s%> has an incompatible type for trait %<%s%>", + r, "constant %qs has an incompatible type for trait %qs", constant.get_identifier ().as_string ().c_str (), trait_reference.get_name ().c_str ()); } @@ -636,7 +636,7 @@ TypeCheckImplItemWithTrait::visit (HIR::TypeAlias &type) { rich_location r (line_table, type.get_locus ()); r.add_range (trait_reference.get_locus ()); - rust_error_at (r, "type alias %<%s%> is not a member of trait %<%s%>", + rust_error_at (r, "type alias %qs is not a member of trait %qs", type.get_new_type_name ().as_string ().c_str (), trait_reference.get_name ().c_str ()); return; @@ -661,7 +661,7 @@ TypeCheckImplItemWithTrait::visit (HIR::TypeAlias &type) r.add_range (resolved_trait_item.get_locus ()); rust_error_at ( - r, "type alias %<%s%> has an incompatible type for trait %<%s%>", + r, "type alias %qs has an incompatible type for trait %qs", type.get_new_type_name ().as_string ().c_str (), trait_reference.get_name ().c_str ()); } @@ -696,7 +696,7 @@ TypeCheckImplItemWithTrait::visit (HIR::Function &function) { rich_location r (line_table, function.get_locus ()); r.add_range (trait_reference.get_locus ()); - rust_error_at (r, "method %<%s%> is not a member of trait %<%s%>", + rust_error_at (r, "method %qs is not a member of trait %qs", function.get_function_name ().as_string ().c_str (), trait_reference.get_name ().c_str ()); return; @@ -721,7 +721,7 @@ TypeCheckImplItemWithTrait::visit (HIR::Function &function) r.add_range (resolved_trait_item.get_locus ()); rust_error_at (r, ErrorCode::E0053, - "method %<%s%> has an incompatible type for trait %<%s%>", + "method %qs has an incompatible type for trait %qs", function.get_function_name ().as_string ().c_str (), trait_reference.get_name ().c_str ()); } diff --git a/gcc/rust/typecheck/rust-hir-type-check-item.cc b/gcc/rust/typecheck/rust-hir-type-check-item.cc index 3e504e5..9635287 100644 --- a/gcc/rust/typecheck/rust-hir-type-check-item.cc +++ b/gcc/rust/typecheck/rust-hir-type-check-item.cc @@ -767,7 +767,7 @@ TypeCheckItem::validate_trait_impl_block ( } rust_error_at (r, ErrorCode::E0046, - "missing %s in implementation of trait %<%s%>", + "missing %s in implementation of trait %qs", missing_items_buf.c_str (), trait_reference->get_name ().c_str ()); } diff --git a/gcc/rust/typecheck/rust-hir-type-check-struct.cc b/gcc/rust/typecheck/rust-hir-type-check-struct.cc index d2977ac..80cfa42 100644 --- a/gcc/rust/typecheck/rust-hir-type-check-struct.cc +++ b/gcc/rust/typecheck/rust-hir-type-check-struct.cc @@ -279,7 +279,7 @@ TypeCheckStructExpr::visit (HIR::StructExprFieldIdentifierValue &field) repeat_location.add_range (prev_field_locus); rust_error_at (repeat_location, ErrorCode::E0062, - "field %<%s%> specified more than once", + "field %qs specified more than once", field.field_name.as_string ().c_str ()); return false; } @@ -325,7 +325,7 @@ TypeCheckStructExpr::visit (HIR::StructExprFieldIndexValue &field) repeat_location.add_range (prev_field_locus); rust_error_at (repeat_location, ErrorCode::E0062, - "field %<%s%> specified more than once", + "field %qs specified more than once", field_name.c_str ()); return false; } @@ -370,7 +370,7 @@ TypeCheckStructExpr::visit (HIR::StructExprFieldIdentifier &field) repeat_location.add_range (prev_field_locus); rust_error_at (repeat_location, ErrorCode::E0062, - "field %<%s%> specified more than once", + "field %qs specified more than once", field.get_field_name ().as_string ().c_str ()); return false; } diff --git a/gcc/rust/typecheck/rust-tyty-call.cc b/gcc/rust/typecheck/rust-tyty-call.cc index a28780b..edc33bf 100644 --- a/gcc/rust/typecheck/rust-tyty-call.cc +++ b/gcc/rust/typecheck/rust-tyty-call.cc @@ -60,7 +60,7 @@ TypeCheckCallExpr::visit (ADTType &type) { rust_error_at ( call.get_locus (), ErrorCode::E0423, - "expected function, tuple struct or tuple variant, found struct %<%s%>", + "expected function, tuple struct or tuple variant, found struct %qs", type.get_name ().c_str ()); return; } diff --git a/gcc/rust/typecheck/rust-tyty.cc b/gcc/rust/typecheck/rust-tyty.cc index 51960ef..9d19d97 100644 --- a/gcc/rust/typecheck/rust-tyty.cc +++ b/gcc/rust/typecheck/rust-tyty.cc @@ -408,7 +408,7 @@ BaseType::bounds_compatible (const BaseType &other, location_t locus, if (emit_error) { rust_error_at (r, ErrorCode::E0277, - "bounds not satisfied for %s %<%s%> is not satisfied", + "bounds not satisfied for %s %qs is not satisfied", other.get_name ().c_str (), missing_preds.c_str ()); // rust_assert (!emit_error); } diff --git a/gcc/rust/typecheck/rust-unify.cc b/gcc/rust/typecheck/rust-unify.cc index 7d1042d..f007b9b 100644 --- a/gcc/rust/typecheck/rust-unify.cc +++ b/gcc/rust/typecheck/rust-unify.cc @@ -135,7 +135,7 @@ UnifyRules::emit_abi_mismatch (const TyTy::FnType &expected, rich_location r (line_table, locus); r.add_range (lhs.get_locus ()); r.add_range (rhs.get_locus ()); - rust_error_at (r, "mistached abi %<%s%> got %<%s%>", + rust_error_at (r, "mistached abi %qs got %qs", get_string_from_abi (expected.get_abi ()).c_str (), get_string_from_abi (got.get_abi ()).c_str ()); } diff --git a/gcc/rust/util/rust-attributes.cc b/gcc/rust/util/rust-attributes.cc index 84d1781..8466092 100644 --- a/gcc/rust/util/rust-attributes.cc +++ b/gcc/rust/util/rust-attributes.cc @@ -653,7 +653,7 @@ AttributeChecker::visit (AST::Function &fun) if (!attribute.has_attr_input ()) { rust_error_at (attribute.get_locus (), - "malformed %<%s%> attribute input", name); + "malformed %qs attribute input", name); rust_inform ( attribute.get_locus (), "must be of the form: %<#[proc_macro_derive(TraitName, " |