Upgrade to Rust 1.79 (#11875)

This commit is contained in:
Micha Reiser 2024-06-17 07:15:10 +01:00 committed by GitHub
parent 355d26f05c
commit 1f654ee729
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 10 additions and 10 deletions

View file

@ -70,7 +70,7 @@ imperative = { version = "1.0.4" }
indexmap = { version = "2.2.6" } indexmap = { version = "2.2.6" }
indicatif = { version = "0.17.8" } indicatif = { version = "0.17.8" }
indoc = { version = "2.0.4" } indoc = { version = "2.0.4" }
insta = { version = "1.35.1", feature = ["filters", "glob"] } insta = { version = "1.35.1" }
insta-cmd = { version = "0.6.0" } insta-cmd = { version = "0.6.0" }
is-macro = { version = "0.3.5" } is-macro = { version = "0.3.5" }
is-wsl = { version = "0.4.0" } is-wsl = { version = "0.4.0" }

View file

@ -932,7 +932,7 @@ mod tests {
// Luckily this crate will fail to build if this file isn't available at build time. // Luckily this crate will fail to build if this file isn't available at build time.
const TYPESHED_ZIP_BYTES: &[u8] = const TYPESHED_ZIP_BYTES: &[u8] =
include_bytes!(concat!(env!("OUT_DIR"), "/zipped_typeshed.zip")); 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 mut typeshed_zip_archive = ZipArchive::new(Cursor::new(TYPESHED_ZIP_BYTES))?;
let path_to_functools = Path::new("stdlib").join("functools.pyi"); let path_to_functools = Path::new("stdlib").join("functools.pyi");

View file

@ -1,8 +1,10 @@
use crate::registry::Rule;
use ruff_macros::CacheKey;
use std::fmt::{Debug, Display, Formatter}; use std::fmt::{Debug, Display, Formatter};
use std::iter::FusedIterator; use std::iter::FusedIterator;
use ruff_macros::CacheKey;
use crate::registry::Rule;
const RULESET_SIZE: usize = 14; const RULESET_SIZE: usize = 14;
/// A set of [`Rule`]s. /// A set of [`Rule`]s.
@ -367,7 +369,7 @@ impl Iterator for RuleSetIterator {
let rule_value = self.index * RuleSet::SLICE_BITS + bit; let rule_value = self.index * RuleSet::SLICE_BITS + bit;
// SAFETY: RuleSet guarantees that only valid rules are stored in the set. // SAFETY: RuleSet guarantees that only valid rules are stored in the set.
#[allow(unsafe_code)] #[allow(unsafe_code)]
return Some(unsafe { std::mem::transmute(rule_value) }); return Some(unsafe { std::mem::transmute::<u16, Rule>(rule_value) });
} }
self.index += 1; self.index += 1;
@ -387,9 +389,10 @@ impl FusedIterator for RuleSetIterator {}
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use crate::registry::{Rule, RuleSet};
use strum::IntoEnumIterator; use strum::IntoEnumIterator;
use crate::registry::{Rule, RuleSet};
/// Tests that the set can contain all rules /// Tests that the set can contain all rules
#[test] #[test]
fn test_all_rules() { fn test_all_rules() {

View file

@ -1,5 +1,3 @@
use std::usize;
use ruff_formatter::{format_args, write, FormatRuleWithOptions}; use ruff_formatter::{format_args, write, FormatRuleWithOptions};
use ruff_python_ast::Parameters; use ruff_python_ast::Parameters;
use ruff_python_ast::{AnyNodeRef, AstNode}; use ruff_python_ast::{AnyNodeRef, AstNode};

View file

@ -5,7 +5,6 @@ use {
fmt, iter, fmt, iter,
num::TryFromIntError, num::TryFromIntError,
ops::{Add, AddAssign, Sub, SubAssign}, ops::{Add, AddAssign, Sub, SubAssign},
u32,
}, },
}; };

View file

@ -1,2 +1,2 @@
[toolchain] [toolchain]
channel = "1.78" channel = "1.79"