-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Use Ancestory to check default fn in const impl instead of comparing idents #89471
Conversation
r? @cjgillot (rust-highfive has picked a reviewer for you, use r? to override) |
Using Symbols completely ignores macro hygiene. In which extent can it be ignored? How does rustc_typeck check impls are complete? |
bdb99dd
to
7d4d536
Compare
I was under the impression that method names are not hygenic, but then I realized it not be true for macro 2.0. So a proper comparision would involve calling |
macro_rules! impl_tr { | ||
($ty: ty) => { | ||
impl const Tr for $ty { | ||
fn req(&self) {} | ||
fn prov(&self) {} | ||
} | ||
} | ||
} | ||
|
||
impl_tr!(u64); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you separate this into another ui test? Having passing code and failing code in the same file does not seem like a good idea to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is an impl const Tr for u8
above already, which is a passing test. Should I split that out as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. I don't know why I included that in the failing test at the time...
r? @fee1-dead |
@bors r+ |
📌 Commit 0a03f8c has been approved by |
Use Ancestory to check default fn in const impl instead of comparing idents Fixes https://rust-lang.zulipchat.com/#narrow/stream/146212-t-compiler.2Fconst-eval/topic/Const.20trait.20impl.20inside.20macro
…askrgr Rollup of 9 pull requests Successful merges: - rust-lang#89471 (Use Ancestory to check default fn in const impl instead of comparing idents) - rust-lang#89643 (Fix inherent impl overlap check.) - rust-lang#89651 (Add `Poll::ready` and revert stabilization of `task::ready!`) - rust-lang#89675 (Re-use TypeChecker instead of passing around some of its fields ) - rust-lang#89710 (Add long explanation for error E0482) - rust-lang#89756 (Greatly reduce amount of debuginfo compiled for bootstrap itself) - rust-lang#89760 (Remove hack ignoring unused attributes for stage 0 std) - rust-lang#89772 (Fix function-names test for GDB 10.1) - rust-lang#89785 (Fix ICE when compiling nightly std/rustc on beta compiler) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Fixes https://rust-lang.zulipchat.com/#narrow/stream/146212-t-compiler.2Fconst-eval/topic/Const.20trait.20impl.20inside.20macro