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

macro_rules: Less hacky heuristic for using tt metavariable spans #119204

Merged
merged 1 commit into from
Jan 4, 2024

Conversation

petrochenkov
Copy link
Contributor

See the big comment on fn maybe_use_metavar_location for a more detailed description.

@rustbot
Copy link
Collaborator

rustbot commented Dec 21, 2023

r? @WaffleLapkin

(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-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Dec 21, 2023
@petrochenkov
Copy link
Contributor Author

@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 21, 2023
@petrochenkov petrochenkov changed the title macro_rules: Less hacky heuristic for tt macro parameter spans macro_rules: Less hacky heuristic for using tt metavariable spans Dec 21, 2023
@bors
Copy link
Contributor

bors commented Dec 21, 2023

⌛ Trying commit a7e8629 with merge 682ee30...

bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 21, 2023
macro_rules: Less hacky heuristic for using `tt` metavariable spans

See the big comment on `fn maybe_use_metavar_location` for a more detailed description.
@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented Dec 22, 2023

☀️ Try build successful - checks-actions
Build commit: 682ee30 (682ee307de2eebc3b5a9034414c4df915e793e92)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (682ee30): 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)
- - 0
Regressions ❌
(secondary)
0.2% [0.2%, 0.2%] 1
Improvements ✅
(primary)
-0.2% [-0.3%, -0.1%] 9
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.2% [-0.3%, -0.1%] 9

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.3%, 1.6%] 2
Regressions ❌
(secondary)
1.9% [1.4%, 2.4%] 2
Improvements ✅
(primary)
-1.1% [-1.1%, -1.0%] 2
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.2% [-1.1%, 1.6%] 4

Cycles

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

