Skip to content

Commit 1bf1f76

Browse files
authored
Merge pull request #518 from stepchowfun/rust-v1.91.0
Update Rust to v1.91.0
2 parents fbef90e + 189ea9a commit 1bf1f76

File tree

3 files changed

+38
-39
lines changed

3 files changed

+38
-39
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ jobs:
9090
# https://github.com/rust-lang/rustup/issues/2441
9191
#
9292
# for more information.
93-
rustup toolchain install 1.88.0 --no-self-update # [ref:rust_1.88.0]
94-
rustup default 1.88.0 # [ref:rust_1.88.0]
93+
rustup toolchain install 1.91.0 --no-self-update # [ref:rust_1.91.0]
94+
rustup default 1.91.0 # [ref:rust_1.91.0]
9595
9696
# Add the targets.
9797
rustup target add x86_64-pc-windows-msvc
@@ -131,8 +131,8 @@ jobs:
131131
set -euxo pipefail
132132
133133
# Install the appropriate version of Rust.
134-
rustup toolchain install 1.88.0 # [ref:rust_1.88.0]
135-
rustup default 1.88.0 # [ref:rust_1.88.0]
134+
rustup toolchain install 1.91.0 # [ref:rust_1.91.0]
135+
rustup default 1.91.0 # [ref:rust_1.91.0]
136136
137137
# Add the targets.
138138
rustup target add x86_64-apple-darwin
@@ -207,8 +207,8 @@ jobs:
207207
set -euxo pipefail
208208
209209
# Install the appropriate version of Rust.
210-
rustup toolchain install 1.88.0 # [ref:rust_1.88.0]
211-
rustup default 1.88.0 # [ref:rust_1.88.0]
210+
rustup toolchain install 1.91.0 # [ref:rust_1.91.0]
211+
rustup default 1.91.0 # [ref:rust_1.91.0]
212212
213213
# Fetch the program version.
214214
VERSION="$(cargo pkgid | cut -d# -f2 | cut -d: -f2)"

src/parser.rs

Lines changed: 26 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -244,27 +244,27 @@ fn parse_schema(
244244
let mut declarations = vec![];
245245

246246
// Parse the comment, if it exists.
247-
if *position < tokens.len() {
248-
if let token::Variant::Comment(paragraphs) = &tokens[*position].variant {
249-
if *position + 1 < tokens.len() {
250-
match tokens[*position + 1].variant {
251-
token::Variant::Struct | token::Variant::Choice => {
252-
if tokens[*position].source_range.end + 1
253-
< tokens[*position + 1].source_range.start
254-
{
255-
comment.clone_from(paragraphs);
256-
*position += 1;
257-
}
258-
}
259-
_ => {
247+
if *position < tokens.len()
248+
&& let token::Variant::Comment(paragraphs) = &tokens[*position].variant
249+
{
250+
if *position + 1 < tokens.len() {
251+
match tokens[*position + 1].variant {
252+
token::Variant::Struct | token::Variant::Choice => {
253+
if tokens[*position].source_range.end + 1
254+
< tokens[*position + 1].source_range.start
255+
{
260256
comment.clone_from(paragraphs);
261257
*position += 1;
262258
}
263259
}
264-
} else {
265-
comment.clone_from(paragraphs);
266-
*position += 1;
260+
_ => {
261+
comment.clone_from(paragraphs);
262+
*position += 1;
263+
}
267264
}
265+
} else {
266+
comment.clone_from(paragraphs);
267+
*position += 1;
268268
}
269269
}
270270

@@ -276,18 +276,17 @@ fn parse_schema(
276276
// [ref:parse_import_keyword_chomp].
277277
if let Some((name, import)) =
278278
parse_import(source_path, source_contents, tokens, position, errors)
279+
&& imports.insert(name.clone(), import.clone()).is_some()
279280
{
280-
if imports.insert(name.clone(), import.clone()).is_some() {
281-
errors.push(throw::<Error>(
282-
&format!(
283-
"An import named {} already exists in this file.",
284-
name.code_str(),
285-
),
286-
Some(source_path),
287-
Some(&listing(source_contents, import.source_range)),
288-
None,
289-
));
290-
}
281+
errors.push(throw::<Error>(
282+
&format!(
283+
"An import named {} already exists in this file.",
284+
name.code_str(),
285+
),
286+
Some(source_path),
287+
Some(&listing(source_contents, import.source_range)),
288+
None,
289+
));
291290
}
292291
}
293292
_ => {

toast.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ command_prefix: |
1717
cargo-offline () { cargo --frozen --offline "$@"; }
1818
1919
# Use this wrapper for formatting code or checking that code is formatted. We use a nightly Rust
20-
# version for the `trailing_comma` formatting option [tag:rust_fmt_nightly_2025-07-06]. The
20+
# version for the `trailing_comma` formatting option [tag:rust_fmt_nightly_2025-11-02]. The
2121
# nightly version was chosen as the latest available release with all components present
2222
# according to this page:
2323
# https://rust-lang.github.io/rustup-components-history/x86_64-unknown-linux-gnu.html
24-
cargo-fmt () { cargo +nightly-2025-07-06 --frozen --offline fmt --all -- "$@"; }
24+
cargo-fmt () { cargo +nightly-2025-11-02 --frozen --offline fmt --all -- "$@"; }
2525
2626
# Load the NVM startup file, if it exists.
2727
if [ -f "$HOME/.nvm/nvm.sh" ]; then
@@ -75,18 +75,18 @@ tasks:
7575
- install_packages
7676
- create_user
7777
command: |
78-
# Install stable Rust [tag:rust_1.88.0].
78+
# Install stable Rust [tag:rust_1.91.0].
7979
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- \
8080
-y \
81-
--default-toolchain 1.88.0 \
81+
--default-toolchain 1.91.0 \
8282
--profile minimal \
8383
--component clippy
8484
8585
# Add Rust tools to `$PATH`.
8686
. "$HOME/.cargo/env"
8787
88-
# Install nightly Rust [ref:rust_fmt_nightly_2025-07-06].
89-
rustup toolchain install nightly-2025-07-06 --profile minimal --component rustfmt
88+
# Install nightly Rust [ref:rust_fmt_nightly_2025-11-02].
89+
rustup toolchain install nightly-2025-11-02 --profile minimal --component rustfmt
9090
9191
install_node:
9292
description: Install Node.js, a JavaScript runtime environment.

0 commit comments

Comments
 (0)