From 5752164328fb2f101a88c6d298dd517436a140ba Mon Sep 17 00:00:00 2001 From: Arthur Cohen Date: Wed, 15 Feb 2023 16:56:07 +0100 Subject: diagnostic: Refactor Error class The class now allows for more variants including a `Hint` one which then gets emitted by calling `rust_inform`. This allows us to display hints/tips/notes in backtracking contexts such as the parser. gcc/rust/ChangeLog: * rust-diagnostics.h (struct Error): Add new Kind enum and various new static constructors to allow for hints as well. * rust-diagnostics.cc (Error::Error): Use new `kind` field properly. * checks/errors/privacy/rust-visibility-resolver.cc (VisibilityResolver::resolve_module_path): Use new Error API. * expand/rust-macro-builtins.cc (MacroBuiltin::include_handler): Likewise. * expand/rust-macro-expand.cc (parse_many): Likewise. (transcribe_type): Likewise. * parse/rust-parse-impl.h (Parser::parse_crate): Likewise. * rust-session-manager.cc (Session::handle_crate_name): Likewise. * ast/rust-ast.cc (Module::load_items): Likewise. --- gcc/rust/parse/rust-parse-impl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc/rust/parse/rust-parse-impl.h') diff --git a/gcc/rust/parse/rust-parse-impl.h b/gcc/rust/parse/rust-parse-impl.h index cc5436c..6a98bcc 100644 --- a/gcc/rust/parse/rust-parse-impl.h +++ b/gcc/rust/parse/rust-parse-impl.h @@ -444,7 +444,7 @@ Parser::parse_crate () // emit all errors for (const auto &error : error_table) - error.emit_error (); + error.emit (); return std::unique_ptr ( new AST::Crate (std::move (items), std::move (inner_attrs))); -- cgit v1.1