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

Nonexisting macro is silently accepted in trait definition block #40845

Closed
bluss opened this issue Mar 26, 2017 · 1 comment
Closed

Nonexisting macro is silently accepted in trait definition block #40845

bluss opened this issue Mar 26, 2017 · 1 comment
Assignees
Labels
A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) regression-from-stable-to-beta Performance or correctness regression from stable to beta. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@bluss
Copy link
Member

bluss commented Mar 26, 2017

This compiles successfully on beta and nightly, but it should be an error.

trait Trait {
    wut!{ }
}

fn main() {
}

(playground link)

Actual Result:

The program compiles successfully.

Expected Result:

Compilation error (Rust 1.16 does this correctly)

rustc 1.16.0 (30cf806ef 2017-03-10)
error: macro undefined: 'wut!'
@bluss bluss added the regression-from-stable-to-beta Performance or correctness regression from stable to beta. label Mar 26, 2017
@sfackler sfackler added A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Mar 26, 2017
@jseyfried jseyfried self-assigned this Mar 27, 2017
@jseyfried
Copy link
Contributor

Fixed in #40849.

alexcrichton added a commit to alexcrichton/rust that referenced this issue Mar 27, 2017
…lutions, r=nrc

bugfix: finalize resolutions of macros in trait positions

Fixes rust-lang#40845.
r? @nrc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) regression-from-stable-to-beta Performance or correctness regression from stable to beta. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants