aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorXiao Ma <turingki@yeah.net>2023-03-02 02:31:36 +0000
committerArthur Cohen <arthur.cohen@embecosm.com>2024-01-16 18:21:13 +0100
commit2163af71247b99e8fd707e5d6da83d14456e02a5 (patch)
tree93d3ae50cc5207033f30341a87a88615d665d5e7 /gcc
parent7e7cffb709def41f3df115d7be4ce86b466d5011 (diff)
downloadgcc-2163af71247b99e8fd707e5d6da83d14456e02a5.zip
gcc-2163af71247b99e8fd707e5d6da83d14456e02a5.tar.gz
gcc-2163af71247b99e8fd707e5d6da83d14456e02a5.tar.bz2
gccrs: Fix `FeatureGate::gate` will crash on 32-bit x86.
gcc/rust/ChangeLog: * checks/errors/rust-feature-gate.cc: Adjust 'ld'->'u'. * checks/errors/rust-feature.h: Adjust the type of `m_issue`: 'uint64_t' -> 'unsigned'. Signed-off-by: Xiao Ma <mxlol233@outlook.com> Co-authored-by: Thomas Schwinge <thomas@codesourcery.com>
Diffstat (limited to 'gcc')
-rw-r--r--gcc/rust/checks/errors/rust-feature-gate.cc4
-rw-r--r--gcc/rust/checks/errors/rust-feature.h6
2 files changed, 5 insertions, 5 deletions
diff --git a/gcc/rust/checks/errors/rust-feature-gate.cc b/gcc/rust/checks/errors/rust-feature-gate.cc
index d2c45f1..21b20a8 100644
--- a/gcc/rust/checks/errors/rust-feature-gate.cc
+++ b/gcc/rust/checks/errors/rust-feature-gate.cc
@@ -75,8 +75,8 @@ FeatureGate::gate (Feature::Name name, Location loc,
if (issue > 0)
{
const char *fmt_str
- = "%s. see issue %ld "
- "<https://github.com/rust-lang/rust/issues/%ld> for more "
+ = "%s. see issue %u "
+ "<https://github.com/rust-lang/rust/issues/%u> for more "
"information. add `#![feature(%s)]` to the crate attributes to "
"enable.";
rust_error_at (loc, fmt_str, error_msg.c_str (), issue, issue,
diff --git a/gcc/rust/checks/errors/rust-feature.h b/gcc/rust/checks/errors/rust-feature.h
index 3391dd7..91fc150 100644
--- a/gcc/rust/checks/errors/rust-feature.h
+++ b/gcc/rust/checks/errors/rust-feature.h
@@ -49,14 +49,14 @@ public:
Name name () { return m_name; }
const std::string &description () { return m_description; }
State state () { return m_state; }
- uint64_t issue () { return m_issue; }
+ unsigned issue () { return m_issue; }
static Optional<Name> as_name (const std::string &name);
static Feature create (Name name);
private:
Feature (Name name, State state, const char *name_str,
- const char *rustc_since, uint64_t issue_number,
+ const char *rustc_since, unsigned issue_number,
const Optional<CompileOptions::Edition> &edition,
const char *description)
: m_state (state), m_name (name), m_name_str (name_str),
@@ -68,7 +68,7 @@ private:
Name m_name;
std::string m_name_str;
std::string m_rustc_since;
- uint64_t m_issue;
+ unsigned m_issue;
Optional<CompileOptions::Edition> edition;
std::string m_description;