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/bootstrap/src/core/android.rs
src/bootstrap/src/core/android.rs
use std::path::PathBuf; use crate::core::builder::Builder; use crate::core::config::TargetSelection; pub(crate) struct Android { pub(crate) adb_path: &'static str, pub(crate) adb_test_dir: &'static str, pub(crate) android_cross_path: PathBuf, } pub(crate) fn discover_android(builder: &Builder<'_>, target...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/bootstrap/src/core/mod.rs
src/bootstrap/src/core/mod.rs
pub(crate) mod android; pub(crate) mod build_steps; pub(crate) mod builder; pub(crate) mod config; pub(crate) mod debuggers; pub(crate) mod download; pub(crate) mod metadata; pub(crate) mod sanity;
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/bootstrap/src/core/metadata.rs
src/bootstrap/src/core/metadata.rs
//! This module interacts with Cargo metadata to collect and store information about //! the packages in the Rust workspace. //! //! It runs `cargo metadata` to gather details about each package, including its name, //! source, dependencies, targets, and available features. The collected metadata is then //! used to up...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/bootstrap/src/core/builder/cli_paths.rs
src/bootstrap/src/core/builder/cli_paths.rs
//! Various pieces of code for dealing with "paths" passed to bootstrap on the //! command-line, extracted from `core/builder/mod.rs` because that file is //! large and hard to navigate. use std::fmt::{self, Debug}; use std::path::PathBuf; use crate::core::builder::{Builder, Kind, PathSet, ShouldRun, StepDescription}...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/bootstrap/src/core/builder/tests.rs
src/bootstrap/src/core/builder/tests.rs
use std::env::VarError; use std::{panic, thread}; use build_helper::stage0_parser::parse_stage0_file; use llvm::prebuilt_llvm_config; use super::*; use crate::Flags; use crate::core::build_steps::doc::DocumentationFormat; use crate::core::builder::cli_paths::PATH_REMAP; use crate::core::config::Config; use crate::uti...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
true
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/bootstrap/src/core/builder/mod.rs
src/bootstrap/src/core/builder/mod.rs
use std::any::{Any, type_name}; use std::cell::{Cell, RefCell}; use std::collections::BTreeSet; use std::fmt::{Debug, Write}; use std::hash::Hash; use std::ops::Deref; use std::path::{Path, PathBuf}; use std::sync::OnceLock; use std::time::{Duration, Instant}; use std::{env, fs}; use clap::ValueEnum; #[cfg(feature = "...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
true
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/bootstrap/src/core/builder/cargo.rs
src/bootstrap/src/core/builder/cargo.rs
use std::env; use std::ffi::{OsStr, OsString}; use std::path::{Path, PathBuf}; use build_helper::ci::CiEnv; use super::{Builder, Kind}; use crate::core::build_steps::test; use crate::core::build_steps::tool::SourceType; use crate::core::config::SplitDebuginfo; use crate::core::config::flags::Color; use crate::utils::...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
true
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/bootstrap/src/core/builder/cli_paths/tests.rs
src/bootstrap/src/core/builder/cli_paths/tests.rs
use std::collections::{BTreeSet, HashSet}; use std::fs; use std::path::{Path, PathBuf}; use std::sync::{Arc, Mutex}; use crate::Build; use crate::core::builder::cli_paths::match_paths_to_steps_and_run; use crate::core::builder::{Builder, StepDescription}; use crate::utils::tests::TestCtx; fn render_steps_for_cli_args...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/bootstrap/src/core/build_steps/setup.rs
src/bootstrap/src/core/build_steps/setup.rs
//! First time setup of a dev environment //! //! These are build-and-run steps for `./x.py setup`, which allows quickly setting up the directory //! for modifying, building, and running the compiler and library. Running arbitrary configuration //! allows setting up things that cannot be simply captured inside the boot...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/bootstrap/src/core/build_steps/synthetic_targets.rs
src/bootstrap/src/core/build_steps/synthetic_targets.rs
//! In some cases, parts of bootstrap need to change part of a target spec just for one or a few //! steps. Adding these targets to rustc proper would "leak" this implementation detail of //! bootstrap, and would make it more complex to apply additional changes if the need arises. //! //! To address that problem, this ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/bootstrap/src/core/build_steps/test.rs
src/bootstrap/src/core/build_steps/test.rs
//! Build-and-run steps for `./x.py test` test fixtures //! //! `./x.py test` (aka [`Kind::Test`]) is currently allowed to reach build steps in other modules. //! However, this contains ~all test parts we expect people to be able to build and run locally. // (This file should be split up, but having tidy block all cha...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
true
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/bootstrap/src/core/build_steps/gcc.rs
src/bootstrap/src/core/build_steps/gcc.rs
//! Compilation of native dependencies like GCC. //! //! Native projects like GCC unfortunately aren't suited just yet for //! compilation in build scripts that Cargo has. This is because the //! compilation takes a *very* long time but also because we don't want to //! compile GCC 3 times as part of a normal bootstrap...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/bootstrap/src/core/build_steps/compile.rs
src/bootstrap/src/core/build_steps/compile.rs
//! Implementation of compiling various phases of the compiler and standard //! library. //! //! This module contains some of the real meat in the bootstrap build system //! which is where Cargo is used to compile the standard library, libtest, and //! the compiler. This module is also responsible for assembling the sy...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
true
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/bootstrap/src/core/build_steps/doc.rs
src/bootstrap/src/core/build_steps/doc.rs
//! Documentation generation for bootstrap. //! //! This module implements generation for all bits and pieces of documentation //! for the Rust project. This notably includes suites like the rust book, the //! nomicon, rust by example, standalone documentation, etc. //! //! Everything here is basically just a shim arou...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
true
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/bootstrap/src/core/build_steps/perf.rs
src/bootstrap/src/core/build_steps/perf.rs
use std::env::consts::EXE_EXTENSION; use std::fmt::{Display, Formatter}; use crate::core::build_steps::compile::Sysroot; use crate::core::build_steps::tool::{RustcPerf, Rustdoc}; use crate::core::builder::Builder; use crate::core::config::DebuginfoLevel; use crate::utils::exec::{BootstrapCommand, command}; #[derive(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/bootstrap/src/core/build_steps/llvm.rs
src/bootstrap/src/core/build_steps/llvm.rs
//! Compilation of native dependencies like LLVM. //! //! Native projects like LLVM unfortunately aren't suited just yet for //! compilation in build scripts that Cargo has. This is because the //! compilation takes a *very* long time but also because we don't want to //! compile LLVM 3 times as part of a normal bootst...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
true
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/bootstrap/src/core/build_steps/check.rs
src/bootstrap/src/core/build_steps/check.rs
//! Implementation of compiling the compiler and standard library, in "check"-based modes. use std::fs; use std::path::{Path, PathBuf}; use crate::core::build_steps::compile::{ add_to_sysroot, run_cargo, rustc_cargo, rustc_cargo_env, std_cargo, std_crates_for_run_make, }; use crate::core::build_steps::tool; use 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/bootstrap/src/core/build_steps/install.rs
src/bootstrap/src/core/build_steps/install.rs
//! Implementation of the install aspects of the compiler. //! //! This module is responsible for installing the standard library, //! compiler, and documentation. use std::path::{Component, Path, PathBuf}; use std::{env, fs}; use crate::core::build_steps::dist; use crate::core::build_steps::tool::RustcPrivateCompile...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/bootstrap/src/core/build_steps/toolstate.rs
src/bootstrap/src/core/build_steps/toolstate.rs
//! [Toolstate] checks to keep tools building //! //! Reachable via `./x.py test` but mostly relevant for CI, since it isn't run locally by default. //! //! [Toolstate]: https://forge.rust-lang.org/infra/toolstate.html use std::collections::HashMap; use std::io::{Seek, SeekFrom}; use std::path::{Path, PathBuf}; use 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/bootstrap/src/core/build_steps/mod.rs
src/bootstrap/src/core/build_steps/mod.rs
pub(crate) mod check; pub(crate) mod clean; pub(crate) mod clippy; pub(crate) mod compile; pub(crate) mod dist; pub(crate) mod doc; pub(crate) mod format; pub(crate) mod gcc; pub(crate) mod install; pub(crate) mod llvm; pub(crate) mod perf; pub(crate) mod run; pub(crate) mod setup; pub(crate) mod synthetic_targets; pub...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/bootstrap/src/core/build_steps/format.rs
src/bootstrap/src/core/build_steps/format.rs
//! Runs rustfmt on the repository. use std::collections::VecDeque; use std::path::{Path, PathBuf}; use std::process::Command; use std::sync::Mutex; use std::sync::mpsc::SyncSender; use build_helper::git::get_git_modified_files; use ignore::WalkBuilder; use crate::core::builder::{Builder, Kind}; use crate::utils::bu...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/bootstrap/src/core/build_steps/run.rs
src/bootstrap/src/core/build_steps/run.rs
//! Build-and-run steps for in-repo tools //! //! A bit of a hodge-podge as e.g. if a tool's a test fixture it should be in `build_steps::test`. //! If it can be reached from `./x.py run` it can go here. use std::path::PathBuf; use build_helper::exit; use build_helper::git::get_git_untracked_files; use clap_complete:...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/bootstrap/src/core/build_steps/tool.rs
src/bootstrap/src/core/build_steps/tool.rs
//! This module handles building and managing various tools in bootstrap //! build system. //! //! **What It Does** //! - Defines how tools are built, configured and installed. //! - Manages tool dependencies and build steps. //! - Copies built tool binaries to the correct locations. //! //! Each Rust tool **MUST** uti...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
true
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/bootstrap/src/core/build_steps/dist.rs
src/bootstrap/src/core/build_steps/dist.rs
//! Implementation of the various distribution aspects of the compiler. //! //! This module is responsible for creating tarballs of the standard library, //! compiler, and documentation. This ends up being what we distribute to //! everyone as well. //! //! No tarball is actually created literally in this file, but rat...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
true
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/bootstrap/src/core/build_steps/vendor.rs
src/bootstrap/src/core/build_steps/vendor.rs
//! Handles the vendoring process for the bootstrap system. //! //! This module ensures that all required Cargo dependencies are gathered //! and stored in the `<src>/<VENDOR_DIR>` directory. use std::path::PathBuf; use crate::core::build_steps::tool::SUBMODULES_FOR_RUSTBOOK; use crate::core::builder::{Builder, RunCon...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/bootstrap/src/core/build_steps/clean.rs
src/bootstrap/src/core/build_steps/clean.rs
//! `./x.py clean` //! //! Responsible for cleaning out a build directory of all old and stale //! artifacts to prepare for a fresh build. Currently doesn't remove the //! `build/cache` directory (download cache) or the `build/$target/llvm` //! directory unless the `--all` flag is present. use std::fs; use std::io::{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/bootstrap/src/core/build_steps/clippy.rs
src/bootstrap/src/core/build_steps/clippy.rs
//! Implementation of running clippy on the compiler, standard library and various tools. //! //! This serves a double purpose: //! - The first is to run Clippy itself on in-tree code, in order to test and dogfood it. //! - The second is to actually lint the in-tree codebase on CI, with a hard-coded set of rules, //! ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/bootstrap/src/core/build_steps/test/compiletest.rs
src/bootstrap/src/core/build_steps/test/compiletest.rs
use std::fmt; /// Enum of all the "test modes" understood by compiletest. /// /// Some of these mode names happen to overlap with the names of test suite /// directories, but the relationship between modes and suites is not 1:1. /// For example: /// - Mode `ui` is used by suites `tests/ui` and `tests/rustdoc-ui` /// -...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/bootstrap/src/core/build_steps/setup/tests.rs
src/bootstrap/src/core/build_steps/setup/tests.rs
use sha2::Digest; use super::EditorKind; use crate::utils::helpers::hex_encode; #[test] fn check_matching_settings_hash() { for editor in EditorKind::ALL { let mut hasher = sha2::Sha256::new(); hasher.update(&editor.settings_template()); let hash = hex_encode(hasher.finalize().as_slice());...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/bootstrap/src/core/config/config.rs
src/bootstrap/src/core/config/config.rs
//! This module defines the central `Config` struct, which aggregates all components //! of the bootstrap configuration into a single unit. //! //! It serves as the primary public interface for accessing the bootstrap configuration. //! The module coordinates the overall configuration parsing process using logic from `...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
true
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/bootstrap/src/core/config/tests.rs
src/bootstrap/src/core/config/tests.rs
use std::collections::BTreeSet; use std::fs::{File, remove_file}; use std::io::Write; use std::path::{Path, PathBuf}; use std::{env, fs}; use build_helper::ci::CiEnv; use build_helper::git::PathFreshness; use clap::CommandFactory; use serde::Deserialize; use super::flags::Flags; use super::toml::change_id::ChangeIdWr...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/bootstrap/src/core/config/flags.rs
src/bootstrap/src/core/config/flags.rs
//! Command-line interface of the bootstrap build system. //! //! This module implements the command-line parsing of the build system which //! has various flags to configure how it's run. use std::path::{Path, PathBuf}; use clap::{CommandFactory, Parser, ValueEnum}; use clap_complete::Generator; #[cfg(feature = "tra...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/bootstrap/src/core/config/mod.rs
src/bootstrap/src/core/config/mod.rs
//! Entry point for the `config` module. //! //! This module defines two macros: //! //! - `define_config!`: A declarative macro used instead of `#[derive(Deserialize)]` to reduce //! compile time and binary size, especially for the bootstrap binary. //! //! - `check_ci_llvm!`: A compile-time assertion macro that ens...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/bootstrap/src/core/config/target_selection.rs
src/bootstrap/src/core/config/target_selection.rs
use std::fmt; use crate::core::config::SplitDebuginfo; use crate::utils::cache::{INTERNER, Interned}; use crate::{Path, env}; #[derive(Copy, Clone, Default, PartialEq, Eq, PartialOrd, Ord, Hash)] // N.B.: This type is used everywhere, and the entire codebase relies on it being Copy. // Making !Copy is highly nontrivi...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/bootstrap/src/core/config/toml/change_id.rs
src/bootstrap/src/core/config/toml/change_id.rs
use serde::{Deserialize, Deserializer}; use serde_derive::Deserialize; /// This enum is used for deserializing change IDs from TOML, allowing both numeric values and the string `"ignore"`. #[derive(Clone, Debug, PartialEq)] pub enum ChangeId { Ignore, Id(usize), } /// Since we use `#[serde(deny_unknown_fields...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/bootstrap/src/core/config/toml/rust.rs
src/bootstrap/src/core/config/toml/rust.rs
//! This module defines the `Rust` struct, which represents the `[rust]` table //! in the `bootstrap.toml` configuration file. use serde::{Deserialize, Deserializer}; use crate::core::config::toml::TomlConfig; use crate::core::config::{DebuginfoLevel, Merge, ReplaceOpt, StringOrBool}; use crate::{BTreeSet, CodegenBac...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/bootstrap/src/core/config/toml/gcc.rs
src/bootstrap/src/core/config/toml/gcc.rs
//! This module defines the `Gcc` struct, which represents the `[gcc]` table //! in the `bootstrap.toml` configuration file. //! //! The `[gcc]` table contains options specifically related to building or //! acquiring the GCC compiler for use within the Rust build process. use serde::{Deserialize, Deserializer}; use ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/bootstrap/src/core/config/toml/llvm.rs
src/bootstrap/src/core/config/toml/llvm.rs
//! This module defines the `Llvm` struct, which represents the `[llvm]` table //! in the `bootstrap.toml` configuration file. use serde::{Deserialize, Deserializer}; use crate::core::config::StringOrBool; use crate::core::config::toml::{Merge, ReplaceOpt, TomlConfig}; use crate::{HashMap, HashSet, PathBuf, define_co...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/bootstrap/src/core/config/toml/target.rs
src/bootstrap/src/core/config/toml/target.rs
//! This module defines the structures and logic for handling target-specific configuration //! within the `bootstrap.toml` file. This allows you to customize build settings, tools, //! and flags for individual compilation targets. //! //! It includes: //! //! * [`TomlTarget`]: This struct directly mirrors the `[target...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/bootstrap/src/core/config/toml/install.rs
src/bootstrap/src/core/config/toml/install.rs
//! This module defines the `Install` struct, which represents the `[install]` table //! in the `bootstrap.toml` configuration file. //! //! The `[install]` table contains options that specify the installation paths //! for various components of the Rust toolchain. These paths determine where //! executables, libraries...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/bootstrap/src/core/config/toml/build.rs
src/bootstrap/src/core/config/toml/build.rs
//! This module defines the `Build` struct, which represents the `[build]` table //! in the `bootstrap.toml` configuration file. //! //! The `[build]` table contains global options that influence the overall build process, //! such as default host and target triples, paths to tools, build directories, and //! various 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/bootstrap/src/core/config/toml/mod.rs
src/bootstrap/src/core/config/toml/mod.rs
//! This module defines the structures that directly mirror the `bootstrap.toml` //! file's format. These types are used for `serde` deserialization. //! //! Crucially, this module also houses the core logic for loading, parsing, and merging //! these raw TOML configurations from various sources (the main `bootstrap.to...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/bootstrap/src/core/config/toml/dist.rs
src/bootstrap/src/core/config/toml/dist.rs
//! This module defines the `Dist` struct, which represents the `[dist]` table //! in the `bootstrap.toml` configuration file. //! //! The `[dist]` table contains options related to the distribution process, //! including signing, uploading artifacts, source tarballs, compression settings, //! and inclusion of specific...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/bootstrap/src/core/debuggers/gdb.rs
src/bootstrap/src/core/debuggers/gdb.rs
use std::borrow::Cow; use std::path::Path; use crate::core::android; use crate::core::builder::Builder; use crate::utils::exec::BootstrapCommand; pub(crate) struct Gdb<'a> { pub(crate) gdb: Cow<'a, Path>, } pub(crate) fn discover_gdb<'a>( builder: &'a Builder<'_>, android: Option<&android::Android>, ) ->...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/bootstrap/src/core/debuggers/lldb.rs
src/bootstrap/src/core/debuggers/lldb.rs
use std::path::PathBuf; use crate::core::builder::Builder; use crate::utils::exec::command; pub(crate) struct Lldb { pub(crate) lldb_exe: PathBuf, pub(crate) lldb_version: String, } pub(crate) fn discover_lldb(builder: &Builder<'_>) -> Option<Lldb> { // FIXME(#148361): We probably should not be picking 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/bootstrap/src/core/debuggers/cdb.rs
src/bootstrap/src/core/debuggers/cdb.rs
use std::env; use std::path::PathBuf; use crate::core::config::TargetSelection; pub(crate) struct Cdb { pub(crate) cdb: PathBuf, } /// FIXME: This CDB discovery code was very questionable when it was in /// compiletest, and it's just as questionable now that it's in bootstrap. pub(crate) fn discover_cdb(target: ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/bootstrap/src/core/debuggers/mod.rs
src/bootstrap/src/core/debuggers/mod.rs
//! Code for discovering debuggers and debugger-related configuration, so that //! it can be passed to compiletest when running debuginfo tests. pub(crate) use self::cdb::{Cdb, discover_cdb}; pub(crate) use self::gdb::{Gdb, discover_gdb}; pub(crate) use self::lldb::{Lldb, discover_lldb}; mod cdb; mod gdb; mod lldb;
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/librustdoc/config.rs
src/librustdoc/config.rs
use std::collections::BTreeMap; use std::ffi::OsStr; use std::io::Read; use std::path::{Path, PathBuf}; use std::str::FromStr; use std::{fmt, io}; use rustc_data_structures::fx::FxIndexMap; use rustc_errors::DiagCtxtHandle; use rustc_session::config::{ self, CodegenOptions, CrateType, ErrorOutputType, Externs, Inp...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
true
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/librustdoc/visit_lib.rs
src/librustdoc/visit_lib.rs
use rustc_hir::def::DefKind; use rustc_hir::def_id::{DefId, DefIdSet}; use rustc_middle::ty::TyCtxt; use crate::core::DocContext; // FIXME: this may not be exhaustive, but is sufficient for rustdocs current uses #[derive(Default)] pub(crate) struct RustdocEffectiveVisibilities { extern_public: DefIdSet, } macro...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/librustdoc/fold.rs
src/librustdoc/fold.rs
use std::mem; use crate::clean::*; pub(crate) fn strip_item(mut item: Item) -> Item { if !matches!(item.inner.kind, StrippedItem(..)) { item.inner.kind = StrippedItem(Box::new(item.inner.kind)); } item } pub(crate) trait DocFolder: Sized { fn fold_item(&mut self, item: Item) -> Option<Item> {...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/librustdoc/lib.rs
src/librustdoc/lib.rs
// tidy-alphabetical-start #![doc( html_root_url = "https://doc.rust-lang.org/nightly/", html_playground_url = "https://play.rust-lang.org/" )] #![feature(ascii_char)] #![feature(ascii_char_variants)] #![feature(assert_matches)] #![feature(box_into_inner)] #![feature(box_patterns)] #![feature(file_buffered)] #!...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
true
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/librustdoc/theme.rs
src/librustdoc/theme.rs
use std::fs; use std::iter::Peekable; use std::path::Path; use std::str::Chars; use rustc_data_structures::fx::{FxIndexMap, IndexEntry}; use rustc_errors::DiagCtxtHandle; #[cfg(test)] mod tests; #[derive(Debug)] pub(crate) struct CssPath { pub(crate) rules: FxIndexMap<String, String>, pub(crate) children: Fx...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/librustdoc/scrape_examples.rs
src/librustdoc/scrape_examples.rs
//! This module analyzes crates to find call sites that can serve as examples in the documentation. use std::fs; use std::path::PathBuf; use rustc_data_structures::fx::FxIndexMap; use rustc_errors::DiagCtxtHandle; use rustc_hir::intravisit::{self, Visitor}; use rustc_hir::{self as hir}; use rustc_macros::{Decodable, ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/librustdoc/externalfiles.rs
src/librustdoc/externalfiles.rs
use std::path::{Path, PathBuf}; use std::{fs, str}; use rustc_errors::DiagCtxtHandle; use rustc_span::edition::Edition; use serde::Serialize; use crate::html::markdown::{ErrorCodes, HeadingOffset, IdMap, Markdown, Playground}; #[derive(Clone, Debug, Serialize)] pub(crate) struct ExternalHtml { /// Content that w...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/librustdoc/core.rs
src/librustdoc/core.rs
use std::sync::{Arc, LazyLock}; use std::{io, mem}; use rustc_data_structures::fx::{FxHashMap, FxHashSet, FxIndexMap}; use rustc_data_structures::unord::UnordSet; use rustc_driver::USING_INTERNAL_FEATURES; use rustc_errors::TerminalUrl; use rustc_errors::annotate_snippet_emitter_writer::AnnotateSnippetEmitter; use rus...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/librustdoc/lint.rs
src/librustdoc/lint.rs
use std::sync::LazyLock as Lazy; use rustc_data_structures::fx::FxHashMap; use rustc_lint::LintStore; use rustc_lint_defs::{Lint, LintId, declare_tool_lint}; use rustc_session::{Session, lint}; /// This function is used to setup the lint initialization. By default, in rustdoc, everything /// is "allowed". Depending 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/librustdoc/error.rs
src/librustdoc/error.rs
use std::error; use std::fmt::{self, Formatter}; use std::path::{Path, PathBuf}; use crate::docfs::PathError; #[derive(Debug)] pub(crate) struct Error { pub(crate) file: PathBuf, pub(crate) error: String, } impl error::Error for Error {} impl std::fmt::Display for Error { fn fmt(&self, f: &mut Formatter...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/librustdoc/build.rs
src/librustdoc/build.rs
use std::str; use sha2::Digest; fn main() { // generate sha256 files // this avoids having to perform hashing at runtime let files = &[ "static/css/rustdoc.css", "static/css/noscript.css", "static/css/normalize.css", "static/js/main.js", "static/js/search.js", ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/librustdoc/display.rs
src/librustdoc/display.rs
//! Various utilities for working with [`fmt::Display`] implementations. use std::fmt::{self, Display, Formatter, FormattingOptions}; pub(crate) trait Joined: IntoIterator { /// Takes an iterator over elements that implement [`Display`], and format them into `f`, separated by `sep`. /// /// This is simila...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/librustdoc/doctest.rs
src/librustdoc/doctest.rs
mod extracted; mod make; mod markdown; mod runner; mod rust; use std::fs::File; use std::hash::{Hash, Hasher}; use std::io::{self, Write}; use std::path::{Path, PathBuf}; use std::process::{self, Command, Stdio}; use std::str::FromStr; use std::sync::atomic::{AtomicUsize, Ordering}; use std::sync::{Arc, Mutex}; use st...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
true
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/librustdoc/markdown.rs
src/librustdoc/markdown.rs
//! Standalone markdown rendering. //! //! For the (much more common) case of rendering markdown in doc-comments, see //! [crate::html::markdown]. //! //! This is used when [rendering a markdown file to an html file][docs], without processing //! rust source code. //! //! [docs]: https://doc.rust-lang.org/stable/rustdo...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/librustdoc/visit.rs
src/librustdoc/visit.rs
use crate::clean::*; /// Allows a type to traverse the cleaned ast of a crate. /// /// Note that like [`rustc_ast::visit::Visitor`], but /// unlike [`rustc_lint::EarlyLintPass`], if you override a /// `visit_*` method, you will need to manually recurse into /// its contents. pub(crate) trait DocVisitor<'a>: Sized { ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/librustdoc/docfs.rs
src/librustdoc/docfs.rs
//! Rustdoc's FileSystem abstraction module. //! //! On Windows this indirects IO into threads to work around performance issues //! with Defender (and other similar virus scanners that do blocking operations). //! //! Only calls needed to permit this workaround have been abstracted: thus //! fs::read is still done dir...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/librustdoc/visit_ast.rs
src/librustdoc/visit_ast.rs
//! The Rust AST Visitor. Extracts useful information and massages it into a form //! usable for `clean`. use std::mem; use rustc_ast::attr::AttributeExt; use rustc_data_structures::fx::{FxHashSet, FxIndexMap}; use rustc_hir as hir; use rustc_hir::attrs::{AttributeKind, DocInline}; use rustc_hir::def::{DefKind, Macro...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/librustdoc/doctest/rust.rs
src/librustdoc/doctest/rust.rs
//! Doctest functionality used only for doctests in `.rs` source files. use std::cell::Cell; use std::str::FromStr; use std::sync::Arc; use proc_macro2::{TokenStream, TokenTree}; use rustc_attr_parsing::eval_config_entry; use rustc_hir::attrs::AttributeKind; use rustc_hir::def_id::{CRATE_DEF_ID, LocalDefId}; use rust...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/librustdoc/doctest/tests.rs
src/librustdoc/doctest/tests.rs
use std::path::PathBuf; use rustc_span::edition::Edition; use rustc_span::{DUMMY_SP, FileName}; use super::extracted::ExtractedDocTests; use super::{BuildDocTestBuilder, GlobalTestOptions, ScrapedDocTest}; use crate::html::markdown::LangString; fn make_test( test_code: &str, crate_name: Option<&str>, don...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/librustdoc/doctest/runner.rs
src/librustdoc/doctest/runner.rs
use std::fmt::Write; use std::time::Duration; use rustc_data_structures::fx::FxIndexSet; use rustc_span::edition::Edition; use crate::doctest::{ DocTestBuilder, GlobalTestOptions, IndividualTestOptions, RunnableDocTest, RustdocOptions, ScrapedDocTest, TestFailure, UnusedExterns, run_test, }; use crate::html::...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/librustdoc/doctest/extracted.rs
src/librustdoc/doctest/extracted.rs
//! Rustdoc's doctest extraction. //! //! This module contains the logic to extract doctests and output a JSON containing this //! information. use rustc_span::edition::Edition; use serde::Serialize; use super::make::DocTestWrapResult; use super::{BuildDocTestBuilder, ScrapedDocTest}; use crate::config::Options as 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/librustdoc/doctest/markdown.rs
src/librustdoc/doctest/markdown.rs
//! Doctest functionality used only for doctests in `.md` Markdown files. use std::fs::read_to_string; use std::sync::{Arc, Mutex}; use rustc_errors::DiagCtxtHandle; use rustc_session::config::Input; use rustc_span::source_map::FilePathMapping; use rustc_span::{DUMMY_SP, FileName, RealFileName}; use tempfile::tempdir...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/librustdoc/doctest/make.rs
src/librustdoc/doctest/make.rs
//! Logic for transforming the raw code given by the user into something actually //! runnable, e.g. by adding a `main` function if it doesn't already exist. use std::fmt::{self, Write as _}; use std::io; use std::sync::Arc; use rustc_ast::token::{Delimiter, TokenKind}; use rustc_ast::tokenstream::TokenTree; use rust...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/librustdoc/json/import_finder.rs
src/librustdoc/json/import_finder.rs
use rustc_hir::def_id::DefIdSet; use crate::clean::{self, Import, ImportSource, Item}; use crate::fold::DocFolder; /// Get the id's of all items that are `pub use`d in the crate. /// /// We need this to know if a stripped module is `pub use mod::*`, to decide /// if it needs to be kept in the index, despite being str...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/librustdoc/json/ids.rs
src/librustdoc/json/ids.rs
//! Id handling for rustdoc-json. //! //! Manages the creation of [`rustdoc_json_types::Id`] and the //! fact that these don't correspond exactly to [`DefId`], because //! [`rustdoc_json_types::Item`] doesn't correspond exactly to what //! other phases think of as an "item". use rustc_data_structures::fx::FxHashMap; 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/librustdoc/json/mod.rs
src/librustdoc/json/mod.rs
//! Rustdoc's JSON backend //! //! This module contains the logic for rendering a crate as JSON rather than the normal static HTML //! output. See [the RFC](https://github.com/rust-lang/rfcs/pull/2963) and the [`types`] module //! docs for usage and details. mod conversions; mod ids; mod import_finder; use std::cell:...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/librustdoc/json/conversions.rs
src/librustdoc/json/conversions.rs
//! These from impls are used to create the JSON types which get serialized. They're very close to //! the `clean` types but with some fields removed or stringified to simplify the output and not //! expose unstable compiler internals. use rustc_abi::ExternAbi; use rustc_ast::ast; use rustc_data_structures::fx::FxHash...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
true
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/librustdoc/html/macro_expansion.rs
src/librustdoc/html/macro_expansion.rs
use rustc_ast::visit::{Visitor, walk_crate, walk_expr, walk_item, walk_pat, walk_stmt, walk_ty}; use rustc_ast::{Crate, Expr, Item, Pat, Stmt, Ty}; use rustc_data_structures::fx::FxHashMap; use rustc_span::source_map::SourceMap; use rustc_span::{BytePos, Span}; use crate::config::{OutputFormat, RenderOptions}; /// It...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/librustdoc/html/highlight.rs
src/librustdoc/html/highlight.rs
//! Basic syntax highlighting functionality. //! //! This module uses librustc_ast's lexer to provide token-based highlighting for //! the HTML documentation generated by rustdoc. //! //! Use the `render_with_highlighting` to highlight some rust code. use std::borrow::Cow; use std::collections::VecDeque; use std::fmt:...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
true
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/librustdoc/html/url_parts_builder.rs
src/librustdoc/html/url_parts_builder.rs
use std::fmt::{self, Write}; use rustc_span::Symbol; /// A builder that allows efficiently and easily constructing the part of a URL /// after the domain: `nightly/core/str/struct.Bytes.html`. /// /// This type is a wrapper around the final `String` buffer, /// but its API is like that of a `Vec` of URL components. #...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/librustdoc/html/tests.rs
src/librustdoc/html/tests.rs
use rustc_span::{Symbol, create_default_session_globals_then, sym}; use crate::html::format::href_relative_parts; fn assert_relative_path(expected: &str, relative_to_fqp: &[Symbol], fqp: &[Symbol]) { create_default_session_globals_then(|| { assert_eq!(expected, href_relative_parts(&fqp, &relative_to_fqp)....
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/librustdoc/html/toc.rs
src/librustdoc/html/toc.rs
//! Table-of-contents creation. use crate::html::escape::Escape; /// A (recursive) table of contents #[derive(Debug, PartialEq)] pub(crate) struct Toc { /// The levels are strictly decreasing, i.e. /// /// `entries[0].level >= entries[1].level >= ...` /// /// Normally they are equal, but can differ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/librustdoc/html/static_files.rs
src/librustdoc/html/static_files.rs
//! Static files bundled with documentation output. //! //! All the static files are included here for centralized access in case anything other than the //! HTML rendering code (say, the theme checker) needs to access one of these files. use std::path::{Path, PathBuf}; use std::{fmt, str}; pub(crate) struct StaticFi...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/librustdoc/html/markdown.rs
src/librustdoc/html/markdown.rs
//! Markdown formatting for rustdoc. //! //! This module implements markdown formatting through the pulldown-cmark library. //! //! ``` //! #![feature(rustc_private)] //! //! extern crate rustc_span; //! //! use rustc_span::edition::Edition; //! use rustdoc::html::markdown::{HeadingOffset, IdMap, Markdown, ErrorCodes};...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
true
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/librustdoc/html/mod.rs
src/librustdoc/html/mod.rs
pub(crate) mod escape; pub(crate) mod format; pub(crate) mod highlight; pub(crate) mod layout; mod length_limit; pub(crate) mod macro_expansion; // used by the error-index generator, so it needs to be public pub mod markdown; pub(crate) mod render; pub(crate) mod sources; pub(crate) mod static_files; pub(crate) mod toc...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/librustdoc/html/layout.rs
src/librustdoc/html/layout.rs
use std::fmt::Display; use std::path::PathBuf; use askama::Template; use rustc_data_structures::fx::FxIndexMap; use super::static_files::{STATIC_FILES, StaticFiles}; use crate::externalfiles::ExternalHtml; use crate::html::render::{StylePath, ensure_trailing_slash}; #[cfg(test)] mod tests; pub(crate) struct Layout ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/librustdoc/html/format.rs
src/librustdoc/html/format.rs
//! HTML formatting module //! //! This module contains a large number of `Display` implementations for //! various types in `rustdoc::clean`. //! //! These implementations all emit HTML. As an internal implementation detail, //! some of them support an alternate format that emits text, but that should //! not be used ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
true
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/librustdoc/html/escape.rs
src/librustdoc/html/escape.rs
//! HTML escaping. //! //! This module contains one unit struct, which can be used to HTML-escape a //! string of text (for use in a format string). use std::fmt; use pulldown_cmark_escape::FmtWriter; use unicode_segmentation::UnicodeSegmentation; /// Wrapper struct which will emit the HTML-escaped version of the co...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/librustdoc/html/length_limit.rs
src/librustdoc/html/length_limit.rs
//! See [`HtmlWithLimit`]. use std::fmt::Write; use std::ops::ControlFlow; use crate::html::escape::Escape; /// A buffer that allows generating HTML with a length limit. /// /// This buffer ensures that: /// /// * all tags are closed, /// * tags are closed in the reverse order of when they were opened (i.e., the cor...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/librustdoc/html/sources.rs
src/librustdoc/html/sources.rs
use std::cell::RefCell; use std::ffi::OsStr; use std::path::{Component, Path, PathBuf}; use std::{fmt, fs}; use askama::Template; use rustc_data_structures::fx::{FxHashSet, FxIndexMap}; use rustc_hir::def_id::LOCAL_CRATE; use rustc_middle::ty::TyCtxt; use rustc_session::Session; use rustc_span::{FileName, RealFileName...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/librustdoc/html/toc/tests.rs
src/librustdoc/html/toc/tests.rs
use super::{Toc, TocBuilder, TocEntry}; #[test] fn builder_smoke() { let mut builder = TocBuilder::new(); // this is purposely not using a fancy macro like below so // that we're sure that this is doing the correct thing, and // there's been no macro mistake. macro_rules! push { ($level: 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/librustdoc/html/escape/tests.rs
src/librustdoc/html/escape/tests.rs
// basic examples #[test] fn escape_body_text_with_wbr() { use super::EscapeBodyTextWithWbr as E; // extreme corner cases assert_eq!(&E("").to_string(), ""); assert_eq!(&E("a").to_string(), "a"); assert_eq!(&E("A").to_string(), "A"); assert_eq!(&E("_").to_string(), "_"); assert_eq!(&E(":").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/librustdoc/html/url_parts_builder/tests.rs
src/librustdoc/html/url_parts_builder/tests.rs
use super::*; fn t(builder: UrlPartsBuilder, expect: &str) { assert_eq!(builder.finish(), expect); } #[test] fn empty() { t(UrlPartsBuilder::new(), ""); } #[test] fn singleton() { t(UrlPartsBuilder::singleton("index.html"), "index.html"); } #[test] fn push_several() { let mut builder = UrlPartsBuild...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/librustdoc/html/layout/tests.rs
src/librustdoc/html/layout/tests.rs
#[test] fn test_may_remove_crossorigin() { use super::may_remove_crossorigin; assert!(may_remove_crossorigin("font.woff2")); assert!(may_remove_crossorigin("/font.woff2")); assert!(may_remove_crossorigin("./font.woff2")); assert!(may_remove_crossorigin(":D/font.woff2")); assert!(may_remove_cros...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/librustdoc/html/render/tests.rs
src/librustdoc/html/render/tests.rs
use std::cmp::Ordering; use super::AllTypes; use super::print_item::compare_names; #[test] fn test_compare_names() { for &(a, b) in &[ ("hello", "world"), ("", "world"), ("123", "hello"), ("123", ""), ("123test", "123"), ("hello", ""), ("hello", "hello"), ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/librustdoc/html/render/sorted_template.rs
src/librustdoc/html/render/sorted_template.rs
use std::collections::BTreeSet; use std::fmt::{self, Write as _}; use std::marker::PhantomData; use std::str::FromStr; use itertools::{Itertools as _, Position}; use serde::{Deserialize, Serialize}; /// Append-only templates for sorted, deduplicated lists of items. /// /// Last line of the rendered output is a commen...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/librustdoc/html/render/print_item.rs
src/librustdoc/html/render/print_item.rs
use std::cmp::Ordering; use std::fmt::{self, Display, Write as _}; use std::iter; use askama::Template; use rustc_abi::VariantIdx; use rustc_ast::join_path_syms; use rustc_data_structures::fx::{FxHashMap, FxIndexMap, FxIndexSet}; use rustc_hir as hir; use rustc_hir::def::CtorKind; use rustc_hir::def_id::DefId; use rus...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
true
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/librustdoc/html/render/ordered_json.rs
src/librustdoc/html/render/ordered_json.rs
use std::borrow::Borrow; use std::fmt; use itertools::Itertools as _; use serde::{Deserialize, Serialize}; use serde_json::Value; /// Prerendered json. /// /// Both the Display and serde_json::to_string implementations write the serialized json #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Serialize, Deseria...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/librustdoc/html/render/type_layout.rs
src/librustdoc/html/render/type_layout.rs
use std::fmt; use askama::Template; use rustc_abi::{Primitive, TagEncoding, Variants}; use rustc_hir::def_id::DefId; use rustc_middle::span_bug; use rustc_middle::ty::layout::LayoutError; use rustc_middle::ty::{self}; use rustc_span::symbol::Symbol; use crate::html::render::Context; #[derive(Template)] #[template(pa...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/librustdoc/html/render/mod.rs
src/librustdoc/html/render/mod.rs
//! Rustdoc's HTML rendering module. //! //! This modules contains the bulk of the logic necessary for rendering a //! rustdoc `clean::Crate` instance to a set of static HTML pages. This //! rendering process is largely driven by the `format!` syntax extension to //! perform all I/O into files and streams. //! //! The ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
true
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/librustdoc/html/render/sidebar.rs
src/librustdoc/html/render/sidebar.rs
use std::borrow::Cow; use std::cmp::Ordering; use std::fmt; use askama::Template; use rustc_data_structures::fx::FxHashSet; use rustc_hir::def::CtorKind; use rustc_hir::def_id::{DefIdMap, DefIdSet}; use rustc_middle::ty::{self, TyCtxt}; use tracing::debug; use super::{Context, ItemSection, item_ty_to_section}; use 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/librustdoc/html/render/write_shared.rs
src/librustdoc/html/render/write_shared.rs
//! Rustdoc writes aut two kinds of shared files: //! - Static files, which are embedded in the rustdoc binary and are written with a //! filename that includes a hash of their contents. These will always have a new //! URL if the contents change, so they are safe to cache with the //! `Cache-Control: immutab...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
true
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/librustdoc/html/render/context.rs
src/librustdoc/html/render/context.rs
use std::cell::RefCell; use std::collections::BTreeMap; use std::fmt::{self, Write as _}; use std::io; use std::path::{Path, PathBuf}; use std::sync::mpsc::{Receiver, channel}; use askama::Template; use rustc_ast::join_path_syms; use rustc_data_structures::fx::{FxHashMap, FxHashSet, FxIndexMap, FxIndexSet}; use rustc_...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
true