Upgrade to Rust 1.78 (#11260)

This commit is contained in:
Micha Reiser 2024-05-03 14:46:21 +02:00 committed by GitHub
parent 349a4cf8ce
commit 6a1e555537
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
69 changed files with 67 additions and 549 deletions

View file

@ -4,7 +4,6 @@ use ruff_python_ast::{Pattern, PatternArguments};
use ruff_python_trivia::{SimpleTokenKind, SimpleTokenizer};
use ruff_text_size::{Ranged, TextRange, TextSize};
use crate::comments::SourceComment;
use crate::expression::parentheses::{empty_parenthesized, parenthesized, Parentheses};
use crate::prelude::*;
@ -72,14 +71,6 @@ impl FormatNodeRule<PatternArguments> for FormatPatternArguments {
.with_dangling_comments(dangling_comments)]
)
}
fn fmt_dangling_comments(
&self,
_dangling_comments: &[SourceComment],
_f: &mut PyFormatter,
) -> FormatResult<()> {
Ok(())
}
}
/// Returns `true` if the pattern (which is the only argument to a [`PatternMatchClass`]) is

View file

@ -2,7 +2,7 @@ use ruff_formatter::write;
use ruff_python_ast::AnyNodeRef;
use ruff_python_ast::PatternMatchAs;
use crate::comments::{dangling_comments, SourceComment};
use crate::comments::dangling_comments;
use crate::expression::parentheses::{NeedsParentheses, OptionalParentheses};
use crate::prelude::*;
@ -48,14 +48,6 @@ impl FormatNodeRule<PatternMatchAs> for FormatPatternMatchAs {
token("_").fmt(f)
}
}
fn fmt_dangling_comments(
&self,
_dangling_comments: &[SourceComment],
_f: &mut PyFormatter,
) -> FormatResult<()> {
Ok(())
}
}
impl NeedsParentheses for PatternMatchAs {

View file

@ -2,7 +2,7 @@ use ruff_formatter::write;
use ruff_python_ast::AnyNodeRef;
use ruff_python_ast::PatternMatchClass;
use crate::comments::{dangling_comments, SourceComment};
use crate::comments::dangling_comments;
use crate::expression::parentheses::{NeedsParentheses, OptionalParentheses};
use crate::prelude::*;
@ -29,14 +29,6 @@ impl FormatNodeRule<PatternMatchClass> for FormatPatternMatchClass {
]
)
}
fn fmt_dangling_comments(
&self,
_dangling_comments: &[SourceComment],
_f: &mut PyFormatter,
) -> FormatResult<()> {
Ok(())
}
}
impl NeedsParentheses for PatternMatchClass {

View file

@ -90,15 +90,6 @@ impl FormatNodeRule<PatternMatchMapping> for FormatPatternMatchMapping {
.with_dangling_comments(open_parenthesis_comments)
.fmt(f)
}
fn fmt_dangling_comments(
&self,
_dangling_comments: &[SourceComment],
_f: &mut PyFormatter,
) -> FormatResult<()> {
// Handled by `fmt_fields`
Ok(())
}
}
impl NeedsParentheses for PatternMatchMapping {

View file

@ -1,4 +1,3 @@
use crate::comments::SourceComment;
use ruff_formatter::{format_args, Format, FormatResult};
use ruff_python_ast::AnyNodeRef;
use ruff_python_ast::PatternMatchSequence;
@ -56,15 +55,6 @@ impl FormatNodeRule<PatternMatchSequence> for FormatPatternMatchSequence {
SequenceType::TupleNoParens => optional_parentheses(&items).fmt(f),
}
}
fn fmt_dangling_comments(
&self,
_dangling_node_comments: &[SourceComment],
_f: &mut PyFormatter,
) -> FormatResult<()> {
// Handled as part of `fmt_fields`
Ok(())
}
}
impl NeedsParentheses for PatternMatchSequence {

View file

@ -2,7 +2,7 @@ use ruff_formatter::write;
use ruff_python_ast::AnyNodeRef;
use ruff_python_ast::PatternMatchStar;
use crate::comments::{dangling_comments, SourceComment};
use crate::comments::dangling_comments;
use crate::expression::parentheses::{NeedsParentheses, OptionalParentheses};
use crate::prelude::*;
@ -23,15 +23,6 @@ impl FormatNodeRule<PatternMatchStar> for FormatPatternMatchStar {
None => write!(f, [token("_")]),
}
}
fn fmt_dangling_comments(
&self,
_dangling_comments: &[SourceComment],
_f: &mut PyFormatter,
) -> FormatResult<()> {
// Handled by `fmt_fields`
Ok(())
}
}
impl NeedsParentheses for PatternMatchStar {