Skip to content

cpu/expand-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

2025-02-20

With nightly 2025-02-20, expand with --features's emits the expected #[cfg(feature = ... )] annotations:

[daniel@blanc:~/Code/Rust/expand-test]$ rustc --version
rustc 1.87.0-nightly (f04bbc60f 2025-02-20)

[daniel@blanc:~/Code/Rust/expand-test]$ cargo expand --features=turbo-mode
    Checking expand-test v0.1.0 (/home/daniel/Code/Rust/expand-test)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.02s

#![feature(prelude_import)]
#[prelude_import]
use std::prelude::rust_2024::*;
#[macro_use]
extern crate std;
pub fn add(left: u64, right: u64) -> u64 {
    left + right
}
#[cfg(feature = "turbo-mode")]
pub fn turbo_add(left: u64, right: u64) -> u64 {
    left + right
}

2025-04-11

With nightly 2025-04-11, expand with --features's emits no #[cfg(feature = ...)] annotations:

[nix-shell:~/Code/Rust/expand-test]$ rustc --version
rustc 1.88.0-nightly (d2b3dd7c1 2025-04-11)

[nix-shell:~/Code/Rust/expand-test]$ cargo expand --features=turbo-mode
    Checking expand-test v0.1.0 (/home/daniel/Code/Rust/expand-test)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.04s

#![feature(prelude_import)]
#[prelude_import]
use std::prelude::rust_2024::*;
#[macro_use]
extern crate std;
pub fn add(left: u64, right: u64) -> u64 {
    left + right
}
pub fn turbo_add(left: u64, right: u64) -> u64 {
    left + right
}

About

Demonstrating a difference in `cargo expand` handling of features between nightly versions

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages