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

by-value self arguments are not described properly in debug info #10549

Closed
michaelwoerister opened this issue Nov 18, 2013 · 0 comments · Fixed by #11033
Closed

by-value self arguments are not described properly in debug info #10549

michaelwoerister opened this issue Nov 18, 2013 · 0 comments · Fixed by #11033
Labels
A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.)

Comments

@michaelwoerister
Copy link
Member

See comment at: https://github.com/mozilla/rust/blob/3d1f3f4de087ccf7e30b795fbd73e054b4761c4f/src/librustc/middle/trans/debuginfo.rs#L423

The llvm.dbg.declare intrinsic used to describe local variables and arguments always expects an alloca as argument. For by-value self arguments, this is not always the case. See trans::base::copy_args_to_allocas(): https://github.com/mozilla/rust/blob/c0b7972f7d63e4b55098797cb48949b00d3ffee7/src/librustc/middle/trans/base.rs#L1785

For other kinds of arguments, the value is always copied out into local allocas when debug info is enabled. Something like this has should be done for by-value self arguments too.

@bors bors closed this as completed in 5ece092 Dec 18, 2013
flip1995 pushed a commit to flip1995/rust that referenced this issue Apr 7, 2023
fix `single_component_path_imports` FP on `self::<import>::..`

fixes rust-lang#10549

I noticed that a couple functions in the file I was working on took `cx` as a parameter but didn't use them, so I removed that. Can revert if desired because it isn't related to my changes.

changelog: [`single_component_path_imports`] don't suggest removing import when it is used as `self::<import>::..`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant