aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust
diff options
context:
space:
mode:
authorXiao Ma <turingki@yeah.net>2023-03-02 02:31:36 +0000
committerThomas Schwinge <thomas@codesourcery.com>2023-03-20 22:16:00 +0000
commit4f76aad18b2b765ecfe8682ea38209e09d4d3bd2 (patch)
treec88d63c543d4baadac9a5d69c43d8407093d027a /gcc/rust
parenta8662e89f84e91466acc09e28b4a289d298498ee (diff)
downloadgcc-4f76aad18b2b765ecfe8682ea38209e09d4d3bd2.zip
gcc-4f76aad18b2b765ecfe8682ea38209e09d4d3bd2.tar.gz
gcc-4f76aad18b2b765ecfe8682ea38209e09d4d3bd2.tar.bz2
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/rust')
-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 07d367e..185afb4 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 7562eaf..6f2021f 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;