Binary size

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.0% [0.0%, 0.0%] 3
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.1% [-0.1%, -0.1%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.0% [-0.1%, 0.0%] 4

Bootstrap: 674.232s -> 671.95s (-0.34%)
Artifact size: 312.80 MiB -> 312.74 MiB (-0.02%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Dec 22, 2023
@petrochenkov
Copy link
Contributor Author

@bors rollup=maybe

@WaffleLapkin
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Dec 28, 2023

📌 Commit 3530295 has been approved by WaffleLapkin

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 28, 2023
@bors
Copy link
Contributor

bors commented Dec 28, 2023

⌛ Testing commit 3530295 with merge c112817...

bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 28, 2023
macro_rules: Less hacky heuristic for using `tt` metavariable spans

See the big comment on `fn maybe_use_metavar_location` for a more detailed description.
@rust-log-analyzer

This comment has been minimized.

@bors

This comment was marked as resolved.

@petrochenkov petrochenkov added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Dec 28, 2023
@petrochenkov
Copy link
Contributor Author

petrochenkov commented Dec 29, 2023

Blocked on rust-lang/cargo#13218.
Blocked on cargo update (maybe #119485, maybe other).
@rustbot blocked

@rustbot rustbot added S-blocked Status: Blocked on something else such as an RFC or other implementation work. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Dec 29, 2023
bors added a commit to rust-lang/cargo that referenced this pull request Jan 1, 2024
Fix fix::fix_in_dependency to not rely on rustc

This changes the `fix::fix_in_dependency` test so that it does not rely on the behavior of rustc.

This test is checking the behavior when rustc includes a suggestion diagnostic that modifies a file in CARGO_HOME from a dependency. rustc should not be emitting suggestions that point outside of the current crate, but there are some known bugs where it does this. #9938 added a workaround for this to avoid writing to CARGO_HOME.

However, the current test was relying on one of those bugs in rustc to exhibit its behavior. rust-lang/rust#119204 is fixing that particular behavior. Instead of relying on issues in rustc, this PR changes the test so that the test creates a fake `rustc` executable that will emit a hard-coded JSON message that tells `cargo fix` to modify a file in CARGO_HOME. This should be stable as it is no longer relying on rustc.

Testing or validating this change is a little tricky. You have to essentially comment out [these three lines](https://github.com/rust-lang/cargo/blob/4f70d1781a2b2d3611087e1ee6e8096903c9b73a/src/cargo/ops/fix.rs#L654-L656) from the original #9938 change, and verify that the test fails (it says "Fixed" in the output). With those three lines in place, it should pass.
@petrochenkov petrochenkov mentioned this pull request Jan 2, 2024
@petrochenkov
Copy link
Contributor Author

@bors r=WaffleLapkin

@bors
Copy link
Contributor

bors commented Jan 4, 2024

📌 Commit 1761eab has been approved by WaffleLapkin

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-blocked Status: Blocked on something else such as an RFC or other implementation work. labels Jan 4, 2024
@rust-log-analyzer

This comment has been minimized.

@petrochenkov
Copy link
Contributor Author

@bors r=WaffleLapkin

@bors
Copy link
Contributor

bors commented Jan 4, 2024

📌 Commit e1d12c8 has been approved by WaffleLapkin

It is now in the queue for this repository.

compiler-errors added a commit to compiler-errors/rust that referenced this pull request Jan 4, 2024
macro_rules: Less hacky heuristic for using `tt` metavariable spans

See the big comment on `fn maybe_use_metavar_location` for a more detailed description.
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 4, 2024
…mpiler-errors

Rollup of 10 pull requests

Successful merges:

 - rust-lang#118521 (Enable address sanitizer for MSVC targets using INFERASANLIBS linker flag)
 - rust-lang#119026 (std::net::bind using -1 for openbsd which in turn sets it to somaxconn.)
 - rust-lang#119195 (Make named_asm_labels lint not trigger on unicode and trigger on format args)
 - rust-lang#119204 (macro_rules: Less hacky heuristic for using `tt` metavariable spans)
 - rust-lang#119362 (Make `derive(Trait)` suggestion more accurate)
 - rust-lang#119397 (Recover parentheses in range patterns)
 - rust-lang#119414 (bootstrap: Move -Clto= setting from Rustc::run to rustc_cargo)
 - rust-lang#119417 (Uplift some miscellaneous coroutine-specific machinery into `check_closure`)
 - rust-lang#119540 (Don't synthesize host effect args inside trait object types)
 - rust-lang#119555 (Add codegen test for RVO on MaybeUninit)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 4, 2024
…mpiler-errors

Rollup of 10 pull requests

Successful merges:

 - rust-lang#118521 (Enable address sanitizer for MSVC targets using INFERASANLIBS linker flag)
 - rust-lang#119026 (std::net::bind using -1 for openbsd which in turn sets it to somaxconn.)
 - rust-lang#119195 (Make named_asm_labels lint not trigger on unicode and trigger on format args)
 - rust-lang#119204 (macro_rules: Less hacky heuristic for using `tt` metavariable spans)
 - rust-lang#119362 (Make `derive(Trait)` suggestion more accurate)
 - rust-lang#119397 (Recover parentheses in range patterns)
 - rust-lang#119414 (bootstrap: Move -Clto= setting from Rustc::run to rustc_cargo)
 - rust-lang#119417 (Uplift some miscellaneous coroutine-specific machinery into `check_closure`)
 - rust-lang#119540 (Don't synthesize host effect args inside trait object types)
 - rust-lang#119555 (Add codegen test for RVO on MaybeUninit)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 4, 2024
…iaskrgr

Rollup of 10 pull requests

Successful merges:

 - rust-lang#118521 (Enable address sanitizer for MSVC targets using INFERASANLIBS linker flag)
 - rust-lang#119026 (std::net::bind using -1 for openbsd which in turn sets it to somaxconn.)
 - rust-lang#119195 (Make named_asm_labels lint not trigger on unicode and trigger on format args)
 - rust-lang#119204 (macro_rules: Less hacky heuristic for using `tt` metavariable spans)
 - rust-lang#119362 (Make `derive(Trait)` suggestion more accurate)
 - rust-lang#119397 (Recover parentheses in range patterns)
 - rust-lang#119417 (Uplift some miscellaneous coroutine-specific machinery into `check_closure`)
 - rust-lang#119539 (Fix typos)
 - rust-lang#119540 (Don't synthesize host effect args inside trait object types)
 - rust-lang#119555 (Add codegen test for RVO on MaybeUninit)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 4, 2024
…iaskrgr

Rollup of 10 pull requests

Successful merges:

 - rust-lang#118521 (Enable address sanitizer for MSVC targets using INFERASANLIBS linker flag)
 - rust-lang#119026 (std::net::bind using -1 for openbsd which in turn sets it to somaxconn.)
 - rust-lang#119195 (Make named_asm_labels lint not trigger on unicode and trigger on format args)
 - rust-lang#119204 (macro_rules: Less hacky heuristic for using `tt` metavariable spans)
 - rust-lang#119362 (Make `derive(Trait)` suggestion more accurate)
 - rust-lang#119397 (Recover parentheses in range patterns)
 - rust-lang#119417 (Uplift some miscellaneous coroutine-specific machinery into `check_closure`)
 - rust-lang#119539 (Fix typos)
 - rust-lang#119540 (Don't synthesize host effect args inside trait object types)
 - rust-lang#119555 (Add codegen test for RVO on MaybeUninit)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 4, 2024
…iaskrgr

Rollup of 10 pull requests

Successful merges:

 - rust-lang#118521 (Enable address sanitizer for MSVC targets using INFERASANLIBS linker flag)
 - rust-lang#119026 (std::net::bind using -1 for openbsd which in turn sets it to somaxconn.)
 - rust-lang#119195 (Make named_asm_labels lint not trigger on unicode and trigger on format args)
 - rust-lang#119204 (macro_rules: Less hacky heuristic for using `tt` metavariable spans)
 - rust-lang#119362 (Make `derive(Trait)` suggestion more accurate)
 - rust-lang#119397 (Recover parentheses in range patterns)
 - rust-lang#119417 (Uplift some miscellaneous coroutine-specific machinery into `check_closure`)
 - rust-lang#119539 (Fix typos)
 - rust-lang#119540 (Don't synthesize host effect args inside trait object types)
 - rust-lang#119555 (Add codegen test for RVO on MaybeUninit)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 3fb61ce into rust-lang:master Jan 4, 2024
11 checks passed
@rustbot rustbot added this to the 1.77.0 milestone Jan 4, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Jan 4, 2024
Rollup merge of rust-lang#119204 - petrochenkov:dialoc2, r=WaffleLapkin

macro_rules: Less hacky heuristic for using `tt` metavariable spans

See the big comment on `fn maybe_use_metavar_location` for a more detailed description.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
perf-regression Performance regression. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants