repo
stringlengths
6
65
file_url
stringlengths
81
311
file_path
stringlengths
6
227
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 15:31:58
2026-01-04 20:25:31
truncated
bool
2 classes
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rustfmt/tests/target/imports/imports_granularity_default-with-dups.rs
src/tools/rustfmt/tests/target/imports/imports_granularity_default-with-dups.rs
use crate::lexer; use crate::lexer; use crate::lexer::tokens::TokenData; use crate::lexer::tokens::TokenData; use crate::lexer::{self}; use crate::lexer::{self, tokens::TokenData};
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rustfmt/tests/target/imports/imports_granularity_item-with-dups.rs
src/tools/rustfmt/tests/target/imports/imports_granularity_item-with-dups.rs
// rustfmt-imports_granularity: Item use crate::lexer; use crate::lexer::tokens::TokenData; use crate::lexer::{self};
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rustfmt/tests/target/imports/imports_granularity_module.rs
src/tools/rustfmt/tests/target/imports/imports_granularity_module.rs
// rustfmt-imports_granularity: Module use a::b::c; use a::d::e; use a::f; use a::g::{h, i}; use a::j::k::{self, l}; use a::j::{self, m}; use a::n::o::p; use a::n::q; pub use a::r::s; pub use a::t; use b::c::d; use b::{self}; use foo::e; #[cfg(test)] use foo::{a::b, c::d}; use bar::{ // comment a::b, // ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rustfmt/tests/target/issue-5157/indented_itemized_markdown_blockquote.rs
src/tools/rustfmt/tests/target/issue-5157/indented_itemized_markdown_blockquote.rs
// rustfmt-wrap_comments: true /// > For each sample received, the middleware internally maintains a /// > sample_state relative to each DataReader. The sample_state can /// > either be READ or NOT_READ. fn block_quote() {}
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rustfmt/tests/target/issue-5157/support_itemized_markdown_blockquote.rs
src/tools/rustfmt/tests/target/issue-5157/support_itemized_markdown_blockquote.rs
// rustfmt-wrap_comments: true /// > For each sample received, the middleware internally maintains a /// > sample_state relative to each DataReader. The sample_state can either be /// > READ or NOT_READ. fn block_quote() {}
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rustfmt/tests/target/issue-5157/nested_itemized_markdown_blockquote.rs
src/tools/rustfmt/tests/target/issue-5157/nested_itemized_markdown_blockquote.rs
// rustfmt-wrap_comments: true /// > For each sample received, the middleware internally maintains a /// > sample_state relative to each DataReader. The sample_state can either be /// > READ or NOT_READ. /// /// > > For each sample received, the middleware internally maintains a /// > > sample_state relative to each D...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rustfmt/tests/target/issue-4926/struct_with_many_fields.rs
src/tools/rustfmt/tests/target/issue-4926/struct_with_many_fields.rs
// rustfmt-struct_field_align_threshold: 30 struct X { a: i32, b: i32, c: i32, d: i32, e: i32, f: i32, g: i32, h: i32, i: i32, j: i32, k: i32, } fn test(x: X) { let y = matches!( x, X { a: 1_000, b: 1_000, c: 1_000, ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rustfmt/tests/target/issue-4926/deeply_nested_struct_with_long_field_names.rs
src/tools/rustfmt/tests/target/issue-4926/deeply_nested_struct_with_long_field_names.rs
// rustfmt-struct_field_align_threshold: 30 struct X { really_really_long_field_a: i32, really_really_really_long_field_b: i32, really_really_really_really_long_field_c: i32, really_really_really_really_really_long_field_d: i32, really_really_really_really_really_really_long_field_e: i32, f: i3...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rustfmt/tests/target/issue-4926/enum_struct_field.rs
src/tools/rustfmt/tests/target/issue-4926/enum_struct_field.rs
// rustfmt-struct_field_align_threshold: 30 // rustfmt-enum_discrim_align_threshold: 30 // rustfmt-imports_layout: HorizontalVertical #[derive(Default)] struct InnerStructA { bbbbbbbbb: i32, cccccccc: i32, } enum SomeEnumNamedD { E(InnerStructA), F { ggggggggggggggggggggggggg: bool, h...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rustfmt/tests/target/issue-4926/minimum_example.rs
src/tools/rustfmt/tests/target/issue-4926/minimum_example.rs
// rustfmt-struct_field_align_threshold: 30 struct X { a: i32, b: i32, } fn test(x: X) { let y = matches!(x, X { a: 1, .. }); }
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rustfmt/tests/target/issue-4926/deeply_nested_struct.rs
src/tools/rustfmt/tests/target/issue-4926/deeply_nested_struct.rs
// rustfmt-struct_field_align_threshold: 30 struct X { a: i32, b: i32, c: i32, } fn test(x: X) { let d = { let e = { let f = { let g = { let h = { let i = { let j = { ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rustfmt/tests/target/issue-4926/deeply_nested_struct_with_many_fields.rs
src/tools/rustfmt/tests/target/issue-4926/deeply_nested_struct_with_many_fields.rs
// rustfmt-struct_field_align_threshold: 30 struct X { a: i32, b: i32, c: i32, d: i32, e: i32, f: i32, g: i32, h: i32, i: i32, j: i32, k: i32, } fn test(x: X) { let d = { let e = { let f = { let g = { let h = { ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rustfmt/tests/target/issue-4926/struct_with_long_field_names.rs
src/tools/rustfmt/tests/target/issue-4926/struct_with_long_field_names.rs
// rustfmt-struct_field_align_threshold: 30 struct X { really_really_long_field_a: i32, really_really_really_long_field_b: i32, really_really_really_really_long_field_c: i32, really_really_really_really_really_long_field_d: i32, really_really_really_really_really_really_long_field_e: i32, f: i3...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rustfmt/tests/target/issue-5012/trailing_comma_always.rs
src/tools/rustfmt/tests/target/issue-5012/trailing_comma_always.rs
// rustfmt-trailing_comma: Always pub struct Matrix<T, const R: usize, const C: usize,> where [T; R * C]:, { contents: [T; R * C], }
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rustfmt/tests/target/issue-5012/trailing_comma_never.rs
src/tools/rustfmt/tests/target/issue-5012/trailing_comma_never.rs
// rustfmt-trailing_comma: Never pub struct Matrix<T, const R: usize, const C: usize> where [T; R * C]: { contents: [T; R * C] }
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rustfmt/tests/target/issue-3434/not_skip_macro.rs
src/tools/rustfmt/tests/target/issue-3434/not_skip_macro.rs
#[this::is::not::skip::macros(ouch)] fn main() { let macro_result1 = ouch! { <div> this should be mangled</div> } .to_string(); }
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rustfmt/tests/target/issue-3434/lib.rs
src/tools/rustfmt/tests/target/issue-3434/lib.rs
#![rustfmt::skip::macros(skip_macro_mod)] mod no_entry; #[rustfmt::skip::macros(html, skip_macro)] fn main() { let macro_result1 = html! { <div> this should be skipped</div> } .to_string(); let macro_result2 = not_skip_macro! { <div> this should be mangled</div> } .to_string(); ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rustfmt/tests/target/issue-3434/no_entry.rs
src/tools/rustfmt/tests/target/issue-3434/no_entry.rs
#[rustfmt::skip::macros(another_macro)] fn foo() { another_macro!( This should be skipped. ); } fn bar() { skip_macro_mod!( This should be skipped. ); } fn baz() { let macro_result1 = no_skip_macro! { <div> this should be mangled</div> } .to_string(); }
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rustfmt/tests/target/cfg_if/lib.rs
src/tools/rustfmt/tests/target/cfg_if/lib.rs
//! Run-time feature detection for the Rust standard library. //! //! To detect whether a feature is enabled in the system running the binary //! use one of the appropriate macro for the target: //! //! * `x86` and `x86_64`: [`is_x86_feature_detected`] //! * `arm`: [`is_arm_feature_detected`] //! * `aarch64`: [`is_aarc...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rustfmt/tests/target/cfg_if/mod.rs
src/tools/rustfmt/tests/target/cfg_if/mod.rs
//! `std_detect` #[doc(hidden)] // unstable implementation detail #[unstable(feature = "stdsimd", issue = "27731")] pub mod detect;
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rustfmt/tests/target/cfg_if/detect/bit.rs
src/tools/rustfmt/tests/target/cfg_if/detect/bit.rs
//! Bit manipulation utilities. /// Tests the `bit` of `x`. #[allow(dead_code)] #[inline] pub(crate) fn test(x: usize, bit: u32) -> bool { debug_assert!(bit < 32, "bit index out-of-bounds"); x & (1 << bit) != 0 }
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rustfmt/tests/target/cfg_if/detect/error_macros.rs
src/tools/rustfmt/tests/target/cfg_if/detect/error_macros.rs
//! The `is_{target_arch}_feature_detected!` macro are only available on their //! architecture. These macros provide a better error messages when the user //! attempts to call them in a different architecture. /// Prevents compilation if `is_x86_feature_detected` is used somewhere /// else than `x86` and `x86_64` tar...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rustfmt/tests/target/cfg_if/detect/mod.rs
src/tools/rustfmt/tests/target/cfg_if/detect/mod.rs
//! This module implements run-time feature detection. //! //! The `is_{arch}_feature_detected!("feature-name")` macros take the name of a //! feature as a string-literal, and return a boolean indicating whether the //! feature is enabled at run-time or not. //! //! These macros do two things: //! * map the string-lite...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rustfmt/tests/target/cfg_if/detect/cache.rs
src/tools/rustfmt/tests/target/cfg_if/detect/cache.rs
//! Caches run-time feature detection so that it only needs to be computed //! once. #![allow(dead_code)] // not used on all platforms use crate::sync::atomic::Ordering; #[cfg(target_pointer_width = "64")] use crate::sync::atomic::AtomicU64; #[cfg(target_pointer_width = "32")] use crate::sync::atomic::AtomicU32; /...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rustfmt/tests/target/cfg_if/detect/arch/x86.rs
src/tools/rustfmt/tests/target/cfg_if/detect/arch/x86.rs
//! This module implements minimal run-time feature detection for x86. //! //! The features are detected using the `detect_features` function below. //! This function uses the CPUID instruction to read the feature flags from the //! CPU and encodes them in a `usize` where each bit position represents //! whether a feat...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rustfmt/tests/target/cfg_if/detect/arch/arm.rs
src/tools/rustfmt/tests/target/cfg_if/detect/arch/arm.rs
//! Run-time feature detection on ARM Aarch32. /// Checks if `arm` feature is enabled. #[macro_export] #[unstable(feature = "stdsimd", issue = "27731")] #[allow_internal_unstable(stdsimd_internal, stdsimd)] macro_rules! is_arm_feature_detected { ("neon") => { cfg!(target_feature = "neon") || $crate::detect...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rustfmt/tests/target/cfg_if/detect/arch/mips.rs
src/tools/rustfmt/tests/target/cfg_if/detect/arch/mips.rs
//! Run-time feature detection on MIPS. /// Checks if `mips` feature is enabled. #[macro_export] #[unstable(feature = "stdsimd", issue = "27731")] #[allow_internal_unstable(stdsimd_internal, stdsimd)] macro_rules! is_mips_feature_detected { ("msa") => { cfg!(target_feature = "msa") || $crate::detect::check...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rustfmt/tests/target/cfg_if/detect/arch/mips64.rs
src/tools/rustfmt/tests/target/cfg_if/detect/arch/mips64.rs
//! Run-time feature detection on MIPS64. /// Checks if `mips64` feature is enabled. #[macro_export] #[unstable(feature = "stdsimd", issue = "27731")] #[allow_internal_unstable(stdsimd_internal, stdsimd)] macro_rules! is_mips64_feature_detected { ("msa") => { cfg!(target_feature = "msa") || $crate::detect:...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rustfmt/tests/target/cfg_if/detect/arch/powerpc.rs
src/tools/rustfmt/tests/target/cfg_if/detect/arch/powerpc.rs
//! Run-time feature detection on PowerPC. /// Checks if `powerpc` feature is enabled. #[macro_export] #[unstable(feature = "stdsimd", issue = "27731")] #[allow_internal_unstable(stdsimd_internal, stdsimd)] macro_rules! is_powerpc_feature_detected { ("altivec") => { cfg!(target_feature = "altivec") ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rustfmt/tests/target/cfg_if/detect/arch/aarch64.rs
src/tools/rustfmt/tests/target/cfg_if/detect/arch/aarch64.rs
//! Aarch64 run-time features. /// Checks if `aarch64` feature is enabled. #[macro_export] #[unstable(feature = "stdsimd", issue = "27731")] #[allow_internal_unstable(stdsimd_internal, stdsimd)] macro_rules! is_aarch64_feature_detected { ("neon") => { // FIXME: this should be removed once we rename Aarch64...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rustfmt/tests/target/cfg_if/detect/arch/powerpc64.rs
src/tools/rustfmt/tests/target/cfg_if/detect/arch/powerpc64.rs
//! Run-time feature detection on PowerPC64. /// Checks if `powerpc64` feature is enabled. #[macro_export] #[unstable(feature = "stdsimd", issue = "27731")] #[allow_internal_unstable(stdsimd_internal, stdsimd)] macro_rules! is_powerpc64_feature_detected { ("altivec") => { cfg!(target_feature = "altivec") ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rustfmt/tests/target/cfg_if/detect/os/x86.rs
src/tools/rustfmt/tests/target/cfg_if/detect/os/x86.rs
//! x86 run-time feature detection is OS independent. #[cfg(target_arch = "x86")] use crate::arch::x86::*; #[cfg(target_arch = "x86_64")] use crate::arch::x86_64::*; use crate::mem; use crate::detect::{bit, cache, Feature}; /// Performs run-time feature detection. #[inline] pub fn check_for(x: Feature) -> bool { ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rustfmt/tests/target/cfg_if/detect/os/other.rs
src/tools/rustfmt/tests/target/cfg_if/detect/os/other.rs
//! Other operating systems use crate::detect::Feature; /// Performs run-time feature detection. #[inline] pub fn check_for(_x: Feature) -> bool { false }
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rustfmt/tests/target/cfg_if/detect/os/aarch64.rs
src/tools/rustfmt/tests/target/cfg_if/detect/os/aarch64.rs
//! Run-time feature detection for Aarch64 on any OS that emulates the mrs instruction. //! //! On FreeBSD >= 12.0, Linux >= 4.11 and other operating systems, it is possible to use //! privileged system registers from userspace to check CPU feature support. //! //! AArch64 system registers ID_AA64ISAR0_EL1, ID_AA64PFR0...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rustfmt/tests/target/cfg_if/detect/os/linux/arm.rs
src/tools/rustfmt/tests/target/cfg_if/detect/os/linux/arm.rs
//! Run-time feature detection for ARM on Linux. use super::{auxvec, cpuinfo}; use crate::detect::{bit, cache, Feature}; /// Performs run-time feature detection. #[inline] pub fn check_for(x: Feature) -> bool { cache::test(x as u32, detect_features) } /// Try to read the features from the auxiliary vector, and i...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rustfmt/tests/target/cfg_if/detect/os/linux/mips.rs
src/tools/rustfmt/tests/target/cfg_if/detect/os/linux/mips.rs
//! Run-time feature detection for MIPS on Linux. use super::auxvec; use crate::detect::{bit, cache, Feature}; /// Performs run-time feature detection. #[inline] pub fn check_for(x: Feature) -> bool { cache::test(x as u32, detect_features) } /// Try to read the features from the auxiliary vector, and if that fai...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rustfmt/tests/target/cfg_if/detect/os/linux/cpuinfo.rs
src/tools/rustfmt/tests/target/cfg_if/detect/os/linux/cpuinfo.rs
//! Parses /proc/cpuinfo #![cfg_attr(not(target_arch = "arm"), allow(dead_code))] extern crate std; use self::std::{fs::File, io, io::Read, prelude::v1::*}; /// cpuinfo pub(crate) struct CpuInfo { raw: String, } impl CpuInfo { /// Reads /proc/cpuinfo into CpuInfo. pub(crate) fn new() -> Result<Self, io::...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rustfmt/tests/target/cfg_if/detect/os/linux/mod.rs
src/tools/rustfmt/tests/target/cfg_if/detect/os/linux/mod.rs
//! Run-time feature detection on Linux mod auxvec; #[cfg(feature = "std_detect_file_io")] mod cpuinfo; cfg_if! { if #[cfg(target_arch = "aarch64")] { mod aarch64; pub use self::aarch64::check_for; } else if #[cfg(target_arch = "arm")] { mod arm; pub use self::arm::check_for; ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rustfmt/tests/target/cfg_if/detect/os/linux/powerpc.rs
src/tools/rustfmt/tests/target/cfg_if/detect/os/linux/powerpc.rs
//! Run-time feature detection for PowerPC on Linux. use super::{auxvec, cpuinfo}; use crate::detect::{cache, Feature}; /// Performs run-time feature detection. #[inline] pub fn check_for(x: Feature) -> bool { cache::test(x as u32, detect_features) } /// Try to read the features from the auxiliary vector, and if...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rustfmt/tests/target/cfg_if/detect/os/linux/aarch64.rs
src/tools/rustfmt/tests/target/cfg_if/detect/os/linux/aarch64.rs
//! Run-time feature detection for Aarch64 on Linux. use super::{auxvec, cpuinfo}; use crate::detect::{bit, cache, Feature}; /// Performs run-time feature detection. #[inline] pub fn check_for(x: Feature) -> bool { cache::test(x as u32, detect_features) } /// Try to read the features from the auxiliary vector, a...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rustfmt/tests/target/cfg_if/detect/os/linux/auxvec.rs
src/tools/rustfmt/tests/target/cfg_if/detect/os/linux/auxvec.rs
//! Parses ELF auxiliary vectors. #![cfg_attr(not(target_arch = "aarch64"), allow(dead_code))] #[cfg(feature = "std_detect_file_io")] use crate::{fs::File, io::Read}; /// Key to access the CPU Hardware capabilities bitfield. pub(crate) const AT_HWCAP: usize = 16; /// Key to access the CPU Hardware capabilities 2 bitf...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rustfmt/tests/target/cfg_if/detect/os/freebsd/arm.rs
src/tools/rustfmt/tests/target/cfg_if/detect/os/freebsd/arm.rs
//! Run-time feature detection for ARM on FreeBSD use super::auxvec; use crate::detect::{cache, Feature}; /// Performs run-time feature detection. #[inline] pub fn check_for(x: Feature) -> bool { cache::test(x as u32, detect_features) } /// Try to read the features from the auxiliary vector fn detect_features() ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rustfmt/tests/target/cfg_if/detect/os/freebsd/mod.rs
src/tools/rustfmt/tests/target/cfg_if/detect/os/freebsd/mod.rs
//! Run-time feature detection on FreeBSD mod auxvec; cfg_if! { if #[cfg(target_arch = "aarch64")] { mod aarch64; pub use self::aarch64::check_for; } else if #[cfg(target_arch = "arm")] { mod arm; pub use self::arm::check_for; } else if #[cfg(target_arch = "powerpc64")] { ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rustfmt/tests/target/cfg_if/detect/os/freebsd/powerpc.rs
src/tools/rustfmt/tests/target/cfg_if/detect/os/freebsd/powerpc.rs
//! Run-time feature detection for PowerPC on FreeBSD. use super::auxvec; use crate::detect::{cache, Feature}; /// Performs run-time feature detection. #[inline] pub fn check_for(x: Feature) -> bool { cache::test(x as u32, detect_features) } fn detect_features() -> cache::Initializer { let mut value = cache:...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rustfmt/tests/target/cfg_if/detect/os/freebsd/aarch64.rs
src/tools/rustfmt/tests/target/cfg_if/detect/os/freebsd/aarch64.rs
//! Run-time feature detection for Aarch64 on FreeBSD. use super::super::aarch64::detect_features; use crate::detect::{cache, Feature}; /// Performs run-time feature detection. #[inline] pub fn check_for(x: Feature) -> bool { cache::test(x as u32, detect_features) } #[cfg(test)] mod tests { #[test] fn du...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rustfmt/tests/target/cfg_if/detect/os/freebsd/auxvec.rs
src/tools/rustfmt/tests/target/cfg_if/detect/os/freebsd/auxvec.rs
//! Parses ELF auxiliary vectors. #![cfg_attr(any(target_arch = "arm", target_arch = "powerpc64"), allow(dead_code))] /// Key to access the CPU Hardware capabilities bitfield. pub(crate) const AT_HWCAP: usize = 25; /// Key to access the CPU Hardware capabilities 2 bitfield. pub(crate) const AT_HWCAP2: usize = 26; ///...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rustfmt/tests/target/issue-3227/one.rs
src/tools/rustfmt/tests/target/issue-3227/one.rs
// rustfmt-style_edition: 2015 fn main() { thread::spawn(|| { while true { println!("iteration"); } }); thread::spawn(|| loop { println!("iteration"); }); }
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rustfmt/tests/target/issue-3227/two.rs
src/tools/rustfmt/tests/target/issue-3227/two.rs
// rustfmt-style_edition: 2024 fn main() { thread::spawn(|| { while true { println!("iteration"); } }); thread::spawn(|| { loop { println!("iteration"); } }); }
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rustfmt/tests/target/binop-separator-back/bitwise.rs
src/tools/rustfmt/tests/target/binop-separator-back/bitwise.rs
// rustfmt-binop_separator: Back fn main() { let value = abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ ^ abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ; let value = abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ & abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ; le...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rustfmt/tests/target/binop-separator-back/range.rs
src/tools/rustfmt/tests/target/binop-separator-back/range.rs
// rustfmt-binop_separator: Back fn main() { let value = abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ.. abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ; let value = abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ..= abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ; }
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rustfmt/tests/target/binop-separator-back/math.rs
src/tools/rustfmt/tests/target/binop-separator-back/math.rs
// rustfmt-binop_separator: Back fn main() { let value = abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ + abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ + abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ + abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ + abcdef...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rustfmt/tests/target/binop-separator-back/patterns.rs
src/tools/rustfmt/tests/target/binop-separator-back/patterns.rs
// rustfmt-binop_separator: Back fn main() { match val { ThisIsA::ReallyLongPatternNameToHelpOverflowTheNextValueOntoTheNextLine | ThisIsA::SecondValueSeparatedByAPipe | ThisIsA::ThirdValueSeparatedByAPipe => { // } } }
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rustfmt/tests/target/binop-separator-back/logic.rs
src/tools/rustfmt/tests/target/binop-separator-back/logic.rs
// rustfmt-binop_separator: Back fn main() { if abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ && abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ || abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ { // } }
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rustfmt/tests/target/binop-separator-back/comp.rs
src/tools/rustfmt/tests/target/binop-separator-back/comp.rs
// rustfmt-binop_separator: Back fn main() { if abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ < abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ { // } if abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ <= abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rustfmt/tests/writemode/source/stdin.rs
src/tools/rustfmt/tests/writemode/source/stdin.rs
fn some( ) { } fn main () {}
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rustfmt/tests/writemode/source/modified.rs
src/tools/rustfmt/tests/writemode/source/modified.rs
// rustfmt-write_mode: modified // Test "modified" output fn blah () { } #[cfg ( a , b )] fn main() {}
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rustfmt/tests/writemode/source/json.rs
src/tools/rustfmt/tests/writemode/source/json.rs
// rustfmt-fn_single_line: true // rustfmt-emit_mode: json // Test single-line functions. fn foo_expr() { 1 } fn foo_stmt() { foo(); } fn foo_decl_local() { let z = 5; } fn foo_decl_item(x: &mut i32) { x = 3; } fn empty() { } fn foo_return() -> String { "yay" } fn foo_where() -...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rustfmt/tests/writemode/source/fn-single-line.rs
src/tools/rustfmt/tests/writemode/source/fn-single-line.rs
// rustfmt-fn_single_line: true // rustfmt-emit_mode: checkstyle // Test single-line functions. fn foo_expr() { 1 } fn foo_stmt() { foo(); } fn foo_decl_local() { let z = 5; } fn foo_decl_item(x: &mut i32) { x = 3; } fn empty() { } fn foo_return() -> String { "yay" } fn foo_whe...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rustfmt/tests/parser/stashed-diag2.rs
src/tools/rustfmt/tests/parser/stashed-diag2.rs
trait Trait<'1> { s> {} fn main() {}
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rustfmt/tests/parser/issue_4418.rs
src/tools/rustfmt/tests/parser/issue_4418.rs
}
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rustfmt/tests/parser/stashed-diag.rs
src/tools/rustfmt/tests/parser/stashed-diag.rs
#![u={static N;}] fn main() {}
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rustfmt/tests/parser/unclosed-delims/issue_4466.rs
src/tools/rustfmt/tests/parser/unclosed-delims/issue_4466.rs
fn main() { if true { println!("answer: {}", a_func(); } else { println!("don't think so."); } } fn a_func() -> i32 { 42 }
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rustfmt/tests/parser/issue-4126/lib.rs
src/tools/rustfmt/tests/parser/issue-4126/lib.rs
mod invalid;
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rustfmt/tests/parser/issue-4126/invalid.rs
src/tools/rustfmt/tests/parser/issue-4126/invalid.rs
fn foo() { if bar && if !baz { next_is_none = Some(true); } println!("foo"); }
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rustfmt/config_proc_macro/src/item_enum.rs
src/tools/rustfmt/config_proc_macro/src/item_enum.rs
use proc_macro2::TokenStream; use quote::{quote, quote_spanned}; use syn::spanned::Spanned; use crate::attrs::*; use crate::utils::*; type Variants = syn::punctuated::Punctuated<syn::Variant, syn::Token![,]>; /// Defines and implements `config_type` enum. pub fn define_config_type_on_enum(em: &syn::ItemEnum) -> syn:...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rustfmt/config_proc_macro/src/config_type.rs
src/tools/rustfmt/config_proc_macro/src/config_type.rs
use proc_macro2::TokenStream; use crate::item_enum::define_config_type_on_enum; use crate::item_struct::define_config_type_on_struct; /// Defines `config_type` on enum or struct. // FIXME: Implement this on struct. pub fn define_config_type(input: &syn::Item) -> TokenStream { match input { syn::Item::Stru...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rustfmt/config_proc_macro/src/attrs.rs
src/tools/rustfmt/config_proc_macro/src/attrs.rs
//! This module provides utilities for handling attributes on variants //! of `config_type` enum. Currently there are the following attributes //! that could appear on the variants of `config_type` enum: //! //! - `doc_hint`: name-value pair whose value is string literal //! - `value`: name-value pair whose value is st...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rustfmt/config_proc_macro/src/lib.rs
src/tools/rustfmt/config_proc_macro/src/lib.rs
//! This crate provides a derive macro for `ConfigType`. #![recursion_limit = "256"] mod attrs; mod config_type; mod item_enum; mod item_struct; mod utils; use std::str::FromStr; use proc_macro::TokenStream; use syn::parse_macro_input; #[proc_macro_attribute] pub fn config_type(_args: TokenStream, input: TokenStre...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rustfmt/config_proc_macro/src/item_struct.rs
src/tools/rustfmt/config_proc_macro/src/item_struct.rs
use proc_macro2::TokenStream; pub fn define_config_type_on_struct(_st: &syn::ItemStruct) -> syn::Result<TokenStream> { unimplemented!() }
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rustfmt/config_proc_macro/src/utils.rs
src/tools/rustfmt/config_proc_macro/src/utils.rs
use proc_macro2::TokenStream; use quote::{ToTokens, quote}; pub fn fold_quote<F, I, T>(input: impl Iterator<Item = I>, f: F) -> TokenStream where F: Fn(I) -> T, T: ToTokens, { input.fold(quote! {}, |acc, x| { let y = f(x); quote! { #acc #y } }) } pub fn is_unit(v: &syn::Variant) -> boo...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rustfmt/config_proc_macro/tests/smoke.rs
src/tools/rustfmt/config_proc_macro/tests/smoke.rs
pub mod config { pub trait ConfigType: Sized { fn doc_hint() -> String; fn stable_variant(&self) -> bool; } } #[allow(dead_code)] #[allow(unused_imports)] mod tests { use rustfmt_config_proc_macro::config_type; #[config_type] enum Bar { Foo, Bar, #[doc_hint ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/opt-dist/src/environment.rs
src/tools/opt-dist/src/environment.rs
use camino::Utf8PathBuf; use derive_builder::Builder; #[derive(Builder)] pub struct Environment { host_tuple: String, python_binary: String, /// The rustc checkout, where the compiler source is located. checkout_dir: Utf8PathBuf, /// The main directory where the build occurs. Stage0 rustc and cargo...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/opt-dist/src/tests.rs
src/tools/opt-dist/src/tests.rs
use std::path::Path; use anyhow::Context; use camino::{Utf8Path, Utf8PathBuf}; use crate::environment::{Environment, executable_extension}; use crate::exec::cmd; use crate::utils::io::{copy_directory, find_file_in_dir, unpack_archive}; /// Run tests on optimized dist artifacts. pub fn run_tests(env: &Environment) ->...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/opt-dist/src/bolt.rs
src/tools/opt-dist/src/bolt.rs
use anyhow::Context; use camino::{Utf8Path, Utf8PathBuf}; use crate::environment::Environment; use crate::exec::cmd; use crate::training::BoltProfile; use crate::utils::io::copy_file; /// Instruments an artifact at the given `path` (in-place) with BOLT and then calls `func`. /// After this function finishes, the orig...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/opt-dist/src/training.rs
src/tools/opt-dist/src/training.rs
use anyhow::Context; use build_helper::{LLVM_PGO_CRATES, RUSTC_PGO_CRATES}; use camino::{Utf8Path, Utf8PathBuf}; use humansize::BINARY; use crate::environment::{Environment, executable_extension}; use crate::exec::{CmdBuilder, cmd}; use crate::utils::io::{count_files, delete_directory}; use crate::utils::with_log_grou...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/opt-dist/src/timer.rs
src/tools/opt-dist/src/timer.rs
use std::ops::{Deref, DerefMut}; use std::time::{Duration, SystemTime}; pub struct Timer { root: TimerSection, } impl Timer { pub fn new() -> Self { Timer { root: TimerSection::new(None) } } pub fn format_stats(&self) -> String { use std::fmt::Write; let mut items = Vec::new(...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/opt-dist/src/main.rs
src/tools/opt-dist/src/main.rs
use anyhow::Context; use camino::{Utf8Path, Utf8PathBuf}; use clap::Parser; use log::LevelFilter; use utils::io; use crate::bolt::{bolt_optimize, with_bolt_instrumented}; use crate::environment::{Environment, EnvironmentBuilder}; use crate::exec::{Bootstrap, cmd}; use crate::tests::run_tests; use crate::timer::Timer; ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/opt-dist/src/metrics.rs
src/tools/opt-dist/src/metrics.rs
use std::time::Duration; use build_helper::metrics::{BuildStep, JsonRoot, format_build_steps}; use camino::Utf8Path; use crate::timer::TimerSection; /// Loads the metrics of the most recent bootstrap execution from a metrics.json file. pub fn load_metrics(path: &Utf8Path) -> anyhow::Result<BuildStep> { let conte...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/opt-dist/src/exec.rs
src/tools/opt-dist/src/exec.rs
use std::collections::BTreeMap; use std::fs::File; use std::process::{Command, Stdio}; use camino::{Utf8Path, Utf8PathBuf}; use crate::environment::Environment; use crate::metrics::{load_metrics, record_metrics}; use crate::timer::TimerSection; use crate::training::{BoltProfile, LlvmPGOProfile, RustcPGOProfile}; #[d...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/opt-dist/src/utils/io.rs
src/tools/opt-dist/src/utils/io.rs
use std::fs::File; use std::path::Path; use anyhow::Context; use camino::{Utf8Path, Utf8PathBuf}; use fs_extra::dir::CopyOptions; /// Delete and re-create the directory. pub fn reset_directory(path: &Utf8Path) -> anyhow::Result<()> { log::info!("Resetting directory {path}"); let _ = std::fs::remove_dir_all(pa...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/opt-dist/src/utils/mod.rs
src/tools/opt-dist/src/utils/mod.rs
use std::time::Duration; use humansize::BINARY; use sysinfo::Disks; use crate::environment::Environment; use crate::timer::Timer; use crate::utils::io::delete_directory; pub mod artifact_size; pub mod io; pub fn format_env_variables() -> String { let vars = std::env::vars().map(|(key, value)| format!("{key}={va...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/opt-dist/src/utils/artifact_size.rs
src/tools/opt-dist/src/utils/artifact_size.rs
use std::io::Write; use tabled::builder::Builder; use tabled::settings::object::Columns; use tabled::settings::style::{LineChar, Offset}; use tabled::settings::{Modify, Style}; use crate::environment::Environment; use crate::utils::io::get_files_from_dir; pub fn print_binary_sizes(env: &Environment) -> anyhow::Resul...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/html-checker/main.rs
src/tools/html-checker/main.rs
use std::env; use std::path::Path; use std::process::{Command, Output}; use rayon::iter::{ParallelBridge, ParallelIterator}; fn check_html_file(file: &Path) -> usize { let to_mute = &[ // "disabled" on <link> or "autocomplete" on <select> emit this warning "PROPRIETARY_ATTRIBUTE", // It co...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/miropt-test-tools/src/lib.rs
src/tools/miropt-test-tools/src/lib.rs
use std::fs; use std::path::Path; pub struct MiroptTestFile { pub expected_file: std::path::PathBuf, pub from_file: String, pub to_file: Option<String>, } pub struct MiroptTest { pub run_filecheck: bool, pub suffix: String, pub files: Vec<MiroptTestFile>, /// Vec of passes under test to be...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/unicode-table-generator/src/cascading_map.rs
src/tools/unicode-table-generator/src/cascading_map.rs
use std::collections::HashMap; use std::fmt::Write as _; use std::ops::Range; use crate::fmt_list; use crate::raw_emitter::RawEmitter; impl RawEmitter { pub fn emit_cascading_map(&mut self, ranges: &[Range<u32>]) -> bool { let mut map: [u8; 256] = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/unicode-table-generator/src/range_search.rs
src/tools/unicode-table-generator/src/range_search.rs
#[inline(always)] const fn bitset_search< const N: usize, const CHUNK_SIZE: usize, const N1: usize, const CANONICAL: usize, const CANONICALIZED: usize, >( needle: u32, chunk_idx_map: &[u8; N], bitset_chunk_idx: &[[u8; CHUNK_SIZE]; N1], bitset_canonical: &[u64; CANONICAL], bitset_...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/unicode-table-generator/src/skiplist.rs
src/tools/unicode-table-generator/src/skiplist.rs
use std::fmt::{self, Write as _}; use std::ops::Range; use crate::fmt_list; use crate::raw_emitter::RawEmitter; /// This will get packed into a single u32 before inserting into the data set. #[derive(PartialEq)] struct ShortOffsetRunHeader { /// Note, we actually only allow for 11 bits here. This should be enough...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/unicode-table-generator/src/case_mapping.rs
src/tools/unicode-table-generator/src/case_mapping.rs
use std::char; use std::collections::BTreeMap; use std::fmt::{self, Write}; use crate::{UnicodeData, fmt_list}; const INDEX_MASK: u32 = 1 << 22; pub(crate) fn generate_case_mapping(data: &UnicodeData) -> (String, [usize; 2]) { let mut file = String::new(); write!(file, "const INDEX_MASK: u32 = 0x{INDEX_MASK...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/unicode-table-generator/src/main.rs
src/tools/unicode-table-generator/src/main.rs
//! This implements the core logic of the compression scheme used to compactly //! encode Unicode properties. //! //! We have two primary goals with the encoding: we want to be compact, because //! these tables often end up in ~every Rust program (especially the //! grapheme_extend table, used for str debugging), inclu...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/unicode-table-generator/src/raw_emitter.rs
src/tools/unicode-table-generator/src/raw_emitter.rs
use std::collections::{BTreeMap, BTreeSet, HashMap}; use std::fmt::{self, Write}; use std::ops::Range; use crate::fmt_list; #[derive(Clone)] pub struct RawEmitter { pub file: String, pub desc: String, pub bytes_used: usize, } impl RawEmitter { pub fn new() -> RawEmitter { RawEmitter { file: S...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/unicode-table-generator/src/unicode_download.rs
src/tools/unicode-table-generator/src/unicode_download.rs
use std::path::Path; use std::process::{Command, Output}; use crate::UNICODE_DIRECTORY; static URL_PREFIX: &str = "https://www.unicode.org/Public/UCD/latest/ucd/"; static README: &str = "ReadMe.txt"; static RESOURCES: &[&str] = &["DerivedCoreProperties.txt", "PropList.txt", "UnicodeData.txt", "SpecialCasing.txt...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/proc-macro-srv-cli/build.rs
src/tools/rust-analyzer/crates/proc-macro-srv-cli/build.rs
//! Construct version in the `commit-hash date channel` format use std::{env, path::PathBuf, process::Command}; fn main() { set_rerun(); set_commit_info(); } fn set_rerun() { println!("cargo:rerun-if-env-changed=CFG_RELEASE"); let mut manifest_dir = PathBuf::from( env::var("CARGO_MANIFEST_DI...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/proc-macro-srv-cli/src/version.rs
src/tools/rust-analyzer/crates/proc-macro-srv-cli/src/version.rs
//! Code for representing rust-analyzer's release version number. #![expect(dead_code)] use std::fmt; /// Information about the git repository where rust-analyzer was built from. pub(crate) struct CommitInfo { pub(crate) short_commit_hash: &'static str, pub(crate) commit_hash: &'static str, pub(crate) com...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/proc-macro-srv-cli/src/main.rs
src/tools/rust-analyzer/crates/proc-macro-srv-cli/src/main.rs
//! A standalone binary for `proc-macro-srv`. //! Driver for proc macro server #![cfg_attr(feature = "in-rust-tree", feature(rustc_private))] #![cfg_attr(not(feature = "sysroot-abi"), allow(unused_crate_dependencies))] #![allow(clippy::print_stdout, clippy::print_stderr)] #[cfg(feature = "in-rust-tree")] extern crate ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/proc-macro-srv-cli/src/main_loop.rs
src/tools/rust-analyzer/crates/proc-macro-srv-cli/src/main_loop.rs
//! The main loop of the proc-macro server. use proc_macro_api::{ Codec, bidirectional_protocol::msg as bidirectional, legacy_protocol::msg as legacy, transport::codec::{json::JsonProtocol, postcard::PostcardProtocol}, version::CURRENT_API_VERSION, }; use std::io; use legacy::Message; use proc_mac...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/toolchain/src/lib.rs
src/tools/rust-analyzer/crates/toolchain/src/lib.rs
//! Discovery of `cargo` & `rustc` executables. use std::{ env, ffi::OsStr, iter, path::{Path, PathBuf}, process::Command, }; use camino::{Utf8Path, Utf8PathBuf}; #[derive(Copy, Clone)] pub enum Tool { Cargo, Rustc, Rustup, Rustfmt, } impl Tool { pub fn proxy(self) -> Option<...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/test-fixture/src/lib.rs
src/tools/rust-analyzer/crates/test-fixture/src/lib.rs
//! A set of high-level utility fixture methods to use in tests. #![cfg_attr(feature = "in-rust-tree", feature(rustc_private))] #[cfg(feature = "in-rust-tree")] extern crate rustc_driver as _; use std::{any::TypeId, mem, str::FromStr, sync}; use base_db::target::TargetData; use base_db::{ Crate, CrateDisplayNam...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
true
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/intern/src/lib.rs
src/tools/rust-analyzer/crates/intern/src/lib.rs
//! Global `Arc`-based object interning infrastructure. //! //! Eventually this should probably be replaced with salsa-based interning. mod gc; mod intern; mod intern_slice; mod symbol; pub use self::gc::{GarbageCollector, GcInternedSliceVisit, GcInternedVisit}; pub use self::intern::{InternStorage, Internable, Inter...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/intern/src/gc.rs
src/tools/rust-analyzer/crates/intern/src/gc.rs
//! Garbage collection of interned values. //! //! The GC is a simple mark-and-sweep GC: you first mark all storages, then the //! GC visits them, and each live value they refer, recursively, then removes //! those not marked. The sweep phase is done in parallel. use std::{hash::Hash, marker::PhantomData, ops::Control...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/intern/src/intern_slice.rs
src/tools/rust-analyzer/crates/intern/src/intern_slice.rs
//! Interning of slices, potentially with a header. //! //! See [`crate::intern`] for an explanation of interning modes. Note that slice interning is currently //! available only in GC mode (there is no other need). //! //! [`InternedSlice`] and [`InternedSliceRef`] are essentially [`Interned<(Header, Box<[SliceType]>)...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false