Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#102750 regresses layout size of Cow<> #105371

Closed
emilio opened this issue Dec 6, 2022 · 6 comments · Fixed by #108106
Closed

#102750 regresses layout size of Cow<> #105371

emilio opened this issue Dec 6, 2022 · 6 comments · Fixed by #108106
Labels
C-bug Category: This is a bug. P-medium Medium priority regression-from-stable-to-stable Performance or correctness regression from one stable version to another. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@emilio
Copy link
Contributor

emilio commented Dec 6, 2022

    assert_eq!(std::mem::size_of::<std::borrow::Cow<'static, str>>(), 24);

Passes on stable and beta but not on Nightly.

I bisected it, results below which point to #102750:

searched nightlies: from nightly-2022-10-20 to nightly-2022-12-06
regressed nightly: nightly-2022-11-24
searched commit range: ff8c8df...70f8737
regressed commit: 4e0d0d7

bisected with cargo-bisect-rustc v0.6.5

Host triple: x86_64-unknown-linux-gnu
Reproduce with:

cargo bisect-rustc --start 2022-10-20 

@rustbot modify labels: +regression-from-stable-to-nightly -regression-untriaged

cc: @nnethercote @the8472 @wesleywiser

@emilio emilio added C-bug Category: This is a bug. regression-untriaged Untriaged performance or correctness regression. labels Dec 6, 2022
@rustbot rustbot added regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. I-prioritize Issue: Indicates that prioritization has been requested for this issue. and removed regression-untriaged Untriaged performance or correctness regression. labels Dec 6, 2022
@the8472
Copy link
Member

the8472 commented Dec 6, 2022

I'm working on improving the niche placement logic, #104807

@the8472
Copy link
Member

the8472 commented Dec 6, 2022

Also note that Cow is repr(Rust) so its layout and sizes aren't guaranteed.

@emilio
Copy link
Contributor Author

emilio commented Dec 6, 2022

Sure, sure, I know that, I wasn't trying to imply otherwise. I just figured that it was probably unintended given the PR that introduced it. Thanks for your work on struct layout optimizations, they're great! :)

@apiraino apiraino added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Dec 7, 2022
@apiraino
Copy link
Contributor

apiraino commented Dec 8, 2022

WG-prioritization assigning priority (Zulip discussion).

@rustbot label -I-prioritize +P-medium

@rustbot rustbot added P-medium Medium priority and removed I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Dec 8, 2022
@dtolnay dtolnay added regression-from-stable-to-beta Performance or correctness regression from stable to beta. and removed regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. labels Jan 6, 2023
@khuey
Copy link
Contributor

khuey commented Feb 4, 2023

This shipped :(

@mati865
Copy link
Contributor

mati865 commented Feb 4, 2023

@rustbot modify labels -regression-from-stable-to-beta +regression-from-stable-to-stable

@rustbot rustbot added regression-from-stable-to-stable Performance or correctness regression from one stable version to another. and removed regression-from-stable-to-beta Performance or correctness regression from stable to beta. labels Feb 4, 2023
@bors bors closed this as completed in f229949 Apr 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. P-medium Medium priority regression-from-stable-to-stable Performance or correctness regression from one stable version to another. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants