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

Point to variable in asm! macro when failing borrowck #54945

Merged
merged 1 commit into from
Oct 13, 2018

Conversation

estebank
Copy link
Contributor

@estebank estebank commented Oct 9, 2018

Fix #34940.

@rust-highfive
Copy link
Collaborator

r? @petrochenkov

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

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 9, 2018
@@ -1812,6 +1812,7 @@ pub struct InlineAsmOutput {
pub constraint: Symbol,
pub is_rw: bool,
pub is_indirect: bool,
pub span: Span,
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like there's no need to keep span here additionally, output expressions are already preserved in hir::ExprKind::InlineAsm (the first HirVec<Expr>), so spans can be taken from there.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This addition is needed in https://github.com/rust-lang/rust/pull/54945/files#diff-5b4d01d26caf43976125ba0f877e78c0 (for the nll output) as we have StatementKind::InlineAsm available only. ExprKind::InlineAsm is accessible for ast-based borrow checker and there it is indeed using the expr.span (https://github.com/rust-lang/rust/pull/54945/files#diff-dc986596b3470440badc6fb1a667adca).

Copy link
Contributor

Choose a reason for hiding this comment

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

I see.

@petrochenkov petrochenkov 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 Oct 10, 2018
@petrochenkov
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Oct 10, 2018

📌 Commit 57f10c7 has been approved by petrochenkov

@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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Oct 10, 2018
pietroalbini added a commit to pietroalbini/rust that referenced this pull request Oct 10, 2018
Point to variable in `asm!` macro when failing borrowck

Fix rust-lang#34940.
@bors
Copy link
Contributor

bors commented Oct 13, 2018

⌛ Testing commit 57f10c7 with merge c47785f...

bors added a commit that referenced this pull request Oct 13, 2018
Point to variable in `asm!` macro when failing borrowck

Fix #34940.
@bors
Copy link
Contributor

bors commented Oct 13, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: petrochenkov
Pushing c47785f to master...

@bors bors merged commit 57f10c7 into rust-lang:master Oct 13, 2018
@estebank estebank deleted the asm-span branch November 9, 2023 05:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants