Add the -Zcrate-attr=foo unstable rustc option by emilyalbini · Pull Request #52355 · rust-lang/rust

eddyb

bors added a commit that referenced this pull request

Jul 19, 2018
Add the -Zfeature=foo unstable rustc option

This PR adds a new unstable option to `rustc`: `-Zfeature=foo`. The option can be used to enable nightly features from the CLI, and it's meant to be used by tools like Crater to try enabling features without changing the crate's source code.

The exact reason I need this is to implement "edition runs" in Crater: we need to add the preview feature flag to every crate, and editing the crates' source code on the fly might produce unexpected results, while a compiler flag is more reliable. Obviously this won't be stabilized in the future.

cc rust-lang/crater#282 @Mark-Simulacrum

@emilyalbini emilyalbini changed the title Add the -Zfeature=foo unstable rustc option Add the -Zcrate-attr=foo unstable rustc option

Jul 27, 2018

@emilyalbini

bors added a commit that referenced this pull request

Jul 28, 2018
Add the -Zcrate-attr=foo unstable rustc option

This PR adds a new unstable option to `rustc`: `-Zcrate-attr=foo`. The option can be used to inject crate-level attributes from the CLI, and it's meant to be used by tools like Crater that needs to add their own attributes to a crate without changing the source code.

The exact reason I need this is to implement "edition runs" in Crater: we need to add the preview feature flag to every crate, and editing the crates' source code on the fly might produce unexpected results, while a compiler flag is more reliable.

cc rust-lang/crater#282 @Mark-Simulacrum

@bors bors added the S-waiting-on-bors

Status: Waiting on bors to run and complete tests. Bors will change the label on completion.

label

Jul 28, 2018

bors added a commit that referenced this pull request

Jul 28, 2018
Add the -Zcrate-attr=foo unstable rustc option

This PR adds a new unstable option to `rustc`: `-Zcrate-attr=foo`. The option can be used to inject crate-level attributes from the CLI, and it's meant to be used by tools like Crater that needs to add their own attributes to a crate without changing the source code.

The exact reason I need this is to implement "edition runs" in Crater: we need to add the preview feature flag to every crate, and editing the crates' source code on the fly might produce unexpected results, while a compiler flag is more reliable.

cc rust-lang/crater#282 @Mark-Simulacrum

@ojeda ojeda mentioned this pull request

Jan 20, 2022

48 tasks

@jieyouxu jieyouxu added -Zcrate-attr

Unstable option: -Zcrate-attr

T-compiler

Relevant to the compiler team, which will review and decide on the PR/issue.

A-CLI

Area: Command-line interface (CLI) to the compiler

A-attributes

Area: Attributes (`#[…]`, `#![…]`)

labels

Mar 16, 2025

@epage epage mentioned this pull request

Mar 17, 2025