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

Make some trivial functions #[inline(always)] #105262

Merged
merged 1 commit into from
Dec 9, 2022
Merged

Make some trivial functions #[inline(always)] #105262

merged 1 commit into from
Dec 9, 2022

Conversation

eduardosm
Copy link
Contributor

This is some kind of follow-up of PRs like #85218, #84061, #87150. Functions that do very basic operations are made #[inline(always)] to avoid pessimizing them in debug builds when compared to using built-in operations directly.

@rustbot
Copy link
Collaborator

rustbot commented Dec 4, 2022

r? @thomcc

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Dec 4, 2022
@rustbot
Copy link
Collaborator

rustbot commented Dec 4, 2022

Hey! It looks like you've submitted a new PR for the library teams!

If this PR contains changes to any rust-lang/rust public library APIs then please comment with @rustbot label +T-libs-api -T-libs to tag it appropriately. If this PR contains changes to any unstable APIs please edit the PR description to add a link to the relevant API Change Proposal or create one if you haven't already. If you're unsure where your change falls no worries, just leave it as is and the reviewer will take a look and make a decision to forward on if necessary.

Examples of T-libs-api changes:

  • Stabilizing library features
  • Introducing insta-stable changes such as new implementations of existing stable traits on existing stable types
  • Introducing new or changing existing unstable library APIs (excluding permanently unstable features / features without a tracking issue)
  • Changing public documentation in ways that create new stability guarantees
  • Changing observable runtime behavior of library APIs

@cjgillot
Copy link
Contributor

cjgillot commented Dec 4, 2022

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Dec 4, 2022
@bors
Copy link
Contributor

bors commented Dec 4, 2022

⌛ Trying commit 2281b6aa29437c0ea7d5a8d84ed3269972b054f0 with merge 60f5d77084c24f92ebfb9d217e70cb687029f648...

@leonardo-m
Copy link

Why isn't #[inline] enough there?

@bors
Copy link
Contributor

bors commented Dec 4, 2022

☀️ Try build successful - checks-actions
Build commit: 60f5d77084c24f92ebfb9d217e70cb687029f648 (60f5d77084c24f92ebfb9d217e70cb687029f648)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (60f5d77084c24f92ebfb9d217e70cb687029f648): comparison URL.

Overall result: ❌✅ regressions and improvements - ACTION NEEDED

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please fix the regressions and do another perf run. If the next run shows neutral or positive results, the label will be automatically removed.

@bors rollup=never
@rustbot label: -S-waiting-on-perf +perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
1.2% [0.6%, 1.7%] 2
Regressions ❌
(secondary)
0.9% [0.4%, 1.2%] 4
Improvements ✅
(primary)
-0.7% [-1.3%, -0.4%] 22
Improvements ✅
(secondary)
-1.5% [-2.7%, -0.3%] 14
All ❌✅ (primary) -0.5% [-1.3%, 1.7%] 24

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
2.4% [2.1%, 2.7%] 2
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-2.5% [-5.9%, -0.2%] 6
Improvements ✅
(secondary)
-1.7% [-1.7%, -1.7%] 1
All ❌✅ (primary) -1.3% [-5.9%, 2.7%] 8

Cycles

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-1.2% [-2.3%, -0.6%] 20
Improvements ✅
(secondary)
-2.2% [-3.0%, -1.1%] 15
All ❌✅ (primary) -1.2% [-2.3%, -0.6%] 20

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Dec 4, 2022
@workingjubilee
Copy link
Member

workingjubilee commented Dec 4, 2022

These functions are not all equally trivial, and #[inline(always)] is a strong hint that can result in regressions in compile time and runtime performance. This is probably overall worth it, but perhaps this PR should be split up (basically, along the lines of each module or so) to find which ones were causing the perf suite regressions on e.g. stm32f.

@eduardosm
Copy link
Contributor Author

Splitting the PR seems to be a good idea.

