diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2022-02-06 20:44:45 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-06 20:44:45 +0000 |
commit | 05cfe8f9fdc363ff7db4cba2decaf22e44057c3f (patch) | |
tree | 2cdb59713c92c6fa31c9e2e76f9d02324d970550 | |
parent | 2423c89dee0c1acc5a63e407250e25d2c515c7d5 (diff) | |
parent | 42f49fa7da2f0ec8f7625e191d4bf7a7c54dd3af (diff) | |
download | gcc-05cfe8f9fdc363ff7db4cba2decaf22e44057c3f.zip gcc-05cfe8f9fdc363ff7db4cba2decaf22e44057c3f.tar.gz gcc-05cfe8f9fdc363ff7db4cba2decaf22e44057c3f.tar.bz2 |
Merge #908
908: Fix '-Wformat-diag' issue in 'TypeCheckPattern::visit (HIR::TupleStructPattern &pattern)' r=philberty a=tschwinge
It's alread now diagnosed, non-fatal warning:
[...]/source-gcc/gcc/rust/typecheck/rust-hir-type-check-pattern.cc: In member function ‘virtual void Rust::Resolver::TypeCheckPattern::visit(Rust::HIR::TupleStructPattern&)’:
[...]/source-gcc/gcc/rust/typecheck/rust-hir-type-check-pattern.cc:61:69: warning: unquoted operator ‘::’ in format [-Wformat-diag]
61 | "expected tuple struct or tuple variant, found %s variant %s::%s",
| ^~
A later merge from GCC upstream will bring in
commit 34ba4275dcf5162efb9b634e4665734766faf4e3
"Enable -Werror=format-diag during bootstrap", which then causes:
[...]/source-gcc/gcc/rust/typecheck/rust-hir-type-check-pattern.cc: In member function ‘virtual void Rust::Resolver::TypeCheckPattern::visit(Rust::HIR::TupleStructPattern&)’:
[...]/source-gcc/gcc/rust/typecheck/rust-hir-type-check-pattern.cc:61:69: error: unquoted operator ‘::’ in format [-Werror=format-diag]
61 | "expected tuple struct or tuple variant, found %s variant %s::%s",
| ^~
cc1plus: all warnings being treated as errors
make[3]: *** [rust/rust-hir-type-check-pattern.o] Error 1
Co-authored-by: Thomas Schwinge <thomas@codesourcery.com>
-rw-r--r-- | gcc/rust/typecheck/rust-hir-type-check-pattern.cc | 2 | ||||
-rw-r--r-- | gcc/testsuite/rust/compile/match5.rs | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/gcc/rust/typecheck/rust-hir-type-check-pattern.cc b/gcc/rust/typecheck/rust-hir-type-check-pattern.cc index 524ef46..e4ec49b 100644 --- a/gcc/rust/typecheck/rust-hir-type-check-pattern.cc +++ b/gcc/rust/typecheck/rust-hir-type-check-pattern.cc @@ -58,7 +58,7 @@ TypeCheckPattern::visit (HIR::TupleStructPattern &pattern) rust_error_at ( pattern.get_locus (), - "expected tuple struct or tuple variant, found %s variant %s::%s", + "expected tuple struct or tuple variant, found %s variant %<%s::%s%>", variant_type.c_str (), adt->get_name ().c_str (), variant->get_identifier ().c_str ()); return; diff --git a/gcc/testsuite/rust/compile/match5.rs b/gcc/testsuite/rust/compile/match5.rs index 6f3d6e4..a5f934d 100644 --- a/gcc/testsuite/rust/compile/match5.rs +++ b/gcc/testsuite/rust/compile/match5.rs @@ -10,6 +10,6 @@ fn inspect(f: Foo) { Foo::A => {} Foo::B => {} Foo::C(a) => {} - Foo::D(x, y) => {} // { dg-error "expected tuple struct or tuple variant, found struct variant Foo::D" } + Foo::D(x, y) => {} // { dg-error "expected tuple struct or tuple variant, found struct variant 'Foo::D'" } } } |