Skip to content

Rustup #3171

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

Merged
merged 4 commits into from
Nov 16, 2023
Merged

Rustup #3171

merged 4 commits into from
Nov 16, 2023

Conversation

saethlin
Copy link
Member

For #3103

bors and others added 4 commits November 16, 2023 08:43
Ensure strings created with `const_str` get the `unnamed_addr` attribute

This function (`const_str`) is only used when we need to invent a string during codegen -- for example, for a panic message to pass when codegening some of the assert/panic/etc terminators (for stuff like divide by zero).

AFAICT all other consts, such as the user-defined ones from const eval, should already be getting this attribute (things that come from a ConstAllocation do, for example). Which means that the "unnamed" part is even more true than usual here, these aren't strings that even exist as far as the user can tell.

~~Setting this attribute allows LLVM to merge these constants, leading to significant binary size savings (much more than I would expect). On x86_64-unknown-linux-gnu, t takes a build of ripgrep (release without debug info) from 9.7MiB to 6.0MiB (a savings of over 30%!?), and a build of rustc_driver's shared object from 123MiB to 112MiB (less drastic, but still over 10% reduced).~~

~~The effect on ripgrep is substantially reduced on macOS for reasons beyond me (I may have fucked up the test), only saving around 0.2MiB, although rustc_driver is still around 10MB or smaller than it had been previously.~~

~~This raises some questions, such as "does that mean 1/3 of ripgrep was made of division by zero complaints?" I'm not sure, that may be the case. The output of `strings path/to/rg` is \~2MB smaller, so it seems like a lot of it was. Allowing these to be merged presumably also allow functions that contain them to be merged (if the addresses had semantic meaning, then it stands).~~

~~I intend to do some more analysis here, but I got this up as soon as I realized that this attribute was only missing for internal const strings, and all other ones already get it.~~

Edit: The wins are much more marginal, but there's some argument to do this for the sake of consistency.
… r=compiler-errors

Try to use approximate placeholder regions when outputting an AscribeUserType error in borrowck

Fixes #114866

Hi from GOSIM :)
@rustbot
Copy link
Collaborator

rustbot commented Nov 16, 2023

There are merge commits (commits with multiple parents) in your changes. We have a no merge policy so these commits will need to be removed for this pull request to be merged.

You can start a rebase with the following commands:

$ # rebase
$ git rebase -i master
$ # delete any merge commits in the editor that appears
$ git push --force-with-lease

The following commits are merge commits:

@saethlin saethlin changed the title rustup Rustup Nov 16, 2023
@saethlin
Copy link
Member Author

@bors r+

@bors
Copy link
Contributor

bors commented Nov 16, 2023

📌 Commit 90744dc has been approved by saethlin

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Nov 16, 2023

⌛ Testing commit 90744dc with merge 133e989...

@bors
Copy link
Contributor

bors commented Nov 16, 2023

☀️ Test successful - checks-actions
Approved by: saethlin
Pushing 133e989 to master...

@bors bors merged commit 133e989 into rust-lang:master Nov 16, 2023
@saethlin saethlin deleted the rustup branch November 19, 2023 18:43
Sign up for free to 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.

3 participants