@eduardosm eduardosm marked this pull request as draft December 4, 2022 21:59
@@ -185,7 +185,7 @@ mod impls {
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_clone", issue = "91805")]
impl const Clone for $t {
#[inline]
#[inline(always)]
Copy link
Member

Choose a reason for hiding this comment

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

This probably does less than you'd expect, because of

fn combine_primitive_clone(

bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 6, 2022
…scottmcm

Make integer-to-integer `From` impls `#[inline(always)]`

Splited from rust-lang#105262
Copy link
Member

@thomcc thomcc left a comment

Choose a reason for hiding this comment

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

Yeah, so super sorry for the delay, I've been unfortunately busy.

Anyway. This is a mixed bag. The biggest advice I'd have would be:

  • Keep in mind that our inlining (and thus its cost model) works bottom-up not top-down (even though thinking about it as top-down is much easier), so inline(always) on a trivial wrapper around a plausibly-large function is bad.
  • A lot of the operations have much more involved internals than you might expect, which can have a big impact, sadly. [T]::len() isn't a field access, and many unsafe ops come with some debug assertions and const eval machinery in certain cases, which may impact the compile time (or may not).

Anyway, here's my summary of what I'd like to see:

Ones that can stay

  • A lot of these are identities or clearly trivial conversions. Those are clearly fine. This includes addr, expose_addr, all the literal identites, the pointer derefs, casts, etc.

Ones that should be split into their own (ideally separate?) PRs

  • For the slice/str/ptr lens, this ends up going through a big chain like {NonNull::<[T]>,str,<[T]>}::len => <*const [T]>::len => ptr::metadata::<[T]> and so on. All these would probably need to be inlined for it to help. You should probably put this and the other len() PRs in a different PR just for len() and relevant metadata functions.

  • Most of the pointer arithmetic (especially byte_sub) does considerably more. It'd be a bug for it to be not inlined in a release build, but could have some big compile impact, since they're used all over the place.

Ones that should (IMO) be removed

  • The blanket Into::into() I think it'd be a mistake given our inline cost model. So, that one's a no (this one has come up before too).
  • Same for copy and copy_to_nonoverlapping -- also seem to be bad choices.

library/core/src/convert/mod.rs Outdated Show resolved Hide resolved
library/core/src/ptr/const_ptr.rs Outdated Show resolved Hide resolved
library/core/src/ptr/mut_ptr.rs Outdated Show resolved Hide resolved
library/core/src/ptr/const_ptr.rs Outdated Show resolved Hide resolved
@thomcc
Copy link
Member

thomcc commented Dec 7, 2022

If you're wondering about the paranoia here around compile times -- #[inline(always)] applies in debug builds too, and for ages "please make rustc faster in debug builds" has been one of the most consistent requests we've gotten.

@thomcc
Copy link
Member

thomcc commented Dec 7, 2022

@rustbot author

Please push this back into my queue when you've taken care of that with <at> rustbot ready. If you don't want to file other PRs, it's sufficient to just take the parts out.

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 7, 2022
@eduardosm eduardosm marked this pull request as ready for review December 7, 2022 17:08
@bors
Copy link
Contributor

bors commented Dec 8, 2022

📌 Commit 00e7b54 has been approved by thomcc

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 8, 2022
@bors
Copy link
Contributor

bors commented Dec 8, 2022

⌛ Testing commit 00e7b54 with merge 18c1d50e807c30ebfd4bb58035f85f7a7529e5df...

@bors
Copy link
Contributor

bors commented Dec 8, 2022

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Dec 8, 2022
@eduardosm
Copy link
Contributor Author

I am not sure what is is going on here

breakpoint set --file 'borrowed-basic.rs' --line 158
DEBUG: breakpoint added, id = 1
Breakpoint 1: where = a`borrowed_basic::main::hb88626abe4f7b94a + 298 at borrowed-basic.rs:158:5, address = 0x0000000100003cba 
DEBUG: registering breakpoint callback, id = 1
Error while trying to register breakpoint callback, id = 1, message = error: could not get num args: can't find callable: breakpoint_callback

run
error: failed to get reply to handshake packet within timeout of 6.0 seconds

print *bool_ref
TIMEOUT: lldb_batchmode.py has been running for too long. Aborting!

@thomcc
Copy link
Member

thomcc commented Dec 9, 2022

Uhhhhhhhh no idea. It does say "timeout" in it, so....

@bors retry

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 9, 2022
RalfJung pushed a commit to RalfJung/miri that referenced this pull request Dec 9, 2022
Make integer-to-integer `From` impls `#[inline(always)]`

Splited from rust-lang/rust#105262
@bors
Copy link
Contributor

bors commented Dec 9, 2022

⌛ Testing commit 00e7b54 with merge f058493...

@bors
Copy link
Contributor

bors commented Dec 9, 2022

☀️ Test successful - checks-actions
Approved by: thomcc
Pushing f058493 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Dec 9, 2022
@bors bors merged commit f058493 into rust-lang:master Dec 9, 2022
@rustbot rustbot added this to the 1.67.0 milestone Dec 9, 2022
@eduardosm eduardosm deleted the more-inline-always branch December 9, 2022 19:23
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (f058493): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
1.5% [1.0%, 2.0%] 2
Regressions ❌
(secondary)
0.7% [0.4%, 0.9%] 4
Improvements ✅
(primary)
-0.1% [-0.1%, -0.1%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.0% [-0.1%, 2.0%] 3

Cycles

This benchmark run did not return any relevant results for this metric.

@rust-log-analyzer
Copy link
Collaborator

The job x86_64-apple-1 failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
test [debuginfo-lldb] src/test/debuginfo/vec.rs ... ok

failures:

---- [debuginfo-lldb] src/test/debuginfo/borrowed-basic.rs stdout ----
Some tests failed in compiletest suite=debuginfo mode=debuginfo host=x86_64-apple-darwin target=x86_64-apple-darwin
NOTE: compiletest thinks it is using LLDB version 1400
NOTE: compiletest thinks it is using LLDB without native rust support
error: Error while running LLDB
error: Error while running LLDB
status: signal: 2 (SIGINT)
command: "/usr/bin/python3" "/Users/runner/work/rust/rust/src/etc/lldb_batchmode.py" "/Users/runner/work/rust/rust/build/x86_64-apple-darwin/test/debuginfo/borrowed-basic.lldb/a" "/Users/runner/work/rust/rust/build/x86_64-apple-darwin/test/debuginfo/borrowed-basic.lldb/borrowed-basic.debugger.script"
--- stdout -------------------------------
LLDB batch-mode script
----------------------
Debugger commands script is '/Users/runner/work/rust/rust/build/x86_64-apple-darwin/test/debuginfo/borrowed-basic.lldb/borrowed-basic.debugger.script'.
Target executable is '/Users/runner/work/rust/rust/build/x86_64-apple-darwin/test/debuginfo/borrowed-basic.lldb/a'.
Current working directory is '/Users/runner/work/rust/rust'
Creating a target for '/Users/runner/work/rust/rust/build/x86_64-apple-darwin/test/debuginfo/borrowed-basic.lldb/a'
settings set auto-confirm true
version
version
lldb-1400.0.30.3 Apple Swift version 5.7 (swiftlang-5.7.0.127.4 clang-1400.0.29.50) 
command script import /Users/runner/work/rust/rust/./src/etc/lldb_lookup.py
type synthetic add -l lldb_lookup.synthetic_lookup -x '.*' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(alloc::([a-z_]+::)+)String$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^&(mut )?str$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^&(mut )?\[.+\]$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(std::ffi::([a-z_]+::)+)OsString$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(alloc::([a-z_]+::)+)Vec<.+>$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(alloc::([a-z_]+::)+)VecDeque<.+>$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(alloc::([a-z_]+::)+)BTreeSet<.+>$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(alloc::([a-z_]+::)+)BTreeMap<.+>$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(std::collections::([a-z_]+::)+)HashMap<.+>$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(std::collections::([a-z_]+::)+)HashSet<.+>$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(alloc::([a-z_]+::)+)Rc<.+>$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(alloc::([a-z_]+::)+)Arc<.+>$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(core::([a-z_]+::)+)Cell<.+>$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(core::([a-z_]+::)+)Ref<.+>$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(core::([a-z_]+::)+)RefMut<.+>$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(core::([a-z_]+::)+)RefCell<.+>$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^core::num::([a-z_]+::)*NonZero.+$' --category Rust
type category enable Rust

breakpoint set --file 'borrowed-basic.rs' --line 158
DEBUG: breakpoint added, id = 1
Breakpoint 1: where = a`borrowed_basic::main::hb88626abe4f7b94a + 298 at borrowed-basic.rs:158:5, address = 0x0000000100003cba 
DEBUG: registering breakpoint callback, id = 1
Error while trying to register breakpoint callback, id = 1, message = error: could not get num args: can't find callable: breakpoint_callback
run
error: failed to get reply to handshake packet within timeout of 6.0 seconds

print *bool_ref
print *bool_ref
TIMEOUT: lldb_batchmode.py has been running for too long. Aborting!
--- stderr -------------------------------
Traceback (most recent call last):
Traceback (most recent call last):
  File "/Users/runner/work/rust/rust/src/etc/lldb_batchmode.py", line 216, in <module>
    execute_command(command_interpreter, command)
  File "/Users/runner/work/rust/rust/src/etc/lldb_batchmode.py", line 78, in execute_command
    command_interpreter.HandleCommand(command, res)
  File "/Applications/Xcode_14.0.1.app/Contents/SharedFrameworks/LLDB.framework/Resources/Python/lldb/__init__.py", line 3166, in HandleCommand
    return _lldb.SBCommandInterpreter_HandleCommand(self, *args)
KeyboardInterrupt
------------------------------------------



---- [debuginfo-lldb] src/test/debuginfo/box.rs stdout ----
NOTE: compiletest thinks it is using LLDB version 1400
NOTE: compiletest thinks it is using LLDB without native rust support
error: Error while running LLDB
error: Error while running LLDB
status: signal: 2 (SIGINT)
command: "/usr/bin/python3" "/Users/runner/work/rust/rust/src/etc/lldb_batchmode.py" "/Users/runner/work/rust/rust/build/x86_64-apple-darwin/test/debuginfo/box.lldb/a" "/Users/runner/work/rust/rust/build/x86_64-apple-darwin/test/debuginfo/box.lldb/box.debugger.script"
--- stdout -------------------------------
LLDB batch-mode script
----------------------
Debugger commands script is '/Users/runner/work/rust/rust/build/x86_64-apple-darwin/test/debuginfo/box.lldb/box.debugger.script'.
Target executable is '/Users/runner/work/rust/rust/build/x86_64-apple-darwin/test/debuginfo/box.lldb/a'.
Current working directory is '/Users/runner/work/rust/rust'
Creating a target for '/Users/runner/work/rust/rust/build/x86_64-apple-darwin/test/debuginfo/box.lldb/a'
settings set auto-confirm true
version
version
lldb-1400.0.30.3 Apple Swift version 5.7 (swiftlang-5.7.0.127.4 clang-1400.0.29.50) 
command script import /Users/runner/work/rust/rust/./src/etc/lldb_lookup.py
type synthetic add -l lldb_lookup.synthetic_lookup -x '.*' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(alloc::([a-z_]+::)+)String$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^&(mut )?str$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^&(mut )?\[.+\]$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(std::ffi::([a-z_]+::)+)OsString$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(alloc::([a-z_]+::)+)Vec<.+>$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(alloc::([a-z_]+::)+)VecDeque<.+>$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(alloc::([a-z_]+::)+)BTreeSet<.+>$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(alloc::([a-z_]+::)+)BTreeMap<.+>$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(std::collections::([a-z_]+::)+)HashMap<.+>$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(std::collections::([a-z_]+::)+)HashSet<.+>$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(alloc::([a-z_]+::)+)Rc<.+>$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(alloc::([a-z_]+::)+)Arc<.+>$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(core::([a-z_]+::)+)Cell<.+>$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(core::([a-z_]+::)+)Ref<.+>$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(core::([a-z_]+::)+)RefMut<.+>$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(core::([a-z_]+::)+)RefCell<.+>$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^core::num::([a-z_]+::)*NonZero.+$' --category Rust
type category enable Rust

breakpoint set --file 'box.rs' --line 34
DEBUG: breakpoint added, id = 1
Breakpoint 1: where = a`box::main::hffbe036b935e8df9 + 270 at box.rs:34:5, address = 0x0000000100002f9e 
DEBUG: registering breakpoint callback, id = 1
Error while trying to register breakpoint callback, id = 1, message = error: could not get num args: can't find callable: breakpoint_callback
run
error: failed to get reply to handshake packet within timeout of 6.0 seconds

print *a
print *a
TIMEOUT: lldb_batchmode.py has been running for too long. Aborting!
--- stderr -------------------------------
Traceback (most recent call last):
Traceback (most recent call last):
  File "/Users/runner/work/rust/rust/src/etc/lldb_batchmode.py", line 216, in <module>
    execute_command(command_interpreter, command)
  File "/Users/runner/work/rust/rust/src/etc/lldb_batchmode.py", line 78, in execute_command
    command_interpreter.HandleCommand(command, res)
  File "/Applications/Xcode_14.0.1.app/Contents/SharedFrameworks/LLDB.framework/Resources/Python/lldb/__init__.py", line 3166, in HandleCommand
    return _lldb.SBCommandInterpreter_HandleCommand(self, *args)
KeyboardInterrupt
------------------------------------------



---- [debuginfo-lldb] src/test/debuginfo/borrowed-c-style-enum.rs stdout ----
NOTE: compiletest thinks it is using LLDB version 1400
NOTE: compiletest thinks it is using LLDB without native rust support
error: Error while running LLDB
error: Error while running LLDB
status: signal: 2 (SIGINT)
command: "/usr/bin/python3" "/Users/runner/work/rust/rust/src/etc/lldb_batchmode.py" "/Users/runner/work/rust/rust/build/x86_64-apple-darwin/test/debuginfo/borrowed-c-style-enum.lldb/a" "/Users/runner/work/rust/rust/build/x86_64-apple-darwin/test/debuginfo/borrowed-c-style-enum.lldb/borrowed-c-style-enum.debugger.script"
--- stdout -------------------------------
LLDB batch-mode script
----------------------
Debugger commands script is '/Users/runner/work/rust/rust/build/x86_64-apple-darwin/test/debuginfo/borrowed-c-style-enum.lldb/borrowed-c-style-enum.debugger.script'.
Target executable is '/Users/runner/work/rust/rust/build/x86_64-apple-darwin/test/debuginfo/borrowed-c-style-enum.lldb/a'.
Current working directory is '/Users/runner/work/rust/rust'
Creating a target for '/Users/runner/work/rust/rust/build/x86_64-apple-darwin/test/debuginfo/borrowed-c-style-enum.lldb/a'
settings set auto-confirm true
version
version
lldb-1400.0.30.3 Apple Swift version 5.7 (swiftlang-5.7.0.127.4 clang-1400.0.29.50) 
command script import /Users/runner/work/rust/rust/./src/etc/lldb_lookup.py
type synthetic add -l lldb_lookup.synthetic_lookup -x '.*' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(alloc::([a-z_]+::)+)String$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^&(mut )?str$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^&(mut )?\[.+\]$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(std::ffi::([a-z_]+::)+)OsString$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(alloc::([a-z_]+::)+)Vec<.+>$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(alloc::([a-z_]+::)+)VecDeque<.+>$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(alloc::([a-z_]+::)+)BTreeSet<.+>$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(alloc::([a-z_]+::)+)BTreeMap<.+>$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(std::collections::([a-z_]+::)+)HashMap<.+>$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(std::collections::([a-z_]+::)+)HashSet<.+>$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(alloc::([a-z_]+::)+)Rc<.+>$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(alloc::([a-z_]+::)+)Arc<.+>$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(core::([a-z_]+::)+)Cell<.+>$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(core::([a-z_]+::)+)Ref<.+>$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(core::([a-z_]+::)+)RefMut<.+>$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(core::([a-z_]+::)+)RefCell<.+>$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^core::num::([a-z_]+::)*NonZero.+$' --category Rust
type category enable Rust

breakpoint set --file 'borrowed-c-style-enum.rs' --line 53
DEBUG: breakpoint added, id = 1
Breakpoint 1: where = a`borrowed_c_style_enum::main::h25d1c13ddf8858ea + 44 at borrowed-c-style-enum.rs:53:5, address = 0x0000000100003b9c 
DEBUG: registering breakpoint callback, id = 1
Error while trying to register breakpoint callback, id = 1, message = error: could not get num args: can't find callable: breakpoint_callback
run
error: failed to get reply to handshake packet within timeout of 6.0 seconds


print *the_a_ref
TIMEOUT: lldb_batchmode.py has been running for too long. Aborting!
--- stderr -------------------------------
Traceback (most recent call last):
Traceback (most recent call last):
  File "/Users/runner/work/rust/rust/src/etc/lldb_batchmode.py", line 216, in <module>
    execute_command(command_interpreter, command)
  File "/Users/runner/work/rust/rust/src/etc/lldb_batchmode.py", line 78, in execute_command
    command_interpreter.HandleCommand(command, res)
  File "/Applications/Xcode_14.0.1.app/Contents/SharedFrameworks/LLDB.framework/Resources/Python/lldb/__init__.py", line 3166, in HandleCommand
    return _lldb.SBCommandInterpreter_HandleCommand(self, *args)
KeyboardInterrupt
------------------------------------------



---- [debuginfo-lldb] src/test/debuginfo/borrowed-unique-basic.rs stdout ----
NOTE: compiletest thinks it is using LLDB version 1400
NOTE: compiletest thinks it is using LLDB without native rust support
error: Error while running LLDB
error: Error while running LLDB
status: signal: 2 (SIGINT)
command: "/usr/bin/python3" "/Users/runner/work/rust/rust/src/etc/lldb_batchmode.py" "/Users/runner/work/rust/rust/build/x86_64-apple-darwin/test/debuginfo/borrowed-unique-basic.lldb/a" "/Users/runner/work/rust/rust/build/x86_64-apple-darwin/test/debuginfo/borrowed-unique-basic.lldb/borrowed-unique-basic.debugger.script"
--- stdout -------------------------------
LLDB batch-mode script
----------------------
Debugger commands script is '/Users/runner/work/rust/rust/build/x86_64-apple-darwin/test/debuginfo/borrowed-unique-basic.lldb/borrowed-unique-basic.debugger.script'.
Target executable is '/Users/runner/work/rust/rust/build/x86_64-apple-darwin/test/debuginfo/borrowed-unique-basic.lldb/a'.
Current working directory is '/Users/runner/work/rust/rust'
Creating a target for '/Users/runner/work/rust/rust/build/x86_64-apple-darwin/test/debuginfo/borrowed-unique-basic.lldb/a'
settings set auto-confirm true
version
version
lldb-1400.0.30.3 Apple Swift version 5.7 (swiftlang-5.7.0.127.4 clang-1400.0.29.50) 
command script import /Users/runner/work/rust/rust/./src/etc/lldb_lookup.py
type synthetic add -l lldb_lookup.synthetic_lookup -x '.*' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(alloc::([a-z_]+::)+)String$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^&(mut )?str$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^&(mut )?\[.+\]$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(std::ffi::([a-z_]+::)+)OsString$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(alloc::([a-z_]+::)+)Vec<.+>$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(alloc::([a-z_]+::)+)VecDeque<.+>$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(alloc::([a-z_]+::)+)BTreeSet<.+>$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(alloc::([a-z_]+::)+)BTreeMap<.+>$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(std::collections::([a-z_]+::)+)HashMap<.+>$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(std::collections::([a-z_]+::)+)HashSet<.+>$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(alloc::([a-z_]+::)+)Rc<.+>$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(alloc::([a-z_]+::)+)Arc<.+>$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(core::([a-z_]+::)+)Cell<.+>$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(core::([a-z_]+::)+)Ref<.+>$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(core::([a-z_]+::)+)RefMut<.+>$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(core::([a-z_]+::)+)RefCell<.+>$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^core::num::([a-z_]+::)*NonZero.+$' --category Rust
type category enable Rust

breakpoint set --file 'borrowed-unique-basic.rs' --line 161
DEBUG: breakpoint added, id = 1
Breakpoint 1: where = a`borrowed_unique_basic::main::h54fba867ae3d9746 + 2456 at borrowed-unique-basic.rs:161:5, address = 0x0000000100002f18 
DEBUG: registering breakpoint callback, id = 1
Error while trying to register breakpoint callback, id = 1, message = error: could not get num args: can't find callable: breakpoint_callback
type format add -f decimal char
type format add -f decimal char
type format add -f decimal 'unsigned char'
error: failed to get reply to handshake packet within timeout of 6.0 seconds

print *bool_ref
print *bool_ref
TIMEOUT: lldb_batchmode.py has been running for too long. Aborting!
--- stderr -------------------------------
Traceback (most recent call last):
Traceback (most recent call last):
  File "/Users/runner/work/rust/rust/src/etc/lldb_batchmode.py", line 216, in <module>
    execute_command(command_interpreter, command)
  File "/Users/runner/work/rust/rust/src/etc/lldb_batchmode.py", line 78, in execute_command
    command_interpreter.HandleCommand(command, res)
  File "/Applications/Xcode_14.0.1.app/Contents/SharedFrameworks/LLDB.framework/Resources/Python/lldb/__init__.py", line 3166, in HandleCommand
    return _lldb.SBCommandInterpreter_HandleCommand(self, *args)
KeyboardInterrupt
------------------------------------------



---- [debuginfo-lldb] src/test/debuginfo/basic-types.rs stdout ----
NOTE: compiletest thinks it is using LLDB version 1400
NOTE: compiletest thinks it is using LLDB without native rust support
error: Error while running LLDB
error: Error while running LLDB
status: signal: 2 (SIGINT)
command: "/usr/bin/python3" "/Users/runner/work/rust/rust/src/etc/lldb_batchmode.py" "/Users/runner/work/rust/rust/build/x86_64-apple-darwin/test/debuginfo/basic-types.lldb/a" "/Users/runner/work/rust/rust/build/x86_64-apple-darwin/test/debuginfo/basic-types.lldb/basic-types.debugger.script"
--- stdout -------------------------------
LLDB batch-mode script
----------------------
Debugger commands script is '/Users/runner/work/rust/rust/build/x86_64-apple-darwin/test/debuginfo/basic-types.lldb/basic-types.debugger.script'.
Target executable is '/Users/runner/work/rust/rust/build/x86_64-apple-darwin/test/debuginfo/basic-types.lldb/a'.
Current working directory is '/Users/runner/work/rust/rust'
Creating a target for '/Users/runner/work/rust/rust/build/x86_64-apple-darwin/test/debuginfo/basic-types.lldb/a'
settings set auto-confirm true
version
version
lldb-1400.0.30.3 Apple Swift version 5.7 (swiftlang-5.7.0.127.4 clang-1400.0.29.50) 
command script import /Users/runner/work/rust/rust/./src/etc/lldb_lookup.py
type synthetic add -l lldb_lookup.synthetic_lookup -x '.*' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(alloc::([a-z_]+::)+)String$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^&(mut )?str$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^&(mut )?\[.+\]$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(std::ffi::([a-z_]+::)+)OsString$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(alloc::([a-z_]+::)+)Vec<.+>$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(alloc::([a-z_]+::)+)VecDeque<.+>$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(alloc::([a-z_]+::)+)BTreeSet<.+>$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(alloc::([a-z_]+::)+)BTreeMap<.+>$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(std::collections::([a-z_]+::)+)HashMap<.+>$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(std::collections::([a-z_]+::)+)HashSet<.+>$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(alloc::([a-z_]+::)+)Rc<.+>$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(alloc::([a-z_]+::)+)Arc<.+>$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(core::([a-z_]+::)+)Cell<.+>$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(core::([a-z_]+::)+)Ref<.+>$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(core::([a-z_]+::)+)RefMut<.+>$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(core::([a-z_]+::)+)RefCell<.+>$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^core::num::([a-z_]+::)*NonZero.+$' --category Rust
type category enable Rust

breakpoint set --file 'basic-types.rs' --line 154
DEBUG: breakpoint added, id = 1
Breakpoint 1: where = a`basic_types::main::h00ef3525e79207b1 + 130 at basic-types.rs:154:5, address = 0x0000000100003b72 
DEBUG: registering breakpoint callback, id = 1
Error while trying to register breakpoint callback, id = 1, message = error: could not get num args: can't find callable: breakpoint_callback
run
run
TIMEOUT: lldb_batchmode.py has been running for too long. Aborting!
--- stderr -------------------------------
Traceback (most recent call last):
Traceback (most recent call last):
  File "/Users/runner/work/rust/rust/src/etc/lldb_batchmode.py", line 216, in <module>
    execute_command(command_interpreter, command)
  File "/Users/runner/work/rust/rust/src/etc/lldb_batchmode.py", line 78, in execute_command
    command_interpreter.HandleCommand(command, res)
  File "/Applications/Xcode_14.0.1.app/Contents/SharedFrameworks/LLDB.framework/Resources/Python/lldb/__init__.py", line 3166, in HandleCommand
    return _lldb.SBCommandInterpreter_HandleCommand(self, *args)
KeyboardInterrupt
------------------------------------------



---- [debuginfo-lldb] src/test/debuginfo/borrowed-struct.rs stdout ----
NOTE: compiletest thinks it is using LLDB version 1400
NOTE: compiletest thinks it is using LLDB without native rust support
error: Error while running LLDB
error: Error while running LLDB
status: signal: 2 (SIGINT)
command: "/usr/bin/python3" "/Users/runner/work/rust/rust/src/etc/lldb_batchmode.py" "/Users/runner/work/rust/rust/build/x86_64-apple-darwin/test/debuginfo/borrowed-struct.lldb/a" "/Users/runner/work/rust/rust/build/x86_64-apple-darwin/test/debuginfo/borrowed-struct.lldb/borrowed-struct.debugger.script"
--- stdout -------------------------------
LLDB batch-mode script
----------------------
Debugger commands script is '/Users/runner/work/rust/rust/build/x86_64-apple-darwin/test/debuginfo/borrowed-struct.lldb/borrowed-struct.debugger.script'.
Target executable is '/Users/runner/work/rust/rust/build/x86_64-apple-darwin/test/debuginfo/borrowed-struct.lldb/a'.
Current working directory is '/Users/runner/work/rust/rust'
Creating a target for '/Users/runner/work/rust/rust/build/x86_64-apple-darwin/test/debuginfo/borrowed-struct.lldb/a'
settings set auto-confirm true
version
version
lldb-1400.0.30.3 Apple Swift version 5.7 (swiftlang-5.7.0.127.4 clang-1400.0.29.50) 
command script import /Users/runner/work/rust/rust/./src/etc/lldb_lookup.py
type synthetic add -l lldb_lookup.synthetic_lookup -x '.*' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(alloc::([a-z_]+::)+)String$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^&(mut )?str$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^&(mut )?\[.+\]$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(std::ffi::([a-z_]+::)+)OsString$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(alloc::([a-z_]+::)+)Vec<.+>$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(alloc::([a-z_]+::)+)VecDeque<.+>$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(alloc::([a-z_]+::)+)BTreeSet<.+>$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(alloc::([a-z_]+::)+)BTreeMap<.+>$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(std::collections::([a-z_]+::)+)HashMap<.+>$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(std::collections::([a-z_]+::)+)HashSet<.+>$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(alloc::([a-z_]+::)+)Rc<.+>$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(alloc::([a-z_]+::)+)Arc<.+>$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(core::([a-z_]+::)+)Cell<.+>$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(core::([a-z_]+::)+)Ref<.+>$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(core::([a-z_]+::)+)RefMut<.+>$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(core::([a-z_]+::)+)RefCell<.+>$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^core::num::([a-z_]+::)*NonZero.+$' --category Rust
type category enable Rust

breakpoint set --file 'borrowed-struct.rs' --line 86
DEBUG: breakpoint added, id = 1
Breakpoint 1: where = a`borrowed_struct::main::h46b5418b8d5b3e31 + 245 at borrowed-struct.rs:86:5, address = 0x0000000100003295 
DEBUG: registering breakpoint callback, id = 1
Error while trying to register breakpoint callback, id = 1, message = error: could not get num args: can't find callable: breakpoint_callback
run
run
TIMEOUT: lldb_batchmode.py has been running for too long. Aborting!
--- stderr -------------------------------
Traceback (most recent call last):
Traceback (most recent call last):
  File "/Users/runner/work/rust/rust/src/etc/lldb_batchmode.py", line 216, in <module>
    execute_command(command_interpreter, command)
  File "/Users/runner/work/rust/rust/src/etc/lldb_batchmode.py", line 78, in execute_command
    command_interpreter.HandleCommand(command, res)
  File "/Applications/Xcode_14.0.1.app/Contents/SharedFrameworks/LLDB.framework/Resources/Python/lldb/__init__.py", line 3166, in HandleCommand
    return _lldb.SBCommandInterpreter_HandleCommand(self, *args)
KeyboardInterrupt
------------------------------------------



---- [debuginfo-lldb] src/test/debuginfo/borrowed-tuple.rs stdout ----
NOTE: compiletest thinks it is using LLDB version 1400
NOTE: compiletest thinks it is using LLDB without native rust support
error: Error while running LLDB
error: Error while running LLDB
status: signal: 2 (SIGINT)
command: "/usr/bin/python3" "/Users/runner/work/rust/rust/src/etc/lldb_batchmode.py" "/Users/runner/work/rust/rust/build/x86_64-apple-darwin/test/debuginfo/borrowed-tuple.lldb/a" "/Users/runner/work/rust/rust/build/x86_64-apple-darwin/test/debuginfo/borrowed-tuple.lldb/borrowed-tuple.debugger.script"
--- stdout -------------------------------
LLDB batch-mode script
----------------------
Debugger commands script is '/Users/runner/work/rust/rust/build/x86_64-apple-darwin/test/debuginfo/borrowed-tuple.lldb/borrowed-tuple.debugger.script'.
Target executable is '/Users/runner/work/rust/rust/build/x86_64-apple-darwin/test/debuginfo/borrowed-tuple.lldb/a'.
Current working directory is '/Users/runner/work/rust/rust'
Creating a target for '/Users/runner/work/rust/rust/build/x86_64-apple-darwin/test/debuginfo/borrowed-tuple.lldb/a'
settings set auto-confirm true
version
version
lldb-1400.0.30.3 Apple Swift version 5.7 (swiftlang-5.7.0.127.4 clang-1400.0.29.50) 
command script import /Users/runner/work/rust/rust/./src/etc/lldb_lookup.py
type synthetic add -l lldb_lookup.synthetic_lookup -x '.*' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(alloc::([a-z_]+::)+)String$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^&(mut )?str$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^&(mut )?\[.+\]$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(std::ffi::([a-z_]+::)+)OsString$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(alloc::([a-z_]+::)+)Vec<.+>$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(alloc::([a-z_]+::)+)VecDeque<.+>$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(alloc::([a-z_]+::)+)BTreeSet<.+>$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(alloc::([a-z_]+::)+)BTreeMap<.+>$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(std::collections::([a-z_]+::)+)HashMap<.+>$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(std::collections::([a-z_]+::)+)HashSet<.+>$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(alloc::([a-z_]+::)+)Rc<.+>$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(alloc::([a-z_]+::)+)Arc<.+>$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(core::([a-z_]+::)+)Cell<.+>$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(core::([a-z_]+::)+)Ref<.+>$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(core::([a-z_]+::)+)RefMut<.+>$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^(core::([a-z_]+::)+)RefCell<.+>$' --category Rust
type summary add -F lldb_lookup.summary_lookup  -e -x -h '^core::num::([a-z_]+::)*NonZero.+$' --category Rust
type category enable Rust

breakpoint set --file 'borrowed-tuple.rs' --line 51
DEBUG: breakpoint added, id = 1
Breakpoint 1: where = a`borrowed_tuple::main::h2a63676140b98dc8 + 156 at borrowed-tuple.rs:51:5, address = 0x000000010000386c 
DEBUG: registering breakpoint callback, id = 1
Error while trying to register breakpoint callback, id = 1, message = error: could not get num args: can't find callable: breakpoint_callback
run
run
TIMEOUT: lldb_batchmode.py has been running for too long. Aborting!
--- stderr -------------------------------
Traceback (most recent call last):
Traceback (most recent call last):
  File "/Users/runner/work/rust/rust/src/etc/lldb_batchmode.py", line 216, in <module>
    execute_command(command_interpreter, command)
  File "/Users/runner/work/rust/rust/src/etc/lldb_batchmode.py", line 78, in execute_command
    command_interpreter.HandleCommand(command, res)
  File "/Applications/Xcode_14.0.1.app/Contents/SharedFrameworks/LLDB.framework/Resources/Python/lldb/__init__.py", line 3166, in HandleCommand
    return _lldb.SBCommandInterpreter_HandleCommand(self, *args)
KeyboardInterrupt
------------------------------------------


bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 11, 2022
… r=Mark-Simulacrum

Make pointer `sub` and `wrapping_sub` methods `#[inline(always)]`

Splitted from rust-lang#105262
@therealprof
Copy link
Contributor

If you're wondering about the paranoia here around compile times -- #[inline(always)] applies in debug builds too, and for ages "please make rustc faster in debug builds" has been one of the most consistent requests we've gotten.

OTOH, not inlining trivial functions means that the binary size goes through the roof in debug builds which is very troublesome when a trivial program (slightly more complex than hello world) can't fit into the flash memory of an MCU (say 16kB).

    Finished dev [unoptimized + debuginfo] target(s) in 0.02s
   text	   data	    bss	    dec	    hex	filename
  14928	      4	     12	  14944	   3a60	flash_systick

For reference, here's the "--release" build:

    Finished release [optimized + debuginfo] target(s) in 0.01s
   text	   data	    bss	    dec	    hex	filename
    752	      4	      8	    764	    2fc	flash_systick

It is a quite a footgun that the default configuration of rustc often produces binaries which will either not even link or if they do frequently fail to run correctly due to being so slow that certain timing requirements (like for USB) cannot be achieved.

IMNSHO trivial operations on intrinsic types should always be inlined and optimized "no questions asked" when code generation is enabled, despite adding some additional compile time. There's zero value in emitting functions which no-one is ever going to set a breakpoint on in a compiler and where the call is more expensive than the operation itself.

NB: I'm one of the persons behind stm32f4 and even though I don't like regressions on this crate, a tradeoff code size vs compile speed would be one I'd be very much willing to accept. A lot of people are shooting themselves in the foot and swearing at Rust because code generation with the defaults is truly abysmal, unlike literally every other language. (I'd also be open to discuss what it would take to make --release the default mode for certain targets, if that's a possibility)

Aaron1011 pushed a commit to Aaron1011/rust that referenced this pull request Jan 6, 2023
Make some trivial functions `#[inline(always)]`

This is some kind of follow-up of PRs like rust-lang#85218, rust-lang#84061, rust-lang#87150. Functions that do very basic operations are made `#[inline(always)]` to avoid pessimizing them in debug builds when compared to using built-in operations directly.
thomcc pushed a commit to tcdi/postgrestd that referenced this pull request Feb 10, 2023
Make integer-to-integer `From` impls `#[inline(always)]`

Splited from rust-lang/rust#105262
thomcc pushed a commit to tcdi/postgrestd that referenced this pull request May 31, 2023
…imulacrum

Make pointer `sub` and `wrapping_sub` methods `#[inline(always)]`

Splitted from rust-lang/rust#105262
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.