Skip to content

test: cross-edition metavar fragment specifiers - #129755

Merged
bors merged 3 commits into
rust-lang:masterfrom
vincenzopalazzo:macros/recursive-macros-between-edition
Sep 20, 2024
Merged

test: cross-edition metavar fragment specifiers#129755
bors merged 3 commits into
rust-lang:masterfrom
vincenzopalazzo:macros/recursive-macros-between-edition

Conversation

@vincenzopalazzo

@vincenzopalazzovincenzopalazzo commented Aug 29, 2024

Copy link
Copy Markdown
Member

There's a subtle interaction between macros with metavar expressions and the edition-dependent fragment matching behavior. This test illustrates the current behavior when using macro-generating-macros across crate boundaries with different editions.

See the original suggestion #123865 (comment)

Tracking:

@rustbot

Copy link
Copy Markdown
Collaborator

r? @chenyukang

rustbot has assigned @chenyukang.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbotrustbot 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 Aug 29, 2024
@eholkeholk added the I-lang-nominated Nominated for discussion during a lang team meeting. label Aug 29, 2024
@eholk

Copy link
Copy Markdown
Contributor

Nominating for T-lang to get a gut check on what the desired behavior is here.

@rust-log-analyzer

This comment has been minimized.

Comment threadtests/ui/macros/expr_2021_with_metavar_expr.rs Outdated
@compiler-errors

Copy link
Copy Markdown
Contributor

For the record, I believe that this is totally fine behavior. The span of the identifier that is used for the nonterminal should be the thing that determines the edition, since it's coming from the edition that's "instantiating" the edition. It's otherwise a somewhat arbitrary choice, though.

Comment threadtests/ui/macros/auxiliary/metavar_2021.rs Outdated
Comment threadtests/ui/macros/expr_2021_with_metavar_expr.rs Outdated
@traviscrosstraviscross added the T-lang Relevant to the language team label Aug 30, 2024
@compiler-errors

compiler-errors commented Aug 30, 2024

Copy link
Copy Markdown
Contributor

So regardless of how we want this to work, this is also how pat_param works, so unless there's a particularly compelling reason to diverge from that, I'd say let's keep it working how it works today, or change both.

(edit: I misread the behavior of the test)

@compiler-errors

Copy link
Copy Markdown
Contributor

errs note: I think I may have ended up changing my mind. We should consider whether we want to use the uninterpolated span of the nonterminal-kind's identifier. This would require fixing pat_param too, ideally. Given the rarity of the example that @traviscross gave though, it may be fine to fix both.

@eholk

Copy link
Copy Markdown
Contributor

Something I realized is that the current behavior leaks the edition of the crate defining the macro. In our example, if the metavar_2021 crate ever moved to edition 2024 then the result of is_expr_from_2024 would change. I think essentially this makes your crate's edition semver-relevant and that seems to be something we've avoided thus far.

I think we probably want to change the behavior in this test.

@traviscross

Copy link
Copy Markdown
Contributor

@rustbot labels -I-lang-nominated

We discussed this in the lang call today. We agreed that the span of the token used to fill in the fragment specifier should be used for deciding the behavior.

That is, if we have code like this in a Rust 2021 crate:

#[macro_export]macro_rules! make_matcher {($name:ident, $fragment_type:ident, $d:tt) => {
#[macro_export]
macro_rules! $name {($d _:$fragment_type) => {true};(const{0}) => {false};}};}make_matcher!(is_expr_from_2021, expr, $);

And code like this in a Rust 2024 crate:

make_matcher!(is_expr_from_2024, expr, $);

We would expect that is_expr_from_2024 would exhibit the Rust 2024 behavior.

We'd also like to fix this for pat, pending of course a crater run.

@rustbotrustbot removed the I-lang-nominated Nominated for discussion during a lang team meeting. label Sep 4, 2024
@vincenzopalazzo
vincenzopalazzoforce-pushed the macros/recursive-macros-between-edition branch from f861467 to e07b011CompareSeptember 8, 2024 14:54
@compiler-errors

Copy link
Copy Markdown
Contributor

@traviscross:

