Skip to content

compiletest needs to check error code for compile-fail tests #938

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
brson opened this issue Sep 16, 2011 · 1 comment
Closed

compiletest needs to check error code for compile-fail tests #938

brson opened this issue Sep 16, 2011 · 1 comment
Assignees
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc

Comments

@brson
Copy link
Contributor

brson commented Sep 16, 2011

Like run-fail tests, we need to make sure the compiler not only fails, but fails correctly. Currently the following tests all fail by segfaulting:

    [compile-fail] ../src/test/compile-fail/break-outside-loop.rs
    [compile-fail] ../src/test/compile-fail/dup-link-name.rs
    [compile-fail] ../src/test/compile-fail/ext-nonexistent.rs
    [compile-fail] ../src/test/compile-fail/extenv-no-args.rs
    [compile-fail] ../src/test/compile-fail/extenv-not-string-literal.rs
    [compile-fail] ../src/test/compile-fail/extenv-too-many-args.rs
    [compile-fail] ../src/test/compile-fail/extfmt-missing-type.rs
    [compile-fail] ../src/test/compile-fail/extfmt-no-args.rs
    [compile-fail] ../src/test/compile-fail/extfmt-non-literal.rs
    [compile-fail] ../src/test/compile-fail/extfmt-non-literal2.rs
    [compile-fail] ../src/test/compile-fail/extfmt-not-enough-args.rs
    [compile-fail] ../src/test/compile-fail/extfmt-too-many-args.rs
    [compile-fail] ../src/test/compile-fail/extfmt-unknown-type.rs
    [compile-fail] ../src/test/compile-fail/extfmt-unsigned-plus.rs
    [compile-fail] ../src/test/compile-fail/extfmt-unsigned-space.rs
    [compile-fail] ../src/test/compile-fail/extfmt-unterminated-conv.rs
    [compile-fail] ../src/test/compile-fail/macro-2.rs
    [compile-fail] ../src/test/compile-fail/macro.rs
@ghost ghost assigned brson Sep 16, 2011
@brson brson closed this as completed in c42401e Sep 19, 2011
@brson brson reopened this Sep 19, 2011
@brson
Copy link
Contributor Author

brson commented Sep 19, 2011

Had to revert c42401e

@brson brson closed this as completed in facc7fd Sep 20, 2011
jdm pushed a commit to jdm/rust that referenced this issue Sep 21, 2011
bors pushed a commit to rust-lang-ci/rust that referenced this issue Oct 26, 2020
ZuseZ4 pushed a commit to EnzymeAD/rust that referenced this issue Mar 7, 2023
* Add inactive global

* Add custom inactive global specification
coastalwhite pushed a commit to coastalwhite/rust that referenced this issue Aug 5, 2023
)

The x86 code contains several macros that following this pattern:

```rust
macro_rules! expr {
    () => { true; }
}

fn bar(_val: bool) {}

fn main() {
    bar(expr!());
}
```

Here, we have a macro `expr!` that expands to tokens sequence with
a trailing semicolon.

Currently, the trailing semicolon is ignored when the macro is invoked
in expression position, due to rust-lang#33953
If this behavior is changed, then a large number of macro invocations in
`stdarch` will stop compiling.

Regardless of whether nor not this change is made, removing the
semicolon more clearly expresses the intent of the code - these macros
are designed to expand to the result of a function call, not ignore its
results (as the `;` would suggest).
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc
Projects
None yet
Development

No branches or pull requests

1 participant