gccrs: Remove ad-hoc formatting - #4784
Draft
powerboat9 wants to merge 3 commits into
Draft
powerboat9 wants to merge 3 commits into
powerboat9 wants to merge 3 commits into
Conversation
ChangeLog: * .github/glibcxx_ubuntu64b_log_expected_warnings: Add warnings. * .github/log_expected_warnings: Likewise. Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
This allows rust_debug to use (an ad-hoc implementation of) gcc diagnostic formatting. To keep this patch as small as possible, proper fixes for -Wformat-diag are mostly left for future patches. gcc/rust/ChangeLog: * ast/rust-ast.cc: Ignore -Wformat-diag. * backend/rust-compile-base.cc: Likewise. * backend/rust-compile-expr.cc: Likewise. * backend/rust-compile-stmt.cc: Likewise. * backend/rust-mangle-v0.cc: Likewise. * checks/errors/borrowck/rust-bir-builder.h: Likewise. * checks/errors/borrowck/rust-bir-fact-collector.h: Likewise. * checks/errors/rust-hir-pattern-analysis.cc: Likewise. * expand/rust-cfg-strip.cc: Likewise. * expand/rust-macro-builtins-asm.cc: Likewise. * expand/rust-macro-builtins-log-debug.cc: Likewise. * hir/tree/rust-hir.cc: Likewise. * lex/rust-lex.cc: Likewise. * parse/rust-parse-impl-lexer.cc: Likewise. * parse/rust-parse-impl-macro.cc: Likewise. * resolve/rust-forever-stack.hxx: Likewise. * rust-diagnostics.cc (rust_debug_loc): Use expand_message. * rust-diagnostics.h (rust_debug_loc): Change formatting attribute. * rust-lang.cc (grs_langhook_parse_file): Change debug message. * rust-session-manager.cc: Ignore -Wformat-diag. * typecheck/rust-autoderef.cc: Likewise. * typecheck/rust-casts.cc: Likewise. * typecheck/rust-coercion.cc: Likewise. * typecheck/rust-hir-dot-operator.cc: Likewise. * typecheck/rust-hir-type-check-expr.cc: Likewise. * typecheck/rust-hir-type-check-path.cc: Likewise. * typecheck/rust-hir-type-check-type.cc: Likewise. * typecheck/rust-type-util.cc: Likewise. * typecheck/rust-tyty-bounds.cc: Likewise. * typecheck/rust-tyty-subst.cc: Likewise. * typecheck/rust-tyty-variance-analysis.cc: Likewise. * typecheck/rust-tyty.cc: Likewise. * typecheck/rust-unify.cc: Likewise. Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
This allows the use of %r and %R in rust diagnostic format strings by removing our ad-hoc (and originally compiler independent?) formatting code. Also, makes sure that va_end and va_start are called inside the same function. gcc/rust/ChangeLog: * rust-diagnostics.cc: Include "diagnostic.h". (mformat_value): Remove function. (expand_format): Remove function. (expand_message): Use pretty_printer and take va_list argument by pointer. (rust_internal_error_at): Pass va_list to expand_message by pointer. (rust_error_at): Likewise. (rust_warning_at): Likewise. (rust_fatal_error): Likewise. (rust_inform): Likewise. (rust_debug_loc): Likewise. (va_constructor): Take va_list argument by pointer for passage to expand_message and remove va_end call. (Error::Error): Pass va_list to va_constructor by pointer and call va_end. (Error::Hint): Likewise. (Error::Fatal): Likewise. * rust-session-manager.cc: Stop ignoring -Wformat-diag. (Session::compile_crate): Adjust diagnostic messages. (Session::register_plugins): Likewise. (TargetOptions::enable_implicit_feature_reqs): Likewise. Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Depends on #4783