]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: Fix `FeatureGate::gate` will crash on 32-bit x86.
authorXiao Ma <turingki@yeah.net>
Thu, 2 Mar 2023 02:31:36 +0000 (02:31 +0000)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 16 Jan 2024 17:21:13 +0000 (18:21 +0100)
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>
gcc/rust/checks/errors/rust-feature-gate.cc
gcc/rust/checks/errors/rust-feature.h

index d2c45f1b18c1982ba58ca3c63cde5bb8232a902c..21b20a834e96e13eb656060338af2590cb401d31 100644 (file)
@@ -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,
index 3391dd7c4733777682c37cac3a4b1622f43a22b4..91fc150b223d76cb36b0cc5d067fe7d14fa70648 100644 (file)
@@ -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;