Max “Goldstein” Siling

Results 120 comments of Max “Goldstein” Siling

@adamreichold Yes, I assumed that `::with_gil()` is not reentrant, but it apparently is. I’m not sure what’s the usecase of it though: if you already have `obj1`, you could just...

`.with_gil()` could still be reentrant, even if objects from different invocations don’t mix. `fmt::Display` doesn’t accept anything GIL-bound, so it should still work fine, I think

In general, I feel like there’re two cases: 1. Either you already have some GIL-bound object, in which case you could just get its `Python` 2. Or you don’t, so...

> I don't understand this part: Why can't these traits not be implemented for GIL-bound types, whether they are bare references or smart pointers? I use the word “GIL-bound” as...

I agree that this approach may harm convenience for some usecases. The only alternative I see is to always perform this check at runtime, which is more convenient to write,...

> Maybe that's a bug? You didn't provide many details about the specific error you're getting. I’m getting a “response truncated” error, but it’s hard to reproduce, because it only...

This commit shows how such an impl is both possible and trivial. https://github.com/GoldsteinE/tokio/commit/ecd7ab32a828645baf17e5da3110cf256446d8f4 The only thing that makes it hard is backwards compatibility, as far as I understand.

This is currently implemented on nightly as part of `fn_delegation` (https://github.com/rust-lang/rust/issues/118212): https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=fe2a0b28cf36b474400ae3faa10c5408 ```rust #![expect(incomplete_features)] #![feature(fn_delegation)] reuse Default::default; fn type_name_of_val(_: &T) -> &'static str { std::any::type_name::() } fn main() { let...

Reproduces for me on 1.5 scale, no external displays. Kinda visible in foot, but much worse in Firefox.