-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Removal of NtTy
resulted in regression
#138975
Comments
cc @nnethercote |
It's late here, so I'll look at this closely tomorrow. But I will note an interesting thing from the crater run for #124141: there were several failures in the following form:
And the example involves a cross-crate boundary and a nested declarative macro, so it very much fits this pattern. In other words, it's possible that the code shouldn't have been compiling in its current form. |
My hunch from yesterday was correct: this is invalid code that the old compiler (pre-#133436) should not have accepted, and the new compiler (post-#133436) is now correctly rejecting it. Details below. I reproduced the behaviour. I didn't use the run-make test, I just created two crates If I combine macro_rules! define_call_with_type {
// if you replace `ty` with `tt` here, it compiles with the latest nightly
($ty: ty) => {
macro_rules! call_with_type {
($m:ident) => { $m! { $ty } }
}
};
}
define_call_with_type!(u64);
macro_rules! type_matcher {
(u64) => { u64 };
}
fn main() {
let _x: call_with_type!(type_matcher) = 42;
} then both the old compiler and the new compiler give the same error (modulo some very slight wording changes in the error message). I believe this is the correct behaviour here, and likewise giving an error when the code is split across two crates is also the correct behaviour. In other words, this code is invalid, the old compiler was incorrectly accepting it when it was split across two crates due to a bug in the handling of declarative macros across crate boundaries, and #133436 fixed the bug. This matches the handful of other failures seen in the crater run. (I don't know why async-usercalls didn't show up as a failure in that crater run.) So I think there is nothing to be done on the compiler side, and the appropriate course of action is to fix the problem in async-usercalls. As the error message explains, changing the |
We encountered an issue that starting with nightly-2025-02-23, the
async-usercalls
crate fails to compile. We managed to come up with a minimal working run-make test, and found that the issue was introduced by commit76b04437be91069260c72a6d59d130a4e127a9a8
as part of #133436.Code
See this branch for a run-make test. Starting from
nightly-2025-02-23
this fails with:The text was updated successfully, but these errors were encountered: