Skip to content

Commit

Permalink
chore: rust 1.79.0 (#3222)
Browse files Browse the repository at this point in the history
  • Loading branch information
ematipico authored Jun 16, 2024
1 parent 219dae0 commit e8c75e3
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 28 deletions.
6 changes: 2 additions & 4 deletions crates/biome_analyze/src/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,7 @@ impl AnalyzerOptions {

pub fn rule_options<R>(&self) -> Option<R::Options>
where
R: Rule + 'static,
R::Options: Clone,
R: Rule<Options: Clone> + 'static,
{
self.configuration
.rules
Expand All @@ -105,8 +104,7 @@ impl AnalyzerOptions {

pub fn rule_fix_kind<R>(&self) -> Option<FixKind>
where
R: Rule + 'static,
R::Options: Clone,
R: Rule<Options: Clone> + 'static,
{
self.configuration
.rules
Expand Down
23 changes: 5 additions & 18 deletions crates/biome_analyze/src/registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,7 @@ pub trait RegistryVisitor<L: Language> {
/// Record the rule `R` to this visitor
fn record_rule<R>(&mut self)
where
R: Rule + 'static,
R::Query: Queryable<Language = L>,
<R::Query as Queryable>::Output: Clone;
R: Rule<Query: Queryable<Language = L, Output: Clone>> + 'static;
}

/// Stores metadata information for all the rules in the registry, sorted
Expand Down Expand Up @@ -85,9 +83,7 @@ impl MetadataRegistry {
impl<L: Language> RegistryVisitor<L> for MetadataRegistry {
fn record_rule<R>(&mut self)
where
R: Rule + 'static,
R::Query: Queryable<Language = L>,
<R::Query as Queryable>::Output: Clone,
R: Rule<Query: Queryable<Language = L, Output: Clone>> + 'static,
{
self.insert_rule(<R::Group as RuleGroup>::NAME, R::METADATA.name);
}
Expand Down Expand Up @@ -165,10 +161,7 @@ impl<L: Language + Default + 'static> RegistryVisitor<L> for RuleRegistryBuilder
/// Add the rule `R` to the list of rules stores in this registry instance
fn record_rule<R>(&mut self)
where
R: Rule + 'static,
<R as Rule>::Options: Default,
R::Query: Queryable<Language = L>,
<R::Query as Queryable>::Output: Clone,
R: Rule<Options: Default, Query: Queryable<Language = L, Output: Clone>> + 'static,
{
if !self.filter.match_rule::<R>() {
return;
Expand Down Expand Up @@ -384,21 +377,15 @@ type RuleExecutor<L> = fn(&mut MatchQueryParams<L>, &mut RuleState<L>) -> Result
impl<L: Language + Default> RegistryRule<L> {
fn new<R>(state_index: usize) -> Self
where
R: Rule + 'static,
<R as Rule>::Options: Default,
R::Query: Queryable<Language = L> + 'static,
<R::Query as Queryable>::Output: Clone,
R: Rule<Options: Default, Query: Queryable<Language = L, Output: Clone>> + 'static,
{
/// Generic implementation of RuleExecutor for any rule type R
fn run<R>(
params: &mut MatchQueryParams<RuleLanguage<R>>,
state: &mut RuleState<RuleLanguage<R>>,
) -> Result<(), Error>
where
R: Rule + 'static,
R::Query: 'static,
<R::Query as Queryable>::Output: Clone,
<R as Rule>::Options: Default,
R: Rule<Options: Default, Query: Queryable<Output: Clone>> + 'static,
{
if let Some(node) = params.query.downcast_ref::<SyntaxNode<RuleLanguage<R>>>() {
if state.suppressions.inner.contains(node) {
Expand Down
3 changes: 1 addition & 2 deletions crates/biome_analyze/src/signals.rs
Original file line number Diff line number Diff line change
Expand Up @@ -342,8 +342,7 @@ where

impl<'bag, R> AnalyzerSignal<RuleLanguage<R>> for RuleSignal<'bag, R>
where
R: Rule + 'static,
<R as Rule>::Options: Default,
R: Rule<Options: Default> + 'static,
{
fn diagnostic(&self) -> Option<AnalyzerDiagnostic> {
let globals = self.options.globals();
Expand Down
1 change: 0 additions & 1 deletion crates/biome_deserialize/src/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ use std::{
num::{NonZeroU16, NonZeroU32, NonZeroU64, NonZeroU8, NonZeroUsize},
ops::Deref,
path::PathBuf,
u8,
};

/// Type that allows deserializing a string without heap-allocation.
Expand Down
1 change: 0 additions & 1 deletion crates/biome_formatter/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ pub use source_map::{TransformSourceMap, TransformSourceMapBuilder};
use std::marker::PhantomData;
use std::num::ParseIntError;
use std::str::FromStr;
use std::u8;
use token::string::Quote;

#[derive(Debug, Eq, PartialEq, Clone, Copy, Hash)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ pub type VariantsConfig = Vec<String>;
/// The sort config, containing the utility config and the variant config.
pub struct SortConfig {
pub utilities: &'static [UtilityLayer],
#[allow(dead_code)]
pub variants: VariantsConfig,
pub layer_index_map: HashMap<&'static str, usize>,
}
Expand Down
1 change: 0 additions & 1 deletion crates/biome_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
Expand Up @@ -2,4 +2,4 @@
# The default profile includes rustc, rust-std, cargo, rust-docs, rustfmt and clippy.
# https://rust-lang.github.io/rustup/concepts/profiles.html
profile = "default"
channel = "1.78.0"
channel = "1.79.0"
2 changes: 2 additions & 0 deletions xtask/codegen/src/js_kinds_src.rs
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,7 @@ pub struct AstListSeparatorConfiguration {

#[derive(Debug)]
pub struct AstNodeSrc {
#[allow(dead_code)]
pub documentation: Vec<String>,
pub name: String,
// pub traits: Vec<String>,
Expand Down Expand Up @@ -607,6 +608,7 @@ pub enum Field {

#[derive(Debug, Clone)]
pub struct AstEnumSrc {
#[allow(dead_code)]
pub documentation: Vec<String>,
pub name: String,
// pub traits: Vec<String>,
Expand Down

0 comments on commit e8c75e3

Please sign in to comment.