I actually don't think this is possible to implement, due to existing bugs (#85708). Namely, we have trouble determining the span of a nonterminal token (which is used to compute the edition) when there's extern crates involved.

I would prefer if we decouple fixing this bug (both expr_2021 and pat) given that this is essentially a theoretical regression, and go ahead with this behavior.

Re-lang-nominating to confirm this.

@rustbot label: -S-waiting-on-review +S-waiting-on-team +I-lang-nominated

@rustbotrustbot added I-lang-nominated Nominated for discussion during a lang team meeting. S-waiting-on-team and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 10, 2024
@eholk

Copy link
Copy Markdown
Contributor

I just pushed a change that adds coverage for pat too, since it's prone to this same issue.

@compiler-errors

compiler-errors commented Sep 17, 2024

Copy link
Copy Markdown
Contributor

While you're at it, can you squash that fixup! commit? git rebase -i --autosquash HEAD~3 should work.

vincenzopalazzoand others added 2 commits September 17, 2024 11:08
There's a subtle interaction between macros with metavar expressions and the
edition-dependent fragment matching behavior. This test illustrates the current
behavior when using macro-generating-macros across crate boundaries with
different editions.
Co-Authored-By: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
Co-Authored-By: Eric Holk <eric@theincredibleholk.org>
In 2021 pat was changed to recognize `|` at the top level, with
pat_param added to retain the old behavior. This means
pat is subject to the same cross-edition behavior as expr will be in
2024.
Co-authored-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
@eholk
eholkforce-pushed the macros/recursive-macros-between-edition branch from 1e3d482 to 7653811CompareSeptember 17, 2024 18:09
@eholk

Copy link
Copy Markdown
Contributor

While you're at it, can you squash that fixup! commit? git rebase -i --autosquash HEAD~3 should work.

Done!

@rust-log-analyzer

This comment has been minimized.

@traviscross

traviscross commented Sep 17, 2024

Copy link
Copy Markdown
Contributor

I filed #130484 so as to be able to separately address this later.

I'd suggest marking the test as:

//@ known-bug: #130484

@compiler-errors

Copy link
Copy Markdown
Contributor

T-lang decided in the meeting that it would be fine for this to remain an open bug to decouple fixing this from the edition. r=me after updating the issue to have //@ known-bug.

@eholk

Copy link
Copy Markdown
Contributor

@bors r=compiler-errors

@bors

bors commented Sep 18, 2024

Copy link
Copy Markdown
Collaborator

📌 Commit dd6460b has been approved by compiler-errors

It is now in the queue for this repository.

@borsbors 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-team labels Sep 18, 2024
workingjubilee added a commit to workingjubilee/rustc that referenced this pull request Sep 19, 2024
…acros-between-edition, r=compiler-errors
test: cross-edition metavar fragment specifiers
There's a subtle interaction between macros with metavar expressions and the edition-dependent fragment matching behavior. This test illustrates the current behavior when using macro-generating-macros across crate boundaries with different editions.
See the original suggestion rust-lang#123865 (comment)
Tracking:
- rust-lang#123742
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 19, 2024
…kingjubilee
Rollup of 3 pull requests
Successful merges:
- rust-lang#129755 (test: cross-edition metavar fragment specifiers)
- rust-lang#130511 (Support `char::encode_utf8` in const scenarios.)
- rust-lang#130531 (Check params for unsafety in THIR)
r? `@ghost`
`@rustbot` modify labels: rollup
@bors

bors commented Sep 19, 2024

Copy link
Copy Markdown
Collaborator

⌛ Testing commit dd6460b with merge 1049209...

bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 19, 2024
…ros-between-edition, r=compiler-errors
test: cross-edition metavar fragment specifiers
There's a subtle interaction between macros with metavar expressions and the edition-dependent fragment matching behavior. This test illustrates the current behavior when using macro-generating-macros across crate boundaries with different editions.
See the original suggestion rust-lang#123865 (comment)
Tracking:
- rust-lang#123742
@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

The job x86_64-gnu-llvm-19 failed! Check out the build log: (web)(plain)

