This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Make unbounded channels size warning exact (part 1) #13490
Make unbounded channels size warning exact (part 1) #13490
Changes from 1 commit
e033a91
2373f33
78251ff
a8ce5cd
7909e9e
4514647
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm.... shouldn't the backtrace be printed out with
{}
instead of{:?}
?Maybe also print out the backtrace from which this send is being made? I can imagine that could also be useful in some cases. It's a one time warning that should only trigger in exceptional cases, so I think we can afford it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
backtrace::Backtrace
doesn't implementstd::fmt::Display
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. The one from
std
does though, if we'd switch to it.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
std
backtrace is resolved at the moment it's captured, so it was proposed by @bkchr to usebacktrace::Backtrace
, which can be resolved only if needed.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it? I just checked before proposing it, and it doesn't seem to be? Unless I'm reading it wrong.
https://github.com/rust-lang/rust/blob/72067c77bdc1e8e339b9ed378a2c0ca0a9367c4d/library/std/src/backtrace.rs#L350
Here's where it's resolved:
https://github.com/rust-lang/rust/blob/72067c77bdc1e8e339b9ed378a2c0ca0a9367c4d/library/std/src/backtrace.rs#L443
And that's called only when
frames
are called (so only when the backtrace is actually accessed, which is from theDisplay
impl below):https://github.com/rust-lang/rust/blob/72067c77bdc1e8e339b9ed378a2c0ca0a9367c4d/library/std/src/backtrace.rs#L379
Am I reading this wrong? (:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't check myself 🙈 Will fix in a moment :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done