]> git.ipfire.org Git - thirdparty/gcc.git/commit
gccrs: diagnostic: Refactor Error class
authorArthur Cohen <arthur.cohen@embecosm.com>
Wed, 15 Feb 2023 15:56:07 +0000 (16:56 +0100)
committerArthur Cohen <arthur.cohen@embecosm.com>
Thu, 6 Apr 2023 08:47:24 +0000 (10:47 +0200)
commit2785d591116a135215f473534b20f5da6075b265
tree2efc2bab8b0f2ac49c354679a19305348249af3d
parentfa7675df86ad2f22d0d349708da5cd363ed03f0f
gccrs: 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/ast/rust-ast.cc
gcc/rust/checks/errors/privacy/rust-visibility-resolver.cc
gcc/rust/expand/rust-macro-builtins.cc
gcc/rust/expand/rust-macro-expand.cc
gcc/rust/parse/rust-parse-impl.h
gcc/rust/rust-diagnostics.cc
gcc/rust/rust-diagnostics.h
gcc/rust/rust-session-manager.cc