diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 63ad16d1951..f219ffe7f33 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -398,7 +398,7 @@ jobs:
needs: compiler
runs-on: ubuntu-22.04
env:
- TOOLCHAIN_VERSION: 1.65.0
+ TOOLCHAIN_VERSION: 1.81.0
steps:
- uses: actions/checkout@v4
diff --git a/LANGUAGES.md b/LANGUAGES.md
index 26ee55576fb..3978f244949 100644
--- a/LANGUAGES.md
+++ b/LANGUAGES.md
@@ -319,7 +319,7 @@ Thrift's core protocol is TBinary, supported by all languages except for JavaScr
Rust |
0.11.0 |
 |  |
-1.65.0 | 1.xx.x |
+1.81.0 | 1.xx.x |
 |
 |  |  |  |  |  |
 |  |  |  |
diff --git a/build/docker/README.md b/build/docker/README.md
index 2a338b4b4c1..de7e9c73690 100644
--- a/build/docker/README.md
+++ b/build/docker/README.md
@@ -196,6 +196,6 @@ Last updated: March 5, 2024
| python2 | 2.7.18 | | |
| python3 | 3.8.10 | 3.10.12 | |
| ruby | 2.7.0p0 | 3.0.2p107 | |
-| rust | 1.65.0 | 1.65.0 | |
+| rust | 1.81.0 | 1.81.0 | |
| smalltalk | | | Not in CI |
| swift | 5.7 | 5.7 | |
diff --git a/build/docker/ubuntu-focal/Dockerfile b/build/docker/ubuntu-focal/Dockerfile
index a29ec69531f..8c2cd61776d 100644
--- a/build/docker/ubuntu-focal/Dockerfile
+++ b/build/docker/ubuntu-focal/Dockerfile
@@ -274,7 +274,7 @@ RUN apt-get install -y --no-install-recommends \
USER ${user}
RUN `# Rust dependencies` \
- curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain 1.65.0 -y
+ curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain 1.81.0 -y
ENV PATH /home/${user}/.cargo/bin:$PATH
USER root
diff --git a/build/docker/ubuntu-jammy/Dockerfile b/build/docker/ubuntu-jammy/Dockerfile
index 5fa6e6f889d..dc9b9d2604a 100644
--- a/build/docker/ubuntu-jammy/Dockerfile
+++ b/build/docker/ubuntu-jammy/Dockerfile
@@ -273,7 +273,7 @@ RUN apt-get install -y --no-install-recommends \
USER ${user}
RUN `# Rust dependencies` \
- curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain 1.65.0 -y
+ curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain 1.81.0 -y
ENV PATH /home/${user}/.cargo/bin:$PATH
USER root
diff --git a/lib/rs/src/lib.rs b/lib/rs/src/lib.rs
index 84c1f9b71a7..2f6018810b3 100644
--- a/lib/rs/src/lib.rs
+++ b/lib/rs/src/lib.rs
@@ -53,7 +53,7 @@
//! [tutorial]: https://github.com/apache/thrift/tree/master/tutorial/rs
#![crate_type = "lib"]
-#![doc(test(attr(allow(unused_variables), deny(warnings))))]
+#![doc(test(attr(allow(unused_variables, dead_code), deny(warnings))))]
#![deny(bare_trait_objects)]
// NOTE: this macro has to be defined before any modules. See:
diff --git a/lib/rs/src/protocol/compact.rs b/lib/rs/src/protocol/compact.rs
index c0c43722ed8..8ed4e0635e4 100644
--- a/lib/rs/src/protocol/compact.rs
+++ b/lib/rs/src/protocol/compact.rs
@@ -681,8 +681,6 @@ fn u8_to_type(b: u8) -> crate::Result {
#[cfg(test)]
mod tests {
- use std::i32;
-
use crate::protocol::{
TFieldIdentifier, TInputProtocol, TListIdentifier, TMapIdentifier, TMessageIdentifier,
TMessageType, TOutputProtocol, TSetIdentifier, TStructIdentifier, TType,
@@ -2818,7 +2816,7 @@ mod tests {
copy_write_buffer_to_read_buffer!(o_prot);
let read_double = i_prot.read_double().unwrap();
- assert!(read_double - double < std::f64::EPSILON);
+ assert!((read_double - double).abs() < f64::EPSILON);
}
#[test]
diff --git a/lib/rs/src/transport/framed.rs b/lib/rs/src/transport/framed.rs
index c30ccd9ed62..d8a7448725f 100644
--- a/lib/rs/src/transport/framed.rs
+++ b/lib/rs/src/transport/framed.rs
@@ -97,7 +97,7 @@ where
self.buf.resize(buf_capacity, 0);
self.chan.read_exact(&mut self.buf[..message_size])?;
- self.cap = message_size as usize;
+ self.cap = message_size;
self.pos = 0;
}
diff --git a/rust-toolchain b/rust-toolchain
index 902c74186fb..dbd41264aa9 100644
--- a/rust-toolchain
+++ b/rust-toolchain
@@ -1 +1 @@
-1.65.0
+1.81.0