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/source/imports/imports_granularity_item-with-dups-StdExternalCrate-no-reorder.rs
src/tools/rustfmt/tests/source/imports/imports_granularity_item-with-dups-StdExternalCrate-no-reorder.rs
// rustfmt-imports_granularity: Item // rustfmt-reorder_imports: false // rustfmt-group_imports: StdExternalCrate use crate::lexer; use crate::lexer; use crate::lexer::tokens::TokenData; use crate::lexer::{tokens::TokenData}; use crate::lexer::self; use crate::lexer; use crate::lexer; use crate::lexer::{self}; use cra...
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/source/imports/imports-reorder.rs
src/tools/rustfmt/tests/source/imports/imports-reorder.rs
// rustfmt-normalize_comments: true use path::{C,/*A*/ A, B /* B */, self /* self */}; use {ab, ac, aa, Z, 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/source/imports/imports_granularity_item.rs
src/tools/rustfmt/tests/source/imports/imports_granularity_item.rs
// rustfmt-imports_granularity: Item use a::{b, c, d}; use a::{f::g, h::{i, j}}; use a::{l::{self, m, n::o, p::*}}; use a::q::{self}; use b::{f::g, h::{i, j} /* After b::h group */}; use b::e; use b::{/* Before b::l group */ l::{self, m, n::o, p::*}, q}; use b::d; use b::r; // After b::r use b::q::{self /* After b::q...
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/source/imports/imports_block_indent.rs
src/tools/rustfmt/tests/source/imports/imports_block_indent.rs
// #2569 use apns2::request::notification::{Notificatio, NotificationBuilder, Priority, SilentNotificationBuilder};
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/source/imports/imports-reorder-lines-and-items.rs
src/tools/rustfmt/tests/source/imports/imports-reorder-lines-and-items.rs
/// This comment should stay with `use std::str;` use std::str; use std::cmp::{d, c, b, a}; use std::ddd::aaa; use std::ddd::{d as p, c as g, b, a}; // This comment should stay with `use std::ddd:bbb;` use std::ddd::bbb;
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/source/imports/imports-reorder-lines.rs
src/tools/rustfmt/tests/source/imports/imports-reorder-lines.rs
use std::str; use std::cmp::{d, c, b, a}; use std::cmp::{b, e, g, f}; use std::ddd::aaa; // This comment should stay with `use std::ddd;` use std::ddd; use std::ddd::bbb; mod test { } use aaa::bbb; use aaa; use aaa::*; mod test {} // If item names are equal, order by rename use test::{a as bb, b}; use test::{a as 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/source/imports/imports-impl-only-use.rs
src/tools/rustfmt/tests/source/imports/imports-impl-only-use.rs
#![feature(underscore_imports)] use attr; use std::iter::Iterator as _;
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/source/imports/imports_granularity_crate.rs
src/tools/rustfmt/tests/source/imports/imports_granularity_crate.rs
// rustfmt-imports_granularity: Crate use a::{c,d,b}; use a::{d, e, b, a, f}; use a::{f, g, c}; #[doc(hidden)] use a::b; use a::c; use a::d; use a::{c, d, e}; #[doc(hidden)] use a::b; use a::d; pub use foo::bar; use foo::{a, b, c}; pub use foo::foobar; use a::{b::{c::*}}; use a::{b::{c::{}}}; use a::{b::{c::d}}; u...
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/source/imports/imports_granularity_default-with-dups.rs
src/tools/rustfmt/tests/source/imports/imports_granularity_default-with-dups.rs
use crate::lexer; use crate::lexer::tokens::TokenData; use crate::lexer::{tokens::TokenData}; use crate::lexer::self; 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/source/imports/imports_granularity_item-with-dups.rs
src/tools/rustfmt/tests/source/imports/imports_granularity_item-with-dups.rs
// rustfmt-imports_granularity: Item use crate::lexer; use crate::lexer; use crate::lexer::tokens::TokenData; use crate::lexer::{tokens::TokenData}; use crate::lexer::self; use crate::lexer; use crate::lexer; 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/source/imports/imports_granularity_module.rs
src/tools/rustfmt/tests/source/imports/imports_granularity_module.rs
// rustfmt-imports_granularity: Module use a::{b::c, d::e}; use a::{f, g::{h, i}}; use a::{j::{self, k::{self, l}, m}, n::{o::p, q}}; pub use a::{r::s, t}; use b::{c::d, self}; #[cfg(test)] use foo::{a::b, c::d}; use foo::e; use bar::{ // comment a::b, // more comment c::d, e::f, }; use b::{f::g...
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/source/issue-5157/indented_itemized_markdown_blockquote.rs
src/tools/rustfmt/tests/source/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/source/issue-5157/support_itemized_markdown_blockquote.rs
src/tools/rustfmt/tests/source/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/source/issue-5157/nested_itemized_markdown_blockquote.rs
src/tools/rustfmt/tests/source/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 DataReader. The sampl...
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/source/issue-4926/struct_with_many_fields.rs
src/tools/rustfmt/tests/source/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, d: 1_000, e: 1_000, f: 1_000, g: 1_000, h: 1_00...
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/source/issue-4926/deeply_nested_struct_with_long_field_names.rs
src/tools/rustfmt/tests/source/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/source/issue-4926/enum_struct_field.rs
src/tools/rustfmt/tests/source/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: 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/source/issue-4926/minimum_example.rs
src/tools/rustfmt/tests/source/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/source/issue-4926/deeply_nested_struct.rs
src/tools/rustfmt/tests/source/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/source/issue-4926/deeply_nested_struct_with_many_fields.rs
src/tools/rustfmt/tests/source/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/source/issue-4926/struct_with_long_field_names.rs
src/tools/rustfmt/tests/source/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/source/issue-3434/not_skip_macro.rs
src/tools/rustfmt/tests/source/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/source/issue-3434/lib.rs
src/tools/rustfmt/tests/source/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(); skip_...
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/source/issue-3434/no_entry.rs
src/tools/rustfmt/tests/source/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/source/cfg_if/lib.rs
src/tools/rustfmt/tests/source/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/source/cfg_if/mod.rs
src/tools/rustfmt/tests/source/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/source/cfg_if/detect/bit.rs
src/tools/rustfmt/tests/source/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/source/cfg_if/detect/error_macros.rs
src/tools/rustfmt/tests/source/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/source/cfg_if/detect/mod.rs
src/tools/rustfmt/tests/source/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/source/cfg_if/detect/cache.rs
src/tools/rustfmt/tests/source/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/source/cfg_if/detect/arch/x86.rs
src/tools/rustfmt/tests/source/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/source/cfg_if/detect/arch/arm.rs
src/tools/rustfmt/tests/source/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") || $cr...
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/source/cfg_if/detect/arch/mips.rs
src/tools/rustfmt/tests/source/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::de...
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/source/cfg_if/detect/arch/mips64.rs
src/tools/rustfmt/tests/source/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") || $cra...
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/source/cfg_if/detect/arch/powerpc.rs
src/tools/rustfmt/tests/source/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/source/cfg_if/detect/arch/aarch64.rs
src/tools/rustfmt/tests/source/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/source/cfg_if/detect/arch/powerpc64.rs
src/tools/rustfmt/tests/source/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/source/cfg_if/detect/os/x86.rs
src/tools/rustfmt/tests/source/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::{Feature, cache, bit}; /// 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/source/cfg_if/detect/os/other.rs
src/tools/rustfmt/tests/source/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/source/cfg_if/detect/os/aarch64.rs
src/tools/rustfmt/tests/source/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/source/cfg_if/detect/os/linux/arm.rs
src/tools/rustfmt/tests/source/cfg_if/detect/os/linux/arm.rs
//! Run-time feature detection for ARM on Linux. use crate::detect::{Feature, cache, bit}; use super::{auxvec, cpuinfo}; /// 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/source/cfg_if/detect/os/linux/mips.rs
src/tools/rustfmt/tests/source/cfg_if/detect/os/linux/mips.rs
//! Run-time feature detection for MIPS on Linux. use crate::detect::{Feature, cache, bit}; use super::auxvec; /// 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/source/cfg_if/detect/os/linux/cpuinfo.rs
src/tools/rustfmt/tests/source/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::{prelude::v1::*, fs::File, io, io::Read}; /// 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/source/cfg_if/detect/os/linux/mod.rs
src/tools/rustfmt/tests/source/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/source/cfg_if/detect/os/linux/powerpc.rs
src/tools/rustfmt/tests/source/cfg_if/detect/os/linux/powerpc.rs
//! Run-time feature detection for PowerPC on Linux. use crate::detect::{Feature, cache}; use super::{auxvec, cpuinfo}; /// 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/source/cfg_if/detect/os/linux/aarch64.rs
src/tools/rustfmt/tests/source/cfg_if/detect/os/linux/aarch64.rs
//! Run-time feature detection for Aarch64 on Linux. use crate::detect::{Feature, cache, bit}; use super::{auxvec, cpuinfo}; /// 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/source/cfg_if/detect/os/linux/auxvec.rs
src/tools/rustfmt/tests/source/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/source/cfg_if/detect/os/freebsd/arm.rs
src/tools/rustfmt/tests/source/cfg_if/detect/os/freebsd/arm.rs
//! Run-time feature detection for ARM on FreeBSD use crate::detect::{Feature, cache}; use super::{auxvec}; /// 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/source/cfg_if/detect/os/freebsd/mod.rs
src/tools/rustfmt/tests/source/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/source/cfg_if/detect/os/freebsd/powerpc.rs
src/tools/rustfmt/tests/source/cfg_if/detect/os/freebsd/powerpc.rs
//! Run-time feature detection for PowerPC on FreeBSD. use crate::detect::{Feature, cache}; use super::{auxvec}; /// 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 = cach...
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/source/cfg_if/detect/os/freebsd/aarch64.rs
src/tools/rustfmt/tests/source/cfg_if/detect/os/freebsd/aarch64.rs
//! Run-time feature detection for Aarch64 on FreeBSD. use crate::detect::{Feature, cache}; use super::super::aarch64::detect_features; /// 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/source/cfg_if/detect/os/freebsd/auxvec.rs
src/tools/rustfmt/tests/source/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/source/issue-3227/two.rs
src/tools/rustfmt/tests/source/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/source/binop-separator-back/bitwise.rs
src/tools/rustfmt/tests/source/binop-separator-back/bitwise.rs
// rustfmt-binop_separator: Back fn main() { let value = abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ ^ abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ; let value = abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ & abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ; let value = 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/source/binop-separator-back/range.rs
src/tools/rustfmt/tests/source/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/source/binop-separator-back/math.rs
src/tools/rustfmt/tests/source/binop-separator-back/math.rs
// rustfmt-binop_separator: Back fn main() { let value = abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ + abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ + abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ + abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ + abcdefghijklmnopqrstuvwxyzABCDEFGHIJKL...
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/source/binop-separator-back/patterns.rs
src/tools/rustfmt/tests/source/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/source/binop-separator-back/logic.rs
src/tools/rustfmt/tests/source/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/source/binop-separator-back/comp.rs
src/tools/rustfmt/tests/source/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/rustfmt/main.rs
src/tools/rustfmt/tests/rustfmt/main.rs
//! Integration tests for rustfmt. use std::env; use std::fs::remove_file; use std::path::Path; use std::process::Command; use rustfmt_config_proc_macro::{nightly_only_test, rustfmt_only_ci_test}; /// Run the rustfmt executable and return its output. fn rustfmt(args: &[&str]) -> (String, String) { let mut bin_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/rustfmt/tests/target/issue-1366.rs
src/tools/rustfmt/tests/target/issue-1366.rs
fn main() { fn f() -> Option<i32> { Some("fffffffsssssssssddddssssfffffddddff") .map(|s| s) .map(|s| s.to_string()) .map(|res| match Some(res) { Some(ref s) if s == "" => 41, Some(_) => 42, _ => 43, }) } ...
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-3568.rs
src/tools/rustfmt/tests/target/issue-3568.rs
use a::b::{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/fn_args_layout-vertical.rs
src/tools/rustfmt/tests/target/fn_args_layout-vertical.rs
// rustfmt-fn_params_layout: Vertical // Empty list should stay on one line. fn do_bar() -> u8 { bar() } // A single argument should stay on the same line. fn do_bar(a: u8) -> u8 { bar() } // Multiple arguments should each get their own line. fn do_bar( a: u8, mut b: u8, c: &u8, d: &mut u8, ...
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/macro_not_expr.rs
src/tools/rustfmt/tests/target/macro_not_expr.rs
macro_rules! test { ($($t:tt)*) => {}; } fn main() { test!( a : B => c 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-6109.rs
src/tools/rustfmt/tests/target/issue-6109.rs
/// Some doc comment with code snippet: ///``` /// '\u{1F} /// ``` pub struct Code {} 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/target/issue-1397.rs
src/tools/rustfmt/tests/target/issue-1397.rs
pub enum TransactionState { Committed(i64), } pub enum Packet { Transaction { state: TransactionState }, } fn baz(p: Packet) { loop { loop { loop { loop { if let Packet::Transaction { state: TransactionState::Committed(ts, ..)...
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/async_fn.rs
src/tools/rustfmt/tests/target/async_fn.rs
// rustfmt-edition: 2018 async fn bar() -> Result<(), ()> { Ok(()) } pub async fn baz() -> Result<(), ()> { Ok(()) } async unsafe fn foo() { async move { Ok(()) } } async unsafe fn rust() { async move { // comment Ok(()) } } async fn await_try() { something.await?; }
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_5907.rs
src/tools/rustfmt/tests/target/issue_5907.rs
// rustfmt-format_code_in_doc_comments: true // ``` // [ // ] // ```
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/macro_rules.rs
src/tools/rustfmt/tests/target/macro_rules.rs
// rustfmt-format_macro_matchers: true macro_rules! m { () => {}; ($x:ident) => {}; ($m1:ident, $m2:ident, $x:ident) => {}; ($($beginning:ident),*; $middle:ident; $($end:ident),*) => {}; ( $($beginning:ident),*; $middle:ident; $($end:ident),*; $($beginning:ident),*; ...
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-2973.rs
src/tools/rustfmt/tests/target/issue-2973.rs
#[cfg(test)] mod test { summary_test! { tokenize_recipe_interpolation_eol, "foo: # some comment {{hello}} ", "foo: \ {{hello}} \ {{ahah}}", "N:#$>^{N}$<.", } summary_test! { tokenize_strings, r#"a = "'a'" + '"b"' + "'c'" + '"d"'#echo hello"#, r#"N="+'+"+...
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-2324.rs
src/tools/rustfmt/tests/target/issue-2324.rs
// nested function calls with cast. fn main() { self.ptr .set(intrinsics::arith_offset(self.ptr.get() as *mut u8, 1) as *mut T); self.ptr .set(intrinsics::arith_offset(self.ptr.get(), mem::size_of::<T>() as isize) as *mut u8); }
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/file-lines-3.rs
src/tools/rustfmt/tests/target/file-lines-3.rs
// rustfmt-file_lines: [{"file":"tests/source/file-lines-3.rs","range":[4,8]},{"file":"tests/source/file-lines-3.rs","range":[10,15]}] fn floaters() { let x = Foo { field1: val1, field2: val2, } .method_call() .method_call(); let y = if cond { val1 } else { val2 }.method_call(); ...
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/fn-custom-6.rs
src/tools/rustfmt/tests/target/fn-custom-6.rs
// rustfmt-brace_style: PreferSameLine // Test different indents. fn foo(a: Aaaaaaaaaaaaaa, b: Bbbbbbbbbbbbbb) { foo(); } fn bar( a: Aaaaaaaaaaaaaa, b: Bbbbbbbbbbbbbb, c: Cccccccccccccccccc, d: Dddddddddddddddd, e: Eeeeeeeeeeeeeee, ) { bar(); } fn foo(a: Aaaaaaaaaaaaaa, b: Bbbbbbbbbbbbbb)...
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-3059.rs
src/tools/rustfmt/tests/target/issue-3059.rs
// rustfmt-wrap_comments: true // rustfmt-max_width: 80 /// Vestibulum elit nibh, rhoncus non, euismod sit amet, pretium eu, enim. Nunc /// commodo ultricies dui. Cras gravida rutrum massa. Donec accumsan mattis /// turpis. Quisque sem. Quisque elementum sapien iaculis augue. In dui sem, /// congue sit amet, feugiat q...
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/asyncness.rs
src/tools/rustfmt/tests/target/asyncness.rs
// rustfmt-edition: 2018 fn foo() -> impl async Fn() {} fn bar() -> impl for<'a> async Fn(&'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/issue-2863.rs
src/tools/rustfmt/tests/target/issue-2863.rs
// rustfmt-reorder_impl_items: true impl<T> IntoIterator for SafeVec<T> { type Bar = u32; type BarFoo = u32; type FooBar = u32; // comment on FoooooBar type FoooooBar = u32; type IntoIter = self::IntoIter<T>; type Item = T; type E = impl Trait; type F = impl Trait; const Anoth...
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/single-line-if-else.rs
src/tools/rustfmt/tests/target/single-line-if-else.rs
// Format if-else expressions on a single line, when possible. fn main() { let a = if 1 > 2 { unreachable!() } else { 10 }; let a = if x { 1 } else if y { 2 } else { 3 }; let b = if cond() { 5 } else { // Brief comment. 10 }; let 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_3839.rs
src/tools/rustfmt/tests/target/issue_3839.rs
struct Foo { a: i32, /* asd */ // foo b: i32, }
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/array_comment.rs
src/tools/rustfmt/tests/target/array_comment.rs
// Issue 2842 // The comment should not make the last line shorter static XXX: [i8; 64] = [ 1, // Comment 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ]; static XXX: [i8; 64] = [ 1, // Comment 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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/5131_crate.rs
src/tools/rustfmt/tests/target/5131_crate.rs
// rustfmt-imports_granularity: Crate use foo::{ a, b, b as b2, b::{f, g, g as g2}, c, d::e, }; use qux::{h, h as h2, 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/issue-3751.rs
src/tools/rustfmt/tests/target/issue-3751.rs
// rustfmt-format_code_in_doc_comments: true //! Empty pound line //! //! ```rust //! # //! # fn main() { //! 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/tests/target/unsafe_extern_blocks.rs
src/tools/rustfmt/tests/target/unsafe_extern_blocks.rs
// See tracking issue for unsafe_extern_blocks // https://github.com/rust-lang/rust/issues/123743 #![feature(unsafe_extern_blocks)] safe static TEST1: i32; unsafe extern "C" { safe static TEST2: i32; unsafe static TEST3: i32; static TEST4: i32; pub safe static TEST5: i32; pub unsafe static TEST6...
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/trailing_commas.rs
src/tools/rustfmt/tests/target/trailing_commas.rs
// rustfmt-match_block_trailing_comma: true // rustfmt-trailing_comma: Always fn main() { match foo { x => {}, y => { foo(); }, _ => x, } } fn f<S, T,>(x: T, y: S,) -> T where T: P, S: Q, { x } impl Trait for T where T: P, { fn f(x: T,) -> T ...
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/tuple_v2.rs
src/tools/rustfmt/tests/target/tuple_v2.rs
// rustfmt-style_edition: 2024 fn issue_4355() { let _ = ((1,),).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/rustfmt/tests/target/issue-4646.rs
src/tools/rustfmt/tests/target/issue-4646.rs
trait Foo { fn bar(&self) // where // Self: Bar ; } trait Foo { fn bar(&self) // where // Self: Bar ; } trait Foo { fn bar(&self) // where // Self: Bar ; }
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-2869.rs
src/tools/rustfmt/tests/target/issue-2869.rs
// rustfmt-struct_field_align_threshold: 50 #[derive(Serialize, Deserialize, Debug)] #[serde(rename_all = "PascalCase")] struct AuditLog1 { creation_time: String, id: String, operation: String, organization_id: ...
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-3759.rs
src/tools/rustfmt/tests/target/issue-3759.rs
fn main() { let Test { #[cfg(feature = "test")] x, } = Test { #[cfg(feature = "test")] x: 1, }; let Test { #[cfg(feature = "test")] // comment x, } = Test { #[cfg(feature = "test")] x: 1, }; let Test { // comme...
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_4675.rs
src/tools/rustfmt/tests/target/issue_4675.rs
macro_rules! foo { ($s:ident ( $p:pat )) => { Foo { name: Name::$s($p), .. } }; }
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/where-clause.rs
src/tools/rustfmt/tests/target/where-clause.rs
// rustfmt-indent_style: Visual fn reflow_list_node_with_rule(node: &CompoundNode, rule: &Rule, args: &[Arg], shape: &Shape) where T: FOo, U: Bar { let mut effects = HashMap::new(); } fn reflow_list_node_with_rule(node: &CompoundNode, rule: &Rule, args: &[Arg], shape: &Shape) where T: 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/tests/target/issue-3672.rs
src/tools/rustfmt/tests/target/issue-3672.rs
fn main() { let x = 5; }
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_4467.rs
src/tools/rustfmt/tests/target/issue_4467.rs
pub fn main() { #[cfg(feature = "std")] { // Comment } }
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/comment_crlf_newline.rs
src/tools/rustfmt/tests/target/comment_crlf_newline.rs
// rustfmt-normalize_comments: true // Block comments followed by CRLF newlines should not an extra newline at the end // Something else
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/match.rs
src/tools/rustfmt/tests/target/match.rs
// rustfmt-normalize_comments: true // Match expressions. fn foo() { // A match expression. match x { // Some comment. a => foo(), b if 0 < 42 => foo(), c => { // Another comment. // Comment. an_expression; 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/tests/target/issue_5533.rs
src/tools/rustfmt/tests/target/issue_5533.rs
// rustfmt-format_code_in_doc_comments: true struct TestStruct { position_currency: String, // Currency for position of this contract. If not null, 1 contract = 1 positionCurrency. pu: Option<i64>, // Previous event update sequense ("u" of previous message), -1 also means None }
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/associated_type_defaults.rs
src/tools/rustfmt/tests/target/associated_type_defaults.rs
#![feature(associated_type_defaults)] trait Foo { type Bar = (); }
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/match-nowrap.rs
src/tools/rustfmt/tests/target/match-nowrap.rs
// rustfmt-match_arm_blocks: false // Match expressions, no unwrapping of block arms or wrapping of multiline // expressions. fn foo() { match x { a => foo(), b => ( aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb...
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/item-brace-style-always-next-line.rs
src/tools/rustfmt/tests/target/item-brace-style-always-next-line.rs
// rustfmt-brace_style: AlwaysNextLine mod M { enum A { A, } struct B { b: i32, } // For empty enums and structs, the brace remains on the same line. enum C {} struct D {} enum A<T> where T: Copy, { A, } struct B<T> 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/target/expr-block.rs
src/tools/rustfmt/tests/target/expr-block.rs
// Test expressions with block formatting. fn arrays() { []; let empty = []; let foo = [a_long_name, a_very_lng_name, a_long_name]; let foo = [ a_long_name, a_very_lng_name, a_long_name, a_very_lng_name, a_long_name, a_very_lng_name, a_long_name...
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/fn-param-attributes.rs
src/tools/rustfmt/tests/target/fn-param-attributes.rs
// https://github.com/rust-lang/rustfmt/issues/3623 fn foo(#[cfg(something)] x: i32, y: i32) -> i32 { x + y } fn foo_b(#[cfg(something)] x: i32, y: i32) -> i32 { x + y } fn add( #[cfg(something)] #[deny(C)] x: i32, y: i32, ) -> i32 { x + y } struct NamedSelfRefStruct {} impl NamedSelfRef...
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/associated-items.rs
src/tools/rustfmt/tests/target/associated-items.rs
fn main() { println!("{}", <bool as ::std::default::Default>::default()); }
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false