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

[DO NOT MERGE] have tag be explicit debug_assert! argument #110888

Closed
wants to merge 1 commit into from

Conversation

krasimirgg
Copy link
Contributor

@krasimirgg krasimirgg commented Apr 27, 2023

No functional changes intended.

We've got a custom rustc build. After 2b8d27b we're seeing a new build error while building rustc_middle:

error: there is no argument named `tag`
    --> <rust>/compiler/rustc_middle/src/ty/mod.rs:1505:1
     |
1505 | / impl_tag! {
1506 | |     impl Tag for ParamTag;
1507 | |     ParamTag { reveal: traits::Reveal::UserFacing, constness: hir::Constness::NotConst },
1508 | |     ParamTag { reveal: traits::Reveal::All,        constness: hir::Constness::NotConst },
1509 | |     ParamTag { reveal: traits::Reveal::UserFacing, constness: hir::Constness::Const    },
1510 | |     ParamTag { reveal: traits::Reveal::All,        constness: hir::Constness::Const    },
1511 | | }
     | |_^
     |
     = note: did you intend to capture a variable `tag` from the surrounding scope?
     = note: to avoid ambiguity, `format_args!` cannot capture variables when the format string is expanded from a macro
     = note: this error originates in the macro `impl_tag` (in Nightly builds, run with -Z macro-backtrace for more info)

This patch fixes it. I'm not sure why this doesn't fire with x.py, hence the DO NOT MERGE. I suspect our custom build is a bit more strict than what x.py's. Maybe we're missing come rustc flags that silence this error?

No functional changes intended.

We've got a custom rustc build. After rust-lang@2b8d27b
we're seeing a new build error while building rustc_middle:
```
error: there is no argument named `tag`
    --> <rust>/compiler/rustc_middle/src/ty/mod.rs:1505:1
     |
1505 | / impl_tag! {
1506 | |     impl Tag for ParamTag;
1507 | |     ParamTag { reveal: traits::Reveal::UserFacing, constness: hir::Constness::NotConst },
1508 | |     ParamTag { reveal: traits::Reveal::All,        constness: hir::Constness::NotConst },
1509 | |     ParamTag { reveal: traits::Reveal::UserFacing, constness: hir::Constness::Const    },
1510 | |     ParamTag { reveal: traits::Reveal::All,        constness: hir::Constness::Const    },
1511 | | }
     | |_^
     |
     = note: did you intend to capture a variable `tag` from the surrounding scope?
     = note: to avoid ambiguity, `format_args!` cannot capture variables when the format string is expanded from a macro
     = note: this error originates in the macro `impl_tag` (in Nightly builds, run with -Z macro-backtrace for more info)
```

This patch fixes it. I'm not sure why this doesn't fire with x.py, hence
the DO NOT MERGE. Maybe we're missing come rustc flags that silence this
error?
@rustbot
Copy link
Collaborator

rustbot commented Apr 27, 2023

r? @petrochenkov

(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 Apr 27, 2023
@krasimirgg
Copy link
Contributor Author

r? @WaffleLapkin

@rustbot rustbot assigned WaffleLapkin and unassigned petrochenkov Apr 27, 2023
@krasimirgg
Copy link
Contributor Author

Hey @WaffleLapkin, could you please take a look and see if there's something suspicious about the new impl_tag behaviour? Do you know which rustc flags/features may be related to this kind of error?

@krasimirgg krasimirgg changed the title [DO NOT MERGE] have tag be explicit debug_args! argument [DO NOT MERGE] have tag be explicit debug_assert! argument Apr 27, 2023
@Noratrieb
Copy link
Member

uh, something is wrong with your bootstrap compiler.. this should compile just fine

@Noratrieb
Copy link
Member

the specific error may be related to #106505, a rustc bug I fixed recently. But there's something wrong with your build setup. How are you building the compiler and with what bootstrap compiler version? @krasimirgg

@krasimirgg
Copy link
Contributor Author

Thank you! I noticed I was using a different beta (bdd077d5d 2023-03-19) as the bootstrap compiler, suspect that's why.

@Noratrieb
Copy link
Member

That was probably it. Only the exact beta in src/stage0.json is supported.

@WaffleLapkin
Copy link
Member

@krasimirgg closing this, since this doesn't seem like a bug in the rust codebase, but rather a problem with invalid toolchain on your side. Feel free to reach out/reopen this PR in case you still have the problem.

@WaffleLapkin WaffleLapkin removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

5 participants