Skip to content
Closed
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
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ opt-level = 3

[profile.test]
opt-level = 3
lto = "thin"
# lto = "thin" # TODO: monitor https://github.com/rust-lang/rust/issues/92869

[profile.bench]
lto = true
Expand Down
1 change: 1 addition & 0 deletions Lib/test/test_weakref.py
Original file line number Diff line number Diff line change
Expand Up @@ -1841,6 +1841,7 @@ def pop_and_collect(lst):
if exc:
raise exc[0]

@unittest.skipIf(sys.platform == "win32", "TODO: RUSTPYTHON, crashes")
def test_threaded_weak_key_dict_copy(self):
# Issue #35615: Weakref keys or values getting GC'ed during dict
# copying should not result in a crash.
Expand Down
3 changes: 2 additions & 1 deletion common/src/boxvec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,8 @@ pub struct Drain<'a, T> {
}

unsafe impl<'a, T: Sync> Sync for Drain<'a, T> {}
unsafe impl<'a, T: Send> Send for Drain<'a, T> {}
#[allow(clippy::non_send_fields_in_send_ty)]
unsafe impl<'a, T: Send> Send for Drain<'a, T> {} // TODO: THIS IMPLEMENTATION IS UNSOUND!!

impl<T> Iterator for Drain<'_, T> {
type Item = T;
Expand Down
3 changes: 2 additions & 1 deletion common/src/linked_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@ struct PointersInner<T> {
_pin: PhantomPinned,
}

unsafe impl<T: Send> Send for Pointers<T> {}
#[allow(clippy::non_send_fields_in_send_ty)]
unsafe impl<T: Send> Send for Pointers<T> {} // TODO: THIS IMPLEMENTATION IS UNSOUND!!
unsafe impl<T: Sync> Sync for Pointers<T> {}

// ===== impl LinkedList =====
Expand Down
1 change: 1 addition & 0 deletions compiler/src/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ struct CompileContext {
}

#[derive(Debug, Clone, Copy, PartialEq)]
#[allow(clippy::enum_variant_names)] // TODO: refactor variant names
enum FunctionContext {
NoFunction,
Function,
Expand Down
6 changes: 3 additions & 3 deletions derive/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ impl ItemMetaInner {
ident,
format!(
"#[{}({})] is not one of allowed attributes [{}]",
meta_ident.to_string(),
meta_ident,
name,
allowed_names.join(", ")
),
Expand All @@ -116,7 +116,7 @@ impl ItemMetaInner {
if !lits.is_empty() {
return Err(syn::Error::new_spanned(
&meta_ident,
format!("#[{}(..)] cannot contain literal", meta_ident.to_string()),
format!("#[{}(..)] cannot contain literal", meta_ident),
));
}

Expand Down Expand Up @@ -381,7 +381,7 @@ impl AttributeExt for Attribute {
other.span(),
format!(
"#[{name}(...)] doesn't contain '{item}' to remove",
name = other.get_ident().unwrap().to_string(),
name = other.get_ident().unwrap(),
item = item_name
),
)),
Expand Down
3 changes: 2 additions & 1 deletion jit/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,8 @@ impl UnTypedAbiValue {
}
}

unsafe impl Send for CompiledCode {}
#[allow(clippy::non_send_fields_in_send_ty)]
unsafe impl Send for CompiledCode {} // TODO: THIS IMPLEMENTATION IS UNSOUND!!
unsafe impl Sync for CompiledCode {}

impl Drop for CompiledCode {
Expand Down
2 changes: 1 addition & 1 deletion vm/src/codecs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ fn namereplace_errors(err: PyObjectRef, vm: &VirtualMachine) -> PyResult<(String
use std::fmt::Write;
let c_u32 = c as u32;
if let Some(c_name) = unicode_names2::name(c) {
write!(out, "\\N{{{}}}", c_name.to_string()).unwrap();
write!(out, "\\N{{{}}}", c_name).unwrap();
} else if c_u32 >= 0x10000 {
write!(out, "\\U{:08x}", c_u32).unwrap();
} else if c_u32 >= 0x100 {
Expand Down
2 changes: 1 addition & 1 deletion vm/src/exceptions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ impl VirtualMachine {
}?;

match offer_suggestions(exc, vm) {
Some(suggestions) => writeln!(output, ". Did you mean: '{}'?", suggestions.to_string()),
Some(suggestions) => writeln!(output, ". Did you mean: '{}'?", suggestions),
None => writeln!(output),
}
}
Expand Down
2 changes: 2 additions & 0 deletions vm/src/format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,7 @@ impl FormatSpec {
},
};

#[allow(clippy::question_mark)]
if raw_magnitude_string_result.is_err() {
return raw_magnitude_string_result;
}
Expand Down Expand Up @@ -474,6 +475,7 @@ impl FormatSpec {
},
None => Ok(magnitude.to_str_radix(10)),
};
#[allow(clippy::question_mark)]
if raw_magnitude_string_result.is_err() {
return raw_magnitude_string_result;
}
Expand Down
5 changes: 3 additions & 2 deletions vm/src/pyobjectrc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,8 @@ pub struct PyWeak {

cfg_if::cfg_if! {
if #[cfg(feature = "threading")] {
unsafe impl Send for PyWeak {}
#[allow(clippy::non_send_fields_in_send_ty)]
unsafe impl Send for PyWeak {} // TODO: THIS IMPLEMENTATION IS UNSOUND!!
unsafe impl Sync for PyWeak {}
}
}
Expand Down Expand Up @@ -819,7 +820,7 @@ fn print_del_error(e: PyBaseExceptionRef, zelf: &PyObject, vm: &VirtualMachine)
let del_method = zelf.get_class_attr("__del__").unwrap();
let repr = &del_method.repr(vm);
match repr {
Ok(v) => println!("{}", v.to_string()),
Ok(v) => println!("{}", v),
Err(_) => println!("{}", del_method.class().name()),
}
let tb_module = vm.import("traceback", None, 0).unwrap();
Expand Down