From 0228462ba10397468b3c0937e2e9cd1d3118e0fc Mon Sep 17 00:00:00 2001 From: Laurenz Date: Thu, 5 Dec 2024 16:57:01 +0100 Subject: [PATCH] Bump Rust to 1.83 (#5534) --- .github/workflows/ci.yml | 4 ++-- .github/workflows/release.yml | 2 +- crates/typst-layout/src/grid/repeated.rs | 2 +- crates/typst-layout/src/grid/rowspans.rs | 2 +- crates/typst-layout/src/inline/line.rs | 4 ++-- crates/typst-library/src/engine.rs | 1 + crates/typst-library/src/introspection/locator.rs | 1 + crates/typst-render/src/lib.rs | 2 +- crates/typst-syntax/src/node.rs | 4 ++-- crates/typst-syntax/src/parser.rs | 4 ++-- docs/src/main.rs | 2 +- flake.lock | 6 +++--- flake.nix | 2 +- 13 files changed, 19 insertions(+), 17 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 268fd93c0..01b3e8c3a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,7 +30,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@1.82.0 + - uses: dtolnay/rust-toolchain@1.83.0 - uses: Swatinem/rust-cache@v2 - run: cargo test --workspace --no-run - run: cargo test --workspace --no-fail-fast @@ -59,7 +59,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@1.82.0 + - uses: dtolnay/rust-toolchain@1.83.0 with: components: clippy, rustfmt - uses: Swatinem/rust-cache@v2 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 84c70c2d2..5be6bfa2c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -44,7 +44,7 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@1.82.0 + - uses: dtolnay/rust-toolchain@1.83.0 with: target: ${{ matrix.target }} diff --git a/crates/typst-layout/src/grid/repeated.rs b/crates/typst-layout/src/grid/repeated.rs index 972179da8..8d08d56db 100644 --- a/crates/typst-layout/src/grid/repeated.rs +++ b/crates/typst-layout/src/grid/repeated.rs @@ -45,7 +45,7 @@ impl Repeatable { } } -impl<'a> GridLayouter<'a> { +impl GridLayouter<'_> { /// Layouts the header's rows. /// Skips regions as necessary. pub fn layout_header( diff --git a/crates/typst-layout/src/grid/rowspans.rs b/crates/typst-layout/src/grid/rowspans.rs index 03b4103fd..93d4c960d 100644 --- a/crates/typst-layout/src/grid/rowspans.rs +++ b/crates/typst-layout/src/grid/rowspans.rs @@ -85,7 +85,7 @@ pub struct CellMeasurementData<'layouter> { pub frames_in_previous_regions: usize, } -impl<'a> GridLayouter<'a> { +impl GridLayouter<'_> { /// Layout a rowspan over the already finished regions, plus the current /// region's frame and resolved rows, if it wasn't finished yet (because /// we're being called from `finish_region`, but note that this function is diff --git a/crates/typst-layout/src/inline/line.rs b/crates/typst-layout/src/inline/line.rs index 6dca95a9d..ef7e26c3c 100644 --- a/crates/typst-layout/src/inline/line.rs +++ b/crates/typst-layout/src/inline/line.rs @@ -38,7 +38,7 @@ pub struct Line<'a> { pub dash: Option, } -impl<'a> Line<'a> { +impl Line<'_> { /// Create an empty line. pub fn empty() -> Self { Self { @@ -685,7 +685,7 @@ impl<'a> Deref for Items<'a> { } } -impl<'a> DerefMut for Items<'a> { +impl DerefMut for Items<'_> { fn deref_mut(&mut self) -> &mut Self::Target { &mut self.0 } diff --git a/crates/typst-library/src/engine.rs b/crates/typst-library/src/engine.rs index cd25ec486..80aaef224 100644 --- a/crates/typst-library/src/engine.rs +++ b/crates/typst-library/src/engine.rs @@ -350,6 +350,7 @@ impl Route<'_> { } #[comemo::track] +#[allow(clippy::needless_lifetimes)] impl<'a> Route<'a> { /// Whether the given id is part of the route. pub fn contains(&self, id: FileId) -> bool { diff --git a/crates/typst-library/src/introspection/locator.rs b/crates/typst-library/src/introspection/locator.rs index 4045aa9ca..a84cf1639 100644 --- a/crates/typst-library/src/introspection/locator.rs +++ b/crates/typst-library/src/introspection/locator.rs @@ -203,6 +203,7 @@ impl<'a> Locator<'a> { } #[comemo::track] +#[allow(clippy::needless_lifetimes)] impl<'a> Locator<'a> { /// Resolves the locator based on its local and the outer information. fn resolve(&self) -> Resolved { diff --git a/crates/typst-render/src/lib.rs b/crates/typst-render/src/lib.rs index 8595e7908..4cd32d39c 100644 --- a/crates/typst-render/src/lib.rs +++ b/crates/typst-render/src/lib.rs @@ -93,7 +93,7 @@ struct State<'a> { size: Size, } -impl<'a> State<'a> { +impl State<'_> { fn new(size: Size, transform: sk::Transform, pixel_per_pt: f32) -> Self { Self { size, diff --git a/crates/typst-syntax/src/node.rs b/crates/typst-syntax/src/node.rs index 14ad018fb..b7e1809d7 100644 --- a/crates/typst-syntax/src/node.rs +++ b/crates/typst-syntax/src/node.rs @@ -767,7 +767,7 @@ impl<'a> LinkedNode<'a> { } /// Access to parents and siblings. -impl<'a> LinkedNode<'a> { +impl LinkedNode<'_> { /// Get this node's parent. pub fn parent(&self) -> Option<&Self> { self.parent.as_deref() @@ -825,7 +825,7 @@ pub enum Side { } /// Access to leaves. -impl<'a> LinkedNode<'a> { +impl LinkedNode<'_> { /// Get the rightmost non-trivia leaf before this node. pub fn prev_leaf(&self) -> Option { let mut node = self.clone(); diff --git a/crates/typst-syntax/src/parser.rs b/crates/typst-syntax/src/parser.rs index ea5b9155d..e087f9dd3 100644 --- a/crates/typst-syntax/src/parser.rs +++ b/crates/typst-syntax/src/parser.rs @@ -1911,7 +1911,7 @@ struct PartialState { } /// The Memoization interface. -impl<'s> Parser<'s> { +impl Parser<'_> { /// Store the already parsed nodes and the parser state into the memo map by /// extending the arena and storing the extended range and a checkpoint. fn memoize_parsed_nodes(&mut self, key: MemoKey, prev_len: usize) { @@ -1967,7 +1967,7 @@ impl<'s> Parser<'s> { /// Functions for eating expected or unexpected tokens and generating errors if /// we don't get what we expect. -impl<'s> Parser<'s> { +impl Parser<'_> { /// Consume the given `kind` or produce an error. fn expect(&mut self, kind: SyntaxKind) -> bool { let at = self.at(kind); diff --git a/docs/src/main.rs b/docs/src/main.rs index f8d7c9345..064bf9a8f 100644 --- a/docs/src/main.rs +++ b/docs/src/main.rs @@ -13,7 +13,7 @@ struct CliResolver<'a> { base: &'a str, } -impl<'a> Resolver for CliResolver<'a> { +impl Resolver for CliResolver<'_> { fn commits(&self, from: &str, to: &str) -> Vec { if self.verbose { eprintln!("commits({from}, {to})"); diff --git a/flake.lock b/flake.lock index 03be65eaa..c02466422 100644 --- a/flake.lock +++ b/flake.lock @@ -112,13 +112,13 @@ "rust-manifest": { "flake": false, "locked": { - "narHash": "sha256-7BORPQOFj1mTsyFBkfImqoE4gwyZfPLYXFFPXPVbo4A=", + "narHash": "sha256-Yqu2/i9170R7pQhvOCR1f5SyFr7PcFbO6xcMr9KWruQ=", "type": "file", - "url": "https://static.rust-lang.org/dist/channel-rust-1.82.0.toml" + "url": "https://static.rust-lang.org/dist/channel-rust-1.83.0.toml" }, "original": { "type": "file", - "url": "https://static.rust-lang.org/dist/channel-rust-1.82.0.toml" + "url": "https://static.rust-lang.org/dist/channel-rust-1.83.0.toml" } }, "systems": { diff --git a/flake.nix b/flake.nix index aec83d896..abdad27aa 100644 --- a/flake.nix +++ b/flake.nix @@ -10,7 +10,7 @@ inputs.nixpkgs.follows = "nixpkgs"; }; rust-manifest = { - url = "https://static.rust-lang.org/dist/channel-rust-1.82.0.toml"; + url = "https://static.rust-lang.org/dist/channel-rust-1.83.0.toml"; flake = false; }; };