Skip to content

Commit

Permalink
Upgrade to Rust 1.79 (#11875)
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaReiser authored Jun 17, 2024
1 parent 355d26f commit 1f654ee
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ imperative = { version = "1.0.4" }
indexmap = { version = "2.2.6" }
indicatif = { version = "0.17.8" }
indoc = { version = "2.0.4" }
insta = { version = "1.35.1", feature = ["filters", "glob"] }
insta = { version = "1.35.1" }
insta-cmd = { version = "0.6.0" }
is-macro = { version = "0.3.5" }
is-wsl = { version = "0.4.0" }
Expand Down
2 changes: 1 addition & 1 deletion crates/red_knot/src/module.rs
Original file line number Diff line number Diff line change
Expand Up @@ -932,7 +932,7 @@ mod tests {
// Luckily this crate will fail to build if this file isn't available at build time.
const TYPESHED_ZIP_BYTES: &[u8] =
include_bytes!(concat!(env!("OUT_DIR"), "/zipped_typeshed.zip"));
assert!(!TYPESHED_ZIP_BYTES.is_empty());

let mut typeshed_zip_archive = ZipArchive::new(Cursor::new(TYPESHED_ZIP_BYTES))?;

let path_to_functools = Path::new("stdlib").join("functools.pyi");
Expand Down
11 changes: 7 additions & 4 deletions crates/ruff_linter/src/registry/rule_set.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
use crate::registry::Rule;
use ruff_macros::CacheKey;
use std::fmt::{Debug, Display, Formatter};
use std::iter::FusedIterator;

use ruff_macros::CacheKey;

use crate::registry::Rule;

const RULESET_SIZE: usize = 14;

/// A set of [`Rule`]s.
Expand Down Expand Up @@ -367,7 +369,7 @@ impl Iterator for RuleSetIterator {
let rule_value = self.index * RuleSet::SLICE_BITS + bit;
// SAFETY: RuleSet guarantees that only valid rules are stored in the set.
#[allow(unsafe_code)]
return Some(unsafe { std::mem::transmute(rule_value) });
return Some(unsafe { std::mem::transmute::<u16, Rule>(rule_value) });
}

self.index += 1;
Expand All @@ -387,9 +389,10 @@ impl FusedIterator for RuleSetIterator {}

#[cfg(test)]
mod tests {
use crate::registry::{Rule, RuleSet};
use strum::IntoEnumIterator;

use crate::registry::{Rule, RuleSet};

/// Tests that the set can contain all rules
#[test]
fn test_all_rules() {
Expand Down
2 changes: 0 additions & 2 deletions crates/ruff_python_formatter/src/other/parameters.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use std::usize;

use ruff_formatter::{format_args, write, FormatRuleWithOptions};
use ruff_python_ast::Parameters;
use ruff_python_ast::{AnyNodeRef, AstNode};
Expand Down
1 change: 0 additions & 1 deletion crates/ruff_text_size/src/size.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ use {
fmt, iter,
num::TryFromIntError,
ops::{Add, AddAssign, Sub, SubAssign},
u32,
},
};

Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[toolchain]
channel = "1.78"
channel = "1.79"

0 comments on commit 1f654ee

Please sign in to comment.