Skip to content

Conversation

@brson
Copy link
Contributor

@brson brson commented Mar 31, 2014

No description provided.

brson added 2 commits March 30, 2014 19:14
When running `make install` we are touching these files that can't
then be removed later.
bors added a commit that referenced this pull request Mar 31, 2014
@bors bors closed this Mar 31, 2014
@bors bors merged commit cfb52a5 into rust-lang:master Mar 31, 2014
notriddle pushed a commit to notriddle/rust that referenced this pull request Sep 20, 2022
…cros, r=Veykril

Fix add reference action on macros.

Before we were using the range of the corresponding expression node in the macro expanded file, which is obviously incorrect as we are setting the text in the original source.

For some reason, the test I added is failing and I haven't found a way to fix it. Does anyone know why `check_fix` wouldn't work with macros? Getting this error:

```text
thread 'handlers::type_mismatch::tests::test_add_reference_to_macro_call' panicked at 'no diagnostics', crates/ide-diagnostics/src/handlers/type_mismatch.rs:317:9
```

closes rust-lang#13219
Jarcho pushed a commit to Jarcho/rust that referenced this pull request Aug 24, 2024
[`macro_metavars_in_unsafe`]: recognize metavariables in tail expressions

Fixes rust-lang#13219

`macro_metavars_in_unsafe` keeps track of the current "expansion depth" (incremented/decremented when entering/leaving a macro span) to tell if an expression from the root context is contained within a macro (see the doc comment I added for a hopefully better explanation)

Before this PR, we didn't increment said `expn_depth` for `unsafe` blocks within macros, because we already do that in `visit_stmt` anyway, so it would work fine for statements, but that's not enough for tail expressions of an unsafe block.

So we now also increment it for macro unsafe blocks.
Also updated the comment for `expn_depth` while I'm at it because "This is not necessary for correctness" isn't correct now that I think about it

------

changelog: none
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