THRIFT-5819: use latest rustc version for rustlib (#3085)

Client: rust

This upgrades the version of rust in the rust-toolchain file, docs and dockerfiles. Doing so requires a few changes to the source, mainly to fix or silence new warnings.

Submitted on behalf of a third-party: Jiayu Liu
Derived from the following PR: https://github.com/apache/thrift/pull/3045

Co-authored-by: Jiayu Liu <jiayu@hey.com>
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 90eb7f3..abc3714 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -400,7 +400,7 @@
     needs: compiler
     runs-on: ubuntu-24.04
     env:
-      TOOLCHAIN_VERSION: 1.65.0
+      TOOLCHAIN_VERSION: 1.83.0
     steps:
       - uses: actions/checkout@v4