aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/rust')
-rw-r--r--gcc/rust/backend/rust-compile-expr.cc4
-rw-r--r--gcc/rust/backend/rust-compile-pattern.cc3
-rw-r--r--gcc/rust/privacy/rust-privacy-reporter.cc3
-rw-r--r--gcc/rust/rust-diagnostics.h5
4 files changed, 9 insertions, 6 deletions
diff --git a/gcc/rust/backend/rust-compile-expr.cc b/gcc/rust/backend/rust-compile-expr.cc
index b153451..d12dc78 100644
--- a/gcc/rust/backend/rust-compile-expr.cc
+++ b/gcc/rust/backend/rust-compile-expr.cc
@@ -239,8 +239,8 @@ CompileExpr::visit (HIR::MatchExpr &expr)
{
// FIXME: CASE_LABEL_EXPR does not support floating point types.
// Find another way to compile these.
- sorry_at (expr.get_locus ().gcc_location (),
- "match on floating-point types is not yet supported");
+ rust_sorry_at (expr.get_locus (),
+ "match on floating-point types is not yet supported");
}
TyTy::BaseType *expr_tyty = nullptr;
diff --git a/gcc/rust/backend/rust-compile-pattern.cc b/gcc/rust/backend/rust-compile-pattern.cc
index 2f3449a..7e7fadd 100644
--- a/gcc/rust/backend/rust-compile-pattern.cc
+++ b/gcc/rust/backend/rust-compile-pattern.cc
@@ -96,8 +96,7 @@ CompilePatternCaseLabelExpr::visit (HIR::LiteralPattern &pattern)
// floating point types.
if (pattern.get_literal ().get_lit_type () == HIR::Literal::LitType::FLOAT)
{
- sorry_at (pattern.get_locus ().gcc_location (),
- "floating-point literal in pattern");
+ rust_sorry_at (pattern.get_locus (), "floating-point literal in pattern");
}
tree lit = CompileExpr::Compile (litexpr, ctx);
diff --git a/gcc/rust/privacy/rust-privacy-reporter.cc b/gcc/rust/privacy/rust-privacy-reporter.cc
index 4b010a0..f2752b6 100644
--- a/gcc/rust/privacy/rust-privacy-reporter.cc
+++ b/gcc/rust/privacy/rust-privacy-reporter.cc
@@ -164,8 +164,7 @@ PrivacyReporter::check_base_type_privacy (Analysis::NodeMapping &node_mappings,
return recursive_check (
static_cast<const TyTy::ProjectionType *> (ty)->get ());
case TyTy::CLOSURE:
- sorry_at (locus.gcc_location (),
- "privacy pass for closures is not handled yet");
+ rust_sorry_at (locus, "privacy pass for closures is not handled yet");
break;
// If we're dealing with a generic param, there's nothing we should be
diff --git a/gcc/rust/rust-diagnostics.h b/gcc/rust/rust-diagnostics.h
index f7a3856..93bd1b3 100644
--- a/gcc/rust/rust-diagnostics.h
+++ b/gcc/rust/rust-diagnostics.h
@@ -142,6 +142,11 @@ struct Error
// rust_debug uses normal printf formatting, not GCC diagnostic formatting.
#define rust_debug(...) rust_debug_loc (Location (), __VA_ARGS__)
+// rust_sorry_at wraps GCC diagnostic "sorry_at" to accept "Location" instead of
+// "location_t"
+#define rust_sorry_at(location, ...) \
+ sorry_at (location.gcc_location (), __VA_ARGS__)
+
void
rust_debug_loc (const Location location, const char *fmt,
...) ATTRIBUTE_PRINTF_2;