Skip to content

Allow to pass or propagate some RUSTFLAGS #283

@gui1117

Description

@gui1117

Due to:
https://github.com/dtolnay/trybuild/pull/278/files#diff-36dcce9bb960d87a9efde38a0309b8e3e552a4193594bb2065ced1e749c9b743R41
the latests version doesn't propagate the RUSTFLAGS anymore.

In our usecase we pass deny warnings using the RUSTFLAGS environment variable.

This is very handy to ensure no warnings ever gets emitted from our macros.

#[test]
fn tests() {
	std::env::set_var("RUSTFLAGS", "--deny warnings");
	let t = trybuild::TestCases::new();
	t.compile_fail("tests/*rs");
}

Is there a way to allow giving rustflags maybe with a new TRYBUILD_RUSTFLAGS or something?

If you approve the direction I can make a PR I struggled a bit, then not much time now

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions