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

invalid-module-declaration.rs test regression #53352

Closed
davidtwco opened this issue Aug 14, 2018 · 4 comments
Closed

invalid-module-declaration.rs test regression #53352

davidtwco opened this issue Aug 14, 2018 · 4 comments
Labels
A-diagnostics Area: Messages for errors, warnings, and lints

Comments

@davidtwco
Copy link
Member

As part of #53196, compile-fail tests were migrated to ui tests. In doing this, it was discovered that error patterns were not being applied to ui tests (#52531). invalid-module-declaration.rs is a test that regressed due to this and that regression was not noticed.

The error patterns previously on invalid-module-declaration.rs expected the following errors:

// error-pattern: cannot declare a new module at this location
// error-pattern: maybe move this module

In particular, these check for duplicate module declaration errors - which should arise as the auxiliary folder contains modules that have the same name as those being defined within the test code. However, these errors had not been occuring, and a lack of error pattern assertions meant this wasn't noticed.

At some point in a previous commit these did work, as evidenced by old .stderr files for this test. In #53196, the error pattern annotations were removed in order to get it passing so that PR could land.

@estebank estebank added the A-testsuite Area: The testsuite used to check the correctness of rustc label Aug 14, 2018
@RalfJung
Copy link
Member

RalfJung commented Aug 15, 2018

Seems like the error-pattern got originally added with #41501

Cc @GuillaumeGomez @jseyfried

@estebank Is "testsuite" the right label? This is not a bug in the testsuite, this is a regression in diagnostics that went unnoticed because of a (now fixed) bug in the test suite.

@estebank
Copy link
Contributor

@RalfJung fair point. I added it to "testsuite" because I understood that this ticket was taking the place of #52531, not filing a task to fix the regression.

@estebank estebank added A-diagnostics Area: Messages for errors, warnings, and lints and removed A-testsuite Area: The testsuite used to check the correctness of rustc labels Aug 15, 2018
@davidtwco
Copy link
Member Author

I've spent a little bit of time looking into this and I'm not convinced that it is a problem. It seems like the error got changed in #46531 but the error patterns weren't updated (because they weren't being checked and therefore weren't causing an error).

I think what this currently tests is correct and while there exists a branch of the code today that has the error expected by the patterns, I don't think it's possible to make that error happen (at least, I couldn't work out a way to).

@steveklabnik
Copy link
Member

It seems this issue is 100% irrelevant now; this test no longer has these declarations, and seems to be working as expected. Closing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints
Projects
None yet
Development

No branches or pull requests

4 participants