Skip to content

Logging fixes - #8250

Closed
brson wants to merge 2 commits into
rust-lang:masterfrom
brson:logging-fixes
Closed

Logging fixes#8250
brson wants to merge 2 commits into
rust-lang:masterfrom
brson:logging-fixes

Conversation

@brson

@brsonbrson commented Aug 3, 2013

Copy link
Copy Markdown
Contributor

Updated from #8241

Comment threadsrc/libstd/logging.rs

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't this make a string of length 257 into one of length 261? (expected behaviour?)

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like it. I don't think it's a problem though. The goal is only to avoid spewing endless garbage - it doesn't need to be precise.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On further consideration though, this is probably only appropriate behavior for the console logger, so likely belongs somewhere else. In theory logging can go to arbitrary sinks. Can be fixed in the future. Logging is going to be completely overhauled eventually anyway.

@thestinger

Copy link
Copy Markdown
Contributor

Actually landing with #8257.

flip1995 pushed a commit to flip1995/rust that referenced this pull request Feb 10, 2022
Fix underflow in `manual_split_once` lint
Hi, a friend found clippy started crashing on a suspiciously large allocation of `u64::MAX` memory on their code.
The mostly minimized repro is:
```rust
fn _f01(title: &str) -> Option<()> {
let _ = title[1..].splitn(2, '[').next()?;
Some(())
}
```
The underflow happens in this case on line 57 of the patch but I've changed the other substraction to saturating as well since it could potentially cause the same issue.
I'm not sure where to put a regression test, or if it's even worth for such a thing.
Aside, has it been considered before to build clippy with overflow checks enabled?
changelog: fix ICE of underflow in `manual_split_once` lint
U007D pushed a commit to U007D/rust-mos that referenced this pull request Aug 21, 2026
8250: More accurately classify assoc. types in paths r=jonas-schievink a=jonas-schievink
Previously `Iterator<Whoops$0 = ()>` would go to the `Iterator` trait. This fixes that and correctly marks `Whoops` as unresolved.
bors r+
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@brson@thestinger@huonw@bors@toddaaro