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/src/lists.rs
src/tools/rustfmt/src/lists.rs
//! Format list-like expressions and items. use std::cmp; use std::iter::Peekable; use rustc_span::BytePos; use crate::comment::{FindUncommented, find_comment_end, rewrite_comment}; use crate::config::lists::*; use crate::config::{Config, IndentStyle}; use crate::rewrite::{RewriteContext, RewriteError, RewriteResult...
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/src/rustfmt_diff.rs
src/tools/rustfmt/src/rustfmt_diff.rs
use std::collections::VecDeque; use std::fmt; use std::io; use std::io::Write; use crate::config::{Color, Config, Verbosity}; #[derive(Debug, PartialEq)] pub(crate) enum DiffLine { Context(String), Expected(String), Resulting(String), } #[derive(Debug, PartialEq)] pub(crate) struct Mismatch { /// The...
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/src/source_file.rs
src/tools/rustfmt/src/source_file.rs
use std::fs; use std::io::{self, Write}; use std::path::Path; use std::sync::Arc; use crate::NewlineStyle; use crate::config::FileName; use crate::emitter::{self, Emitter}; use crate::parse::session::ParseSess; #[cfg(test)] use crate::config::Config; #[cfg(test)] use crate::create_emitter; #[cfg(test)] use crate::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/src/format_report_formatter.rs
src/tools/rustfmt/src/format_report_formatter.rs
use crate::formatting::FormattingError; use crate::{ErrorKind, FormatReport}; use annotate_snippets::display_list::{DisplayList, FormatOptions}; use annotate_snippets::snippet::{Annotation, AnnotationType, Slice, Snippet, SourceAnnotation}; use std::fmt::{self, Display}; /// A builder for [`FormatReportFormatter`]. pu...
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/src/closures.rs
src/tools/rustfmt/src/closures.rs
use rustc_ast::ast; use rustc_span::Span; use thin_vec::thin_vec; use tracing::debug; use crate::attr::get_attrs_from_stmt; use crate::config::StyleEdition; use crate::config::lists::*; use crate::expr::{block_contains_comment, is_simple_block, is_unsafe_block, rewrite_cond}; use crate::items::{span_hi_for_param, span...
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/src/spanned.rs
src/tools/rustfmt/src/spanned.rs
use std::cmp::max; use rustc_ast::ast; use rustc_span::{Span, source_map}; use crate::macros::MacroArg; use crate::patterns::RangeOperand; use crate::utils::{mk_sp, outer_attributes}; /// Spanned returns a span including attributes, if available. pub(crate) trait Spanned { fn span(&self) -> Span; } impl<T: Span...
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/src/types.rs
src/tools/rustfmt/src/types.rs
use std::ops::Deref; use rustc_ast::ast::{self, FnRetTy, Mutability, Term}; use rustc_span::{BytePos, Pos, Span, symbol::kw}; use tracing::debug; use crate::comment::{combine_strs_with_missing_comments, contains_comment}; use crate::config::lists::*; use crate::config::{IndentStyle, StyleEdition, TypeDensity}; use cr...
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/rustfmt/src/utils.rs
src/tools/rustfmt/src/utils.rs
use std::borrow::Cow; use rustc_ast::YieldKind; use rustc_ast::ast::{ self, Attribute, MetaItem, MetaItemInner, MetaItemKind, NodeId, Path, Visibility, VisibilityKind, }; use rustc_ast_pretty::pprust; use rustc_span::{BytePos, LocalExpnId, Span, Symbol, SyntaxContext, sym, symbol}; use unicode_width::UnicodeWi...
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/src/macros.rs
src/tools/rustfmt/src/macros.rs
// Format list-like macro invocations. These are invocations whose token trees // can be interpreted as expressions and separated by commas. // Note that these token trees do not actually have to be interpreted as // expressions by the compiler. An example of an invocation we would reformat is // foo!( x, y, z ). The t...
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/rustfmt/src/patterns.rs
src/tools/rustfmt/src/patterns.rs
use rustc_ast::ast::{self, BindingMode, ByRef, Pat, PatField, PatKind, RangeEnd, RangeSyntax}; use rustc_span::{BytePos, Span}; use crate::comment::{FindUncommented, combine_strs_with_missing_comments}; use crate::config::StyleEdition; use crate::config::lists::*; use crate::expr::{can_be_overflowed_expr, rewrite_unar...
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/src/reorder.rs
src/tools/rustfmt/src/reorder.rs
//! Reorder items. //! //! `mod`, `extern crate` and `use` declarations are reordered in alphabetical //! order. Trait items are reordered in pre-determined order (associated types //! and constants comes before methods). // FIXME(#2455): Reorder trait items. use std::cmp::Ordering; use rustc_ast::{ast, attr}; use r...
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/src/skip.rs
src/tools/rustfmt/src/skip.rs
//! Module that contains skip related stuffs. use rustc_ast::ast; use rustc_ast_pretty::pprust; use std::collections::HashSet; /// Track which blocks of code are to be skipped when formatting. /// /// You can update it by: /// /// - attributes slice /// - manually feeding values into the underlying contexts /// /// 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/src/missed_spans.rs
src/tools/rustfmt/src/missed_spans.rs
use rustc_span::{BytePos, Pos, Span}; use tracing::debug; use crate::comment::{CodeCharKind, CommentCodeSlices, is_last_comment_block, rewrite_comment}; use crate::config::FileName; use crate::config::StyleEdition; use crate::config::file_lines::FileLines; use crate::coverage::transform_missing_snippet; use crate::sha...
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/src/release_channel.rs
src/tools/rustfmt/src/release_channel.rs
/// Checks if we're in a nightly build. /// /// The environment variable `CFG_RELEASE_CHANNEL` is set during the rustc bootstrap /// to "stable", "beta", or "nightly" depending on what toolchain is being built. /// If we are being built as part of the stable or beta toolchains, we want /// to disable unstable configura...
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/src/comment.rs
src/tools/rustfmt/src/comment.rs
// Formatting and tools for comments. use std::{borrow::Cow, iter}; use itertools::{Itertools as _, MultiPeek, multipeek}; use rustc_span::Span; use tracing::{debug, trace}; use crate::config::Config; use crate::rewrite::{RewriteContext, RewriteErrorExt, RewriteResult}; use crate::shape::{Indent, Shape}; use crate::...
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/rustfmt/src/formatting.rs
src/tools/rustfmt/src/formatting.rs
// High level formatting functions. use std::collections::HashMap; use std::io::{self, Write}; use std::time::{Duration, Instant}; use rustc_ast::ast; use rustc_span::Span; use tracing::debug; use self::newline_style::apply_newline_style; use crate::comment::{CharClasses, FullCodeCharKind}; use crate::config::{Confi...
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/src/stmt.rs
src/tools/rustfmt/src/stmt.rs
use rustc_ast::ast; use rustc_span::Span; use crate::comment::recover_comment_removed; use crate::config::StyleEdition; use crate::expr::{ExprType, format_expr, is_simple_block}; use crate::rewrite::{Rewrite, RewriteContext, RewriteError, RewriteErrorExt, RewriteResult}; use crate::shape::Shape; use crate::source_map:...
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/src/parse/parser.rs
src/tools/rustfmt/src/parse/parser.rs
use std::panic::{AssertUnwindSafe, catch_unwind}; use std::path::{Path, PathBuf}; use rustc_ast::{ast, attr}; use rustc_errors::Diag; use rustc_parse::lexer::StripTokens; use rustc_parse::parser::Parser as RawParser; use rustc_parse::{exp, new_parser_from_file, new_parser_from_source_str, unwrap_or_emit_fatal}; use ru...
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/src/parse/session.rs
src/tools/rustfmt/src/parse/session.rs
use std::path::Path; use std::sync::Arc; use std::sync::atomic::{AtomicBool, Ordering}; use rustc_data_structures::sync::IntoDynSyncSend; use rustc_errors::emitter::{DynEmitter, Emitter, HumanEmitter, SilentEmitter, stderr_destination}; use rustc_errors::registry::Registry; use rustc_errors::translation::Translator; 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/src/parse/mod.rs
src/tools/rustfmt/src/parse/mod.rs
pub(crate) mod macros; pub(crate) mod parser; pub(crate) mod session;
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/src/parse/macros/asm.rs
src/tools/rustfmt/src/parse/macros/asm.rs
use rustc_ast::ast; use rustc_parse::parser::asm::{AsmArg, parse_asm_args}; use crate::rewrite::RewriteContext; #[allow(dead_code)] pub(crate) fn parse_asm(context: &RewriteContext<'_>, mac: &ast::MacCall) -> Option<Vec<AsmArg>> { let ts = mac.args.tokens.clone(); let mut parser = super::build_parser(context,...
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/src/parse/macros/lazy_static.rs
src/tools/rustfmt/src/parse/macros/lazy_static.rs
use rustc_ast::ast; use rustc_ast::token; use rustc_ast::tokenstream::TokenStream; use rustc_parse::exp; use rustc_span::symbol; use crate::rewrite::RewriteContext; pub(crate) fn parse_lazy_static( context: &RewriteContext<'_>, ts: TokenStream, ) -> Option<Vec<(ast::Visibility, symbol::Ident, Box<ast::Ty>, Bo...
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/src/parse/macros/mod.rs
src/tools/rustfmt/src/parse/macros/mod.rs
use rustc_ast::ast; use rustc_ast::token::{Delimiter, NonterminalKind, NtExprKind::*, NtPatKind::*, TokenKind}; use rustc_ast::tokenstream::TokenStream; use rustc_parse::MACRO_ARGUMENTS; use rustc_parse::parser::{ForceCollect, Parser, Recovery}; use rustc_session::parse::ParseSess; use rustc_span::symbol; use crate::m...
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/src/parse/macros/cfg_if.rs
src/tools/rustfmt/src/parse/macros/cfg_if.rs
use std::panic::{AssertUnwindSafe, catch_unwind}; use rustc_ast::ast; use rustc_ast::token::TokenKind; use rustc_parse::exp; use rustc_parse::parser::ForceCollect; use rustc_span::symbol::kw; use crate::parse::macros::build_stream_parser; use crate::parse::session::ParseSess; pub(crate) fn parse_cfg_if<'a>( pses...
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/src/cargo-fmt/main.rs
src/tools/rustfmt/src/cargo-fmt/main.rs
// Inspired by Paul Woolcock's cargo-fmt (https://github.com/pwoolcoc/cargo-fmt/). #![deny(warnings)] #![allow(clippy::match_like_matches_macro)] use std::cmp::Ordering; use std::collections::{BTreeMap, BTreeSet}; use std::env; use std::ffi::OsStr; use std::fs; use std::hash::{Hash, Hasher}; use std::io::{self, Write...
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/src/cargo-fmt/test/targets.rs
src/tools/rustfmt/src/cargo-fmt/test/targets.rs
use super::*; struct ExpTarget { path: &'static str, edition: Edition, kind: &'static str, } mod all_targets { use super::*; fn assert_correct_targets_loaded( manifest_suffix: &str, source_root: &str, exp_targets: &[ExpTarget], exp_num_targets: usize, ) { ...
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/src/cargo-fmt/test/mod.rs
src/tools/rustfmt/src/cargo-fmt/test/mod.rs
use super::*; mod message_format; mod targets; #[test] fn default_options() { let empty: Vec<String> = vec![]; let o = Opts::parse_from(&empty); assert_eq!(false, o.quiet); assert_eq!(false, o.verbose); assert_eq!(false, o.version); assert_eq!(false, o.check); assert_eq!(empty, o.packages)...
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/src/cargo-fmt/test/message_format.rs
src/tools/rustfmt/src/cargo-fmt/test/message_format.rs
use super::*; #[test] fn invalid_message_format() { assert_eq!( convert_message_format_to_rustfmt_args("awesome", &mut vec![]), Err(String::from( "invalid --message-format value: awesome. Allowed values are: short|json|human" )), ); } #[test] fn json_message_format_and_chec...
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/src/emitter/stdout.rs
src/tools/rustfmt/src/emitter/stdout.rs
use super::*; use crate::config::Verbosity; #[derive(Debug)] pub(crate) struct StdoutEmitter { verbosity: Verbosity, } impl StdoutEmitter { pub(crate) fn new(verbosity: Verbosity) -> Self { Self { verbosity } } } impl Emitter for StdoutEmitter { fn emit_formatted_file( &mut 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/src/emitter/diff.rs
src/tools/rustfmt/src/emitter/diff.rs
use super::*; use crate::config::Config; use crate::rustfmt_diff::{make_diff, print_diff}; pub(crate) struct DiffEmitter { config: Config, } impl DiffEmitter { pub(crate) fn new(config: Config) -> Self { Self { config } } } impl Emitter for DiffEmitter { fn emit_formatted_file( &mut 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/rustfmt/src/emitter/json.rs
src/tools/rustfmt/src/emitter/json.rs
use super::*; use crate::rustfmt_diff::{DiffLine, Mismatch, make_diff}; use serde::Serialize; use serde_json::to_string as to_json_string; #[derive(Debug, Default)] pub(crate) struct JsonEmitter { mismatched_files: Vec<MismatchedFile>, } #[derive(Debug, Default, PartialEq, Serialize)] struct MismatchedBlock { ...
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/src/emitter/files_with_backup.rs
src/tools/rustfmt/src/emitter/files_with_backup.rs
use super::*; use std::fs; #[derive(Debug, Default)] pub(crate) struct FilesWithBackupEmitter; impl Emitter for FilesWithBackupEmitter { fn emit_formatted_file( &mut self, _output: &mut dyn Write, FormattedFile { filename, original_text, formatted_text, ...
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/src/emitter/modified_lines.rs
src/tools/rustfmt/src/emitter/modified_lines.rs
use super::*; use crate::rustfmt_diff::{ModifiedLines, make_diff}; #[derive(Debug, Default)] pub(crate) struct ModifiedLinesEmitter; impl Emitter for ModifiedLinesEmitter { fn emit_formatted_file( &mut self, output: &mut dyn Write, FormattedFile { original_text, 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/src/emitter/checkstyle.rs
src/tools/rustfmt/src/emitter/checkstyle.rs
use self::xml::XmlEscaped; use super::*; use crate::rustfmt_diff::{DiffLine, Mismatch, make_diff}; mod xml; #[derive(Debug, Default)] pub(crate) struct CheckstyleEmitter; impl Emitter for CheckstyleEmitter { fn emit_header(&self, output: &mut dyn Write) -> Result<(), io::Error> { writeln!(output, r#"<?xm...
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/src/emitter/files.rs
src/tools/rustfmt/src/emitter/files.rs
use super::*; use std::fs; #[derive(Debug, Default)] pub(crate) struct FilesEmitter { print_misformatted_file_names: bool, } impl FilesEmitter { pub(crate) fn new(print_misformatted_file_names: bool) -> Self { Self { print_misformatted_file_names, } } } impl Emitter for FilesE...
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/src/emitter/checkstyle/xml.rs
src/tools/rustfmt/src/emitter/checkstyle/xml.rs
use std::fmt::{self, Display}; /// Convert special characters into XML entities. /// This is needed for checkstyle output. pub(super) struct XmlEscaped<'a>(pub(super) &'a str); impl<'a> Display for XmlEscaped<'a> { fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result { for char in self.0.chars...
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/src/test/parser.rs
src/tools/rustfmt/src/test/parser.rs
use std::io; use std::path::PathBuf; use super::read_config; use crate::modules::{ModuleResolutionError, ModuleResolutionErrorKind}; use crate::{ErrorKind, Input, Session}; #[test] fn parser_errors_in_submods_are_surfaced() { // See also https://github.com/rust-lang/rustfmt/issues/4126 let filename = "tests/...
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/src/test/mod_resolver.rs
src/tools/rustfmt/src/test/mod_resolver.rs
use std::io; use std::path::PathBuf; use super::read_config; use crate::{FileName, Input, Session}; fn verify_mod_resolution(input_file_name: &str, exp_misformatted_files: &[&str]) { let input_file = PathBuf::from(input_file_name); let config = read_config(&input_file); let mut session = Session::<io::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/src/test/mod.rs
src/tools/rustfmt/src/test/mod.rs
use std::collections::HashMap; use std::env; use std::fs; use std::io::{self, BufRead, BufReader, Read, Write}; use std::iter::Peekable; use std::mem; use std::path::{Path, PathBuf}; use std::process::{Command, Stdio}; use std::str::{Chars, FromStr}; use std::thread; use crate::config::{Color, Config, EmitMode, FileNa...
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/rustfmt/src/test/configuration_snippet.rs
src/tools/rustfmt/src/test/configuration_snippet.rs
use std::collections::{HashMap, HashSet}; use std::fs; use std::io::{BufRead, BufReader, Write}; use std::iter::Enumerate; use std::path::{Path, PathBuf}; use super::{DIFF_CONTEXT_SIZE, print_mismatches, write_message}; use crate::config::{Config, EmitMode, Verbosity}; use crate::rustfmt_diff::{Mismatch, make_diff}; 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/src/git-rustfmt/main.rs
src/tools/rustfmt/src/git-rustfmt/main.rs
// We need this feature as it changes `dylib` linking behavior and allows us to link to // `rustc_driver`. #![feature(rustc_private)] use std::env; use std::io::stdout; use std::path::{Path, PathBuf}; use std::process::Command; use std::str::FromStr; use getopts::{Matches, Options}; use rustfmt_nightly as rustfmt; us...
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/src/bin/main.rs
src/tools/rustfmt/src/bin/main.rs
#![feature(rustc_private)] use anyhow::{Result, format_err}; use io::Error as IoError; use thiserror::Error; use rustfmt_nightly as rustfmt; use tracing_subscriber::EnvFilter; use std::collections::HashMap; use std::env; use std::fs::File; use std::io::{self, Read, Write, stdout}; use std::path::{Path, PathBuf}; us...
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/rustfmt/src/modules/visitor.rs
src/tools/rustfmt/src/modules/visitor.rs
use rustc_ast::ast; use rustc_ast::visit::Visitor; use rustc_span::Symbol; use tracing::debug; use crate::attr::MetaVisitor; use crate::parse::macros::cfg_if::parse_cfg_if; use crate::parse::session::ParseSess; pub(crate) struct ModItem { pub(crate) item: ast::Item, } /// Traverse `cfg_if!` macro and fetch modul...
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/src/formatting/newline_style.rs
src/tools/rustfmt/src/formatting/newline_style.rs
use crate::NewlineStyle; /// Apply this newline style to the formatted text. When the style is set /// to `Auto`, the `raw_input_text` is used to detect the existing line /// endings. /// /// If the style is set to `Auto` and `raw_input_text` contains no /// newlines, the `Native` style will be used. pub(crate) fn app...
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/src/formatting/generated.rs
src/tools/rustfmt/src/formatting/generated.rs
use crate::Config; /// Returns `true` if the given span is a part of generated files. pub(super) fn is_generated_file(original_snippet: &str, config: &Config) -> bool { original_snippet .lines() // looking for marker only in the beginning of the file .take(config.generated_marker_line_searc...
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/src/config/macro_names.rs
src/tools/rustfmt/src/config/macro_names.rs
//! This module contains types and functions to support formatting specific macros. use itertools::Itertools; use std::{fmt, str}; use serde::{Deserialize, Deserializer, Serialize}; use serde_json as json; use thiserror::Error; /// Defines the name of a macro. #[derive(Clone, Debug, Eq, PartialEq, Hash, Ord, Partial...
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/src/config/file_lines.rs
src/tools/rustfmt/src/config/file_lines.rs
//! This module contains types and functions to support formatting specific line ranges. use itertools::Itertools; use std::collections::HashMap; use std::path::PathBuf; use std::sync::Arc; use std::{cmp, fmt, iter, str}; use rustc_span::SourceFile; use serde::{Deserialize, Deserializer, Serialize, Serializer, ser}; ...
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/src/config/config_type.rs
src/tools/rustfmt/src/config/config_type.rs
use crate::config::file_lines::FileLines; use crate::config::macro_names::MacroSelectors; use crate::config::options::{IgnoreList, WidthHeuristics}; /// Trait for types that can be used in `Config`. pub(crate) trait ConfigType: Sized { /// Returns hint text for use in `Config::print_docs()`. For enum types, this 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/src/config/lists.rs
src/tools/rustfmt/src/config/lists.rs
//! Configuration options related to rewriting a list. use rustfmt_config_proc_macro::config_type; use crate::config::IndentStyle; /// The definitive formatting tactic for lists. #[derive(Eq, PartialEq, Debug, Copy, Clone)] pub enum DefinitiveListTactic { Vertical, Horizontal, Mixed, /// Special case...
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/src/config/options.rs
src/tools/rustfmt/src/config/options.rs
#![allow(unused_imports)] use std::collections::{HashSet, hash_set}; use std::fmt; use std::path::{Path, PathBuf}; use std::str::FromStr; use itertools::Itertools; use rustfmt_config_proc_macro::config_type; use serde::de::{SeqAccess, Visitor}; use serde::ser::SerializeSeq; use serde::{Deserialize, Deserializer, Seri...
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/src/config/mod.rs
src/tools/rustfmt/src/config/mod.rs
use std::cell::Cell; use std::fs::File; use std::io::{Error, ErrorKind, Read}; use std::path::{Path, PathBuf}; use std::{env, fs}; use thiserror::Error; use crate::config::config_type::ConfigType; #[allow(unreachable_pub)] pub use crate::config::file_lines::{FileLines, FileName, Range}; #[allow(unreachable_pub)] pub ...
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/rustfmt/src/config/style_edition.rs
src/tools/rustfmt/src/config/style_edition.rs
use crate::config::StyleEdition; /// Defines the default value for the given style edition #[allow(dead_code)] pub trait StyleEditionDefault { type ConfigType; fn style_edition_default(style_edition: StyleEdition) -> Self::ConfigType; } /// macro to help implement `StyleEditionDefault` for config options #[ma...
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/src/format-diff/main.rs
src/tools/rustfmt/src/format-diff/main.rs
// Inspired by Clang's clang-format-diff: // // https://github.com/llvm-mirror/clang/blob/master/tools/clang-format/clang-format-diff.py #![deny(warnings)] use serde::{Deserialize, Serialize}; use serde_json as json; use thiserror::Error; use tracing::debug; use tracing_subscriber::EnvFilter; use std::collections::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/src/attr/doc_comment.rs
src/tools/rustfmt/src/attr/doc_comment.rs
use crate::comment::CommentStyle; use std::fmt::{self, Display}; /// Formats a string as a doc comment using the given [`CommentStyle`]. pub(super) struct DocCommentFormatter<'a> { literal: &'a str, style: CommentStyle<'a>, } impl<'a> DocCommentFormatter<'a> { pub(super) const fn new(literal: &'a str, sty...
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/mod-resolver/test-submodule-issue-5119/src/lib.rs
src/tools/rustfmt/tests/mod-resolver/test-submodule-issue-5119/src/lib.rs
pub fn foo() -> i32 { 3 } pub fn bar() -> i32 { 4 }
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/mod-resolver/test-submodule-issue-5119/tests/test1.rs
src/tools/rustfmt/tests/mod-resolver/test-submodule-issue-5119/tests/test1.rs
mod test1 { #[cfg(unix)] mod sub1; #[cfg(not(unix))] mod sub2; mod sub3; }
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/mod-resolver/test-submodule-issue-5119/tests/test1/sub2.rs
src/tools/rustfmt/tests/mod-resolver/test-submodule-issue-5119/tests/test1/sub2.rs
use rustfmt_test_submodule_issue::bar; #[test] fn test_bar() { assert_eq!(4, 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/mod-resolver/test-submodule-issue-5119/tests/test1/sub1.rs
src/tools/rustfmt/tests/mod-resolver/test-submodule-issue-5119/tests/test1/sub1.rs
use rustfmt_test_submodule_issue::foo; #[test] fn test_foo() { assert_eq!(3, 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/mod-resolver/test-submodule-issue-5119/tests/test1/sub3/sub4.rs
src/tools/rustfmt/tests/mod-resolver/test-submodule-issue-5119/tests/test1/sub3/sub4.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/mod-resolver/test-submodule-issue-5119/tests/test1/sub3/mod.rs
src/tools/rustfmt/tests/mod-resolver/test-submodule-issue-5119/tests/test1/sub3/mod.rs
mod sub4;
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/mod-resolver/issue-5198/lib.rs
src/tools/rustfmt/tests/mod-resolver/issue-5198/lib.rs
mod a; mod b; mod 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/mod-resolver/issue-5198/a.rs
src/tools/rustfmt/tests/mod-resolver/issue-5198/a.rs
fn main( ) { println!("Hello World!") }
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/mod-resolver/issue-5198/lib/b.rs
src/tools/rustfmt/tests/mod-resolver/issue-5198/lib/b.rs
fn main( ) { println!("Hello World!") }
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/mod-resolver/issue-5198/lib/c/e.rs
src/tools/rustfmt/tests/mod-resolver/issue-5198/lib/c/e.rs
fn main( ) { println!("Hello World!") }
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/mod-resolver/issue-5198/lib/c/d.rs
src/tools/rustfmt/tests/mod-resolver/issue-5198/lib/c/d.rs
mod e; mod f; mod 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/mod-resolver/issue-5198/lib/c/mod.rs
src/tools/rustfmt/tests/mod-resolver/issue-5198/lib/c/mod.rs
mod d; fn main( ) { println!("Hello World!") }
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/mod-resolver/issue-5198/lib/c/d/f.rs
src/tools/rustfmt/tests/mod-resolver/issue-5198/lib/c/d/f.rs
fn main( ) { println!("Hello World!") }
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/mod-resolver/issue-5198/lib/c/d/g/mod.rs
src/tools/rustfmt/tests/mod-resolver/issue-5198/lib/c/d/g/mod.rs
fn main( ) { println!("Hello World!") }
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/mod-resolver/issue-5063/main.rs
src/tools/rustfmt/tests/mod-resolver/issue-5063/main.rs
fn main() { println!("Hello, world!"); } mod 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/mod-resolver/issue-5063/foo.rs
src/tools/rustfmt/tests/mod-resolver/issue-5063/foo.rs
mod bar { mod baz;}
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/mod-resolver/issue-5063/foo/bar/baz.rs
src/tools/rustfmt/tests/mod-resolver/issue-5063/foo/bar/baz.rs
fn baz() { }
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/mod-resolver/module-not-found/relative_module/lib.rs
src/tools/rustfmt/tests/mod-resolver/module-not-found/relative_module/lib.rs
mod 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/mod-resolver/module-not-found/relative_module/a.rs
src/tools/rustfmt/tests/mod-resolver/module-not-found/relative_module/a.rs
// module resolution fails because `./a/b.rs` does not exist mod 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/mod-resolver/module-not-found/bad_path_attribute/lib.rs
src/tools/rustfmt/tests/mod-resolver/module-not-found/bad_path_attribute/lib.rs
// module resolution fails because the path does not exist. #[path = "path/to/does_not_exist.rs"] mod 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/mod-resolver/module-not-found/sibling_module/lib.rs
src/tools/rustfmt/tests/mod-resolver/module-not-found/sibling_module/lib.rs
// module resolution fails because `./a.rs` does not exist mod 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/mod-resolver/skip-files-issue-5065/one.rs
src/tools/rustfmt/tests/mod-resolver/skip-files-issue-5065/one.rs
struct One { value: 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/mod-resolver/skip-files-issue-5065/main.rs
src/tools/rustfmt/tests/mod-resolver/skip-files-issue-5065/main.rs
#![rustfmt::skip] mod foo; mod one; fn main() {println!("Hello, world!"); } // trailing 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/mod-resolver/skip-files-issue-5065/foo.rs
src/tools/rustfmt/tests/mod-resolver/skip-files-issue-5065/foo.rs
#![rustfmt::skip] mod bar { mod baz;}
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/mod-resolver/skip-files-issue-5065/foo/bar/baz.rs
src/tools/rustfmt/tests/mod-resolver/skip-files-issue-5065/foo/bar/baz.rs
fn baz() { }
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/mod-resolver/issue-5167/src/lib.rs
src/tools/rustfmt/tests/mod-resolver/issue-5167/src/lib.rs
mod 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/mod-resolver/issue-5167/src/a.rs
src/tools/rustfmt/tests/mod-resolver/issue-5167/src/a.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/mod-resolver/issue-5167/src/a/mod.rs
src/tools/rustfmt/tests/mod-resolver/issue-5167/src/a/mod.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/mod-resolver/issue-4874/main.rs
src/tools/rustfmt/tests/mod-resolver/issue-4874/main.rs
fn main() { println!("Hello, world!"); } mod foo; mod bar { mod baz; }
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/mod-resolver/issue-4874/foo.rs
src/tools/rustfmt/tests/mod-resolver/issue-4874/foo.rs
mod qux;
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/mod-resolver/issue-4874/bar/baz.rs
src/tools/rustfmt/tests/mod-resolver/issue-4874/bar/baz.rs
fn fail_fmt_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/mod-resolver/issue-4874/foo/qux.rs
src/tools/rustfmt/tests/mod-resolver/issue-4874/foo/qux.rs
fn badly_formatted ( ) {}
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/cargo-fmt/main.rs
src/tools/rustfmt/tests/cargo-fmt/main.rs
// Integration tests for cargo-fmt. use std::env; use std::path::Path; use std::process::Command; use rustfmt_config_proc_macro::rustfmt_only_ci_test; /// Run the cargo-fmt executable and return its output. fn cargo_fmt(args: &[&str]) -> (String, String) { let mut bin_dir = env::current_exe().unwrap(); bin_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/cargo-fmt/source/divergent-crate-dir-names/src/main.rs
src/tools/rustfmt/tests/cargo-fmt/source/divergent-crate-dir-names/src/main.rs
fn main() { println!("Hello, world!"); }
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/cargo-fmt/source/divergent-crate-dir-names/dependency-dir-name/src/lib.rs
src/tools/rustfmt/tests/cargo-fmt/source/divergent-crate-dir-names/dependency-dir-name/src/lib.rs
#[cfg(test)] mod tests { #[test] fn it_works() { assert_eq!(2 + 2, 4); } }
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/cargo-fmt/source/divergent-crate-dir-names/dependency-dir-name/subdep-dir-name/src/lib.rs
src/tools/rustfmt/tests/cargo-fmt/source/divergent-crate-dir-names/dependency-dir-name/subdep-dir-name/src/lib.rs
#[cfg(test)] mod tests { #[test] fn sub_test_that_works() { assert_eq!(3 + 3, 6); } }
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/cargo-fmt/source/issue_3164/src/main.rs
src/tools/rustfmt/tests/cargo-fmt/source/issue_3164/src/main.rs
#[allow(unused_macros)] macro_rules! foo { ($id:ident) => { macro_rules! bar { ($id2:tt) => { #[cfg(any(target_feature = $id2, target_feature = $id2, target_feature = $id2, target_feature = $id2, target_feature = $id2))] fn $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/cargo-fmt/source/workspaces/path-dep-above/ws/a/src/main.rs
src/tools/rustfmt/tests/cargo-fmt/source/workspaces/path-dep-above/ws/a/src/main.rs
struct 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/cargo-fmt/source/workspaces/path-dep-above/ws/a/d/f/src/lib.rs
src/tools/rustfmt/tests/cargo-fmt/source/workspaces/path-dep-above/ws/a/d/f/src/lib.rs
struct F{ }
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/cargo-fmt/source/workspaces/path-dep-above/ws/a/d/src/lib.rs
src/tools/rustfmt/tests/cargo-fmt/source/workspaces/path-dep-above/ws/a/d/src/lib.rs
struct 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/cargo-fmt/source/workspaces/path-dep-above/ws/c/src/lib.rs
src/tools/rustfmt/tests/cargo-fmt/source/workspaces/path-dep-above/ws/c/src/lib.rs
struct 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/cargo-fmt/source/workspaces/path-dep-above/ws/b/src/main.rs
src/tools/rustfmt/tests/cargo-fmt/source/workspaces/path-dep-above/ws/b/src/main.rs
struct 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/cargo-fmt/source/workspaces/path-dep-above/e/src/main.rs
src/tools/rustfmt/tests/cargo-fmt/source/workspaces/path-dep-above/e/src/main.rs
struct E{ }
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/coverage/source/comments.rs
src/tools/rustfmt/tests/coverage/source/comments.rs
// rustfmt-emit_mode: coverage /// Here's a doc comment! fn main() { // foo is bar let foo = "bar"; // loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong 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/coverage/target/comments.rs
src/tools/rustfmt/tests/coverage/target/comments.rs
XX XXXXXXXXXXXXXXXXXX XXXXXXXX /// Here's a doc comment! fn main() { XX XXX XX XXX let foo = "bar"; XX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXX }
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/hello2.rs
src/tools/rustfmt/tests/source/hello2.rs
// rustfmt-config: small_tabs.toml // rustfmt-target: hello.rs // Smoke test - hello world. fn main( ) { println!("Hello world!"); }
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false