Click to see the possible cause of the failure (guessed by this bot)
failures:
---- [codegen] tests/codegen/issues/issue-111508-vec-tryinto-array.rs stdout ----
error: verification with 'FileCheck' failed
status: exit status: 1
command: "/usr/lib/llvm-19/bin/FileCheck" "--input-file" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/codegen/issues/issue-111508-vec-tryinto-array/issue-111508-vec-tryinto-array.ll" "/checkout/tests/codegen/issues/issue-111508-vec-tryinto-array.rs" "--check-prefix=CHECK" "--check-prefix" "NONMSVC" "--allow-unused-prefixes" "--dump-input-context" "100"
--- stderr -------------------------------
/checkout/tests/codegen/issues/issue-111508-vec-tryinto-array.rs:12:15: error: CHECK-NOT: excluded string found in input
/checkout/tests/codegen/issues/issue-111508-vec-tryinto-array.rs:12:15: error: CHECK-NOT: excluded string found in input
// CHECK-NOT: unwrap_failed
^
/checkout/obj/build/x86_64-unknown-linux-gnu/test/codegen/issues/issue-111508-vec-tryinto-array/issue-111508-vec-tryinto-array.ll:162:24: note: found here
; invoke core::result::unwrap_failed
Input file: /checkout/obj/build/x86_64-unknown-linux-gnu/test/codegen/issues/issue-111508-vec-tryinto-array/issue-111508-vec-tryinto-array.ll
Check file: /checkout/tests/codegen/issues/issue-111508-vec-tryinto-array.rs
-dump-input=help explains the following input dump.
Input was:
<<<<<<
.
.
.
.
62: tail call void @__rust_dealloc(ptr noundef nonnull %self4.i.i.i.i3, i64 noundef %_5.i.i.i.i1, i64 noundef 1) #8, !noalias !24 63: br label %"_ZN4core3ptr53drop_in_place$LT$alloc..raw_vec..RawVec$LT$u8$GT$$GT$17h733058e54ec660efE.exit4" 64: 65: "_ZN4core3ptr53drop_in_place$LT$alloc..raw_vec..RawVec$LT$u8$GT$$GT$17h733058e54ec660efE.exit4": ; preds = %bb4, %"_ZN63_$LT$alloc..alloc..Global$u20$as$u20$core..alloc..Allocator$GT$10deallocate17h75ad4441689c67a8E.exit.i.i.i2" 66: ret void 67: } 68: 69: ; <alloc::vec::Vec<T,A> as core::fmt::Debug>::fmt 70: ; Function Attrs: nonlazybind uwtable 71: define internal noundef zeroext i1 @"_ZN65_$LT$alloc..vec..Vec$LT$T$C$A$GT$$u20$as$u20$core..fmt..Debug$GT$3fmt17hdc743e5a05c68fddE"(ptr noalias nocapture noundef readonly align 8 dereferenceable(24) %self, ptr noalias noundef align 8 dereferenceable(64) %f) unnamed_addr #0 personality ptr @rust_eh_personality { 72: start: 73: %entry.i.i = alloca [8 x i8], align 8 74: %_5.i = alloca [16 x i8], align 8 75: %self1 = load ptr, ptr %self, align 8, !nonnull !3, !noundef !3 76: %0 = getelementptr inbounds i8, ptr %self, i64 16 77: %len = load i64, ptr %0, align 8, !noundef !3 78: call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %_5.i), !noalias !25 79: ; call core::fmt::Formatter::debug_list 80: call void @_ZN4core3fmt9Formatter10debug_list17hc731f7a2283f6562E(ptr noalias nocapture noundef nonnull sret([16 x i8]) align 8 dereferenceable(16) %_5.i, ptr noalias noundef nonnull align 8 dereferenceable(64) %f), !noalias !29 81: %_11.i = getelementptr inbounds i8, ptr %self1, i64 %len 82: %1 = icmp eq i64 %len, 0 83: br i1 %1, label %"_ZN48_$LT$$u5b$T$u5d$$u20$as$u20$core..fmt..Debug$GT$3fmt17h38223f730ec7eab1E.exit", label %bb5.i.i 84: 85: bb5.i.i: ; preds = %start, %bb5.i.i 86: %iter.sroa.0.06.i.i = phi ptr [ %_24.i.i.i, %bb5.i.i ], [ %self1, %start ] 87: %_24.i.i.i = getelementptr inbounds i8, ptr %iter.sroa.0.06.i.i, i64 1 88: call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %entry.i.i), !noalias !30 89: store ptr %iter.sroa.0.06.i.i, ptr %entry.i.i, align 8, !noalias !30 90: ; call core::fmt::builders::DebugList::entry 91: %_9.i.i = call noundef align 8 dereferenceable(16) ptr @_ZN4core3fmt8builders9DebugList5entry17hc04a3b47eba44643E(ptr noalias noundef nonnull align 8 dereferenceable(16) %_5.i, ptr noundef nonnull align 1 %entry.i.i, ptr noalias noundef nonnull readonly align 8 dereferenceable(32) @vtable.0) 92: call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %entry.i.i), !noalias !30 93: %2 = icmp eq ptr %_24.i.i.i, %_11.i 94: br i1 %2, label %"_ZN48_$LT$$u5b$T$u5d$$u20$as$u20$core..fmt..Debug$GT$3fmt17h38223f730ec7eab1E.exit", label %bb5.i.i 95: 96: "_ZN48_$LT$$u5b$T$u5d$$u20$as$u20$core..fmt..Debug$GT$3fmt17h38223f730ec7eab1E.exit": ; preds = %bb5.i.i, %start 97: ; call core::fmt::builders::DebugList::finish 98: %_0.i = call noundef zeroext i1 @_ZN4core3fmt8builders9DebugList6finish17h4ea41cceed03d9a2E(ptr noalias noundef nonnull align 8 dereferenceable(16) %_5.i) 99: call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %_5.i), !noalias !25 100: ret i1 %_0.i 101: } 102: 103: ; Function Attrs: nonlazybind uwtable 104: define noundef i8 @example(ptr noalias nocapture noundef readonly align 8 dereferenceable(24) %a) unnamed_addr #0 personality ptr @rust_eh_personality { 105: start: 106: %e.i = alloca [24 x i8], align 8 107: %_5.sroa.5 = alloca [16 x i8], align 8 108: %0 = getelementptr inbounds i8, ptr %a, i64 16 109: %_2 = load i64, ptr %0, align 8, !noundef !3 110: %1 = icmp eq i64 %_2, 32 111: br i1 %1, label %bb2, label %bb1 112: 113: bb2: ; preds = %start 114: call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %_5.sroa.5) 115: %_5.sroa.0.0.copyload = load ptr, ptr %a, align 8 116: %_5.sroa.5.0.a.sroa_idx = getelementptr inbounds i8, ptr %a, i64 8 117: call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %_5.sroa.5, ptr noundef nonnull align 8 dereferenceable(16) %_5.sroa.5.0.a.sroa_idx, i64 16, i1 false) 118: tail call void @llvm.experimental.noalias.scope.decl(metadata !33) 119: tail call void @llvm.experimental.noalias.scope.decl(metadata !36) 120: %_5.sroa.5.8.sroa_idx = getelementptr inbounds i8, ptr %_5.sroa.5, i64 8 121: %_5.sroa.5.8._5.sroa.5.8._5.sroa.5.8._5.sroa.5.16._3.i = load i64, ptr %_5.sroa.5.8.sroa_idx, align 8 122: %_2.not.i = icmp eq i64 %_5.sroa.5.8._5.sroa.5.8._5.sroa.5.8._5.sroa.5.16._3.i, 32 123: br i1 %_2.not.i, label %bb6.i, label %bb2.i 124: 125: bb6.i: ; preds = %bb2 126: %2 = icmp ne ptr %_5.sroa.0.0.copyload, null 127: tail call void @llvm.assume(i1 %2) 128: %_4.sroa.9.1.self.i.sroa_idx = getelementptr inbounds i8, ptr %_5.sroa.0.0.copyload, i64 15 129: %_4.sroa.9.1.copyload = load i8, ptr %_4.sroa.9.1.self.i.sroa_idx, align 1, !noalias !36 130: %_4.sroa.11.1.self.i.sroa_idx = getelementptr inbounds i8, ptr %_5.sroa.0.0.copyload, i64 24 131: %_4.sroa.11.1.copyload = load i8, ptr %_4.sroa.11.1.self.i.sroa_idx, align 1, !noalias !36 132: tail call void @llvm.experimental.noalias.scope.decl(metadata !38) 133: tail call void @llvm.experimental.noalias.scope.decl(metadata !41) 134: tail call void @llvm.experimental.noalias.scope.decl(metadata !44) 135: tail call void @llvm.experimental.noalias.scope.decl(metadata !47) 136: %_5.sroa.5.0._5.sroa.5.0._5.sroa.5.0._5.sroa.5.8._5.i.i.i.i1.i.i = load i64, ptr %_5.sroa.5, align 8, !alias.scope !50, !noalias !53 137: %3 = icmp eq i64 %_5.sroa.5.0._5.sroa.5.0._5.sroa.5.0._5.sroa.5.8._5.i.i.i.i1.i.i, 0 138: br i1 %3, label %"_ZN4core6result19Result$LT$T$C$E$GT$6unwrap17h35f66af9f8950efaE.exit", label %"_ZN63_$LT$alloc..alloc..Global$u20$as$u20$core..alloc..Allocator$GT$10deallocate17h75ad4441689c67a8E.exit.i.i.i2.i.i" 139: 140: "_ZN63_$LT$alloc..alloc..Global$u20$as$u20$core..alloc..Allocator$GT$10deallocate17h75ad4441689c67a8E.exit.i.i.i2.i.i": ; preds = %bb6.i 141: tail call void @__rust_dealloc(ptr noundef nonnull %_5.sroa.0.0.copyload, i64 noundef %_5.sroa.5.0._5.sroa.5.0._5.sroa.5.0._5.sroa.5.8._5.i.i.i.i1.i.i, i64 noundef 1) #8, !noalias !55 142: br label %"_ZN4core6result19Result$LT$T$C$E$GT$6unwrap17h35f66af9f8950efaE.exit" 143: 144: bb2.i: ; preds = %bb2 145: %4 = lshr i64 %_5.sroa.5.8._5.sroa.5.8._5.sroa.5.8._5.sroa.5.16._3.i, 8 146: %5 = trunc i64 %4 to i8 147: %_5.sroa.5.0._5.sroa.5.0._5.sroa.5.0._5.sroa.5.8._4.sroa.9.8.copyload8 = load i8, ptr %_5.sroa.5, align 8, !alias.scope !56 148: %_5.sroa.5.1.sroa_idx = getelementptr inbounds i8, ptr %_5.sroa.5, i64 1 149: %_5.sroa.5.1._5.sroa.5.1._5.sroa.5.1._5.sroa.5.9._4.sroa.10.8.copyload9 = load i64, ptr %_5.sroa.5.1.sroa_idx, align 1, !alias.scope !56 150: %6 = getelementptr inbounds i8, ptr %a, i64 18 151: call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %_5.sroa.5) 152: call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %e.i), !noalias !57 153: store ptr %_5.sroa.0.0.copyload, ptr %e.i, align 8, !noalias !61 154: %_4.sroa.9.8.e.i.sroa_idx = getelementptr inbounds i8, ptr %e.i, i64 8 155: store i8 %_5.sroa.5.0._5.sroa.5.0._5.sroa.5.0._5.sroa.5.8._4.sroa.9.8.copyload8, ptr %_4.sroa.9.8.e.i.sroa_idx, align 8, !noalias !61 156: %_4.sroa.10.8.e.i.sroa_idx = getelementptr inbounds i8, ptr %e.i, i64 9 157: store i64 %_5.sroa.5.1._5.sroa.5.1._5.sroa.5.1._5.sroa.5.9._4.sroa.10.8.copyload9, ptr %_4.sroa.10.8.e.i.sroa_idx, align 1, !noalias !61 158: %_4.sroa.11.8.e.i.sroa_idx = getelementptr inbounds i8, ptr %e.i, i64 17 159: store i8 %5, ptr %_4.sroa.11.8.e.i.sroa_idx, align 1, !noalias !61 160: %_4.sroa.12.8.e.i.sroa_idx = getelementptr inbounds i8, ptr %e.i, i64 18 161: call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 2 dereferenceable(6) %_4.sroa.12.8.e.i.sroa_idx, ptr noundef nonnull align 2 dereferenceable(6) %6, i64 6, i1 false) 162: ; invoke core::result::unwrap_failed not:12 !~~~~~~~~~~~~ error: no match expected
163: invoke void @_ZN4core6result13unwrap_failed17h46b0af729c930890E(ptr noalias noundef nonnull readonly align 1 @alloc_00ae4b301f7fab8ac9617c03fcbd7274, i64 noundef 43, ptr noundef nonnull align 1 %e.i, ptr noalias noundef nonnull readonly align 8 dereferenceable(32) @vtable.1, ptr noalias noundef nonnull readonly align 8 dereferenceable(24) @alloc_ed8bfa62ecc2b9e2af0bced4759850cb) #9 164: to label %unreachable.i unwind label %cleanup.i, !noalias !57 165: 166: cleanup.i: ; preds = %bb2.i 167: %7 = landingpad { ptr, i32 } 168: cleanup 169: call void @llvm.experimental.noalias.scope.decl(metadata !62) 170: call void @llvm.experimental.noalias.scope.decl(metadata !65), !noalias !57 171: call void @llvm.experimental.noalias.scope.decl(metadata !68), !noalias !57 172: call void @llvm.experimental.noalias.scope.decl(metadata !71), !noalias !57 173: %_5.i.i.i.i1.i = load i64, ptr %_4.sroa.9.8.e.i.sroa_idx, align 8, !alias.scope !74, !noalias !77 174: %8 = icmp eq i64 %_5.i.i.i.i1.i, 0 175: br i1 %8, label %bb5.i, label %"_ZN63_$LT$alloc..alloc..Global$u20$as$u20$core..alloc..Allocator$GT$10deallocate17h75ad4441689c67a8E.exit.i.i.i2.i" 176: 177: "_ZN63_$LT$alloc..alloc..Global$u20$as$u20$core..alloc..Allocator$GT$10deallocate17h75ad4441689c67a8E.exit.i.i.i2.i": ; preds = %cleanup.i 178: %self4.i.i.i.i3.i = load ptr, ptr %e.i, align 8, !alias.scope !74, !noalias !77, !nonnull !3, !noundef !3 179: call void @__rust_dealloc(ptr noundef nonnull %self4.i.i.i.i3.i, i64 noundef %_5.i.i.i.i1.i, i64 noundef 1) #8, !noalias !79 180: br label %bb5.i 181: 182: unreachable.i: ; preds = %bb2.i 183: unreachable 184: 185: bb5.i: ; preds = %"_ZN63_$LT$alloc..alloc..Global$u20$as$u20$core..alloc..Allocator$GT$10deallocate17h75ad4441689c67a8E.exit.i.i.i2.i", %cleanup.i 186: resume { ptr, i32 } %7 187: 188: "_ZN4core6result19Result$LT$T$C$E$GT$6unwrap17h35f66af9f8950efaE.exit": ; preds = %bb6.i, %"_ZN63_$LT$alloc..alloc..Global$u20$as$u20$core..alloc..Allocator$GT$10deallocate17h75ad4441689c67a8E.exit.i.i.i2.i.i" 189: call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %_5.sroa.5) 190: %9 = add i8 %_4.sroa.11.1.copyload, %_4.sroa.9.1.copyload 191: br label %bb4 192: 193: bb1: ; preds = %start 194: tail call void @llvm.experimental.noalias.scope.decl(metadata !80) 195: tail call void @llvm.experimental.noalias.scope.decl(metadata !83) 196: tail call void @llvm.experimental.noalias.scope.decl(metadata !86) 197: tail call void @llvm.experimental.noalias.scope.decl(metadata !89) 198: %10 = getelementptr inbounds i8, ptr %a, i64 8 199: %_5.i.i.i.i1.i2 = load i64, ptr %10, align 8, !alias.scope !92, !noalias !95 200: %11 = icmp eq i64 %_5.i.i.i.i1.i2, 0 201: br i1 %11, label %bb4, label %"_ZN63_$LT$alloc..alloc..Global$u20$as$u20$core..alloc..Allocator$GT$10deallocate17h75ad4441689c67a8E.exit.i.i.i2.i3" 202: 203: "_ZN63_$LT$alloc..alloc..Global$u20$as$u20$core..alloc..Allocator$GT$10deallocate17h75ad4441689c67a8E.exit.i.i.i2.i3": ; preds = %bb1 204: %self4.i.i.i.i3.i4 = load ptr, ptr %a, align 8, !alias.scope !92, !noalias !95, !nonnull !3, !noundef !3 205: tail call void @__rust_dealloc(ptr noundef nonnull %self4.i.i.i.i3.i4, i64 noundef %_5.i.i.i.i1.i2, i64 noundef 1) #8, !noalias !97 206: br label %bb4 207: 208: bb4: ; preds = %"_ZN63_$LT$alloc..alloc..Global$u20$as$u20$core..alloc..Allocator$GT$10deallocate17h75ad4441689c67a8E.exit.i.i.i2.i3", %bb1, %"_ZN4core6result19Result$LT$T$C$E$GT$6unwrap17h35f66af9f8950efaE.exit" 209: %_0.sroa.0.0 = phi i8 [ %9, %"_ZN4core6result19Result$LT$T$C$E$GT$6unwrap17h35f66af9f8950efaE.exit" ], [ 0, %bb1 ], [ 0, %"_ZN63_$LT$alloc..alloc..Global$u20$as$u20$core..alloc..Allocator$GT$10deallocate17h75ad4441689c67a8E.exit.i.i.i2.i3" ] 210: ret i8 %_0.sroa.0.0 211: } 213: ; core::fmt::Formatter::debug_list 213: ; core::fmt::Formatter::debug_list 214: ; Function Attrs: nonlazybind uwtable 215: declare void @_ZN4core3fmt9Formatter10debug_list17hc731f7a2283f6562E(ptr dead_on_unwind noalias nocapture noundef writable sret([16 x i8]) align 8 dereferenceable(16), ptr noalias noundef align 8 dereferenceable(64)) unnamed_addr #0 217: ; core::fmt::builders::DebugList::finish 217: ; core::fmt::builders::DebugList::finish 218: ; Function Attrs: nonlazybind uwtable 219: declare noundef zeroext i1 @_ZN4core3fmt8builders9DebugList6finish17h4ea41cceed03d9a2E(ptr noalias noundef align 8 dereferenceable(16)) unnamed_addr #0 220: 221: ; core::fmt::num::imp::<impl core::fmt::Display for u8>::fmt 222: ; Function Attrs: nonlazybind uwtable 223: declare noundef zeroext i1 @"_ZN4core3fmt3num3imp51_$LT$impl$u20$core..fmt..Display$u20$for$u20$u8$GT$3fmt17h6e755fdbacee79d5E"(ptr noalias noundef readonly align 1 dereferenceable(1), ptr noalias noundef align 8 dereferenceable(64)) unnamed_addr #0 224: 225: ; core::fmt::num::<impl core::fmt::UpperHex for u8>::fmt 226: ; Function Attrs: nonlazybind uwtable 227: declare noundef zeroext i1 @"_ZN4core3fmt3num52_$LT$impl$u20$core..fmt..UpperHex$u20$for$u20$u8$GT$3fmt17hbf2723374375ecdcE"(ptr noalias noundef readonly align 1 dereferenceable(1), ptr noalias noundef align 8 dereferenceable(64)) unnamed_addr #0 228: 229: ; core::fmt::num::<impl core::fmt::LowerHex for u8>::fmt 230: ; Function Attrs: nonlazybind uwtable 231: declare noundef zeroext i1 @"_ZN4core3fmt3num52_$LT$impl$u20$core..fmt..LowerHex$u20$for$u20$u8$GT$3fmt17hbb0cf069135568f3E"(ptr noalias noundef readonly align 1 dereferenceable(1), ptr noalias noundef align 8 dereferenceable(64)) unnamed_addr #0 232: 233: ; Function Attrs: nounwind nonlazybind uwtable 234: declare noundef range(i32 0, 10) i32 @rust_eh_personality(i32 noundef, i32 noundef range(i32 1, 17), i64 noundef, ptr noundef, ptr noundef) unnamed_addr #1 236: ; core::fmt::builders::DebugList::entry 236: ; core::fmt::builders::DebugList::entry 237: ; Function Attrs: nonlazybind uwtable 238: declare noundef align 8 dereferenceable(16) ptr @_ZN4core3fmt8builders9DebugList5entry17hc04a3b47eba44643E(ptr noalias noundef align 8 dereferenceable(16), ptr noundef nonnull align 1, ptr noalias noundef readonly align 8 dereferenceable(32)) unnamed_addr #0 239: 240: ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) 241: declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2 243: ; core::result::unwrap_failed 243: ; core::result::unwrap_failed 244: ; Function Attrs: cold noinline noreturn nonlazybind uwtable 245: declare void @_ZN4core6result13unwrap_failed17h46b0af729c930890E(ptr noalias noundef nonnull readonly align 1, i64 noundef, ptr noundef nonnull align 1, ptr noalias noundef readonly align 8 dereferenceable(32), ptr noalias noundef readonly align 8 dereferenceable(24)) unnamed_addr #3 246: 247: ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) 248: declare void @llvm.assume(i1 noundef) #4 249: 250: ; Function Attrs: nounwind nonlazybind allockind("free") uwtable 251: declare void @__rust_dealloc(ptr allocptr noundef, i64 noundef, i64 noundef) unnamed_addr #5 252: 253: ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) 254: declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #6 255: 256: ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) 257: declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #6 258: 259: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: readwrite) 260: declare void @llvm.experimental.noalias.scope.decl(metadata) #7 261: 262: attributes #0 = { nonlazybind uwtable "probe-stack"="inline-asm" "target-cpu"="x86-64" } .
.
>>>>>>
------------------------------------------

