Skip to content

Fix Nightly clippy #5798

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions compiler/codegen/src/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ pub fn compile_program(
let mut compiler = Compiler::new(opts, source_code, "<module>".to_owned());
compiler.compile_program(ast, symbol_table)?;
let code = compiler.pop_code_object();
trace!("Compilation completed: {:?}", code);
trace!("Compilation completed: {code:?}");
Ok(code)
}

Expand All @@ -166,7 +166,7 @@ pub fn compile_program_single(
let mut compiler = Compiler::new(opts, source_code, "<module>".to_owned());
compiler.compile_program_single(&ast.body, symbol_table)?;
let code = compiler.pop_code_object();
trace!("Compilation completed: {:?}", code);
trace!("Compilation completed: {code:?}");
Ok(code)
}

Expand All @@ -180,7 +180,7 @@ pub fn compile_block_expression(
let mut compiler = Compiler::new(opts, source_code, "<module>".to_owned());
compiler.compile_block_expr(&ast.body, symbol_table)?;
let code = compiler.pop_code_object();
trace!("Compilation completed: {:?}", code);
trace!("Compilation completed: {code:?}");
Ok(code)
}

Expand Down Expand Up @@ -233,7 +233,7 @@ fn eprint_location(zelf: &Compiler<'_>) {
fn unwrap_internal<T>(zelf: &Compiler<'_>, r: InternalResult<T>) -> T {
if let Err(ref r_err) = r {
eprintln!("=== CODEGEN PANIC INFO ===");
eprintln!("This IS an internal error: {}", r_err);
eprintln!("This IS an internal error: {r_err}");
eprint_location(zelf);
eprintln!("=== END PANIC INFO ===");
}
Expand Down Expand Up @@ -671,7 +671,7 @@ impl Compiler<'_> {

fn compile_statement(&mut self, statement: &Stmt) -> CompileResult<()> {
use ruff_python_ast::*;
trace!("Compiling {:?}", statement);
trace!("Compiling {statement:?}");
self.set_source_range(statement.range());

match &statement {
Expand Down Expand Up @@ -1907,7 +1907,7 @@ impl Compiler<'_> {

fn compile_error_forbidden_name(&mut self, name: &str) -> CodegenError {
// TODO: make into error (fine for now since it realistically errors out earlier)
panic!("Failing due to forbidden name {:?}", name);
panic!("Failing due to forbidden name {name:?}");
}

/// Ensures that `pc.fail_pop` has at least `n + 1` entries.
Expand Down Expand Up @@ -3209,7 +3209,7 @@ impl Compiler<'_> {

fn compile_expression(&mut self, expression: &Expr) -> CompileResult<()> {
use ruff_python_ast::*;
trace!("Compiling {:?}", expression);
trace!("Compiling {expression:?}");
let range = expression.range();
self.set_source_range(range);

Expand Down Expand Up @@ -4432,7 +4432,7 @@ pub fn ruff_int_to_bigint(int: &Int) -> Result<BigInt, CodegenErrorType> {
fn parse_big_integer(int: &Int) -> Result<BigInt, CodegenErrorType> {
// TODO: Improve ruff API
// Can we avoid this copy?
let s = format!("{}", int);
let s = format!("{int}");
let mut s = s.as_str();
// See: https://peps.python.org/pep-0515/#literal-grammar
let radix = match s.get(0..2) {
Expand Down
4 changes: 2 additions & 2 deletions compiler/core/src/bytecode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1388,12 +1388,12 @@ impl Instruction {
let value = ctx.get_constant(idx.get(arg) as usize);
match value.borrow_constant() {
BorrowedConstant::Code { code } if expand_code_objects => {
write!(f, "{:pad$}({:?}):", op, code)?;
write!(f, "{op:pad$}({code:?}):")?;
code.display_inner(f, true, level + 1)?;
Ok(())
}
c => {
write!(f, "{:pad$}(", op)?;
write!(f, "{op:pad$}(")?;
c.fmt_display(f)?;
write!(f, ")")
}
Expand Down
2 changes: 1 addition & 1 deletion wtf8/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ impl fmt::Debug for Wtf8 {
write_str_escaped(formatter, unsafe {
str::from_utf8_unchecked(&self.bytes[pos..surrogate_pos])
})?;
write!(formatter, "\\u{{{:x}}}", surrogate)?;
write!(formatter, "\\u{{{surrogate:x}}}")?;
pos = surrogate_pos + 3;
}
write_str_escaped(formatter, unsafe {
Expand Down
Loading