From 1fe255e4928dd3a6d1ab574f92d472b1eea894c2 Mon Sep 17 00:00:00 2001 From: Owen Avery Date: Mon, 3 Jul 2023 13:48:45 -0400 Subject: [PATCH] Replace Linemap::unknown_location with UNKNOWN_LOCATION gcc/rust/ChangeLog: * rust-linemap.h (Linemap::unknown_location): Remove. * ast/rust-ast.cc: Replace Linemap::unknown_location with UNKNOWN_LOCATION. * ast/rust-path.cc: Likewise. * hir/tree/rust-hir.cc: Likewise. * metadata/rust-imports.cc: Likewise. * parse/rust-parse-impl.h: Likewise. * parse/rust-parse.h: Likewise. * rust-backend.h: Likewise. * rust-diagnostics.cc: Likewise. * rust-session-manager.cc: Likewise. * typecheck/rust-tyty.cc: Likewise. Signed-off-by: Owen Avery --- gcc/rust/ast/rust-ast.cc | 15 +++++---- gcc/rust/ast/rust-path.cc | 2 +- gcc/rust/hir/tree/rust-hir.cc | 2 +- gcc/rust/metadata/rust-imports.cc | 8 ++--- gcc/rust/parse/rust-parse-impl.h | 52 ++++++++++++++++--------------- gcc/rust/parse/rust-parse.h | 35 +++++++++------------ gcc/rust/rust-backend.h | 3 +- gcc/rust/rust-diagnostics.cc | 4 +-- gcc/rust/rust-linemap.h | 3 -- gcc/rust/rust-session-manager.cc | 17 +++++----- gcc/rust/typecheck/rust-tyty.cc | 3 +- 11 files changed, 67 insertions(+), 77 deletions(-) diff --git a/gcc/rust/ast/rust-ast.cc b/gcc/rust/ast/rust-ast.cc index 3e5cec86e3a6..befdc767162c 100644 --- a/gcc/rust/ast/rust-ast.cc +++ b/gcc/rust/ast/rust-ast.cc @@ -3610,8 +3610,7 @@ AttributeParser::parse_meta_item_inner () new MetaListPaths (ident, ident_locus, std::move (path_items))); } - rust_error_at (Linemap::unknown_location (), - "failed to parse any meta item inner"); + rust_error_at (UNKNOWN_LOCATION, "failed to parse any meta item inner"); return nullptr; } @@ -3905,7 +3904,7 @@ MetaListNameValueStr::check_cfg_predicate (const Session &session) const { /* HACK: convert vector platform-dependent size_type to string to * use in printf */ - rust_error_at (Linemap::unknown_location (), + rust_error_at (UNKNOWN_LOCATION, "cfg predicate could not be checked for " "MetaListNameValueStr with ident of " "'not' because there are '%s' elements, not '1'", @@ -3917,7 +3916,7 @@ MetaListNameValueStr::check_cfg_predicate (const Session &session) const } else { - rust_error_at (Linemap::unknown_location (), + rust_error_at (UNKNOWN_LOCATION, "cfg predicate could not be checked for " "MetaListNameValueStr with ident of " "'%s' - ident must be 'all' or 'any'", @@ -3953,7 +3952,7 @@ MetaListPaths::check_cfg_predicate (const Session &session) const { // HACK: convert vector platform-dependent size_type to string to // use in printf - rust_error_at (Linemap::unknown_location (), + rust_error_at (UNKNOWN_LOCATION, "cfg predicate could not be checked for MetaListPaths " "with ident of 'not' " "because there are '%s' elements, not '1'", @@ -3965,7 +3964,7 @@ MetaListPaths::check_cfg_predicate (const Session &session) const } else { - rust_error_at (Linemap::unknown_location (), + rust_error_at (UNKNOWN_LOCATION, "cfg predicate could not be checked for " "MetaListNameValueStr with ident of " "'%s' - ident must be 'all' or 'any'", @@ -4008,7 +4007,7 @@ MetaItemSeq::check_cfg_predicate (const Session &session) const { /* HACK: convert vector platform-dependent size_type to string to * use in printf */ - rust_error_at (Linemap::unknown_location (), + rust_error_at (UNKNOWN_LOCATION, "cfg predicate could not be checked for MetaItemSeq " "with ident of 'not' " "because there are '%s' elements, not '1'", @@ -4021,7 +4020,7 @@ MetaItemSeq::check_cfg_predicate (const Session &session) const else { rust_error_at ( - Linemap::unknown_location (), + UNKNOWN_LOCATION, "cfg predicate could not be checked for MetaItemSeq with path of " "'%s' - path must be 'all' or 'any'", path.as_string ().c_str ()); diff --git a/gcc/rust/ast/rust-path.cc b/gcc/rust/ast/rust-path.cc index ee6a6fb482e2..7c6d7e146586 100644 --- a/gcc/rust/ast/rust-path.cc +++ b/gcc/rust/ast/rust-path.cc @@ -172,7 +172,7 @@ PathPattern::convert_to_simple_path (bool with_opening_scope_resolution) const } // kind of a HACK to get locus depending on opening scope resolution - Location locus = Linemap::unknown_location (); + Location locus = UNKNOWN_LOCATION; if (with_opening_scope_resolution) locus = simple_segments[0].get_locus () - 2; // minus 2 chars for :: else diff --git a/gcc/rust/hir/tree/rust-hir.cc b/gcc/rust/hir/tree/rust-hir.cc index 0bad5201fa8d..9d7650441d55 100644 --- a/gcc/rust/hir/tree/rust-hir.cc +++ b/gcc/rust/hir/tree/rust-hir.cc @@ -2173,7 +2173,7 @@ PathPattern::convert_to_simple_path (bool with_opening_scope_resolution) const } // kind of a HACK to get locus depending on opening scope resolution - Location locus = Linemap::unknown_location (); + Location locus = UNKNOWN_LOCATION; if (with_opening_scope_resolution) { locus = simple_segments[0].get_locus () - 2; // minus 2 chars for :: diff --git a/gcc/rust/metadata/rust-imports.cc b/gcc/rust/metadata/rust-imports.cc index acfec3e4a1a4..45b3832fd95c 100644 --- a/gcc/rust/metadata/rust-imports.cc +++ b/gcc/rust/metadata/rust-imports.cc @@ -375,7 +375,7 @@ Stream_from_file::Stream_from_file (int fd) : fd_ (fd), data_ () { if (lseek (fd, 0, SEEK_SET) != 0) { - rust_fatal_error (Linemap::unknown_location (), "lseek failed: %m"); + rust_fatal_error (UNKNOWN_LOCATION, "lseek failed: %m"); this->set_saw_error (); } } @@ -399,7 +399,7 @@ Stream_from_file::do_peek (size_t length, const char **bytes) if (got < 0) { if (!this->saw_error ()) - rust_fatal_error (Linemap::unknown_location (), "read failed: %m"); + rust_fatal_error (UNKNOWN_LOCATION, "read failed: %m"); this->set_saw_error (); return false; } @@ -407,7 +407,7 @@ Stream_from_file::do_peek (size_t length, const char **bytes) if (lseek (this->fd_, -got, SEEK_CUR) < 0) { if (!this->saw_error ()) - rust_fatal_error (Linemap::unknown_location (), "lseek failed: %m"); + rust_fatal_error (UNKNOWN_LOCATION, "lseek failed: %m"); this->set_saw_error (); return false; } @@ -427,7 +427,7 @@ Stream_from_file::do_advance (size_t skip) if (lseek (this->fd_, skip, SEEK_CUR) < 0) { if (!this->saw_error ()) - rust_fatal_error (Linemap::unknown_location (), "lseek failed: %m"); + rust_fatal_error (UNKNOWN_LOCATION, "lseek failed: %m"); this->set_saw_error (); } if (!this->data_.empty ()) diff --git a/gcc/rust/parse/rust-parse-impl.h b/gcc/rust/parse/rust-parse-impl.h index e94e205665dd..06faaee69261 100644 --- a/gcc/rust/parse/rust-parse-impl.h +++ b/gcc/rust/parse/rust-parse-impl.h @@ -606,7 +606,7 @@ AST::SimplePath Parser::parse_simple_path () { bool has_opening_scope_resolution = false; - Location locus = Linemap::unknown_location (); + Location locus = UNKNOWN_LOCATION; // don't parse anything if not a path upfront if (!is_simple_path_segment (lexer.peek_token ()->get_id ()) @@ -628,7 +628,7 @@ Parser::parse_simple_path () AST::SimplePathSegment segment = parse_simple_path_segment (); // get location if not gotten already - if (locus == Linemap::unknown_location ()) + if (locus == UNKNOWN_LOCATION) locus = segment.get_locus (); std::vector segments; @@ -6764,7 +6764,7 @@ template AST::PathInExpression Parser::parse_path_in_expression () { - Location locus = Linemap::unknown_location (); + Location locus = UNKNOWN_LOCATION; bool has_opening_scope_resolution = false; if (lexer.peek_token ()->get_id () == SCOPE_RESOLUTION) { @@ -6778,7 +6778,7 @@ Parser::parse_path_in_expression () // create segment vector std::vector segments; - if (locus == Linemap::unknown_location ()) + if (locus == UNKNOWN_LOCATION) { locus = lexer.peek_token ()->get_locus (); } @@ -6949,7 +6949,7 @@ Parser::parse_qualified_path_type ( Location locus = pratt_parsed_loc; /* TODO: should this actually be error? is there anywhere where this could * be valid? */ - if (locus == Linemap::unknown_location ()) + if (locus == UNKNOWN_LOCATION) { locus = lexer.peek_token ()->get_locus (); @@ -7381,7 +7381,7 @@ Parser::parse_block_expr (AST::AttrVec outer_attrs, Location pratt_parsed_loc) { Location locus = pratt_parsed_loc; - if (locus == Linemap::unknown_location ()) + if (locus == UNKNOWN_LOCATION) { locus = lexer.peek_token ()->get_locus (); if (!skip_token (LEFT_CURLY)) @@ -7685,7 +7685,7 @@ Parser::parse_return_expr (AST::AttrVec outer_attrs, Location pratt_parsed_loc) { Location locus = pratt_parsed_loc; - if (locus == Linemap::unknown_location ()) + if (locus == UNKNOWN_LOCATION) { locus = lexer.peek_token ()->get_locus (); skip_token (RETURN_TOK); @@ -7710,7 +7710,7 @@ Parser::parse_break_expr (AST::AttrVec outer_attrs, Location pratt_parsed_loc) { Location locus = pratt_parsed_loc; - if (locus == Linemap::unknown_location ()) + if (locus == UNKNOWN_LOCATION) { locus = lexer.peek_token ()->get_locus (); skip_token (BREAK); @@ -7741,7 +7741,7 @@ Parser::parse_continue_expr (AST::AttrVec outer_attrs, Location pratt_parsed_loc) { Location locus = pratt_parsed_loc; - if (locus == Linemap::unknown_location ()) + if (locus == UNKNOWN_LOCATION) { locus = lexer.peek_token ()->get_locus (); skip_token (CONTINUE); @@ -7792,7 +7792,7 @@ Parser::parse_if_expr (AST::AttrVec outer_attrs, { // TODO: make having outer attributes an error? Location locus = pratt_parsed_loc; - if (locus == Linemap::unknown_location ()) + if (locus == UNKNOWN_LOCATION) { locus = lexer.peek_token ()->get_locus (); if (!skip_token (IF)) @@ -7950,7 +7950,7 @@ Parser::parse_if_let_expr (AST::AttrVec outer_attrs, { // TODO: make having outer attributes an error? Location locus = pratt_parsed_loc; - if (locus == Linemap::unknown_location ()) + if (locus == UNKNOWN_LOCATION) { locus = lexer.peek_token ()->get_locus (); if (!skip_token (IF)) @@ -8136,7 +8136,7 @@ Parser::parse_loop_expr (AST::AttrVec outer_attrs, Location pratt_parsed_loc) { Location locus = pratt_parsed_loc; - if (locus == Linemap::unknown_location ()) + if (locus == UNKNOWN_LOCATION) { if (label.is_error ()) locus = lexer.peek_token ()->get_locus (); @@ -8180,7 +8180,7 @@ Parser::parse_while_loop_expr (AST::AttrVec outer_attrs, Location pratt_parsed_loc) { Location locus = pratt_parsed_loc; - if (locus == Linemap::unknown_location ()) + if (locus == UNKNOWN_LOCATION) { if (label.is_error ()) locus = lexer.peek_token ()->get_locus (); @@ -8251,7 +8251,7 @@ std::unique_ptr Parser::parse_while_let_loop_expr (AST::AttrVec outer_attrs, AST::LoopLabel label) { - Location locus = Linemap::unknown_location (); + Location locus = UNKNOWN_LOCATION; if (label.is_error ()) locus = lexer.peek_token ()->get_locus (); else @@ -8325,7 +8325,7 @@ std::unique_ptr Parser::parse_for_loop_expr (AST::AttrVec outer_attrs, AST::LoopLabel label) { - Location locus = Linemap::unknown_location (); + Location locus = UNKNOWN_LOCATION; if (label.is_error ()) locus = lexer.peek_token ()->get_locus (); else @@ -8456,7 +8456,7 @@ Parser::parse_match_expr (AST::AttrVec outer_attrs, Location pratt_parsed_loc) { Location locus = pratt_parsed_loc; - if (locus == Linemap::unknown_location ()) + if (locus == UNKNOWN_LOCATION) { locus = lexer.peek_token ()->get_locus (); skip_token (MATCH_TOK); @@ -8742,7 +8742,7 @@ Parser::parse_unsafe_block_expr (AST::AttrVec outer_attrs, Location pratt_parsed_loc) { Location locus = pratt_parsed_loc; - if (locus == Linemap::unknown_location ()) + if (locus == UNKNOWN_LOCATION) { locus = lexer.peek_token ()->get_locus (); skip_token (UNSAFE); @@ -8773,7 +8773,7 @@ Parser::parse_array_expr (AST::AttrVec outer_attrs, Location pratt_parsed_loc) { Location locus = pratt_parsed_loc; - if (locus == Linemap::unknown_location ()) + if (locus == UNKNOWN_LOCATION) { locus = lexer.peek_token ()->get_locus (); skip_token (LEFT_SQUARE); @@ -8959,7 +8959,7 @@ Parser::parse_grouped_or_tuple_expr ( { // adjustment to allow Pratt parsing to reuse function without copy-paste Location locus = pratt_parsed_loc; - if (locus == Linemap::unknown_location ()) + if (locus == UNKNOWN_LOCATION) { locus = lexer.peek_token ()->get_locus (); skip_token (LEFT_PAREN); @@ -10682,9 +10682,10 @@ Parser::parse_pattern_no_alt () std::unique_ptr upper_bound = parse_range_pattern_bound (); - return std::unique_ptr (new AST::RangePattern ( - std::move (lower_bound), std::move (upper_bound), - Linemap::unknown_location (), has_ellipsis_syntax)); + return std::unique_ptr ( + new AST::RangePattern (std::move (lower_bound), + std::move (upper_bound), + UNKNOWN_LOCATION, has_ellipsis_syntax)); } case EXCLAM: return parse_macro_invocation_partial (std::move (path), @@ -11221,9 +11222,10 @@ Parser::parse_ident_leading_pattern () std::unique_ptr upper_bound = parse_range_pattern_bound (); - return std::unique_ptr (new AST::RangePattern ( - std::move (lower_bound), std::move (upper_bound), - Linemap::unknown_location (), has_ellipsis_syntax)); + return std::unique_ptr ( + new AST::RangePattern (std::move (lower_bound), + std::move (upper_bound), UNKNOWN_LOCATION, + has_ellipsis_syntax)); } case PATTERN_BIND: { // only allow on single-segment paths diff --git a/gcc/rust/parse/rust-parse.h b/gcc/rust/parse/rust-parse.h index 1d49c956b5c0..21540a31cc3b 100644 --- a/gcc/rust/parse/rust-parse.h +++ b/gcc/rust/parse/rust-parse.h @@ -139,7 +139,7 @@ template class Parser std::unique_ptr parse_block_expr (AST::AttrVec outer_attrs = AST::AttrVec (), - Location pratt_parsed_loc = Linemap::unknown_location ()); + Location pratt_parsed_loc = UNKNOWN_LOCATION); std::unique_ptr parse_item (bool called_from_statement); std::unique_ptr parse_pattern (); @@ -211,10 +211,9 @@ template class Parser // first token parsed in the expression (the parsing of that first // token should be skipped). parse_qualified_path_in_expression (Location pratt_parsed_loc - = Linemap::unknown_location ()); - AST::QualifiedPathType - parse_qualified_path_type (Location pratt_parsed_loc - = Linemap::unknown_location ()); + = UNKNOWN_LOCATION); + AST::QualifiedPathType parse_qualified_path_type (Location pratt_parsed_loc + = UNKNOWN_LOCATION); AST::QualifiedPathInType parse_qualified_path_in_type (); // Token tree or macro related @@ -566,19 +565,18 @@ template class Parser // token should be skipped). std::unique_ptr parse_if_expr (AST::AttrVec outer_attrs = AST::AttrVec (), - Location pratt_parsed_loc = Linemap::unknown_location ()); + Location pratt_parsed_loc = UNKNOWN_LOCATION); std::unique_ptr parse_if_let_expr (AST::AttrVec outer_attrs = AST::AttrVec (), - Location pratt_parsed_loc = Linemap::unknown_location ()); + Location pratt_parsed_loc = UNKNOWN_LOCATION); std::unique_ptr parse_loop_expr (AST::AttrVec outer_attrs = AST::AttrVec (), AST::LoopLabel label = AST::LoopLabel::error (), - Location pratt_parsed_loc = Linemap::unknown_location ()); + Location pratt_parsed_loc = UNKNOWN_LOCATION); std::unique_ptr parse_while_loop_expr (AST::AttrVec outer_attrs = AST::AttrVec (), AST::LoopLabel label = AST::LoopLabel::error (), - Location pratt_parsed_loc - = Linemap::unknown_location ()); + Location pratt_parsed_loc = UNKNOWN_LOCATION); std::unique_ptr parse_while_let_loop_expr (AST::AttrVec outer_attrs = AST::AttrVec (), AST::LoopLabel label = AST::LoopLabel::error ()); @@ -587,7 +585,7 @@ template class Parser AST::LoopLabel label = AST::LoopLabel::error ()); std::unique_ptr parse_match_expr (AST::AttrVec outer_attrs = AST::AttrVec (), - Location pratt_parsed_loc = Linemap::unknown_location ()); + Location pratt_parsed_loc = UNKNOWN_LOCATION); AST::MatchArm parse_match_arm (); std::vector > parse_match_arm_patterns (TokenId end_token_id); @@ -608,25 +606,22 @@ template class Parser // token should be skipped). std::unique_ptr parse_return_expr (AST::AttrVec outer_attrs = AST::AttrVec (), - Location pratt_parsed_loc = Linemap::unknown_location ()); + Location pratt_parsed_loc = UNKNOWN_LOCATION); std::unique_ptr parse_break_expr (AST::AttrVec outer_attrs = AST::AttrVec (), - Location pratt_parsed_loc = Linemap::unknown_location ()); + Location pratt_parsed_loc = UNKNOWN_LOCATION); std::unique_ptr parse_continue_expr (AST::AttrVec outer_attrs = AST::AttrVec (), - Location pratt_parsed_loc - = Linemap::unknown_location ()); + Location pratt_parsed_loc = UNKNOWN_LOCATION); std::unique_ptr parse_unsafe_block_expr (AST::AttrVec outer_attrs = AST::AttrVec (), - Location pratt_parsed_loc - = Linemap::unknown_location ()); + Location pratt_parsed_loc = UNKNOWN_LOCATION); std::unique_ptr parse_array_expr (AST::AttrVec outer_attrs = AST::AttrVec (), - Location pratt_parsed_loc = Linemap::unknown_location ()); + Location pratt_parsed_loc = UNKNOWN_LOCATION); std::unique_ptr parse_grouped_or_tuple_expr (AST::AttrVec outer_attrs = AST::AttrVec (), - Location pratt_parsed_loc - = Linemap::unknown_location ()); + Location pratt_parsed_loc = UNKNOWN_LOCATION); std::unique_ptr parse_struct_expr_field (); bool will_be_expr_with_block (); diff --git a/gcc/rust/rust-backend.h b/gcc/rust/rust-backend.h index 42b28399f4f3..4e1391926362 100644 --- a/gcc/rust/rust-backend.h +++ b/gcc/rust/rust-backend.h @@ -52,8 +52,7 @@ class Backend tree type; Location location; - typed_identifier () - : name (), type (NULL_TREE), location (Linemap::unknown_location ()) + typed_identifier () : name (), type (NULL_TREE), location (UNKNOWN_LOCATION) {} typed_identifier (const std::string &a_name, tree a_type, diff --git a/gcc/rust/rust-diagnostics.cc b/gcc/rust/rust-diagnostics.cc index bdff7a644d77..4847f6fa5b75 100644 --- a/gcc/rust/rust-diagnostics.cc +++ b/gcc/rust/rust-diagnostics.cc @@ -119,7 +119,7 @@ expand_message (const char *fmt, va_list ap) if (nwr == -1) { // memory allocation failed - rust_be_error_at (Linemap::unknown_location (), + rust_be_error_at (UNKNOWN_LOCATION, "memory allocation failed in vasprintf"); rust_assert (0); } @@ -323,7 +323,7 @@ rust_debug_loc (const Location location, const char *fmt, ...) va_end (ap); if (nwr == -1) { - rust_be_error_at (Linemap::unknown_location (), + rust_be_error_at (UNKNOWN_LOCATION, "memory allocation failed in vasprintf"); rust_assert (0); } diff --git a/gcc/rust/rust-linemap.h b/gcc/rust/rust-linemap.h index 12fdb9ff065c..710e47d7d365 100644 --- a/gcc/rust/rust-linemap.h +++ b/gcc/rust/rust-linemap.h @@ -78,9 +78,6 @@ class Linemap // Return the special Location used for predeclared identifiers. static Location predeclared_location () { return BUILTINS_LOCATION; } - // Return the special Location used when no location is known. - static Location unknown_location () { return UNKNOWN_LOCATION; } - // Produce a human-readable description of a Location. static std::string location_to_string (Location loc) { diff --git a/gcc/rust/rust-session-manager.cc b/gcc/rust/rust-session-manager.cc index 4178245314c2..c27b45646d04 100644 --- a/gcc/rust/rust-session-manager.cc +++ b/gcc/rust/rust-session-manager.cc @@ -488,8 +488,8 @@ Session::compile_crate (const char *filename) dump_lex_stream.open (kLexDumpFile); if (dump_lex_stream.fail ()) { - rust_error_at (Linemap::unknown_location (), - "cannot open %s:%m; ignored", kLexDumpFile); + rust_error_at (UNKNOWN_LOCATION, "cannot open %s:%m; ignored", + kLexDumpFile); } auto stream = Optional::some (dump_lex_stream); dump_lex_opt = std::move (stream); @@ -499,7 +499,7 @@ Session::compile_crate (const char *filename) if (!lex.input_source_is_valid_utf8 ()) { - rust_error_at (Linemap::unknown_location (), + rust_error_at (UNKNOWN_LOCATION, "cannot read %s; stream did not contain valid UTF-8", filename); return; @@ -802,8 +802,7 @@ Session::injection (AST::Crate &crate) // create "extern crate" item with the name std::unique_ptr extern_crate ( new AST::ExternCrate (*it, AST::Visibility::create_error (), - {std::move (attr)}, - Linemap::unknown_location ())); + {std::move (attr)}, UNKNOWN_LOCATION)); // insert at beginning // crate.items.insert (crate.items.begin (), std::move (extern_crate)); @@ -913,7 +912,7 @@ Session::dump_ast_pretty (AST::Crate &crate, bool expanded) const if (out.fail ()) { - rust_error_at (Linemap::unknown_location (), "cannot open %s:%m; ignored", + rust_error_at (UNKNOWN_LOCATION, "cannot open %s:%m; ignored", kASTDumpFile); return; } @@ -930,7 +929,7 @@ Session::dump_hir (HIR::Crate &crate) const out.open (kHIRDumpFile); if (out.fail ()) { - rust_error_at (Linemap::unknown_location (), "cannot open %s:%m; ignored", + rust_error_at (UNKNOWN_LOCATION, "cannot open %s:%m; ignored", kHIRDumpFile); return; } @@ -946,7 +945,7 @@ Session::dump_hir_pretty (HIR::Crate &crate) const out.open (kHIRPrettyDumpFile); if (out.fail ()) { - rust_error_at (Linemap::unknown_location (), "cannot open %s:%m; ignored", + rust_error_at (UNKNOWN_LOCATION, "cannot open %s:%m; ignored", kHIRPrettyDumpFile); return; } @@ -1038,7 +1037,7 @@ TargetOptions::dump_target_options () const out.open (kTargetOptionsDumpFile); if (out.fail ()) { - rust_error_at (Linemap::unknown_location (), "cannot open %s:%m; ignored", + rust_error_at (UNKNOWN_LOCATION, "cannot open %s:%m; ignored", kTargetOptionsDumpFile); return; } diff --git a/gcc/rust/typecheck/rust-tyty.cc b/gcc/rust/typecheck/rust-tyty.cc index d0436448ab81..d05633a4a8a9 100644 --- a/gcc/rust/typecheck/rust-tyty.cc +++ b/gcc/rust/typecheck/rust-tyty.cc @@ -1454,8 +1454,7 @@ VariantDef::get_error_node () { static VariantDef node = VariantDef (UNKNOWN_HIRID, UNKNOWN_DEFID, "", - {Resolver::CanonicalPath::create_empty (), - Linemap::unknown_location ()}, + {Resolver::CanonicalPath::create_empty (), UNKNOWN_LOCATION}, nullptr); return node;