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

Compiletest is not passing #110

Closed
dtolnay opened this issue Aug 2, 2018 · 3 comments
Closed

Compiletest is not passing #110

dtolnay opened this issue Aug 2, 2018 · 3 comments

Comments

@dtolnay
Copy link
Member

dtolnay commented Aug 2, 2018

One of our compile-fail test cases is no longer failing to compile.

$ cd compiletest
$ cargo clean
$ cargo update
$ cargo test

test [compile-fail] compile-fail/static_never_used.rs ... FAILED

failures:

---- [compile-fail] compile-fail/static_never_used.rs stdout ----


------stdout------------------------------

------stderr------------------------------

------------------------------------------

error: compile-fail test compiled successfully!
@KodrAus
Copy link
Contributor

KodrAus commented Aug 3, 2018

Hmm, looks like there are some changes to how warnings are surfaced in external macros in a recent nightly? As an example, in a quick local test I've got a binary main that depends on a library lib. Both define a macro containing dead code, but only the local macro actually raises a warning:

// lib/lib.rs

#[macro_export]
macro_rules! lib_make_unused {
    () => { static LIB_UNUSED: () = (); }
}
// main/main.rs

#[macro_use]
extern crate lib;

macro_rules! make_unused {
    () => { static UNUSED: () = (); }
}

lib_make_unused! {}
make_unused! {}

fn main() { }

Which on my (fairly recent) nightly rustc 1.29.0-nightly (97085f9fb 2018-08-01) results in:

warning: static item is never used: `UNUSED`
 --> src/main.rs:5:13
  |
5 |     () => { static UNUSED: () = (); }
  |             ^^^^^^^^^^^^^^^^^^^^^^^
...
9 | make_unused! {}
  | --------------- in this macro invocation

@KodrAus
Copy link
Contributor

KodrAus commented Aug 5, 2018

I'm wondering if it's really worth keeping this compile test since it's only dealing with a warn-by-default lint anyway.

@KodrAus
Copy link
Contributor

KodrAus commented Aug 9, 2018

Ok I've gone ahead and removed this test so folks have a green build to work with, but thought we could leave this issue open until we decide whether we want to find a way to restore the previous behaviour.

@KodrAus KodrAus closed this as completed Sep 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants