mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-28 18:59:04 +08:00
Fix Nightly clippy (#5798)
This commit is contained in:
1 parent
323ea3b96b
commit
2e368baf2a
4 files changed
+19
-19
No files matched your search
Generated
+8
-8
@@ -365,18 +365,18 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "clap"
|
||||
version = "4.5.37"
|
||||
version = "4.5.38"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "eccb054f56cbd38340b380d4a8e69ef1f02f1af43db2f0cc817a4774d80ae071"
|
||||
checksum = "ed93b9805f8ba930df42c2590f05453d5ec36cbb85d018868a5b24d31f6ac000"
|
||||
dependencies = [
|
||||
"clap_builder",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "clap_builder"
|
||||
version = "4.5.37"
|
||||
version = "4.5.38"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "efd9466fac8543255d3b1fcad4762c5e116ffe808c8a3043d4263cd4fd4862a2"
|
||||
checksum = "379026ff283facf611b0ea629334361c4211d1b12ee01024eec1591133b04120"
|
||||
dependencies = [
|
||||
"anstyle",
|
||||
"clap_lex",
|
||||
@@ -1302,9 +1302,9 @@ checksum = "d750af042f7ef4f724306de029d18836c26c1765a54a6a3f094cbd23a7267ffa"
|
||||
|
||||
[[package]]
|
||||
name = "libffi"
|
||||
version = "4.0.0"
|
||||
version = "4.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4a9434b6fc77375fb624698d5f8c49d7e80b10d59eb1219afda27d1f824d4074"
|
||||
checksum = "ebfd30a67b482a08116e753d0656cb626548cf4242543e5cc005be7639d99838"
|
||||
dependencies = [
|
||||
"libc",
|
||||
"libffi-sys",
|
||||
@@ -1312,9 +1312,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "libffi-sys"
|
||||
version = "3.2.0"
|
||||
version = "3.3.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ead36a2496acfc8edd6cc32352110e9478ac5b9b5f5b9856ebd3d28019addb84"
|
||||
checksum = "f003aa318c9f0ee69eb0ada7c78f5c9d2fedd2ceb274173b5c7ff475eee584a3"
|
||||
dependencies = [
|
||||
"cc",
|
||||
]
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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 ===");
|
||||
}
|
||||
@@ -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 {
|
||||
@@ -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.
|
||||
@@ -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);
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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, ")")
|
||||
}
|
||||
|
||||
+1
-1
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user