@bors

bors commented Sep 19, 2024

Copy link
Copy Markdown
Collaborator

💔 Test failed - checks-actions

@borsbors 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 Sep 19, 2024
@compiler-errors

Copy link
Copy Markdown
Contributor

@bors retry

@borsbors 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 Sep 20, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 20, 2024
…llaumeGomez
Rollup of 6 pull requests
Successful merges:
- rust-lang#129542 (Add regression test for rust-lang#129541)
- rust-lang#129755 (test: cross-edition metavar fragment specifiers)
- rust-lang#130566 (Break up compiletest `runtest.rs` into smaller helper modules)
- rust-lang#130585 (Add tidy check for rustdoc templates to ensure the whitespace characters are all stripped)
- rust-lang#130605 (Fix feature name in test)
- rust-lang#130607 ([Clippy] Remove final std paths for diagnostic item)
r? `@ghost`
`@rustbot` modify labels: rollup
@bors
bors merged commit 9cbb1cb into rust-lang:masterSep 20, 2024
@rustbotrustbot added this to the 1.83.0 milestone Sep 20, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Sep 20, 2024
Rollup merge of rust-lang#129755 - vincenzopalazzo:macros/recursive-macros-between-edition, r=compiler-errors
test: cross-edition metavar fragment specifiers
There's a subtle interaction between macros with metavar expressions and the edition-dependent fragment matching behavior. This test illustrates the current behavior when using macro-generating-macros across crate boundaries with different editions.
See the original suggestion rust-lang#123865 (comment)
Tracking:
- rust-lang#123742
@vincenzopalazzo
vincenzopalazzo deleted the macros/recursive-macros-between-edition branch September 23, 2024 01:55
@apirainoapiraino removed the I-lang-nominated Nominated for discussion during a lang team meeting. label Apr 10, 2025
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.T-langRelevant to the language team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants

@vincenzopalazzo@rustbot@eholk@rust-log-analyzer@compiler-errors@traviscross@bors@chenyukang@apiraino