-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Instance
is Copy
#123044
Instance
is Copy
#123044
Conversation
r? @Nadrieril rustbot has assigned @Nadrieril. Use |
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
It's 32 bytes large though, so using a reference could still save quite a bit of copying? OTOH, |
@RalfJung: For the record, it's being passed by value in many places that are presumably hot --
Not as far as I am aware. |
`Instance` is `Copy` No reason to take it by value; it was confusing `@rcvalle` to see it being mutated when it's also being passed by ref in some places.
…kingjubilee Rollup of 10 pull requests Successful merges: - rust-lang#122707 (Fix a typo in the alloc::string::String docs) - rust-lang#122769 (extend comments for reachability set computation) - rust-lang#122892 (fix(bootstrap/dist): use versioned dirs when vendoring) - rust-lang#122896 (Update stdarch submodule) - rust-lang#122923 (In `pretty_print_type()`, print `async fn` futures' paths instead of spans.) - rust-lang#122950 (Add regression tests for rust-lang#101903) - rust-lang#122958 (Port backtrace dylib-dep test to a ui test) - rust-lang#123039 (Update books) - rust-lang#123044 (`Instance` is `Copy`) - rust-lang#123051 (did I mention that tests are super cool? ) r? `@ghost` `@rustbot` modify labels: rollup
…kingjubilee Rollup of 10 pull requests Successful merges: - rust-lang#122707 (Fix a typo in the alloc::string::String docs) - rust-lang#122769 (extend comments for reachability set computation) - rust-lang#122892 (fix(bootstrap/dist): use versioned dirs when vendoring) - rust-lang#122896 (Update stdarch submodule) - rust-lang#122923 (In `pretty_print_type()`, print `async fn` futures' paths instead of spans.) - rust-lang#122950 (Add regression tests for rust-lang#101903) - rust-lang#123039 (Update books) - rust-lang#123042 (Import the 2021 prelude in the core crate) - rust-lang#123044 (`Instance` is `Copy`) - rust-lang#123051 (did I mention that tests are super cool? ) r? `@ghost` `@rustbot` modify labels: rollup
most CPUs have a 64 byte cache line, so that might be a reasonable heuristic for when to profile the difference. trying to save on data copying when it is less than a single line often causes more thrashing because the result is that, especially in the big functions with complex loops that rustc can wind up having, you can wind up poking a bunch of different cache lines while trying to evaluate a function in a hot loop, whereas if you just copied all that data in you wouldn't have to worry about that as much. |
…kingjubilee Rollup of 10 pull requests Successful merges: - rust-lang#122707 (Fix a typo in the alloc::string::String docs) - rust-lang#122769 (extend comments for reachability set computation) - rust-lang#122892 (fix(bootstrap/dist): use versioned dirs when vendoring) - rust-lang#122896 (Update stdarch submodule) - rust-lang#122923 (In `pretty_print_type()`, print `async fn` futures' paths instead of spans.) - rust-lang#122950 (Add regression tests for rust-lang#101903) - rust-lang#123039 (Update books) - rust-lang#123042 (Import the 2021 prelude in the core crate) - rust-lang#123044 (`Instance` is `Copy`) - rust-lang#123051 (did I mention that tests are super cool? ) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#123044 - compiler-errors:instance, r=oli-obk `Instance` is `Copy` No reason to take it by value; it was confusing ``@rcvalle`` to see it being mutated when it's also being passed by ref in some places.
No reason to take it by value; it was confusing @rcvalle to see it being mutated when it's also being passed by ref in some places.