aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/rust-diagnostics.h
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-05-13 14:36:25 +0000
committerGitHub <noreply@github.com>2021-05-13 14:36:25 +0000
commit5d7fbc4a78897f8f561bdd78b4d3bbc15f4b351f (patch)
tree167d95c3c3e816ddb3284ed078027f8a9ef1b7c6 /gcc/rust/rust-diagnostics.h
parent5134aaa9f0b37ea372cb185fe7aa6c26fe0a4c2e (diff)
parentfcd4ed431272414157eb90773f174405431eb6bd (diff)
downloadgcc-5d7fbc4a78897f8f561bdd78b4d3bbc15f4b351f.zip
gcc-5d7fbc4a78897f8f561bdd78b4d3bbc15f4b351f.tar.gz
gcc-5d7fbc4a78897f8f561bdd78b4d3bbc15f4b351f.tar.bz2
Merge #427
427: Fix duplicate function generation in the backend r=philberty a=philberty Fix duplicated function generation for generics When emitting the backend IR we need to check if we have already compiled one already. This is all due to the fact when we do generic substitutions in type resolution its only upon usage of a function the function is substituted it gains a new unique ty_ref HIR ID to make sure new substituted versions of a type have unique ids. Fixes #403 Co-authored-by: Philip Herron <philip.herron@embecosm.com>
Diffstat (limited to 'gcc/rust/rust-diagnostics.h')
-rw-r--r--gcc/rust/rust-diagnostics.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/rust/rust-diagnostics.h b/gcc/rust/rust-diagnostics.h
index d861267..81f558a 100644
--- a/gcc/rust/rust-diagnostics.h
+++ b/gcc/rust/rust-diagnostics.h
@@ -114,10 +114,13 @@ struct Error
...) /*RUST_ATTRIBUTE_GCC_DIAG (2, 3)*/ RUST_ATTRIBUTE_GCC_DIAG (3, 4);
// Irreversibly emits the error as an error.
- void emit_error () const { rust_error_at (locus, message.c_str ()); }
+ void emit_error () const { rust_error_at (locus, "%s", message.c_str ()); }
// Irreversibly emits the error as a fatal error.
- void emit_fatal_error () const { rust_fatal_error (locus, message.c_str ()); }
+ void emit_fatal_error () const
+ {
+ rust_fatal_error (locus, "%s", message.c_str ());
+ }
};
} // namespace Rust