Auto merge of #142392 - matthiaskrgr:rollup-9jrfqnu, r=matthiaskrgr

Rollup of 10 pull requests

Successful merges:

 - rust-lang/rust#141307 (Add method to retrieve body of closure in stable-mir)
 - rust-lang/rust#142040 (transmutability: shift abstraction boundary)
 - rust-lang/rust#142066 (More simple 2015 edition test decoupling)
 - rust-lang/rust#142157 (rustc_resolve: Improve `resolve_const_param_in_non_trivial_anon_const` wording)
 - rust-lang/rust#142217 (`tests/ui`: A New Order [10/N])
 - rust-lang/rust#142219 (`tests/ui`: A New Order [11/N])
 - rust-lang/rust#142261 (use correct edition when warning for unsafe attributes)
 - rust-lang/rust#142303 (Assorted bootstrap cleanups (step 1))
 - rust-lang/rust#142318 (Cleanup `rust-src` remapping and real dir)
 - rust-lang/rust#142352 (compiler: Make `c_int_width` an integer)

r? `@ghost`
`@rustbot` modify labels: rollup
This commit is contained in:
bors 2025-06-12 04:06:02 +00:00
commit fe5c95d4ae
228 changed files with 1648 additions and 1393 deletions

View file

@ -44,10 +44,10 @@ pub trait DerivedTypeCodegenMethods<'tcx>:
BaseTypeCodegenMethods + MiscCodegenMethods<'tcx> + HasTyCtxt<'tcx> + HasTypingEnv<'tcx>
{
fn type_int(&self) -> Self::Type {
match &self.sess().target.c_int_width[..] {
"16" => self.type_i16(),
"32" => self.type_i32(),
"64" => self.type_i64(),
match &self.sess().target.c_int_width {
16 => self.type_i16(),
32 => self.type_i32(),
64 => self.type_i64(),
width => bug!("Unsupported c_int_width: {}", width),
}
}

View file

@ -1649,34 +1649,7 @@ impl<'a> CrateMetadataRef<'a> {
old_name
&& let Ok(rest) = virtual_name.strip_prefix(virtual_dir)
{
// The std library crates are in
// `$sysroot/lib/rustlib/src/rust/library`, whereas other crates
// may be in `$sysroot/lib/rustlib/src/rust/` directly. So we
// detect crates from the std libs and handle them specially.
const STD_LIBS: &[&str] = &[
"core",
"alloc",
"std",
"test",
"term",
"unwind",
"proc_macro",
"panic_abort",
"panic_unwind",
"profiler_builtins",
"rtstartup",
"rustc-std-workspace-core",
"rustc-std-workspace-alloc",
"rustc-std-workspace-std",
"backtrace",
];
let is_std_lib = STD_LIBS.iter().any(|l| rest.starts_with(l));
let new_path = if is_std_lib {
real_dir.join("library").join(rest)
} else {
real_dir.join(rest)
};
let new_path = real_dir.join(rest);
debug!(
"try_to_translate_virtual_to_real: `{}` -> `{}`",

View file

@ -180,9 +180,14 @@ pub fn check_attribute_safety(
let diag_span = attr_item.span();
// Attributes can be safe in earlier editions, and become unsafe in later ones.
//
// Use the span of the attribute's name to determine the edition: the span of the
// attribute as a whole may be inaccurate if it was emitted by a macro.
//
// See https://github.com/rust-lang/rust/issues/142182.
let emit_error = match unsafe_since {
None => true,
Some(unsafe_since) => attr.span.edition() >= unsafe_since,
Some(unsafe_since) => path_span.edition() >= unsafe_since,
};
if emit_error {

View file

@ -119,7 +119,7 @@ resolve_const_param_in_enum_discriminant =
const parameters may not be used in enum discriminant values
resolve_const_param_in_non_trivial_anon_const =
const parameters may only be used as standalone arguments, i.e. `{$name}`
const parameters may only be used as standalone arguments here, i.e. `{$name}`
resolve_constructor_private_if_any_field_private =
a constructor is private if any of the fields is private

View file

@ -743,6 +743,14 @@ crate_def! {
pub ClosureDef;
}
impl ClosureDef {
/// Retrieves the body of the closure definition. Returns None if the body
/// isn't available.
pub fn body(&self) -> Option<Body> {
with(|ctx| ctx.has_body(self.0).then(|| ctx.mir_body(self.0)))
}
}
crate_def! {
#[derive(Serialize)]
pub CoroutineDef;

View file

@ -6,7 +6,7 @@ pub(crate) fn opts() -> TargetOptions {
TargetOptions {
os: "none".into(),
endian: Endian::Little,
c_int_width: "32".into(),
c_int_width: 32,
linker_flavor: LinkerFlavor::Gnu(Cc::Yes, Lld::No),
executables: true,
panic_strategy: PanicStrategy::Abort,

View file

@ -80,6 +80,12 @@ impl Target {
base.$key_name = s;
}
} );
($key_name:ident = $json_name:expr, u64 as $int_ty:ty) => ( {
let name = $json_name;
if let Some(s) = obj.remove(name).and_then(|b| b.as_u64()) {
base.$key_name = s as $int_ty;
}
} );
($key_name:ident, bool) => ( {
let name = (stringify!($key_name)).replace("_", "-");
if let Some(s) = obj.remove(&name).and_then(|b| b.as_bool()) {
@ -554,7 +560,7 @@ impl Target {
}
}
key!(c_int_width = "target-c-int-width");
key!(c_int_width = "target-c-int-width", u64 as u16);
key!(c_enum_min_bits, Option<u64>); // if None, matches c_int_width
key!(os);
key!(env);

View file

@ -2213,18 +2213,10 @@ impl Target {
});
}
dl.c_enum_min_size = self
.c_enum_min_bits
.map_or_else(
|| {
self.c_int_width
.parse()
.map_err(|_| String::from("failed to parse c_int_width"))
},
Ok,
)
.and_then(|i| Integer::from_size(Size::from_bits(i)))
.map_err(|err| TargetDataLayoutErrors::InvalidBitsSize { err })?;
dl.c_enum_min_size = Integer::from_size(Size::from_bits(
self.c_enum_min_bits.unwrap_or(self.c_int_width as _),
))
.map_err(|err| TargetDataLayoutErrors::InvalidBitsSize { err })?;
Ok(dl)
}
@ -2286,7 +2278,7 @@ pub struct TargetOptions {
/// Used as the `target_endian` `cfg` variable. Defaults to little endian.
pub endian: Endian,
/// Width of c_int type. Defaults to "32".
pub c_int_width: StaticCow<str>,
pub c_int_width: u16,
/// OS name to use for conditional compilation (`target_os`). Defaults to "none".
/// "none" implies a bare metal target without `std` library.
/// A couple of targets having `std` also use "unknown" as an `os` value,
@ -2783,7 +2775,7 @@ impl Default for TargetOptions {
fn default() -> TargetOptions {
TargetOptions {
endian: Endian::Little,
c_int_width: "32".into(),
c_int_width: 32,
os: "none".into(),
env: "".into(),
abi: "".into(),

View file

@ -31,7 +31,7 @@ pub(crate) fn target() -> Target {
options: TargetOptions {
os: "vita".into(),
endian: Endian::Little,
c_int_width: "32".into(),
c_int_width: 32,
env: "newlib".into(),
vendor: "sony".into(),
abi: "eabihf".into(),

View file

@ -13,7 +13,7 @@ pub(crate) fn target() -> Target {
llvm_target: "avr-unknown-unknown".into(),
pointer_width: 16,
options: TargetOptions {
c_int_width: "16".into(),
c_int_width: 16,
exe_suffix: ".elf".into(),
linker: Some("avr-gcc".into()),
eh_frame_header: false,

View file

@ -16,7 +16,7 @@ pub(crate) fn target() -> Target {
arch: "msp430".into(),
options: TargetOptions {
c_int_width: "16".into(),
c_int_width: 16,
// The LLVM backend currently can't generate object files. To
// workaround this LLVM generates assembly files which then we feed

View file

@ -13,7 +13,7 @@ pub(crate) fn target() -> Target {
options: TargetOptions {
endian: Endian::Little,
c_int_width: "32".into(),
c_int_width: 32,
families: cvs!["unix"],
os: "espidf".into(),
env: "newlib".into(),

View file

@ -13,7 +13,7 @@ pub(crate) fn target() -> Target {
options: TargetOptions {
endian: Endian::Little,
c_int_width: "32".into(),
c_int_width: 32,
families: cvs!["unix"],
os: "espidf".into(),
env: "newlib".into(),

View file

@ -13,7 +13,7 @@ pub(crate) fn target() -> Target {
options: TargetOptions {
endian: Endian::Little,
c_int_width: "32".into(),
c_int_width: 32,
families: cvs!["unix"],
os: "espidf".into(),
env: "newlib".into(),

View file

@ -2558,32 +2558,31 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
rustc_transmute::Reason::SrcIsNotYetSupported => {
format!("analyzing the transmutability of `{src}` is not yet supported")
}
rustc_transmute::Reason::DstIsNotYetSupported => {
format!("analyzing the transmutability of `{dst}` is not yet supported")
}
rustc_transmute::Reason::DstIsBitIncompatible => {
format!(
"at least one value of `{src}` isn't a bit-valid value of `{dst}`"
)
}
rustc_transmute::Reason::DstUninhabited => {
format!("`{dst}` is uninhabited")
}
rustc_transmute::Reason::DstMayHaveSafetyInvariants => {
format!("`{dst}` may carry safety invariants")
}
rustc_transmute::Reason::DstIsTooBig => {
format!("the size of `{src}` is smaller than the size of `{dst}`")
}
rustc_transmute::Reason::DstRefIsTooBig { src, dst } => {
let src_size = src.size;
let dst_size = dst.size;
rustc_transmute::Reason::DstRefIsTooBig {
src,
src_size,
dst,
dst_size,
} => {
format!(
"the referent size of `{src}` ({src_size} bytes) \
"the size of `{src}` ({src_size} bytes) \
is smaller than that of `{dst}` ({dst_size} bytes)"
)
}

View file

@ -9,13 +9,12 @@
use std::ops::ControlFlow;
use rustc_ast::Mutability;
use rustc_data_structures::stack::ensure_sufficient_stack;
use rustc_hir::lang_items::LangItem;
use rustc_infer::infer::{DefineOpaqueTypes, HigherRankedType, InferOk};
use rustc_infer::traits::ObligationCauseCode;
use rustc_middle::traits::{BuiltinImplSource, SignatureMismatchData};
use rustc_middle::ty::{self, GenericArgsRef, Ty, TyCtxt, Upcast, elaborate};
use rustc_middle::ty::{self, GenericArgsRef, Region, Ty, TyCtxt, Upcast, elaborate};
use rustc_middle::{bug, span_bug};
use rustc_span::def_id::DefId;
use thin_vec::thin_vec;
@ -286,99 +285,12 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
) -> Result<PredicateObligations<'tcx>, SelectionError<'tcx>> {
use rustc_transmute::{Answer, Assume, Condition};
/// Generate sub-obligations for reference-to-reference transmutations.
fn reference_obligations<'tcx>(
tcx: TyCtxt<'tcx>,
obligation: &PolyTraitObligation<'tcx>,
(src_lifetime, src_ty, src_mut): (ty::Region<'tcx>, Ty<'tcx>, Mutability),
(dst_lifetime, dst_ty, dst_mut): (ty::Region<'tcx>, Ty<'tcx>, Mutability),
assume: Assume,
) -> PredicateObligations<'tcx> {
let make_transmute_obl = |src, dst| {
let transmute_trait = obligation.predicate.def_id();
let assume = obligation.predicate.skip_binder().trait_ref.args.const_at(2);
let trait_ref = ty::TraitRef::new(
tcx,
transmute_trait,
[
ty::GenericArg::from(dst),
ty::GenericArg::from(src),
ty::GenericArg::from(assume),
],
);
Obligation::with_depth(
tcx,
obligation.cause.clone(),
obligation.recursion_depth + 1,
obligation.param_env,
trait_ref,
)
};
let make_freeze_obl = |ty| {
let trait_ref = ty::TraitRef::new(
tcx,
tcx.require_lang_item(LangItem::Freeze, obligation.cause.span),
[ty::GenericArg::from(ty)],
);
Obligation::with_depth(
tcx,
obligation.cause.clone(),
obligation.recursion_depth + 1,
obligation.param_env,
trait_ref,
)
};
let make_outlives_obl = |target, region| {
let outlives = ty::OutlivesPredicate(target, region);
Obligation::with_depth(
tcx,
obligation.cause.clone(),
obligation.recursion_depth + 1,
obligation.param_env,
outlives,
)
};
// Given a transmutation from `&'a (mut) Src` and `&'dst (mut) Dst`,
// it is always the case that `Src` must be transmutable into `Dst`,
// and that that `'src` must outlive `'dst`.
let mut obls = PredicateObligations::with_capacity(1);
obls.push(make_transmute_obl(src_ty, dst_ty));
if !assume.lifetimes {
obls.push(make_outlives_obl(src_lifetime, dst_lifetime));
}
// Given a transmutation from `&Src`, both `Src` and `Dst` must be
// `Freeze`, otherwise, using the transmuted value could lead to
// data races.
if src_mut == Mutability::Not {
obls.extend([make_freeze_obl(src_ty), make_freeze_obl(dst_ty)])
}
// Given a transmutation into `&'dst mut Dst`, it also must be the
// case that `Dst` is transmutable into `Src`. For example,
// transmuting bool -> u8 is OK as long as you can't update that u8
// to be > 1, because you could later transmute the u8 back to a
// bool and get undefined behavior. It also must be the case that
// `'dst` lives exactly as long as `'src`.
if dst_mut == Mutability::Mut {
obls.push(make_transmute_obl(dst_ty, src_ty));
if !assume.lifetimes {
obls.push(make_outlives_obl(dst_lifetime, src_lifetime));
}
}
obls
}
/// Flatten the `Condition` tree into a conjunction of obligations.
#[instrument(level = "debug", skip(tcx, obligation))]
fn flatten_answer_tree<'tcx>(
tcx: TyCtxt<'tcx>,
obligation: &PolyTraitObligation<'tcx>,
cond: Condition<rustc_transmute::layout::rustc::Ref<'tcx>>,
cond: Condition<Region<'tcx>, Ty<'tcx>>,
assume: Assume,
) -> PredicateObligations<'tcx> {
match cond {
@ -388,13 +300,50 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
.into_iter()
.flat_map(|cond| flatten_answer_tree(tcx, obligation, cond, assume))
.collect(),
Condition::IfTransmutable { src, dst } => reference_obligations(
tcx,
obligation,
(src.lifetime, src.ty, src.mutability),
(dst.lifetime, dst.ty, dst.mutability),
assume,
),
Condition::Immutable { ty } => {
let trait_ref = ty::TraitRef::new(
tcx,
tcx.require_lang_item(LangItem::Freeze, obligation.cause.span),
[ty::GenericArg::from(ty)],
);
thin_vec![Obligation::with_depth(
tcx,
obligation.cause.clone(),
obligation.recursion_depth + 1,
obligation.param_env,
trait_ref,
)]
}
Condition::Outlives { long, short } => {
let outlives = ty::OutlivesPredicate(long, short);
thin_vec![Obligation::with_depth(
tcx,
obligation.cause.clone(),
obligation.recursion_depth + 1,
obligation.param_env,
outlives,
)]
}
Condition::Transmutable { src, dst } => {
let transmute_trait = obligation.predicate.def_id();
let assume = obligation.predicate.skip_binder().trait_ref.args.const_at(2);
let trait_ref = ty::TraitRef::new(
tcx,
transmute_trait,
[
ty::GenericArg::from(dst),
ty::GenericArg::from(src),
ty::GenericArg::from(assume),
],
);
thin_vec![Obligation::with_depth(
tcx,
obligation.cause.clone(),
obligation.recursion_depth + 1,
obligation.param_env,
trait_ref,
)]
}
}
}

View file

@ -2,32 +2,35 @@ use std::fmt;
use std::iter::Peekable;
use std::sync::atomic::{AtomicU32, Ordering};
use super::{Byte, Ref, Tree, Uninhabited};
use super::{Byte, Reference, Region, Tree, Type, Uninhabited};
use crate::{Map, Set};
#[derive(PartialEq)]
#[cfg_attr(test, derive(Clone))]
pub(crate) struct Dfa<R>
pub(crate) struct Dfa<R, T>
where
R: Ref,
R: Region,
T: Type,
{
pub(crate) transitions: Map<State, Transitions<R>>,
pub(crate) transitions: Map<State, Transitions<R, T>>,
pub(crate) start: State,
pub(crate) accept: State,
}
#[derive(PartialEq, Clone, Debug)]
pub(crate) struct Transitions<R>
pub(crate) struct Transitions<R, T>
where
R: Ref,
R: Region,
T: Type,
{
byte_transitions: EdgeSet<State>,
ref_transitions: Map<R, State>,
ref_transitions: Map<Reference<R, T>, State>,
}
impl<R> Default for Transitions<R>
impl<R, T> Default for Transitions<R, T>
where
R: Ref,
R: Region,
T: Type,
{
fn default() -> Self {
Self { byte_transitions: EdgeSet::empty(), ref_transitions: Map::default() }
@ -51,9 +54,10 @@ impl fmt::Debug for State {
}
}
impl<R> Dfa<R>
impl<R, T> Dfa<R, T>
where
R: Ref,
R: Region,
T: Type,
{
#[cfg(test)]
pub(crate) fn bool() -> Self {
@ -64,7 +68,7 @@ where
}
pub(crate) fn unit() -> Self {
let transitions: Map<State, Transitions<R>> = Map::default();
let transitions: Map<State, Transitions<R, T>> = Map::default();
let start = State::new();
let accept = start;
@ -78,21 +82,21 @@ where
})
}
pub(crate) fn from_ref(r: R) -> Self {
pub(crate) fn from_ref(r: Reference<R, T>) -> Self {
Self::from_transitions(|accept| Transitions {
byte_transitions: EdgeSet::empty(),
ref_transitions: [(r, accept)].into_iter().collect(),
})
}
fn from_transitions(f: impl FnOnce(State) -> Transitions<R>) -> Self {
fn from_transitions(f: impl FnOnce(State) -> Transitions<R, T>) -> Self {
let start = State::new();
let accept = State::new();
Self { transitions: [(start, f(accept))].into_iter().collect(), start, accept }
}
pub(crate) fn from_tree(tree: Tree<!, R>) -> Result<Self, Uninhabited> {
pub(crate) fn from_tree(tree: Tree<!, R, T>) -> Result<Self, Uninhabited> {
Ok(match tree {
Tree::Byte(b) => Self::from_byte(b),
Tree::Ref(r) => Self::from_ref(r),
@ -125,7 +129,7 @@ where
let start = self.start;
let accept = other.accept;
let mut transitions: Map<State, Transitions<R>> = self.transitions;
let mut transitions: Map<State, Transitions<R, T>> = self.transitions;
for (source, transition) in other.transitions {
let fix_state = |state| if state == other.start { self.accept } else { state };
@ -169,7 +173,7 @@ where
};
let start = mapped((Some(a.start), Some(b.start)));
let mut transitions: Map<State, Transitions<R>> = Map::default();
let mut transitions: Map<State, Transitions<R, T>> = Map::default();
let empty_transitions = Transitions::default();
struct WorkQueue {
@ -257,7 +261,7 @@ where
.flat_map(|transitions| transitions.byte_transitions.iter())
}
pub(crate) fn refs_from(&self, start: State) -> impl Iterator<Item = (R, State)> {
pub(crate) fn refs_from(&self, start: State) -> impl Iterator<Item = (Reference<R, T>, State)> {
self.transitions
.get(&start)
.into_iter()
@ -297,9 +301,10 @@ where
}
/// Serialize the DFA using the Graphviz DOT format.
impl<R> fmt::Debug for Dfa<R>
impl<R, T> fmt::Debug for Dfa<R, T>
where
R: Ref,
R: Region,
T: Type,
{
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
writeln!(f, "digraph {{")?;

View file

@ -78,16 +78,41 @@ impl From<u8> for Byte {
}
}
/// A reference, i.e., `&'region T` or `&'region mut T`.
#[derive(Debug, Hash, Eq, PartialEq, Ord, PartialOrd, Clone, Copy)]
pub(crate) struct Reference<R, T>
where
R: Region,
T: Type,
{
pub(crate) region: R,
pub(crate) is_mut: bool,
pub(crate) referent: T,
pub(crate) referent_size: usize,
pub(crate) referent_align: usize,
}
impl<R, T> fmt::Display for Reference<R, T>
where
R: Region,
T: Type,
{
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str("&")?;
if self.is_mut {
f.write_str("mut ")?;
}
self.referent.fmt(f)
}
}
pub(crate) trait Def: Debug + Hash + Eq + PartialEq + Copy + Clone {
fn has_safety_invariants(&self) -> bool;
}
pub trait Ref: Debug + Hash + Eq + PartialEq + Copy + Clone {
fn min_align(&self) -> usize;
fn size(&self) -> usize;
pub(crate) trait Region: Debug + Hash + Eq + PartialEq + Copy + Clone {}
fn is_mutable(&self) -> bool;
}
pub(crate) trait Type: Debug + Hash + Eq + PartialEq + Copy + Clone {}
impl Def for ! {
fn has_safety_invariants(&self) -> bool {
@ -95,79 +120,21 @@ impl Def for ! {
}
}
impl Ref for ! {
fn min_align(&self) -> usize {
unreachable!()
}
fn size(&self) -> usize {
unreachable!()
}
fn is_mutable(&self) -> bool {
unreachable!()
}
}
impl Region for ! {}
impl Type for ! {}
#[cfg(test)]
impl<const N: usize> Ref for [(); N] {
fn min_align(&self) -> usize {
N
}
impl Region for usize {}
fn size(&self) -> usize {
N
}
fn is_mutable(&self) -> bool {
false
}
}
#[cfg(test)]
impl Type for () {}
#[cfg(feature = "rustc")]
pub mod rustc {
use std::fmt::{self, Write};
use rustc_abi::Layout;
use rustc_middle::mir::Mutability;
use rustc_middle::ty::layout::{HasTyCtxt, LayoutCx, LayoutError};
use rustc_middle::ty::{self, Ty};
/// A reference in the layout.
#[derive(Debug, Hash, Eq, PartialEq, Clone, Copy)]
pub struct Ref<'tcx> {
pub lifetime: ty::Region<'tcx>,
pub ty: Ty<'tcx>,
pub mutability: Mutability,
pub align: usize,
pub size: usize,
}
impl<'tcx> super::Ref for Ref<'tcx> {
fn min_align(&self) -> usize {
self.align
}
fn size(&self) -> usize {
self.size
}
fn is_mutable(&self) -> bool {
match self.mutability {
Mutability::Mut => true,
Mutability::Not => false,
}
}
}
impl<'tcx> Ref<'tcx> {}
impl<'tcx> fmt::Display for Ref<'tcx> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_char('&')?;
if self.mutability == Mutability::Mut {
f.write_str("mut ")?;
}
self.ty.fmt(f)
}
}
use rustc_middle::ty::{self, Region, Ty};
/// A visibility node in the layout.
#[derive(Debug, Hash, Eq, PartialEq, Clone, Copy)]
@ -187,6 +154,10 @@ pub mod rustc {
}
}
impl<'tcx> super::Region for Region<'tcx> {}
impl<'tcx> super::Type for Ty<'tcx> {}
pub(crate) fn layout_of<'tcx>(
cx: LayoutCx<'tcx>,
ty: Ty<'tcx>,

View file

@ -1,6 +1,6 @@
use std::ops::{ControlFlow, RangeInclusive};
use super::{Byte, Def, Ref};
use super::{Byte, Def, Reference, Region, Type};
#[cfg(test)]
mod tests;
@ -15,10 +15,11 @@ mod tests;
/// 2. A `Seq` is never directly nested beneath another `Seq`.
/// 3. `Seq`s and `Alt`s with a single member do not exist.
#[derive(Clone, Debug, Hash, PartialEq, Eq)]
pub(crate) enum Tree<D, R>
pub(crate) enum Tree<D, R, T>
where
D: Def,
R: Ref,
R: Region,
T: Type,
{
/// A sequence of successive layouts.
Seq(Vec<Self>),
@ -27,7 +28,7 @@ where
/// A definition node.
Def(D),
/// A reference node.
Ref(R),
Ref(Reference<R, T>),
/// A byte node.
Byte(Byte),
}
@ -48,10 +49,11 @@ impl From<rustc_abi::Endian> for Endian {
}
}
impl<D, R> Tree<D, R>
impl<D, R, T> Tree<D, R, T>
where
D: Def,
R: Ref,
R: Region,
T: Type,
{
/// A `Tree` consisting only of a definition node.
pub(crate) fn def(def: D) -> Self {
@ -138,7 +140,7 @@ where
/// Remove all `Def` nodes, and all branches of the layout for which `f`
/// produces `true`.
pub(crate) fn prune<F>(self, f: &F) -> Tree<!, R>
pub(crate) fn prune<F>(self, f: &F) -> Tree<!, R, T>
where
F: Fn(D) -> bool,
{
@ -198,13 +200,13 @@ where
/// Produces a `Tree` where each of the trees in `trees` are sequenced one
/// after another.
pub(crate) fn seq<const N: usize>(trees: [Tree<D, R>; N]) -> Self {
pub(crate) fn seq<const N: usize>(trees: [Tree<D, R, T>; N]) -> Self {
trees.into_iter().fold(Tree::unit(), Self::then)
}
/// Produces a `Tree` where each of the trees in `trees` are accepted as
/// alternative layouts.
pub(crate) fn alt<const N: usize>(trees: [Tree<D, R>; N]) -> Self {
pub(crate) fn alt<const N: usize>(trees: [Tree<D, R, T>; N]) -> Self {
trees.into_iter().fold(Tree::uninhabited(), Self::or)
}
@ -251,11 +253,14 @@ pub(crate) mod rustc {
FieldIdx, FieldsShape, Layout, Size, TagEncoding, TyAndLayout, VariantIdx, Variants,
};
use rustc_middle::ty::layout::{HasTyCtxt, LayoutCx, LayoutError};
use rustc_middle::ty::{self, AdtDef, AdtKind, List, ScalarInt, Ty, TyCtxt, TypeVisitableExt};
use rustc_middle::ty::{
self, AdtDef, AdtKind, List, Region, ScalarInt, Ty, TyCtxt, TypeVisitableExt,
};
use rustc_span::ErrorGuaranteed;
use super::Tree;
use crate::layout::rustc::{Def, Ref, layout_of};
use crate::layout::Reference;
use crate::layout::rustc::{Def, layout_of};
#[derive(Debug, Copy, Clone)]
pub(crate) enum Err {
@ -281,7 +286,7 @@ pub(crate) mod rustc {
}
}
impl<'tcx> Tree<Def<'tcx>, Ref<'tcx>> {
impl<'tcx> Tree<Def<'tcx>, Region<'tcx>, Ty<'tcx>> {
pub(crate) fn from_ty(ty: Ty<'tcx>, cx: LayoutCx<'tcx>) -> Result<Self, Err> {
use rustc_abi::HasDataLayout;
let layout = layout_of(cx, ty)?;
@ -353,16 +358,17 @@ pub(crate) mod rustc {
}
}
ty::Ref(lifetime, ty, mutability) => {
ty::Ref(region, ty, mutability) => {
let layout = layout_of(cx, *ty)?;
let align = layout.align.abi.bytes_usize();
let size = layout.size.bytes_usize();
Ok(Tree::Ref(Ref {
lifetime: *lifetime,
ty: *ty,
mutability: *mutability,
align,
size,
let referent_align = layout.align.abi.bytes_usize();
let referent_size = layout.size.bytes_usize();
Ok(Tree::Ref(Reference {
region: *region,
is_mut: mutability.is_mut(),
referent: *ty,
referent_align,
referent_size,
}))
}

View file

@ -20,13 +20,13 @@ mod prune {
#[test]
fn seq_1() {
let layout: Tree<Def, !> = Tree::def(Def::NoSafetyInvariants).then(Tree::byte(0x00));
let layout: Tree<Def, !, !> = Tree::def(Def::NoSafetyInvariants).then(Tree::byte(0x00));
assert_eq!(layout.prune(&|d| matches!(d, Def::HasSafetyInvariants)), Tree::byte(0x00));
}
#[test]
fn seq_2() {
let layout: Tree<Def, !> =
let layout: Tree<Def, !, !> =
Tree::byte(0x00).then(Tree::def(Def::NoSafetyInvariants)).then(Tree::byte(0x01));
assert_eq!(
@ -41,7 +41,7 @@ mod prune {
#[test]
fn invisible_def() {
let layout: Tree<Def, !> = Tree::def(Def::HasSafetyInvariants);
let layout: Tree<Def, !, !> = Tree::def(Def::HasSafetyInvariants);
assert_eq!(
layout.prune(&|d| matches!(d, Def::HasSafetyInvariants)),
Tree::uninhabited()
@ -50,7 +50,7 @@ mod prune {
#[test]
fn invisible_def_in_seq_len_2() {
let layout: Tree<Def, !> =
let layout: Tree<Def, !, !> =
Tree::def(Def::NoSafetyInvariants).then(Tree::def(Def::HasSafetyInvariants));
assert_eq!(
layout.prune(&|d| matches!(d, Def::HasSafetyInvariants)),
@ -60,7 +60,7 @@ mod prune {
#[test]
fn invisible_def_in_seq_len_3() {
let layout: Tree<Def, !> = Tree::def(Def::NoSafetyInvariants)
let layout: Tree<Def, !, !> = Tree::def(Def::NoSafetyInvariants)
.then(Tree::byte(0x00))
.then(Tree::def(Def::HasSafetyInvariants));
assert_eq!(
@ -75,20 +75,20 @@ mod prune {
#[test]
fn visible_def() {
let layout: Tree<Def, !> = Tree::def(Def::NoSafetyInvariants);
let layout: Tree<Def, !, !> = Tree::def(Def::NoSafetyInvariants);
assert_eq!(layout.prune(&|d| matches!(d, Def::HasSafetyInvariants)), Tree::unit());
}
#[test]
fn visible_def_in_seq_len_2() {
let layout: Tree<Def, !> =
let layout: Tree<Def, !, !> =
Tree::def(Def::NoSafetyInvariants).then(Tree::def(Def::NoSafetyInvariants));
assert_eq!(layout.prune(&|d| matches!(d, Def::HasSafetyInvariants)), Tree::unit());
}
#[test]
fn visible_def_in_seq_len_3() {
let layout: Tree<Def, !> = Tree::def(Def::NoSafetyInvariants)
let layout: Tree<Def, !, !> = Tree::def(Def::NoSafetyInvariants)
.then(Tree::byte(0x00))
.then(Tree::def(Def::NoSafetyInvariants));
assert_eq!(layout.prune(&|d| matches!(d, Def::HasSafetyInvariants)), Tree::byte(0x00));

View file

@ -19,23 +19,29 @@ pub struct Assume {
/// Either transmutation is allowed, we have an error, or we have an optional
/// Condition that must hold.
#[derive(Debug, Hash, Eq, PartialEq, Clone)]
pub enum Answer<R> {
pub enum Answer<R, T> {
Yes,
No(Reason<R>),
If(Condition<R>),
No(Reason<T>),
If(Condition<R, T>),
}
/// A condition which must hold for safe transmutation to be possible.
#[derive(Debug, Hash, Eq, PartialEq, Clone)]
pub enum Condition<R> {
pub enum Condition<R, T> {
/// `Src` is transmutable into `Dst`, if `src` is transmutable into `dst`.
IfTransmutable { src: R, dst: R },
Transmutable { src: T, dst: T },
/// The region `long` must outlive `short`.
Outlives { long: R, short: R },
/// The `ty` is immutable.
Immutable { ty: T },
/// `Src` is transmutable into `Dst`, if all of the enclosed requirements are met.
IfAll(Vec<Condition<R>>),
IfAll(Vec<Condition<R, T>>),
/// `Src` is transmutable into `Dst` if any of the enclosed requirements are met.
IfAny(Vec<Condition<R>>),
IfAny(Vec<Condition<R, T>>),
}
/// Answers "why wasn't the source type transmutable into the destination type?"
@ -53,12 +59,16 @@ pub enum Reason<T> {
DstMayHaveSafetyInvariants,
/// `Dst` is larger than `Src`, and the excess bytes were not exclusively uninitialized.
DstIsTooBig,
/// A referent of `Dst` is larger than a referent in `Src`.
/// `Dst` is larger `Src`.
DstRefIsTooBig {
/// The referent of the source type.
src: T,
/// The size of the source type's referent.
src_size: usize,
/// The too-large referent of the destination type.
dst: T,
/// The size of the destination type's referent.
dst_size: usize,
},
/// Src should have a stricter alignment than Dst, but it does not.
DstHasStricterAlignment { src_min_align: usize, dst_min_align: usize },
@ -79,7 +89,7 @@ pub enum Reason<T> {
#[cfg(feature = "rustc")]
mod rustc {
use rustc_hir::lang_items::LangItem;
use rustc_middle::ty::{Const, Ty, TyCtxt};
use rustc_middle::ty::{Const, Region, Ty, TyCtxt};
use super::*;
@ -105,7 +115,7 @@ mod rustc {
&mut self,
types: Types<'tcx>,
assume: crate::Assume,
) -> crate::Answer<crate::layout::rustc::Ref<'tcx>> {
) -> crate::Answer<Region<'tcx>, Ty<'tcx>> {
crate::maybe_transmutable::MaybeTransmutableQuery::new(
types.src, types.dst, assume, self.tcx,
)

View file

@ -5,7 +5,7 @@ pub(crate) mod query_context;
#[cfg(test)]
mod tests;
use crate::layout::{self, Def, Dfa, Ref, Tree, dfa, union};
use crate::layout::{self, Def, Dfa, Reference, Tree, dfa, union};
use crate::maybe_transmutable::query_context::QueryContext;
use crate::{Answer, Condition, Map, Reason};
@ -41,7 +41,10 @@ mod rustc {
/// This method begins by converting `src` and `dst` from `Ty`s to `Tree`s,
/// then computes an answer using those trees.
#[instrument(level = "debug", skip(self), fields(src = ?self.src, dst = ?self.dst))]
pub(crate) fn answer(self) -> Answer<<TyCtxt<'tcx> as QueryContext>::Ref> {
pub(crate) fn answer(
self,
) -> Answer<<TyCtxt<'tcx> as QueryContext>::Region, <TyCtxt<'tcx> as QueryContext>::Type>
{
let Self { src, dst, assume, context } = self;
let layout_cx = LayoutCx::new(context, TypingEnv::fully_monomorphized());
@ -67,7 +70,11 @@ mod rustc {
}
}
impl<C> MaybeTransmutableQuery<Tree<<C as QueryContext>::Def, <C as QueryContext>::Ref>, C>
impl<C>
MaybeTransmutableQuery<
Tree<<C as QueryContext>::Def, <C as QueryContext>::Region, <C as QueryContext>::Type>,
C,
>
where
C: QueryContext,
{
@ -77,7 +84,7 @@ where
/// then converts `src` and `dst` to `Dfa`s, and computes an answer using those DFAs.
#[inline(always)]
#[instrument(level = "debug", skip(self), fields(src = ?self.src, dst = ?self.dst))]
pub(crate) fn answer(self) -> Answer<<C as QueryContext>::Ref> {
pub(crate) fn answer(self) -> Answer<<C as QueryContext>::Region, <C as QueryContext>::Type> {
let Self { src, dst, assume, context } = self;
// Unconditionally remove all `Def` nodes from `src`, without pruning away the
@ -130,12 +137,12 @@ where
}
}
impl<C> MaybeTransmutableQuery<Dfa<<C as QueryContext>::Ref>, C>
impl<C> MaybeTransmutableQuery<Dfa<<C as QueryContext>::Region, <C as QueryContext>::Type>, C>
where
C: QueryContext,
{
/// Answers whether a `Dfa` is transmutable into another `Dfa`.
pub(crate) fn answer(self) -> Answer<<C as QueryContext>::Ref> {
pub(crate) fn answer(self) -> Answer<<C as QueryContext>::Region, <C as QueryContext>::Type> {
self.answer_memo(&mut Map::default(), self.src.start, self.dst.start)
}
@ -143,10 +150,13 @@ where
#[instrument(level = "debug", skip(self))]
fn answer_memo(
&self,
cache: &mut Map<(dfa::State, dfa::State), Answer<<C as QueryContext>::Ref>>,
cache: &mut Map<
(dfa::State, dfa::State),
Answer<<C as QueryContext>::Region, <C as QueryContext>::Type>,
>,
src_state: dfa::State,
dst_state: dfa::State,
) -> Answer<<C as QueryContext>::Ref> {
) -> Answer<<C as QueryContext>::Region, <C as QueryContext>::Type> {
if let Some(answer) = cache.get(&(src_state, dst_state)) {
answer.clone()
} else {
@ -160,10 +170,13 @@ where
fn answer_impl(
&self,
cache: &mut Map<(dfa::State, dfa::State), Answer<<C as QueryContext>::Ref>>,
cache: &mut Map<
(dfa::State, dfa::State),
Answer<<C as QueryContext>::Region, <C as QueryContext>::Type>,
>,
src_state: dfa::State,
dst_state: dfa::State,
) -> Answer<<C as QueryContext>::Ref> {
) -> Answer<<C as QueryContext>::Region, <C as QueryContext>::Type> {
debug!(?src_state, ?dst_state);
debug!(src = ?self.src);
debug!(dst = ?self.dst);
@ -247,27 +260,51 @@ where
// ...there exists a reference transition out of `dst_state`...
Quantifier::ThereExists.apply(self.dst.refs_from(dst_state).map(
|(dst_ref, dst_state_prime)| {
if !src_ref.is_mutable() && dst_ref.is_mutable() {
if !src_ref.is_mut && dst_ref.is_mut {
Answer::No(Reason::DstIsMoreUnique)
} else if !self.assume.alignment
&& src_ref.min_align() < dst_ref.min_align()
&& src_ref.referent_align < dst_ref.referent_align
{
Answer::No(Reason::DstHasStricterAlignment {
src_min_align: src_ref.min_align(),
dst_min_align: dst_ref.min_align(),
src_min_align: src_ref.referent_align,
dst_min_align: dst_ref.referent_align,
})
} else if dst_ref.referent_size > src_ref.referent_size {
Answer::No(Reason::DstRefIsTooBig {
src: src_ref.referent,
src_size: src_ref.referent_size,
dst: dst_ref.referent,
dst_size: dst_ref.referent_size,
})
} else if dst_ref.size() > src_ref.size() {
Answer::No(Reason::DstRefIsTooBig { src: src_ref, dst: dst_ref })
} else {
// ...such that `src` is transmutable into `dst`, if
// `src_ref` is transmutability into `dst_ref`.
and(
Answer::If(Condition::IfTransmutable {
src: src_ref,
dst: dst_ref,
}),
self.answer_memo(cache, src_state_prime, dst_state_prime),
)
let mut conditions = Vec::with_capacity(4);
let mut is_transmutable =
|src: Reference<_, _>, dst: Reference<_, _>| {
conditions.push(Condition::Transmutable {
src: src.referent,
dst: dst.referent,
});
if !self.assume.lifetimes {
conditions.push(Condition::Outlives {
long: src.region,
short: dst.region,
});
}
};
is_transmutable(src_ref, dst_ref);
if dst_ref.is_mut {
is_transmutable(dst_ref, src_ref);
} else {
conditions.push(Condition::Immutable { ty: dst_ref.referent });
}
Answer::If(Condition::IfAll(conditions)).and(self.answer_memo(
cache,
src_state_prime,
dst_state_prime,
))
}
},
))
@ -275,67 +312,65 @@ where
);
if self.assume.validity {
or(bytes_answer, refs_answer)
bytes_answer.or(refs_answer)
} else {
and(bytes_answer, refs_answer)
bytes_answer.and(refs_answer)
}
}
}
}
fn and<R>(lhs: Answer<R>, rhs: Answer<R>) -> Answer<R>
where
R: PartialEq,
{
match (lhs, rhs) {
// If both are errors, then we should return the more specific one
(Answer::No(Reason::DstIsBitIncompatible), Answer::No(reason))
| (Answer::No(reason), Answer::No(_))
// If either is an error, return it
| (Answer::No(reason), _) | (_, Answer::No(reason)) => Answer::No(reason),
// If only one side has a condition, pass it along
| (Answer::Yes, other) | (other, Answer::Yes) => other,
// If both sides have IfAll conditions, merge them
(Answer::If(Condition::IfAll(mut lhs)), Answer::If(Condition::IfAll(ref mut rhs))) => {
lhs.append(rhs);
Answer::If(Condition::IfAll(lhs))
impl<R, T> Answer<R, T> {
fn and(self, rhs: Answer<R, T>) -> Answer<R, T> {
let lhs = self;
match (lhs, rhs) {
// If both are errors, then we should return the more specific one
(Answer::No(Reason::DstIsBitIncompatible), Answer::No(reason))
| (Answer::No(reason), Answer::No(_))
// If either is an error, return it
| (Answer::No(reason), _) | (_, Answer::No(reason)) => Answer::No(reason),
// If only one side has a condition, pass it along
| (Answer::Yes, other) | (other, Answer::Yes) => other,
// If both sides have IfAll conditions, merge them
(Answer::If(Condition::IfAll(mut lhs)), Answer::If(Condition::IfAll(ref mut rhs))) => {
lhs.append(rhs);
Answer::If(Condition::IfAll(lhs))
}
// If only one side is an IfAll, add the other Condition to it
(Answer::If(cond), Answer::If(Condition::IfAll(mut conds)))
| (Answer::If(Condition::IfAll(mut conds)), Answer::If(cond)) => {
conds.push(cond);
Answer::If(Condition::IfAll(conds))
}
// Otherwise, both lhs and rhs conditions can be combined in a parent IfAll
(Answer::If(lhs), Answer::If(rhs)) => Answer::If(Condition::IfAll(vec![lhs, rhs])),
}
// If only one side is an IfAll, add the other Condition to it
(Answer::If(cond), Answer::If(Condition::IfAll(mut conds)))
| (Answer::If(Condition::IfAll(mut conds)), Answer::If(cond)) => {
conds.push(cond);
Answer::If(Condition::IfAll(conds))
}
// Otherwise, both lhs and rhs conditions can be combined in a parent IfAll
(Answer::If(lhs), Answer::If(rhs)) => Answer::If(Condition::IfAll(vec![lhs, rhs])),
}
}
fn or<R>(lhs: Answer<R>, rhs: Answer<R>) -> Answer<R>
where
R: PartialEq,
{
match (lhs, rhs) {
// If both are errors, then we should return the more specific one
(Answer::No(Reason::DstIsBitIncompatible), Answer::No(reason))
| (Answer::No(reason), Answer::No(_)) => Answer::No(reason),
// Otherwise, errors can be ignored for the rest of the pattern matching
(Answer::No(_), other) | (other, Answer::No(_)) => or(other, Answer::Yes),
// If only one side has a condition, pass it along
(Answer::Yes, other) | (other, Answer::Yes) => other,
// If both sides have IfAny conditions, merge them
(Answer::If(Condition::IfAny(mut lhs)), Answer::If(Condition::IfAny(ref mut rhs))) => {
lhs.append(rhs);
Answer::If(Condition::IfAny(lhs))
fn or(self, rhs: Answer<R, T>) -> Answer<R, T> {
let lhs = self;
match (lhs, rhs) {
// If both are errors, then we should return the more specific one
(Answer::No(Reason::DstIsBitIncompatible), Answer::No(reason))
| (Answer::No(reason), Answer::No(_)) => Answer::No(reason),
// Otherwise, errors can be ignored for the rest of the pattern matching
(Answer::No(_), other) | (other, Answer::No(_)) => other.or(Answer::Yes),
// If only one side has a condition, pass it along
(Answer::Yes, other) | (other, Answer::Yes) => other,
// If both sides have IfAny conditions, merge them
(Answer::If(Condition::IfAny(mut lhs)), Answer::If(Condition::IfAny(ref mut rhs))) => {
lhs.append(rhs);
Answer::If(Condition::IfAny(lhs))
}
// If only one side is an IfAny, add the other Condition to it
(Answer::If(cond), Answer::If(Condition::IfAny(mut conds)))
| (Answer::If(Condition::IfAny(mut conds)), Answer::If(cond)) => {
conds.push(cond);
Answer::If(Condition::IfAny(conds))
}
// Otherwise, both lhs and rhs conditions can be combined in a parent IfAny
(Answer::If(lhs), Answer::If(rhs)) => Answer::If(Condition::IfAny(vec![lhs, rhs])),
}
// If only one side is an IfAny, add the other Condition to it
(Answer::If(cond), Answer::If(Condition::IfAny(mut conds)))
| (Answer::If(Condition::IfAny(mut conds)), Answer::If(cond)) => {
conds.push(cond);
Answer::If(Condition::IfAny(conds))
}
// Otherwise, both lhs and rhs conditions can be combined in a parent IfAny
(Answer::If(lhs), Answer::If(rhs)) => Answer::If(Condition::IfAny(vec![lhs, rhs])),
}
}
@ -345,24 +380,25 @@ enum Quantifier {
}
impl Quantifier {
fn apply<R, I>(&self, iter: I) -> Answer<R>
fn apply<R, T, I>(&self, iter: I) -> Answer<R, T>
where
R: layout::Ref,
I: IntoIterator<Item = Answer<R>>,
R: layout::Region,
T: layout::Type,
I: IntoIterator<Item = Answer<R, T>>,
{
use std::ops::ControlFlow::{Break, Continue};
let (init, try_fold_f): (_, fn(_, _) -> _) = match self {
Self::ThereExists => {
(Answer::No(Reason::DstIsBitIncompatible), |accum: Answer<R>, next| {
match or(accum, next) {
Answer::Yes => Break(Answer::Yes),
maybe => Continue(maybe),
}
(Answer::No(Reason::DstIsBitIncompatible), |accum: Answer<R, T>, next| match accum
.or(next)
{
Answer::Yes => Break(Answer::Yes),
maybe => Continue(maybe),
})
}
Self::ForAll => (Answer::Yes, |accum: Answer<R>, next| {
let answer = and(accum, next);
Self::ForAll => (Answer::Yes, |accum: Answer<R, T>, next| {
let answer = accum.and(next);
match answer {
Answer::No(_) => Break(answer),
maybe => Continue(maybe),

View file

@ -3,7 +3,8 @@ use crate::layout;
/// Context necessary to answer the question "Are these types transmutable?".
pub(crate) trait QueryContext {
type Def: layout::Def;
type Ref: layout::Ref;
type Region: layout::Region;
type Type: layout::Type;
}
#[cfg(test)]
@ -12,9 +13,9 @@ pub(crate) mod test {
use super::QueryContext;
pub(crate) struct UltraMinimal<R = !>(PhantomData<R>);
pub(crate) struct UltraMinimal<R = !, T = !>(PhantomData<(R, T)>);
impl<R> Default for UltraMinimal<R> {
impl<R, T> Default for UltraMinimal<R, T> {
fn default() -> Self {
Self(PhantomData)
}
@ -32,20 +33,26 @@ pub(crate) mod test {
}
}
impl<R: crate::layout::Ref> QueryContext for UltraMinimal<R> {
impl<R, T> QueryContext for UltraMinimal<R, T>
where
R: crate::layout::Region,
T: crate::layout::Type,
{
type Def = Def;
type Ref = R;
type Region = R;
type Type = T;
}
}
#[cfg(feature = "rustc")]
mod rustc {
use rustc_middle::ty::TyCtxt;
use rustc_middle::ty::{Region, Ty, TyCtxt};
use super::*;
impl<'tcx> super::QueryContext for TyCtxt<'tcx> {
type Def = layout::rustc::Def<'tcx>;
type Ref = layout::rustc::Ref<'tcx>;
type Region = Region<'tcx>;
type Type = Ty<'tcx>;
}
}

View file

@ -3,17 +3,17 @@ extern crate test;
use itertools::Itertools;
use super::query_context::test::{Def, UltraMinimal};
use crate::{Answer, Assume, Reason, layout};
use crate::{Answer, Assume, Condition, Reason, layout};
type Tree = layout::Tree<Def, !>;
type Dfa = layout::Dfa<!>;
type Tree = layout::Tree<Def, !, !>;
type Dfa = layout::Dfa<!, !>;
trait Representation {
fn is_transmutable(src: Self, dst: Self, assume: Assume) -> Answer<!>;
fn is_transmutable(src: Self, dst: Self, assume: Assume) -> Answer<!, !>;
}
impl Representation for Tree {
fn is_transmutable(src: Self, dst: Self, assume: Assume) -> Answer<!> {
fn is_transmutable(src: Self, dst: Self, assume: Assume) -> Answer<!, !> {
crate::maybe_transmutable::MaybeTransmutableQuery::new(
src,
dst,
@ -25,7 +25,7 @@ impl Representation for Tree {
}
impl Representation for Dfa {
fn is_transmutable(src: Self, dst: Self, assume: Assume) -> Answer<!> {
fn is_transmutable(src: Self, dst: Self, assume: Assume) -> Answer<!, !> {
crate::maybe_transmutable::MaybeTransmutableQuery::new(
src,
dst,
@ -40,7 +40,7 @@ fn is_transmutable<R: Representation + Clone>(
src: &R,
dst: &R,
assume: Assume,
) -> crate::Answer<!> {
) -> crate::Answer<!, !> {
let src = src.clone();
let dst = dst.clone();
// The only dimension of the transmutability analysis we want to test
@ -53,7 +53,7 @@ mod safety {
use super::*;
use crate::Answer;
const DST_HAS_SAFETY_INVARIANTS: Answer<!> =
const DST_HAS_SAFETY_INVARIANTS: Answer<!, !> =
Answer::No(crate::Reason::DstMayHaveSafetyInvariants);
#[test]
@ -177,14 +177,15 @@ mod bool {
#[test]
fn should_permit_validity_expansion_and_reject_contraction() {
let b0 = layout::Tree::<Def, !>::byte(0);
let b1 = layout::Tree::<Def, !>::byte(1);
let b2 = layout::Tree::<Def, !>::byte(2);
let b0 = layout::Tree::<Def, !, !>::byte(0);
let b1 = layout::Tree::<Def, !, !>::byte(1);
let b2 = layout::Tree::<Def, !, !>::byte(2);
let alts = [b0, b1, b2];
let into_layout = |alts: Vec<_>| {
alts.into_iter().fold(layout::Tree::<Def, !>::uninhabited(), layout::Tree::<Def, !>::or)
alts.into_iter()
.fold(layout::Tree::<Def, !, !>::uninhabited(), layout::Tree::<Def, !, !>::or)
};
let into_set = |alts: Vec<_>| {
@ -277,7 +278,7 @@ mod alt {
#[test]
fn should_permit_identity_transmutation() {
type Tree = layout::Tree<Def, !>;
type Tree = layout::Tree<Def, !, !>;
let x = Tree::Seq(vec![Tree::byte(0), Tree::byte(0)]);
let y = Tree::Seq(vec![Tree::bool(), Tree::byte(1)]);
@ -331,7 +332,7 @@ mod char {
fn should_permit_valid_transmutation() {
for order in [Endian::Big, Endian::Little] {
use Answer::*;
let char_layout = layout::Tree::<Def, !>::char(order);
let char_layout = layout::Tree::<Def, !, !>::char(order);
// `char`s can be in the following ranges:
// - [0, 0xD7FF]
@ -353,7 +354,7 @@ mod char {
(0xFFFFFFFF, no),
] {
let src_layout =
layout::tree::Tree::<Def, !>::from_big_endian(order, src.to_be_bytes());
layout::tree::Tree::<Def, !, !>::from_big_endian(order, src.to_be_bytes());
let a = is_transmutable(&src_layout, &char_layout, Assume::default());
assert_eq!(a, answer, "endian:{order:?},\nsrc:{src:x}");
@ -371,7 +372,7 @@ mod nonzero {
#[test]
fn should_permit_identity_transmutation() {
for width in NONZERO_BYTE_WIDTHS {
let layout = layout::Tree::<Def, !>::nonzero(width);
let layout = layout::Tree::<Def, !, !>::nonzero(width);
assert_eq!(is_transmutable(&layout, &layout, Assume::default()), Answer::Yes);
}
}
@ -381,8 +382,8 @@ mod nonzero {
for width in NONZERO_BYTE_WIDTHS {
use Answer::*;
let num = layout::Tree::<Def, !>::number(width);
let nz = layout::Tree::<Def, !>::nonzero(width);
let num = layout::Tree::<Def, !, !>::number(width);
let nz = layout::Tree::<Def, !, !>::nonzero(width);
let a = is_transmutable(&num, &nz, Assume::default());
assert_eq!(a, No(Reason::DstIsBitIncompatible), "width:{width}");
@ -395,13 +396,23 @@ mod nonzero {
mod r#ref {
use super::*;
use crate::layout::Reference;
#[test]
fn should_permit_identity_transmutation() {
type Tree = crate::layout::Tree<Def, [(); 1]>;
type Tree = crate::layout::Tree<Def, usize, ()>;
for validity in [false, true] {
let layout = Tree::Seq(vec![Tree::byte(0x00), Tree::Ref([()])]);
let layout = Tree::Seq(vec![
Tree::byte(0x00),
Tree::Ref(Reference {
region: 42,
is_mut: false,
referent: (),
referent_size: 0,
referent_align: 1,
}),
]);
let assume = Assume { validity, ..Assume::default() };
@ -414,7 +425,11 @@ mod r#ref {
.answer();
assert_eq!(
answer,
Answer::If(crate::Condition::IfTransmutable { src: [()], dst: [()] })
Answer::If(Condition::IfAll(vec![
Condition::Transmutable { src: (), dst: () },
Condition::Outlives { long: 42, short: 42 },
Condition::Immutable { ty: () },
]))
);
}
}

View file

@ -89,7 +89,7 @@ impl Step for Std {
let stage = self.custom_stage.unwrap_or(builder.top_stage);
let target = self.target;
let compiler = builder.compiler(stage, builder.config.build);
let compiler = builder.compiler(stage, builder.config.host_target);
if stage == 0 {
let mut is_explicitly_called =
@ -244,7 +244,7 @@ impl Step for Rustc {
/// the `compiler` targeting the `target` architecture. The artifacts
/// created will also be linked into the sysroot directory.
fn run(self, builder: &Builder<'_>) {
let compiler = builder.compiler(builder.top_stage, builder.config.build);
let compiler = builder.compiler(builder.top_stage, builder.config.host_target);
let target = self.target;
if compiler.stage != 0 {
@ -327,7 +327,7 @@ impl Step for CodegenBackend {
return;
}
let compiler = builder.compiler(builder.top_stage, builder.config.build);
let compiler = builder.compiler(builder.top_stage, builder.config.host_target);
let target = self.target;
let backend = self.backend;
@ -382,7 +382,7 @@ impl Step for RustAnalyzer {
}
fn run(self, builder: &Builder<'_>) {
let compiler = builder.compiler(builder.top_stage, builder.config.build);
let compiler = builder.compiler(builder.top_stage, builder.config.host_target);
let target = self.target;
builder.ensure(Rustc::new(target, builder));
@ -448,7 +448,7 @@ impl Step for Compiletest {
let compiler = builder.compiler(
if mode == Mode::ToolBootstrap { 0 } else { builder.top_stage },
builder.config.build,
builder.config.host_target,
);
if mode != Mode::ToolBootstrap {
@ -527,7 +527,7 @@ fn run_tool_check_step(
path: &str,
) {
let display_name = path.rsplit('/').next().unwrap();
let compiler = builder.compiler(builder.top_stage, builder.config.build);
let compiler = builder.compiler(builder.top_stage, builder.config.host_target);
builder.ensure(Rustc::new(target, builder));
@ -614,7 +614,7 @@ impl Step for CoverageDump {
// Make sure we haven't forgotten any fields, if there are any.
let Self {} = self;
let display_name = "coverage-dump";
let host = builder.config.build;
let host = builder.config.host_target;
let target = host;
let mode = Mode::ToolBootstrap;

View file

@ -144,7 +144,7 @@ impl Step for Std {
builder.require_submodule("library/stdarch", None);
let target = self.target;
let compiler = builder.compiler(builder.top_stage, builder.config.build);
let compiler = builder.compiler(builder.top_stage, builder.config.host_target);
let mut cargo = builder::Cargo::new(
builder,
@ -204,7 +204,7 @@ impl Step for Rustc {
/// This will lint the compiler for a particular stage of the build using
/// the `compiler` targeting the `target` architecture.
fn run(self, builder: &Builder<'_>) {
let compiler = builder.compiler(builder.top_stage, builder.config.build);
let compiler = builder.compiler(builder.top_stage, builder.config.host_target);
let target = self.target;
if !builder.download_rustc() {
@ -285,7 +285,7 @@ macro_rules! lint_any {
}
fn run(self, builder: &Builder<'_>) -> Self::Output {
let compiler = builder.compiler(builder.top_stage, builder.config.build);
let compiler = builder.compiler(builder.top_stage, builder.config.host_target);
let target = self.target;
if !builder.download_rustc() {

View file

@ -35,6 +35,7 @@ use crate::utils::helpers::{
};
use crate::{CLang, Compiler, DependencyType, FileType, GitRepo, LLVM_TOOLS, Mode, debug, trace};
/// Build a standard library for the given `target` using the given `compiler`.
#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct Std {
pub target: TargetSelection,
@ -159,7 +160,7 @@ impl Step for Std {
let compiler = if builder.download_rustc() && self.force_recompile {
// When there are changes in the library tree with CI-rustc, we want to build
// the stageN library and that requires using stageN-1 compiler.
builder.compiler(self.compiler.stage.saturating_sub(1), builder.config.build)
builder.compiler(self.compiler.stage.saturating_sub(1), builder.config.host_target)
} else {
self.compiler
};
@ -301,7 +302,7 @@ impl Step for Std {
builder.ensure(StdLink::from_std(
self,
builder.compiler(compiler.stage, builder.config.build),
builder.compiler(compiler.stage, builder.config.host_target),
));
}
}
@ -960,11 +961,18 @@ fn cp_rustc_component_to_ci_sysroot(builder: &Builder<'_>, sysroot: &Path, conte
}
}
/// Build rustc using the passed `build_compiler`.
///
/// - Makes sure that `build_compiler` has a standard library prepared for its host target,
/// so that it can compile build scripts and proc macros when building this `rustc`.
/// - Makes sure that `build_compiler` has a standard library prepared for `target`,
/// so that the built `rustc` can *link to it* and use it at runtime.
#[derive(Debug, PartialOrd, Ord, Clone, PartialEq, Eq, Hash)]
pub struct Rustc {
/// The target on which rustc will run (its host).
pub target: TargetSelection,
/// The **previous** compiler used to compile this compiler.
pub compiler: Compiler,
/// The **previous** compiler used to compile this rustc.
pub build_compiler: Compiler,
/// Whether to build a subset of crates, rather than the whole compiler.
///
/// This should only be requested by the user, not used within bootstrap itself.
@ -974,8 +982,8 @@ pub struct Rustc {
}
impl Rustc {
pub fn new(compiler: Compiler, target: TargetSelection) -> Self {
Self { target, compiler, crates: Default::default() }
pub fn new(build_compiler: Compiler, target: TargetSelection) -> Self {
Self { target, build_compiler, crates: Default::default() }
}
}
@ -1007,7 +1015,7 @@ impl Step for Rustc {
fn make_run(run: RunConfig<'_>) {
let crates = run.cargo_crates_in_set();
run.builder.ensure(Rustc {
compiler: run
build_compiler: run
.builder
.compiler(run.builder.top_stage.saturating_sub(1), run.build_triple()),
target: run.target,
@ -1018,7 +1026,7 @@ impl Step for Rustc {
/// Builds the compiler.
///
/// This will build the compiler for a particular stage of the build using
/// the `compiler` targeting the `target` architecture. The artifacts
/// the `build_compiler` targeting the `target` architecture. The artifacts
/// created will also be linked into the sysroot directory.
#[cfg_attr(
feature = "tracing",
@ -1026,54 +1034,58 @@ impl Step for Rustc {
level = "debug",
name = "Rustc::run",
skip_all,
fields(previous_compiler = ?self.compiler, target = ?self.target),
fields(previous_compiler = ?self.build_compiler, target = ?self.target),
),
)]
fn run(self, builder: &Builder<'_>) -> u32 {
let compiler = self.compiler;
let build_compiler = self.build_compiler;
let target = self.target;
// NOTE: the ABI of the stage0 compiler is different from the ABI of the downloaded compiler,
// so its artifacts can't be reused.
if builder.download_rustc() && compiler.stage != 0 {
trace!(stage = compiler.stage, "`download_rustc` requested");
if builder.download_rustc() && build_compiler.stage != 0 {
trace!(stage = build_compiler.stage, "`download_rustc` requested");
let sysroot = builder.ensure(Sysroot { compiler, force_recompile: false });
let sysroot =
builder.ensure(Sysroot { compiler: build_compiler, force_recompile: false });
cp_rustc_component_to_ci_sysroot(
builder,
&sysroot,
builder.config.ci_rustc_dev_contents(),
);
return compiler.stage;
return build_compiler.stage;
}
builder.ensure(Std::new(compiler, target));
// Build a standard library for `target` using the `build_compiler`.
// This will be the standard library that the rustc which we build *links to*.
builder.ensure(Std::new(build_compiler, target));
if builder.config.keep_stage.contains(&compiler.stage) {
trace!(stage = compiler.stage, "`keep-stage` requested");
if builder.config.keep_stage.contains(&build_compiler.stage) {
trace!(stage = build_compiler.stage, "`keep-stage` requested");
builder.info("WARNING: Using a potentially old librustc. This may not behave well.");
builder.info("WARNING: Use `--keep-stage-std` if you want to rebuild the compiler when it changes");
builder.ensure(RustcLink::from_rustc(self, compiler));
builder.ensure(RustcLink::from_rustc(self, build_compiler));
return compiler.stage;
return build_compiler.stage;
}
let compiler_to_use = builder.compiler_for(compiler.stage, compiler.host, target);
if compiler_to_use != compiler {
let compiler_to_use =
builder.compiler_for(build_compiler.stage, build_compiler.host, target);
if compiler_to_use != build_compiler {
builder.ensure(Rustc::new(compiler_to_use, target));
let msg = if compiler_to_use.host == target {
format!(
"Uplifting rustc (stage{} -> stage{})",
compiler_to_use.stage,
compiler.stage + 1
build_compiler.stage + 1
)
} else {
format!(
"Uplifting rustc (stage{}:{} -> stage{}:{})",
compiler_to_use.stage,
compiler_to_use.host,
compiler.stage + 1,
build_compiler.stage + 1,
target
)
};
@ -1082,22 +1094,26 @@ impl Step for Rustc {
return compiler_to_use.stage;
}
// Ensure that build scripts and proc macros have a std / libproc_macro to link against.
// Build a standard library for the current host target using the `build_compiler`.
// This standard library will be used when building `rustc` for compiling
// build scripts and proc macros.
// If we are not cross-compiling, the Std build above will be the same one as the one we
// prepare here.
builder.ensure(Std::new(
builder.compiler(self.compiler.stage, builder.config.build),
builder.config.build,
builder.compiler(self.build_compiler.stage, builder.config.host_target),
builder.config.host_target,
));
let mut cargo = builder::Cargo::new(
builder,
compiler,
build_compiler,
Mode::Rustc,
SourceType::InTree,
target,
Kind::Build,
);
rustc_cargo(builder, &mut cargo, target, &compiler, &self.crates);
rustc_cargo(builder, &mut cargo, target, &build_compiler, &self.crates);
// NB: all RUSTFLAGS should be added to `rustc_cargo()` so they will be
// consistently applied by check/doc/test modes too.
@ -1106,19 +1122,19 @@ impl Step for Rustc {
cargo.arg("-p").arg(krate);
}
if builder.build.config.enable_bolt_settings && compiler.stage == 1 {
if builder.build.config.enable_bolt_settings && build_compiler.stage == 1 {
// Relocations are required for BOLT to work.
cargo.env("RUSTC_BOLT_LINK_FLAGS", "1");
}
let _guard = builder.msg_sysroot_tool(
Kind::Build,
compiler.stage,
build_compiler.stage,
format_args!("compiler artifacts{}", crate_description(&self.crates)),
compiler.host,
build_compiler.host,
target,
);
let stamp = build_stamp::librustc_stamp(builder, compiler, target);
let stamp = build_stamp::librustc_stamp(builder, build_compiler, target);
run_cargo(
builder,
cargo,
@ -1150,10 +1166,10 @@ impl Step for Rustc {
builder.ensure(RustcLink::from_rustc(
self,
builder.compiler(compiler.stage, builder.config.build),
builder.compiler(build_compiler.stage, builder.config.host_target),
));
compiler.stage
build_compiler.stage
}
}
@ -1161,7 +1177,7 @@ pub fn rustc_cargo(
builder: &Builder<'_>,
cargo: &mut Cargo,
target: TargetSelection,
compiler: &Compiler,
build_compiler: &Compiler,
crates: &[String],
) {
cargo
@ -1190,11 +1206,11 @@ pub fn rustc_cargo(
// We want to link against registerEnzyme and in the future we want to use additional
// functionality from Enzyme core. For that we need to link against Enzyme.
if builder.config.llvm_enzyme {
let arch = builder.build.build;
let arch = builder.build.host_target;
let enzyme_dir = builder.build.out.join(arch).join("enzyme").join("lib");
cargo.rustflag("-L").rustflag(enzyme_dir.to_str().expect("Invalid path"));
if let Some(llvm_config) = builder.llvm_config(builder.config.build) {
if let Some(llvm_config) = builder.llvm_config(builder.config.host_target) {
let llvm_version_major = llvm::get_llvm_version_major(builder, &llvm_config);
cargo.rustflag("-l").rustflag(&format!("Enzyme-{llvm_version_major}"));
}
@ -1208,7 +1224,7 @@ pub fn rustc_cargo(
cargo.rustflag("-Zdefault-visibility=protected");
}
if is_lto_stage(compiler) {
if is_lto_stage(build_compiler) {
match builder.config.rust_lto {
RustcLto::Thin | RustcLto::Fat => {
// Since using LTO for optimizing dylibs is currently experimental,
@ -1241,7 +1257,7 @@ pub fn rustc_cargo(
// is already on by default in MSVC optimized builds, which is interpreted as --icf=all:
// https://github.com/llvm/llvm-project/blob/3329cec2f79185bafd678f310fafadba2a8c76d2/lld/COFF/Driver.cpp#L1746
// https://github.com/rust-lang/rust/blob/f22819bcce4abaff7d1246a56eec493418f9f4ee/compiler/rustc_codegen_ssa/src/back/linker.rs#L827
if builder.config.lld_mode.is_used() && !compiler.host.is_msvc() {
if builder.config.lld_mode.is_used() && !build_compiler.host.is_msvc() {
cargo.rustflag("-Clink-args=-Wl,--icf=all");
}
@ -1249,7 +1265,7 @@ pub fn rustc_cargo(
panic!("Cannot use and generate PGO profiles at the same time");
}
let is_collecting = if let Some(path) = &builder.config.rust_profile_generate {
if compiler.stage == 1 {
if build_compiler.stage == 1 {
cargo.rustflag(&format!("-Cprofile-generate={path}"));
// Apparently necessary to avoid overflowing the counters during
// a Cargo build profile
@ -1259,7 +1275,7 @@ pub fn rustc_cargo(
false
}
} else if let Some(path) = &builder.config.rust_profile_use {
if compiler.stage == 1 {
if build_compiler.stage == 1 {
cargo.rustflag(&format!("-Cprofile-use={path}"));
if builder.is_verbose() {
cargo.rustflag("-Cllvm-args=-pgo-warn-missing-function");
@ -1284,20 +1300,20 @@ pub fn rustc_cargo(
// useful.
// This is only performed for non-incremental builds, as ccache cannot deal with these.
if let Some(ref ccache) = builder.config.ccache
&& compiler.stage == 0
&& build_compiler.stage == 0
&& !builder.config.incremental
{
cargo.env("RUSTC_WRAPPER", ccache);
}
rustc_cargo_env(builder, cargo, target, compiler.stage);
rustc_cargo_env(builder, cargo, target, build_compiler.stage);
}
pub fn rustc_cargo_env(
builder: &Builder<'_>,
cargo: &mut Cargo,
target: TargetSelection,
stage: u32,
build_stage: u32,
) {
// Set some configuration variables picked up by build scripts and
// the compiler alike
@ -1364,7 +1380,7 @@ pub fn rustc_cargo_env(
crate::core::build_steps::llvm::prebuilt_llvm_config(builder, target, false)
.should_build();
// `top_stage == stage` might be false for `check --stage 1`, if we are building the stage 1 compiler
let can_skip_build = builder.kind == Kind::Check && builder.top_stage == stage;
let can_skip_build = builder.kind == Kind::Check && builder.top_stage == build_stage;
let should_skip_build = building_is_expensive && can_skip_build;
if !should_skip_build {
rustc_llvm_env(builder, cargo, target)
@ -1475,7 +1491,7 @@ impl RustcLink {
fn from_rustc(rustc: Rustc, host_compiler: Compiler) -> Self {
Self {
compiler: host_compiler,
previous_stage_compiler: rustc.compiler,
previous_stage_compiler: rustc.build_compiler,
target: rustc.target,
crates: rustc.crates,
}
@ -1813,7 +1829,7 @@ impl Step for Sysroot {
// If we're downloading a compiler from CI, we can use the same compiler for all stages other than 0.
if builder.download_rustc() && compiler.stage != 0 {
assert_eq!(
builder.config.build, compiler.host,
builder.config.host_target, compiler.host,
"Cross-compiling is not yet supported with `download-rustc`",
);
@ -1967,7 +1983,7 @@ impl Step for Assemble {
if target_compiler.stage == 0 {
trace!("stage 0 build compiler is always available, simply returning");
assert_eq!(
builder.config.build, target_compiler.host,
builder.config.host_target, target_compiler.host,
"Cannot obtain compiler for non-native build triple at stage 0"
);
// The stage 0 compiler for the build triple is always pre-built.
@ -2080,15 +2096,16 @@ impl Step for Assemble {
debug!(
"ensuring build compiler is available: compiler(stage = {}, host = {:?})",
target_compiler.stage - 1,
builder.config.build,
builder.config.host_target,
);
let mut build_compiler = builder.compiler(target_compiler.stage - 1, builder.config.build);
let mut build_compiler =
builder.compiler(target_compiler.stage - 1, builder.config.host_target);
// Build enzyme
if builder.config.llvm_enzyme && !builder.config.dry_run() {
debug!("`llvm_enzyme` requested");
let enzyme_install = builder.ensure(llvm::Enzyme { target: build_compiler.host });
let llvm_config = builder.llvm_config(builder.config.build).unwrap();
let llvm_config = builder.llvm_config(builder.config.host_target).unwrap();
let llvm_version_major = llvm::get_llvm_version_major(builder, &llvm_config);
let lib_ext = std::env::consts::DLL_EXTENSION;
let libenzyme = format!("libEnzyme-{llvm_version_major}");

View file

@ -422,7 +422,7 @@ impl Step for Rustc {
}
let ra_proc_macro_srv_compiler =
builder.compiler_for(compiler.stage, builder.config.build, compiler.host);
builder.compiler_for(compiler.stage, builder.config.host_target, compiler.host);
builder.ensure(compile::Rustc::new(ra_proc_macro_srv_compiler, compiler.host));
if let Some(ra_proc_macro_srv) = builder.ensure_if_default(
@ -696,7 +696,7 @@ impl Step for Std {
run.builder.ensure(Std {
compiler: run.builder.compiler_for(
run.builder.top_stage,
run.builder.config.build,
run.builder.config.host_target,
run.target,
),
target: run.target,
@ -748,7 +748,7 @@ impl Step for RustcDev {
run.builder.ensure(RustcDev {
compiler: run.builder.compiler_for(
run.builder.top_stage,
run.builder.config.build,
run.builder.config.host_target,
run.target,
),
target: run.target,
@ -815,7 +815,7 @@ impl Step for Analysis {
// through the sysroot uplifting.
compiler: run.builder.compiler_for(
run.builder.top_stage,
run.builder.config.build,
run.builder.config.host_target,
run.target,
),
target: run.target,
@ -1168,7 +1168,7 @@ impl Step for Cargo {
run.builder.ensure(Cargo {
compiler: run.builder.compiler_for(
run.builder.top_stage,
run.builder.config.build,
run.builder.config.host_target,
run.target,
),
target: run.target,
@ -1224,7 +1224,7 @@ impl Step for RustAnalyzer {
run.builder.ensure(RustAnalyzer {
compiler: run.builder.compiler_for(
run.builder.top_stage,
run.builder.config.build,
run.builder.config.host_target,
run.target,
),
target: run.target,
@ -1268,7 +1268,7 @@ impl Step for Clippy {
run.builder.ensure(Clippy {
compiler: run.builder.compiler_for(
run.builder.top_stage,
run.builder.config.build,
run.builder.config.host_target,
run.target,
),
target: run.target,
@ -1317,7 +1317,7 @@ impl Step for Miri {
run.builder.ensure(Miri {
compiler: run.builder.compiler_for(
run.builder.top_stage,
run.builder.config.build,
run.builder.config.host_target,
run.target,
),
target: run.target,
@ -1462,7 +1462,7 @@ impl Step for Rustfmt {
run.builder.ensure(Rustfmt {
compiler: run.builder.compiler_for(
run.builder.top_stage,
run.builder.config.build,
run.builder.config.host_target,
run.target,
),
target: run.target,
@ -1507,7 +1507,7 @@ impl Step for Extended {
fn make_run(run: RunConfig<'_>) {
run.builder.ensure(Extended {
stage: run.builder.top_stage,
host: run.builder.config.build,
host: run.builder.config.host_target,
target: run.target,
});
}
@ -2157,7 +2157,7 @@ fn maybe_install_llvm(
cmd.arg("--libfiles");
builder.verbose(|| println!("running {cmd:?}"));
let files = cmd.run_capture_stdout(builder).stdout();
let build_llvm_out = &builder.llvm_out(builder.config.build);
let build_llvm_out = &builder.llvm_out(builder.config.host_target);
let target_llvm_out = &builder.llvm_out(target);
for file in files.trim_end().split(' ') {
// If we're not using a custom LLVM, make sure we package for the target.
@ -2341,7 +2341,7 @@ impl Step for LlvmBitcodeLinker {
run.builder.ensure(LlvmBitcodeLinker {
compiler: run.builder.compiler_for(
run.builder.top_stage,
run.builder.config.build,
run.builder.config.host_target,
run.target,
),
target: run.target,

View file

@ -209,7 +209,7 @@ impl Step for TheBook {
fn make_run(run: RunConfig<'_>) {
run.builder.ensure(TheBook {
compiler: run.builder.compiler(run.builder.top_stage, run.builder.config.build),
compiler: run.builder.compiler(run.builder.top_stage, run.builder.config.host_target),
target: run.target,
});
}
@ -329,7 +329,7 @@ impl Step for Standalone {
fn make_run(run: RunConfig<'_>) {
run.builder.ensure(Standalone {
compiler: run.builder.compiler(run.builder.top_stage, run.builder.config.build),
compiler: run.builder.compiler(run.builder.top_stage, run.builder.config.host_target),
target: run.target,
});
}
@ -431,7 +431,7 @@ impl Step for Releases {
fn make_run(run: RunConfig<'_>) {
run.builder.ensure(Releases {
compiler: run.builder.compiler(run.builder.top_stage, run.builder.config.build),
compiler: run.builder.compiler(run.builder.top_stage, run.builder.config.host_target),
target: run.target,
});
}
@ -449,7 +449,7 @@ impl Step for Releases {
t!(fs::create_dir_all(&out));
builder.ensure(Standalone {
compiler: builder.compiler(builder.top_stage, builder.config.build),
compiler: builder.compiler(builder.top_stage, builder.config.host_target),
target,
});
@ -700,7 +700,7 @@ fn doc_std(
extra_args: &[&str],
requested_crates: &[String],
) {
let compiler = builder.compiler(stage, builder.config.build);
let compiler = builder.compiler(stage, builder.config.host_target);
let target_doc_dir_name = if format == DocumentationFormat::Json { "json-doc" } else { "doc" };
let target_dir = builder.stage_out(compiler, Mode::Std).join(target).join(target_doc_dir_name);
@ -803,8 +803,8 @@ impl Step for Rustc {
// Build the standard library, so that proc-macros can use it.
// (Normally, only the metadata would be necessary, but proc-macros are special since they run at compile-time.)
let compiler = builder.compiler(stage, builder.config.build);
builder.ensure(compile::Std::new(compiler, builder.config.build));
let compiler = builder.compiler(stage, builder.config.host_target);
builder.ensure(compile::Std::new(compiler, builder.config.host_target));
let _guard = builder.msg_sysroot_tool(
Kind::Doc,
@ -946,7 +946,7 @@ macro_rules! tool_doc {
let out = builder.compiler_doc_out(target);
t!(fs::create_dir_all(&out));
let compiler = builder.compiler(stage, builder.config.build);
let compiler = builder.compiler(stage, builder.config.host_target);
builder.ensure(compile::Std::new(compiler, target));
if true $(&& $rustc_tool)? {
@ -1174,7 +1174,7 @@ impl Step for RustcBook {
fn make_run(run: RunConfig<'_>) {
run.builder.ensure(RustcBook {
compiler: run.builder.compiler(run.builder.top_stage, run.builder.config.build),
compiler: run.builder.compiler(run.builder.top_stage, run.builder.config.host_target),
target: run.target,
validate: false,
});
@ -1261,7 +1261,7 @@ impl Step for Reference {
fn make_run(run: RunConfig<'_>) {
run.builder.ensure(Reference {
compiler: run.builder.compiler(run.builder.top_stage, run.builder.config.build),
compiler: run.builder.compiler(run.builder.top_stage, run.builder.config.host_target),
target: run.target,
});
}
@ -1272,7 +1272,7 @@ impl Step for Reference {
// This is needed for generating links to the standard library using
// the mdbook-spec plugin.
builder.ensure(compile::Std::new(self.compiler, builder.config.build));
builder.ensure(compile::Std::new(self.compiler, builder.config.host_target));
// Run rustbook/mdbook to generate the HTML pages.
builder.ensure(RustbookSrc {

View file

@ -285,7 +285,7 @@ pub fn add_cg_gcc_cargo_flags(cargo: &mut Cargo, gcc: &GccOutput) {
/// The absolute path to the downloaded GCC artifacts.
#[cfg(not(test))]
fn ci_gcc_root(config: &crate::Config) -> PathBuf {
config.out.join(config.build).join("ci-gcc")
config.out.join(config.host_target).join("ci-gcc")
}
/// Detect whether GCC sources have been modified locally or not.

View file

@ -73,7 +73,7 @@ fn install_sh(
let prefix = default_path(&builder.config.prefix, "/usr/local");
let sysconfdir = prefix.join(default_path(&builder.config.sysconfdir, "/etc"));
let destdir_env = env::var_os("DESTDIR").map(PathBuf::from);
let is_cygwin = builder.config.build.is_cygwin();
let is_cygwin = builder.config.host_target.is_cygwin();
// Sanity checks on the write access of user.
//
@ -187,7 +187,7 @@ macro_rules! install {
fn make_run(run: RunConfig<'_>) {
run.builder.ensure($name {
compiler: run.builder.compiler(run.builder.top_stage, run.builder.config.build),
compiler: run.builder.compiler(run.builder.top_stage, run.builder.config.host_target),
target: run.target,
});
}
@ -246,7 +246,7 @@ install!((self, builder, _config),
);
}
};
LlvmTools, alias = "llvm-tools", _config.llvm_tools_enabled && _config.llvm_enabled(_config.build), only_hosts: true, {
LlvmTools, alias = "llvm-tools", _config.llvm_tools_enabled && _config.llvm_enabled(_config.host_target), only_hosts: true, {
if let Some(tarball) = builder.ensure(dist::LlvmTools { target: self.target }) {
install_sh(builder, "llvm-tools", self.compiler.stage, Some(self.target), &tarball);
} else {

View file

@ -132,14 +132,14 @@ pub fn prebuilt_llvm_config(
let build_llvm_config = if let Some(build_llvm_config) = builder
.config
.target_config
.get(&builder.config.build)
.get(&builder.config.host_target)
.and_then(|config| config.llvm_config.clone())
{
build_llvm_config
} else {
let mut llvm_config_ret_dir = builder.llvm_out(builder.config.build);
let mut llvm_config_ret_dir = builder.llvm_out(builder.config.host_target);
llvm_config_ret_dir.push("bin");
llvm_config_ret_dir.join(exe("llvm-config", builder.config.build))
llvm_config_ret_dir.join(exe("llvm-config", builder.config.host_target))
};
let llvm_cmake_dir = out_dir.join("lib/cmake/llvm");
@ -235,8 +235,8 @@ pub(crate) fn is_ci_llvm_available_for_target(config: &Config, asserts: bool) ->
("x86_64-unknown-netbsd", false),
];
if !supported_platforms.contains(&(&*config.build.triple, asserts))
&& (asserts || !supported_platforms.contains(&(&*config.build.triple, true)))
if !supported_platforms.contains(&(&*config.host_target.triple, asserts))
&& (asserts || !supported_platforms.contains(&(&*config.host_target.triple, true)))
{
return false;
}
@ -480,7 +480,7 @@ impl Step for Llvm {
// https://llvm.org/docs/HowToCrossCompileLLVM.html
if !builder.config.is_host_target(target) {
let LlvmResult { llvm_config, .. } =
builder.ensure(Llvm { target: builder.config.build });
builder.ensure(Llvm { target: builder.config.host_target });
if !builder.config.dry_run() {
let llvm_bindir =
command(&llvm_config).arg("--bindir").run_capture_stdout(builder).stdout();
@ -494,7 +494,8 @@ impl Step for Llvm {
}
cfg.define("LLVM_CONFIG_PATH", llvm_config);
if builder.config.llvm_clang {
let build_bin = builder.llvm_out(builder.config.build).join("build").join("bin");
let build_bin =
builder.llvm_out(builder.config.host_target).join("build").join("bin");
let clang_tblgen = build_bin.join("clang-tblgen").with_extension(EXE_EXTENSION);
if !builder.config.dry_run() && !clang_tblgen.exists() {
panic!("unable to find {}", clang_tblgen.display());
@ -628,7 +629,7 @@ fn configure_cmake(
if builder.ninja() {
cfg.generator("Ninja");
}
cfg.target(&target.triple).host(&builder.config.build.triple);
cfg.target(&target.triple).host(&builder.config.host_target.triple);
if !builder.config.is_host_target(target) {
cfg.define("CMAKE_CROSSCOMPILING", "True");
@ -813,7 +814,7 @@ fn configure_cmake(
ldflags.push_all(flags);
}
if let Some(flags) = get_var("LDFLAGS", &builder.config.build.triple, &target.triple) {
if let Some(flags) = get_var("LDFLAGS", &builder.config.host_target.triple, &target.triple) {
ldflags.push_all(&flags);
}
@ -1135,7 +1136,8 @@ impl Step for Sanitizers {
return runtimes;
}
let LlvmResult { llvm_config, .. } = builder.ensure(Llvm { target: builder.config.build });
let LlvmResult { llvm_config, .. } =
builder.ensure(Llvm { target: builder.config.host_target });
static STAMP_HASH_MEMO: OnceLock<String> = OnceLock::new();
let smart_stamp_hash = STAMP_HASH_MEMO.get_or_init(|| {
@ -1345,7 +1347,7 @@ impl Step for CrtBeginEnd {
cfg.cargo_metadata(false)
.out_dir(&out_dir)
.target(&self.target.triple)
.host(&builder.config.build.triple)
.host(&builder.config.host_target.triple)
.warnings(false)
.debug(false)
.opt_level(3)
@ -1424,7 +1426,7 @@ impl Step for Libunwind {
cfg.archiver(ar);
}
cfg.target(&self.target.triple);
cfg.host(&builder.config.build.triple);
cfg.host(&builder.config.host_target.triple);
cfg.warnings(false);
cfg.debug(false);
// get_compiler() need set opt_level first.

View file

@ -136,8 +136,8 @@ impl Display for Scenario {
/// Performs profiling using `rustc-perf` on a built version of the compiler.
pub fn perf(builder: &Builder<'_>, args: &PerfArgs) {
let collector = builder.ensure(RustcPerf {
compiler: builder.compiler(0, builder.config.build),
target: builder.config.build,
compiler: builder.compiler(0, builder.config.host_target),
target: builder.config.host_target,
});
let is_profiling = match &args.cmd {
@ -151,8 +151,8 @@ pub fn perf(builder: &Builder<'_>, args: &PerfArgs) {
Consider setting `rust.debuginfo-level = 1` in `bootstrap.toml`."#);
}
let compiler = builder.compiler(builder.top_stage, builder.config.build);
builder.ensure(Std::new(compiler, builder.config.build));
let compiler = builder.compiler(builder.top_stage, builder.config.host_target);
builder.ensure(Std::new(compiler, builder.config.host_target));
if let Some(opts) = args.cmd.shared_opts()
&& opts.profiles.contains(&Profile::Doc)

View file

@ -116,7 +116,7 @@ impl Step for Miri {
}
fn run(self, builder: &Builder<'_>) {
let host = builder.build.build;
let host = builder.build.host_target;
let target = self.target;
// `x run` uses stage 0 by default but miri does not work well with stage 0.
@ -448,7 +448,7 @@ impl Step for Rustfmt {
}
fn run(self, builder: &Builder<'_>) {
let host = builder.build.build;
let host = builder.build.host_target;
// `x run` uses stage 0 by default but rustfmt does not work well with stage 0.
// Change the stage to 1 if it's not set explicitly.

View file

@ -260,7 +260,7 @@ impl Step for Link {
}
let stage_path =
["build", config.build.rustc_target_arg(), "stage1"].join(MAIN_SEPARATOR_STR);
["build", config.host_target.rustc_target_arg(), "stage1"].join(MAIN_SEPARATOR_STR);
if stage_dir_exists(&stage_path[..]) && !config.dry_run() {
attempt_toolchain_link(builder, &stage_path[..]);

View file

@ -70,7 +70,7 @@ impl Step for CrateBootstrap {
}
fn run(self, builder: &Builder<'_>) {
let bootstrap_host = builder.config.build;
let bootstrap_host = builder.config.host_target;
let compiler = builder.compiler(0, bootstrap_host);
let mut path = self.path.to_str().unwrap();
@ -128,7 +128,7 @@ You can skip linkcheck with --skip src/tools/linkchecker"
builder.info(&format!("Linkcheck ({host})"));
// Test the linkchecker itself.
let bootstrap_host = builder.config.build;
let bootstrap_host = builder.config.host_target;
let compiler = builder.compiler(0, bootstrap_host);
let cargo = tool::prepare_tool_cargo(
@ -525,7 +525,7 @@ impl Step for Miri {
/// Runs `cargo test` for miri.
fn run(self, builder: &Builder<'_>) {
let host = builder.build.build;
let host = builder.build.host_target;
let target = self.target;
let stage = builder.top_stage;
if stage == 0 {
@ -637,7 +637,7 @@ impl Step for CargoMiri {
/// Tests `cargo miri test`.
fn run(self, builder: &Builder<'_>) {
let host = builder.build.build;
let host = builder.build.host_target;
let target = self.target;
let stage = builder.top_stage;
if stage == 0 {
@ -915,7 +915,7 @@ impl Step for RustdocJSStd {
Kind::Test,
builder.top_stage,
"rustdoc-js-std",
builder.config.build,
builder.config.host_target,
self.target,
);
command.run(builder);
@ -1607,7 +1607,7 @@ NOTE: if you're sure you want to do this, please open an issue as to why. In the
// At stage 0 (stage - 1) we are using the stage0 compiler. Using `self.target` can lead
// finding an incorrect compiler path on cross-targets, as the stage 0 is always equal to
// `build.build` in the configuration.
let build = builder.build.build;
let build = builder.build.host_target;
compiler = builder.compiler(compiler.stage - 1, build);
let test_stage = compiler.stage + 1;
(test_stage, format!("stage{test_stage}-{build}"))
@ -1729,7 +1729,7 @@ NOTE: if you're sure you want to do this, please open an issue as to why. In the
cmd.arg("--mode").arg(mode);
cmd.arg("--target").arg(target.rustc_target_arg());
cmd.arg("--host").arg(&*compiler.host.triple);
cmd.arg("--llvm-filecheck").arg(builder.llvm_filecheck(builder.config.build));
cmd.arg("--llvm-filecheck").arg(builder.llvm_filecheck(builder.config.host_target));
if builder.build.config.llvm_enzyme {
cmd.arg("--has-enzyme");
@ -1900,7 +1900,7 @@ NOTE: if you're sure you want to do this, please open an issue as to why. In the
let mut copts_passed = false;
if builder.config.llvm_enabled(compiler.host) {
let llvm::LlvmResult { llvm_config, .. } =
builder.ensure(llvm::Llvm { target: builder.config.build });
builder.ensure(llvm::Llvm { target: builder.config.host_target });
if !builder.config.dry_run() {
let llvm_version = get_llvm_version(builder, &llvm_config);
let llvm_components =
@ -1947,7 +1947,7 @@ NOTE: if you're sure you want to do this, please open an issue as to why. In the
// If LLD is available, add it to the PATH
if builder.config.lld_enabled {
let lld_install_root =
builder.ensure(llvm::Lld { target: builder.config.build });
builder.ensure(llvm::Lld { target: builder.config.host_target });
let lld_bin_path = lld_install_root.join("bin");
@ -2202,7 +2202,7 @@ impl BookTest {
let mut lib_paths = vec![];
for dep in self.dependencies {
let mode = Mode::ToolRustc;
let target = builder.config.build;
let target = builder.config.host_target;
let cargo = tool::prepare_tool_cargo(
builder,
compiler,
@ -2384,7 +2384,7 @@ impl Step for ErrorIndex {
// error_index_generator depends on librustdoc. Use the compiler that
// is normally used to build rustdoc for other tests (like compiletest
// tests in tests/rustdoc) so that it shares the same artifacts.
let compiler = run.builder.compiler(run.builder.top_stage, run.builder.config.build);
let compiler = run.builder.compiler(run.builder.top_stage, run.builder.config.host_target);
run.builder.ensure(ErrorIndex { compiler });
}
@ -2983,7 +2983,7 @@ impl Step for Distcheck {
.arg("--enable-vendor")
.current_dir(&dir)
.run(builder);
command(helpers::make(&builder.config.build.triple))
command(helpers::make(&builder.config.host_target.triple))
.arg("check")
.current_dir(&dir)
.run(builder);
@ -3024,7 +3024,7 @@ impl Step for Bootstrap {
/// Tests the build system itself.
fn run(self, builder: &Builder<'_>) {
let host = builder.config.build;
let host = builder.config.host_target;
let compiler = builder.compiler(0, host);
let _guard = builder.msg(Kind::Test, 0, "bootstrap", host, host);
@ -3035,7 +3035,7 @@ impl Step for Bootstrap {
check_bootstrap
.args(["-m", "unittest", "bootstrap_test.py"])
.env("BUILD_DIR", &builder.out)
.env("BUILD_PLATFORM", builder.build.build.triple)
.env("BUILD_PLATFORM", builder.build.host_target.triple)
.env("BOOTSTRAP_TEST_RUSTC_BIN", &builder.initial_rustc)
.env("BOOTSTRAP_TEST_CARGO_BIN", &builder.initial_cargo)
.current_dir(builder.src.join("src/bootstrap/"));
@ -3090,8 +3090,11 @@ impl Step for TierCheck {
}
fn make_run(run: RunConfig<'_>) {
let compiler =
run.builder.compiler_for(run.builder.top_stage, run.builder.build.build, run.target);
let compiler = run.builder.compiler_for(
run.builder.top_stage,
run.builder.build.host_target,
run.target,
);
run.builder.ensure(TierCheck { compiler });
}
@ -3142,7 +3145,7 @@ impl Step for LintDocs {
fn make_run(run: RunConfig<'_>) {
run.builder.ensure(LintDocs {
compiler: run.builder.compiler(run.builder.top_stage, run.builder.config.build),
compiler: run.builder.compiler(run.builder.top_stage, run.builder.config.host_target),
target: run.target,
});
}
@ -3168,7 +3171,7 @@ impl Step for RustInstaller {
/// Ensure the version placeholder replacement tool builds
fn run(self, builder: &Builder<'_>) {
let bootstrap_host = builder.config.build;
let bootstrap_host = builder.config.host_target;
let compiler = builder.compiler(0, bootstrap_host);
let cargo = tool::prepare_tool_cargo(
builder,
@ -3270,7 +3273,7 @@ impl Step for TestHelpers {
cfg.cargo_metadata(false)
.out_dir(&dst)
.target(&target.triple)
.host(&builder.config.build.triple)
.host(&builder.config.host_target.triple)
.opt_level(0)
.warnings(false)
.debug(false)
@ -3560,7 +3563,7 @@ impl Step for TestFloatParse {
}
fn run(self, builder: &Builder<'_>) {
let bootstrap_host = builder.config.build;
let bootstrap_host = builder.config.host_target;
let compiler = builder.compiler(builder.top_stage, bootstrap_host);
let path = self.path.to_str().unwrap();
let crate_name = self.path.iter().next_back().unwrap().to_str().unwrap();

View file

@ -341,14 +341,14 @@ pub(crate) fn get_tool_rustc_compiler(
if builder.download_rustc() && target_compiler.stage == 1 {
// We shouldn't drop to stage0 compiler when using CI rustc.
return builder.compiler(1, builder.config.build);
return builder.compiler(1, builder.config.host_target);
}
// Similar to `compile::Assemble`, build with the previous stage's compiler. Otherwise
// we'd have stageN/bin/rustc and stageN/bin/$rustc_tool be effectively different stage
// compilers, which isn't what we want. Rustc tools should be linked in the same way as the
// compiler it's paired with, so it must be built with the previous stage compiler.
builder.compiler(target_compiler.stage.saturating_sub(1), builder.config.build)
builder.compiler(target_compiler.stage.saturating_sub(1), builder.config.host_target)
}
/// Links a built tool binary with the given `name` from the build directory to the
@ -389,8 +389,8 @@ macro_rules! bootstrap_tool {
match tool {
$(Tool::$name =>
self.ensure($name {
compiler: self.compiler(0, self.config.build),
target: self.config.build,
compiler: self.compiler(0, self.config.host_target),
target: self.config.host_target,
}).tool_path,
)+
}
@ -414,7 +414,7 @@ macro_rules! bootstrap_tool {
fn make_run(run: RunConfig<'_>) {
run.builder.ensure($name {
// snapshot compiler
compiler: run.builder.compiler(0, run.builder.config.build),
compiler: run.builder.compiler(0, run.builder.config.host_target),
target: run.target,
});
}
@ -531,7 +531,7 @@ impl Step for RustcPerf {
fn make_run(run: RunConfig<'_>) {
run.builder.ensure(RustcPerf {
compiler: run.builder.compiler(0, run.builder.config.build),
compiler: run.builder.compiler(0, run.builder.config.host_target),
target: run.target,
});
}
@ -572,7 +572,7 @@ impl ErrorIndex {
pub fn command(builder: &Builder<'_>) -> BootstrapCommand {
// Error-index-generator links with the rustdoc library, so we need to add `rustc_lib_paths`
// for rustc_private and libLLVM.so, and `sysroot_lib` for libstd, etc.
let host = builder.config.build;
let host = builder.config.host_target;
let compiler = builder.compiler_for(builder.top_stage, host, host);
let mut cmd = command(builder.ensure(ErrorIndex { compiler }).tool_path);
let mut dylib_paths = builder.rustc_lib_paths(compiler);
@ -595,7 +595,7 @@ impl Step for ErrorIndex {
// src/tools/error-index-generator` which almost nobody does.
// Normally, `x.py test` or `x.py doc` will use the
// `ErrorIndex::command` function instead.
let compiler = run.builder.compiler(run.builder.top_stage, run.builder.config.build);
let compiler = run.builder.compiler(run.builder.top_stage, run.builder.config.host_target);
run.builder.ensure(ErrorIndex { compiler });
}
@ -630,7 +630,7 @@ impl Step for RemoteTestServer {
fn make_run(run: RunConfig<'_>) {
run.builder.ensure(RemoteTestServer {
compiler: run.builder.compiler(run.builder.top_stage, run.builder.config.build),
compiler: run.builder.compiler(run.builder.top_stage, run.builder.config.host_target),
target: run.target,
});
}
@ -787,7 +787,7 @@ impl Step for Cargo {
fn make_run(run: RunConfig<'_>) {
run.builder.ensure(Cargo {
compiler: run.builder.compiler(run.builder.top_stage, run.builder.config.build),
compiler: run.builder.compiler(run.builder.top_stage, run.builder.config.host_target),
target: run.target,
});
}
@ -905,7 +905,7 @@ impl Step for RustAnalyzer {
fn make_run(run: RunConfig<'_>) {
run.builder.ensure(RustAnalyzer {
compiler: run.builder.compiler(run.builder.top_stage, run.builder.config.build),
compiler: run.builder.compiler(run.builder.top_stage, run.builder.config.host_target),
target: run.target,
});
}
@ -950,7 +950,7 @@ impl Step for RustAnalyzerProcMacroSrv {
fn make_run(run: RunConfig<'_>) {
run.builder.ensure(RustAnalyzerProcMacroSrv {
compiler: run.builder.compiler(run.builder.top_stage, run.builder.config.build),
compiler: run.builder.compiler(run.builder.top_stage, run.builder.config.host_target),
target: run.target,
});
}
@ -1003,7 +1003,7 @@ impl Step for LlvmBitcodeLinker {
fn make_run(run: RunConfig<'_>) {
run.builder.ensure(LlvmBitcodeLinker {
compiler: run.builder.compiler(run.builder.top_stage, run.builder.config.build),
compiler: run.builder.compiler(run.builder.top_stage, run.builder.config.host_target),
extra_features: Vec::new(),
target: run.target,
});
@ -1141,7 +1141,7 @@ macro_rules! tool_extended {
fn make_run(run: RunConfig<'_>) {
run.builder.ensure($name {
compiler: run.builder.compiler(run.builder.top_stage, run.builder.config.build),
compiler: run.builder.compiler(run.builder.top_stage, run.builder.config.host_target),
target: run.target,
});
}
@ -1283,7 +1283,7 @@ impl Step for TestFloatParse {
}
fn run(self, builder: &Builder<'_>) -> ToolBuildResult {
let bootstrap_host = builder.config.build;
let bootstrap_host = builder.config.host_target;
let compiler = builder.compiler(builder.top_stage, bootstrap_host);
builder.ensure(ToolBuild {
@ -1306,7 +1306,7 @@ impl Builder<'_> {
/// `host`.
pub fn tool_cmd(&self, tool: Tool) -> BootstrapCommand {
let mut cmd = command(self.tool_exe(tool));
let compiler = self.compiler(0, self.config.build);
let compiler = self.compiler(0, self.config.host_target);
let host = &compiler.host;
// Prepares the `cmd` provided to be able to run the `compiler` provided.
//

View file

@ -137,7 +137,7 @@ pub struct RunConfig<'a> {
impl RunConfig<'_> {
pub fn build_triple(&self) -> TargetSelection {
self.builder.build.build
self.builder.build.host_target
}
/// Return a list of crate names selected by `run.paths`.
@ -1297,10 +1297,10 @@ impl<'a> Builder<'a> {
) -> Compiler {
let mut resolved_compiler = if self.build.force_use_stage2(stage) {
trace!(target: "COMPILER_FOR", ?stage, "force_use_stage2");
self.compiler(2, self.config.build)
self.compiler(2, self.config.host_target)
} else if self.build.force_use_stage1(stage, target) {
trace!(target: "COMPILER_FOR", ?stage, "force_use_stage1");
self.compiler(1, self.config.build)
self.compiler(1, self.config.host_target)
} else {
trace!(target: "COMPILER_FOR", ?stage, ?host, "no force, fallback to `compiler()`");
self.compiler(stage, host)
@ -1358,7 +1358,7 @@ impl<'a> Builder<'a> {
/// Windows.
pub fn libdir_relative(&self, compiler: Compiler) -> &Path {
if compiler.is_snapshot(self) {
libdir(self.config.build).as_ref()
libdir(self.config.host_target).as_ref()
} else {
match self.config.libdir_relative() {
Some(relative_libdir) if compiler.stage >= 1 => relative_libdir,
@ -1439,9 +1439,10 @@ impl<'a> Builder<'a> {
return cmd;
}
let _ = self.ensure(tool::Clippy { compiler: run_compiler, target: self.build.build });
let cargo_clippy =
self.ensure(tool::CargoClippy { compiler: run_compiler, target: self.build.build });
let _ =
self.ensure(tool::Clippy { compiler: run_compiler, target: self.build.host_target });
let cargo_clippy = self
.ensure(tool::CargoClippy { compiler: run_compiler, target: self.build.host_target });
let mut dylib_path = helpers::dylib_path();
dylib_path.insert(0, self.sysroot(run_compiler).join("lib"));
@ -1454,9 +1455,10 @@ impl<'a> Builder<'a> {
pub fn cargo_miri_cmd(&self, run_compiler: Compiler) -> BootstrapCommand {
assert!(run_compiler.stage > 0, "miri can not be invoked at stage 0");
// Prepare the tools
let miri = self.ensure(tool::Miri { compiler: run_compiler, target: self.build.build });
let miri =
self.ensure(tool::Miri { compiler: run_compiler, target: self.build.host_target });
let cargo_miri =
self.ensure(tool::CargoMiri { compiler: run_compiler, target: self.build.build });
self.ensure(tool::CargoMiri { compiler: run_compiler, target: self.build.host_target });
// Invoke cargo-miri, make sure it can find miri and cargo.
let mut cmd = command(cargo_miri.tool_path);
cmd.env("MIRI", &miri.tool_path);

View file

@ -46,7 +46,7 @@ fn configure_with_args(cmd: &[String], host: &[&str], target: &[&str]) -> Config
.join(&thread::current().name().unwrap_or("unknown").replace(":", "-"));
t!(fs::create_dir_all(&dir));
config.out = dir;
config.build = TargetSelection::from_user(TEST_TRIPLE_1);
config.host_target = TargetSelection::from_user(TEST_TRIPLE_1);
config.hosts = host.iter().map(|s| TargetSelection::from_user(s)).collect();
config.targets = target.iter().map(|s| TargetSelection::from_user(s)).collect();
config
@ -1102,7 +1102,7 @@ fn test_prebuilt_llvm_config_path_resolution() {
let actual = drop_win_disk_prefix_if_present(actual);
assert_eq!(expected, actual);
let actual = prebuilt_llvm_config(&builder, builder.config.build, false)
let actual = prebuilt_llvm_config(&builder, builder.config.host_target, false)
.llvm_result()
.llvm_config
.clone();
@ -1120,15 +1120,15 @@ fn test_prebuilt_llvm_config_path_resolution() {
let build = Build::new(config.clone());
let builder = Builder::new(&build);
let actual = prebuilt_llvm_config(&builder, builder.config.build, false)
let actual = prebuilt_llvm_config(&builder, builder.config.host_target, false)
.llvm_result()
.llvm_config
.clone();
let expected = builder
.out
.join(builder.config.build)
.join(builder.config.host_target)
.join("llvm/bin")
.join(exe("llvm-config", builder.config.build));
.join(exe("llvm-config", builder.config.host_target));
assert_eq!(expected, actual);
let config = configure(
@ -1143,15 +1143,15 @@ fn test_prebuilt_llvm_config_path_resolution() {
let build = Build::new(config.clone());
let builder = Builder::new(&build);
let actual = prebuilt_llvm_config(&builder, builder.config.build, false)
let actual = prebuilt_llvm_config(&builder, builder.config.host_target, false)
.llvm_result()
.llvm_config
.clone();
let expected = builder
.out
.join(builder.config.build)
.join(builder.config.host_target)
.join("ci-llvm/bin")
.join(exe("llvm-config", builder.config.build));
.join(exe("llvm-config", builder.config.host_target));
assert_eq!(expected, actual);
}
}
@ -1163,7 +1163,7 @@ fn test_is_builder_target() {
for (target1, target2) in [(target1, target2), (target2, target1)] {
let mut config = configure("build", &[], &[]);
config.build = target1;
config.host_target = target1;
let build = Build::new(config);
let builder = Builder::new(&build);

View file

@ -221,7 +221,7 @@ pub struct Config {
pub reproducible_artifacts: Vec<String>,
pub build: TargetSelection,
pub host_target: TargetSelection,
pub hosts: Vec<TargetSelection>,
pub targets: Vec<TargetSelection>,
pub local_rebuild: bool,
@ -346,7 +346,7 @@ impl Config {
stderr_is_tty: std::io::stderr().is_terminal(),
// set by build.rs
build: TargetSelection::from_user(env!("BUILD_TRIPLE")),
host_target: TargetSelection::from_user(env!("BUILD_TRIPLE")),
src: {
let manifest_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
@ -727,7 +727,7 @@ impl Config {
config.jobs = Some(threads_from_config(flags.jobs.unwrap_or(jobs.unwrap_or(0))));
if let Some(file_build) = build {
config.build = TargetSelection::from_user(&file_build);
config.host_target = TargetSelection::from_user(&file_build);
};
set(&mut config.out, flags.build_dir.or_else(|| build_dir.map(PathBuf::from)));
@ -753,10 +753,10 @@ impl Config {
config.download_beta_toolchain();
config
.out
.join(config.build)
.join(config.host_target)
.join("stage0")
.join("bin")
.join(exe("rustc", config.build))
.join(exe("rustc", config.host_target))
};
config.initial_sysroot = t!(PathBuf::from_str(
@ -777,7 +777,7 @@ impl Config {
cargo
} else {
config.download_beta_toolchain();
config.initial_sysroot.join("bin").join(exe("cargo", config.build))
config.initial_sysroot.join("bin").join(exe("cargo", config.host_target))
};
// NOTE: it's important this comes *after* we set `initial_rustc` just above.
@ -792,7 +792,7 @@ impl Config {
} else if let Some(file_host) = host {
file_host.iter().map(|h| TargetSelection::from_user(h)).collect()
} else {
vec![config.build]
vec![config.host_target]
};
config.targets = if let Some(TargetSelectionList(arg_target)) = flags.target {
arg_target
@ -926,17 +926,19 @@ impl Config {
}
if config.llvm_from_ci {
let triple = &config.build.triple;
let triple = &config.host_target.triple;
let ci_llvm_bin = config.ci_llvm_root().join("bin");
let build_target = config
.target_config
.entry(config.build)
.entry(config.host_target)
.or_insert_with(|| Target::from_triple(triple));
check_ci_llvm!(build_target.llvm_config);
check_ci_llvm!(build_target.llvm_filecheck);
build_target.llvm_config = Some(ci_llvm_bin.join(exe("llvm-config", config.build)));
build_target.llvm_filecheck = Some(ci_llvm_bin.join(exe("FileCheck", config.build)));
build_target.llvm_config =
Some(ci_llvm_bin.join(exe("llvm-config", config.host_target)));
build_target.llvm_filecheck =
Some(ci_llvm_bin.join(exe("FileCheck", config.host_target)));
}
config.apply_dist_config(toml.dist);
@ -953,7 +955,7 @@ impl Config {
);
}
if config.lld_enabled && config.is_system_llvm(config.build) {
if config.lld_enabled && config.is_system_llvm(config.host_target) {
eprintln!(
"Warning: LLD is enabled when using external llvm-config. LLD will not be built and copied to the sysroot."
);
@ -1147,13 +1149,13 @@ impl Config {
/// The absolute path to the downloaded LLVM artifacts.
pub(crate) fn ci_llvm_root(&self) -> PathBuf {
assert!(self.llvm_from_ci);
self.out.join(self.build).join("ci-llvm")
self.out.join(self.host_target).join("ci-llvm")
}
/// Directory where the extracted `rustc-dev` component is stored.
pub(crate) fn ci_rustc_dir(&self) -> PathBuf {
assert!(self.download_rustc());
self.out.join(self.build).join("ci-rustc")
self.out.join(self.host_target).join("ci-rustc")
}
/// Determine whether llvm should be linked dynamically.
@ -1237,7 +1239,7 @@ impl Config {
// Check the config compatibility
// FIXME: this doesn't cover `--set` flags yet.
let res = check_incompatible_options_for_ci_rustc(
self.build,
self.host_target,
current_config_toml,
ci_config_toml,
);
@ -1473,7 +1475,7 @@ impl Config {
debug_assertions_requested: bool,
llvm_assertions: bool,
) -> Option<String> {
if !is_download_ci_available(&self.build.triple, llvm_assertions) {
if !is_download_ci_available(&self.host_target.triple, llvm_assertions) {
return None;
}
@ -1709,7 +1711,7 @@ impl Config {
/// Checks if the given target is the same as the host target.
pub fn is_host_target(&self, target: TargetSelection) -> bool {
self.build == target
self.host_target == target
}
/// Returns `true` if this is an external version of LLVM not managed by bootstrap.

View file

@ -59,7 +59,7 @@ pub struct Flags {
pub build_dir: Option<PathBuf>,
#[arg(global = true, long, value_hint = clap::ValueHint::Other, value_name = "BUILD")]
/// build target of the stage0 compiler
/// host target of the stage0 compiler
pub build: Option<String>,
#[arg(global = true, long, value_hint = clap::ValueHint::Other, value_name = "HOST", value_parser = target_selection_list)]

View file

@ -147,7 +147,7 @@ impl Config {
}
let builder_config_path =
self.out.join(self.build.triple).join(build_name).join(BUILDER_CONFIG_FILENAME);
self.out.join(self.host_target.triple).join(build_name).join(BUILDER_CONFIG_FILENAME);
Self::get_toml(&builder_config_path)
}

View file

@ -621,13 +621,13 @@ impl Config {
// thus, disabled
// - similarly, lld will not be built nor used by default when explicitly asked not to, e.g.
// when the config sets `rust.lld = false`
if self.build.triple == "x86_64-unknown-linux-gnu"
&& self.hosts == [self.build]
if self.host_target.triple == "x86_64-unknown-linux-gnu"
&& self.hosts == [self.host_target]
&& (self.channel == "dev" || self.channel == "nightly")
{
let no_llvm_config = self
.target_config
.get(&self.build)
.get(&self.host_target)
.is_some_and(|target_config| target_config.llvm_config.is_none());
let enable_lld = self.llvm_from_ci || no_llvm_config;
// Prefer the config setting in case an explicit opt-out is needed.

View file

@ -101,7 +101,7 @@ impl Config {
let mut target = Target::from_triple(&triple);
if let Some(ref s) = cfg.llvm_config {
if self.download_rustc_commit.is_some() && triple == *self.build.triple {
if self.download_rustc_commit.is_some() && triple == *self.host_target.triple {
panic!(
"setting llvm_config for the host is incompatible with download-rustc"
);

View file

@ -256,7 +256,7 @@ impl Config {
}
curl.arg(url);
if !self.check_run(&mut curl) {
if self.build.contains("windows-msvc") {
if self.host_target.contains("windows-msvc") {
eprintln!("Fallback to PowerShell");
for _ in 0..3 {
let powershell = command("PowerShell.exe").allow_failure().args([
@ -411,7 +411,7 @@ impl Config {
let date = &self.stage0_metadata.compiler.date;
let version = &self.stage0_metadata.compiler.version;
let host = self.build;
let host = self.host_target;
let clippy_stamp =
BuildStamp::new(&self.initial_sysroot).with_prefix("clippy").add_stamp(date);
@ -449,7 +449,7 @@ impl Config {
let VersionMetadata { date, version } = self.stage0_metadata.rustfmt.as_ref()?;
let channel = format!("{version}-{date}");
let host = self.build;
let host = self.host_target;
let bin_root = self.out.join(host).join("rustfmt");
let rustfmt_path = bin_root.join("bin").join(exe("rustfmt", host));
let rustfmt_stamp = BuildStamp::new(&bin_root).with_prefix("rustfmt").add_stamp(channel);
@ -557,11 +557,11 @@ impl Config {
extra_components: &[&str],
download_component: fn(&Config, String, &str, &str),
) {
let host = self.build.triple;
let host = self.host_target.triple;
let bin_root = self.out.join(host).join(sysroot);
let rustc_stamp = BuildStamp::new(&bin_root).with_prefix("rustc").add_stamp(stamp_key);
if !bin_root.join("bin").join(exe("rustc", self.build)).exists()
if !bin_root.join("bin").join(exe("rustc", self.host_target)).exists()
|| !rustc_stamp.is_up_to_date()
{
if bin_root.exists() {
@ -630,7 +630,7 @@ impl Config {
t!(fs::create_dir_all(&cache_dir));
}
let bin_root = self.out.join(self.build).join(destination);
let bin_root = self.out.join(self.host_target).join(destination);
let tarball = cache_dir.join(&filename);
let (base_url, url, should_verify) = match mode {
DownloadSource::CI => {
@ -759,7 +759,7 @@ download-rustc = false
let now = std::time::SystemTime::now();
let file_times = fs::FileTimes::new().set_accessed(now).set_modified(now);
let llvm_config = llvm_root.join("bin").join(exe("llvm-config", self.build));
let llvm_config = llvm_root.join("bin").join(exe("llvm-config", self.host_target));
t!(crate::utils::helpers::set_file_times(llvm_config, file_times));
if self.should_fix_bins_and_dylibs() {
@ -814,7 +814,7 @@ download-rustc = false
&self.stage0_metadata.config.artifacts_server
};
let version = self.artifact_version_part(llvm_sha);
let filename = format!("rust-dev-{}-{}.tar.xz", version, self.build.triple);
let filename = format!("rust-dev-{}-{}.tar.xz", version, self.host_target.triple);
let tarball = rustc_cache.join(&filename);
if !tarball.exists() {
let help_on_error = "ERROR: failed to download llvm from ci
@ -844,7 +844,7 @@ download-rustc = false
}
let base = &self.stage0_metadata.config.artifacts_server;
let version = self.artifact_version_part(gcc_sha);
let filename = format!("gcc-{version}-{}.tar.xz", self.build.triple);
let filename = format!("gcc-{version}-{}.tar.xz", self.host_target.triple);
let tarball = gcc_cache.join(&filename);
if !tarball.exists() {
let help_on_error = "ERROR: failed to download gcc from ci

View file

@ -109,9 +109,9 @@ pub fn check(build: &mut Build) {
// Ensure that a compatible version of libstdc++ is available on the system when using `llvm.download-ci-llvm`.
#[cfg(not(test))]
if !build.config.dry_run() && !build.build.is_msvc() && build.config.llvm_from_ci {
if !build.config.dry_run() && !build.host_target.is_msvc() && build.config.llvm_from_ci {
let builder = Builder::new(build);
let libcxx_version = builder.ensure(tool::LibcxxVersionTool { target: build.build });
let libcxx_version = builder.ensure(tool::LibcxxVersionTool { target: build.host_target });
match libcxx_version {
tool::LibcxxVersion::Gnu(version) => {
@ -237,7 +237,7 @@ than building it.
}
// skip check for cross-targets
if skip_target_sanity && target != &build.build {
if skip_target_sanity && target != &build.host_target {
continue;
}
@ -308,7 +308,7 @@ than building it.
if build.config.llvm_enabled(*host) {
// Externally configured LLVM requires FileCheck to exist
let filecheck = build.llvm_filecheck(build.build);
let filecheck = build.llvm_filecheck(build.host_target);
if !filecheck.starts_with(&build.out)
&& !filecheck.exists()
&& build.config.codegen_tests
@ -333,7 +333,7 @@ than building it.
}
// skip check for cross-targets
if skip_target_sanity && target != &build.build {
if skip_target_sanity && target != &build.host_target {
continue;
}

View file

@ -175,7 +175,7 @@ pub struct Build {
verbosity: usize,
/// Build triple for the pre-compiled snapshot compiler.
build: TargetSelection,
host_target: TargetSelection,
/// Which triples to produce a compiler toolchain for.
hosts: Vec<TargetSelection>,
/// Which triples to build libraries (core/alloc/std/test/proc_macro) for.
@ -420,7 +420,7 @@ impl Build {
if bootstrap_out.ends_with("deps") {
bootstrap_out.pop();
}
if !bootstrap_out.join(exe("rustc", config.build)).exists() && !cfg!(test) {
if !bootstrap_out.join(exe("rustc", config.host_target)).exists() && !cfg!(test) {
// this restriction can be lifted whenever https://github.com/rust-lang/rfcs/pull/3028 is implemented
panic!(
"`rustc` not found in {}, run `cargo build --bins` before `cargo run`",
@ -436,7 +436,9 @@ impl Build {
initial_lld,
initial_relative_libdir,
initial_rustc: config.initial_rustc.clone(),
initial_rustdoc: config.initial_rustc.with_file_name(exe("rustdoc", config.build)),
initial_rustdoc: config
.initial_rustc
.with_file_name(exe("rustdoc", config.host_target)),
initial_cargo: config.initial_cargo.clone(),
initial_sysroot: config.initial_sysroot.clone(),
local_rebuild: config.local_rebuild,
@ -444,7 +446,7 @@ impl Build {
doc_tests: config.cmd.doc_tests(),
verbosity: config.verbose,
build: config.build,
host_target: config.host_target,
hosts: config.hosts.clone(),
targets: config.targets.clone(),
@ -521,7 +523,7 @@ impl Build {
}
// Create symbolic link to use host sysroot from a consistent path (e.g., in the rust-analyzer config file).
let build_triple = build.out.join(build.build);
let build_triple = build.out.join(build.host_target);
t!(fs::create_dir_all(&build_triple));
let host = build.out.join("host");
if host.is_symlink() {
@ -932,7 +934,7 @@ impl Build {
/// Returns the libdir of the snapshot compiler.
fn rustc_snapshot_libdir(&self) -> PathBuf {
self.rustc_snapshot_sysroot().join(libdir(self.config.build))
self.rustc_snapshot_sysroot().join(libdir(self.config.host_target))
}
/// Returns the sysroot of the snapshot compiler.
@ -973,7 +975,7 @@ impl Build {
what: impl Display,
target: impl Into<Option<TargetSelection>>,
) -> Option<gha::Group> {
self.msg(Kind::Clippy, self.config.stage, what, self.config.build, target)
self.msg(Kind::Clippy, self.config.stage, what, self.config.host_target, target)
}
#[must_use = "Groups should not be dropped until the Step finishes running"]
@ -988,7 +990,7 @@ impl Build {
Kind::Check,
custom_stage.unwrap_or(self.config.stage),
what,
self.config.build,
self.config.host_target,
target,
)
}
@ -1246,7 +1248,7 @@ impl Build {
Some(self.cc(target))
} else if self.config.lld_mode.is_used()
&& self.is_lld_direct_linker(target)
&& self.build == target
&& self.host_target == target
{
match self.config.lld_mode {
LldMode::SelfContained => Some(self.initial_lld.clone()),
@ -1400,7 +1402,7 @@ impl Build {
/// Path to the python interpreter to use
fn python(&self) -> &Path {
if self.config.build.ends_with("apple-darwin") {
if self.config.host_target.ends_with("apple-darwin") {
// Force /usr/bin/python3 on macOS for LLDB tests because we're loading the
// LLDB plugin's compiled module which only works with the system python
// (namely not Homebrew-installed python)
@ -1440,7 +1442,7 @@ impl Build {
!self.config.full_bootstrap
&& !self.config.download_rustc()
&& stage >= 2
&& (self.hosts.contains(&target) || target == self.build)
&& (self.hosts.contains(&target) || target == self.host_target)
}
/// Checks whether the `compiler` compiling for `target` should be forced to
@ -1877,7 +1879,7 @@ to download LLVM rather than building it.
// In these cases we automatically enable Ninja if we find it in the
// environment.
if !self.config.ninja_in_file
&& self.config.build.is_msvc()
&& self.config.host_target.is_msvc()
&& cmd_finder.maybe_have("ninja").is_some()
{
return true;
@ -1946,7 +1948,7 @@ impl Compiler {
/// Returns `true` if this is a snapshot compiler for `build`'s configuration
pub fn is_snapshot(&self, build: &Build) -> bool {
self.stage == 0 && self.host == build.build
self.stage == 0 && self.host == build.host_target
}
/// Indicates whether the compiler was forced to use a specific stage.

View file

@ -39,7 +39,7 @@ fn new_cc_build(build: &Build, target: TargetSelection) -> cc::Build {
// Compress debuginfo
.flag_if_supported("-gz")
.target(&target.triple)
.host(&build.build.triple);
.host(&build.host_target.triple);
match build.crt_static(target) {
Some(a) => {
cfg.static_crt(a);
@ -70,7 +70,7 @@ pub fn find(build: &Build) {
| crate::Subcommand::Suggest { .. }
| crate::Subcommand::Format { .. }
| crate::Subcommand::Setup { .. } => {
build.hosts.iter().cloned().chain(iter::once(build.build)).collect()
build.hosts.iter().cloned().chain(iter::once(build.host_target)).collect()
}
_ => {
@ -81,7 +81,7 @@ pub fn find(build: &Build) {
.iter()
.chain(&build.hosts)
.cloned()
.chain(iter::once(build.build))
.chain(iter::once(build.host_target))
.collect()
}
};

View file

@ -155,7 +155,7 @@ fn test_find() {
build.targets.push(target1.clone());
build.hosts.push(target2.clone());
find(&build);
for t in build.hosts.iter().chain(build.targets.iter()).chain(iter::once(&build.build)) {
for t in build.hosts.iter().chain(build.targets.iter()).chain(iter::once(&build.host_target)) {
assert!(build.cc.borrow().contains_key(t), "CC not set for target {}", t.triple);
}
}

View file

@ -26,7 +26,7 @@ end
complete -c x -n "__fish_x_needs_command" -l config -d 'TOML configuration file for build' -r -F
complete -c x -n "__fish_x_needs_command" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)"
complete -c x -n "__fish_x_needs_command" -l build -d 'build target of the stage0 compiler' -r -f
complete -c x -n "__fish_x_needs_command" -l build -d 'host target of the stage0 compiler' -r -f
complete -c x -n "__fish_x_needs_command" -l host -d 'host targets to build' -r -f
complete -c x -n "__fish_x_needs_command" -l target -d 'target targets to build' -r -f
complete -c x -n "__fish_x_needs_command" -l exclude -d 'build paths to exclude' -r -F
@ -78,7 +78,7 @@ complete -c x -n "__fish_x_needs_command" -a "vendor" -d 'Vendor dependencies'
complete -c x -n "__fish_x_needs_command" -a "perf" -d 'Perform profiling and benchmarking of the compiler using `rustc-perf`'
complete -c x -n "__fish_x_using_subcommand build" -l config -d 'TOML configuration file for build' -r -F
complete -c x -n "__fish_x_using_subcommand build" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)"
complete -c x -n "__fish_x_using_subcommand build" -l build -d 'build target of the stage0 compiler' -r -f
complete -c x -n "__fish_x_using_subcommand build" -l build -d 'host target of the stage0 compiler' -r -f
complete -c x -n "__fish_x_using_subcommand build" -l host -d 'host targets to build' -r -f
complete -c x -n "__fish_x_using_subcommand build" -l target -d 'target targets to build' -r -f
complete -c x -n "__fish_x_using_subcommand build" -l exclude -d 'build paths to exclude' -r -F
@ -113,7 +113,7 @@ complete -c x -n "__fish_x_using_subcommand build" -l skip-std-check-if-no-downl
complete -c x -n "__fish_x_using_subcommand build" -s h -l help -d 'Print help (see more with \'--help\')'
complete -c x -n "__fish_x_using_subcommand check" -l config -d 'TOML configuration file for build' -r -F
complete -c x -n "__fish_x_using_subcommand check" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)"
complete -c x -n "__fish_x_using_subcommand check" -l build -d 'build target of the stage0 compiler' -r -f
complete -c x -n "__fish_x_using_subcommand check" -l build -d 'host target of the stage0 compiler' -r -f
complete -c x -n "__fish_x_using_subcommand check" -l host -d 'host targets to build' -r -f
complete -c x -n "__fish_x_using_subcommand check" -l target -d 'target targets to build' -r -f
complete -c x -n "__fish_x_using_subcommand check" -l exclude -d 'build paths to exclude' -r -F
@ -153,7 +153,7 @@ complete -c x -n "__fish_x_using_subcommand clippy" -s W -d 'clippy lints to war
complete -c x -n "__fish_x_using_subcommand clippy" -s F -d 'clippy lints to forbid' -r
complete -c x -n "__fish_x_using_subcommand clippy" -l config -d 'TOML configuration file for build' -r -F
complete -c x -n "__fish_x_using_subcommand clippy" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)"
complete -c x -n "__fish_x_using_subcommand clippy" -l build -d 'build target of the stage0 compiler' -r -f
complete -c x -n "__fish_x_using_subcommand clippy" -l build -d 'host target of the stage0 compiler' -r -f
complete -c x -n "__fish_x_using_subcommand clippy" -l host -d 'host targets to build' -r -f
complete -c x -n "__fish_x_using_subcommand clippy" -l target -d 'target targets to build' -r -f
complete -c x -n "__fish_x_using_subcommand clippy" -l exclude -d 'build paths to exclude' -r -F
@ -191,7 +191,7 @@ complete -c x -n "__fish_x_using_subcommand clippy" -l skip-std-check-if-no-down
complete -c x -n "__fish_x_using_subcommand clippy" -s h -l help -d 'Print help (see more with \'--help\')'
complete -c x -n "__fish_x_using_subcommand fix" -l config -d 'TOML configuration file for build' -r -F
complete -c x -n "__fish_x_using_subcommand fix" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)"
complete -c x -n "__fish_x_using_subcommand fix" -l build -d 'build target of the stage0 compiler' -r -f
complete -c x -n "__fish_x_using_subcommand fix" -l build -d 'host target of the stage0 compiler' -r -f
complete -c x -n "__fish_x_using_subcommand fix" -l host -d 'host targets to build' -r -f
complete -c x -n "__fish_x_using_subcommand fix" -l target -d 'target targets to build' -r -f
complete -c x -n "__fish_x_using_subcommand fix" -l exclude -d 'build paths to exclude' -r -F
@ -226,7 +226,7 @@ complete -c x -n "__fish_x_using_subcommand fix" -l skip-std-check-if-no-downloa
complete -c x -n "__fish_x_using_subcommand fix" -s h -l help -d 'Print help (see more with \'--help\')'
complete -c x -n "__fish_x_using_subcommand fmt" -l config -d 'TOML configuration file for build' -r -F
complete -c x -n "__fish_x_using_subcommand fmt" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)"
complete -c x -n "__fish_x_using_subcommand fmt" -l build -d 'build target of the stage0 compiler' -r -f
complete -c x -n "__fish_x_using_subcommand fmt" -l build -d 'host target of the stage0 compiler' -r -f
complete -c x -n "__fish_x_using_subcommand fmt" -l host -d 'host targets to build' -r -f
complete -c x -n "__fish_x_using_subcommand fmt" -l target -d 'target targets to build' -r -f
complete -c x -n "__fish_x_using_subcommand fmt" -l exclude -d 'build paths to exclude' -r -F
@ -263,7 +263,7 @@ complete -c x -n "__fish_x_using_subcommand fmt" -l skip-std-check-if-no-downloa
complete -c x -n "__fish_x_using_subcommand fmt" -s h -l help -d 'Print help (see more with \'--help\')'
complete -c x -n "__fish_x_using_subcommand doc" -l config -d 'TOML configuration file for build' -r -F
complete -c x -n "__fish_x_using_subcommand doc" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)"
complete -c x -n "__fish_x_using_subcommand doc" -l build -d 'build target of the stage0 compiler' -r -f
complete -c x -n "__fish_x_using_subcommand doc" -l build -d 'host target of the stage0 compiler' -r -f
complete -c x -n "__fish_x_using_subcommand doc" -l host -d 'host targets to build' -r -f
complete -c x -n "__fish_x_using_subcommand doc" -l target -d 'target targets to build' -r -f
complete -c x -n "__fish_x_using_subcommand doc" -l exclude -d 'build paths to exclude' -r -F
@ -306,7 +306,7 @@ complete -c x -n "__fish_x_using_subcommand test" -l pass -d 'force {check,build
complete -c x -n "__fish_x_using_subcommand test" -l run -d 'whether to execute run-* tests' -r
complete -c x -n "__fish_x_using_subcommand test" -l config -d 'TOML configuration file for build' -r -F
complete -c x -n "__fish_x_using_subcommand test" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)"
complete -c x -n "__fish_x_using_subcommand test" -l build -d 'build target of the stage0 compiler' -r -f
complete -c x -n "__fish_x_using_subcommand test" -l build -d 'host target of the stage0 compiler' -r -f
complete -c x -n "__fish_x_using_subcommand test" -l host -d 'host targets to build' -r -f
complete -c x -n "__fish_x_using_subcommand test" -l target -d 'target targets to build' -r -f
complete -c x -n "__fish_x_using_subcommand test" -l exclude -d 'build paths to exclude' -r -F
@ -350,7 +350,7 @@ complete -c x -n "__fish_x_using_subcommand test" -s h -l help -d 'Print help (s
complete -c x -n "__fish_x_using_subcommand miri" -l test-args -d 'extra arguments to be passed for the test tool being used (e.g. libtest, compiletest or rustdoc)' -r
complete -c x -n "__fish_x_using_subcommand miri" -l config -d 'TOML configuration file for build' -r -F
complete -c x -n "__fish_x_using_subcommand miri" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)"
complete -c x -n "__fish_x_using_subcommand miri" -l build -d 'build target of the stage0 compiler' -r -f
complete -c x -n "__fish_x_using_subcommand miri" -l build -d 'host target of the stage0 compiler' -r -f
complete -c x -n "__fish_x_using_subcommand miri" -l host -d 'host targets to build' -r -f
complete -c x -n "__fish_x_using_subcommand miri" -l target -d 'target targets to build' -r -f
complete -c x -n "__fish_x_using_subcommand miri" -l exclude -d 'build paths to exclude' -r -F
@ -389,7 +389,7 @@ complete -c x -n "__fish_x_using_subcommand miri" -s h -l help -d 'Print help (s
complete -c x -n "__fish_x_using_subcommand bench" -l test-args -r
complete -c x -n "__fish_x_using_subcommand bench" -l config -d 'TOML configuration file for build' -r -F
complete -c x -n "__fish_x_using_subcommand bench" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)"
complete -c x -n "__fish_x_using_subcommand bench" -l build -d 'build target of the stage0 compiler' -r -f
complete -c x -n "__fish_x_using_subcommand bench" -l build -d 'host target of the stage0 compiler' -r -f
complete -c x -n "__fish_x_using_subcommand bench" -l host -d 'host targets to build' -r -f
complete -c x -n "__fish_x_using_subcommand bench" -l target -d 'target targets to build' -r -f
complete -c x -n "__fish_x_using_subcommand bench" -l exclude -d 'build paths to exclude' -r -F
@ -425,7 +425,7 @@ complete -c x -n "__fish_x_using_subcommand bench" -s h -l help -d 'Print help (
complete -c x -n "__fish_x_using_subcommand clean" -l stage -d 'Clean a specific stage without touching other artifacts. By default, every stage is cleaned if this option is not used' -r
complete -c x -n "__fish_x_using_subcommand clean" -l config -d 'TOML configuration file for build' -r -F
complete -c x -n "__fish_x_using_subcommand clean" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)"
complete -c x -n "__fish_x_using_subcommand clean" -l build -d 'build target of the stage0 compiler' -r -f
complete -c x -n "__fish_x_using_subcommand clean" -l build -d 'host target of the stage0 compiler' -r -f
complete -c x -n "__fish_x_using_subcommand clean" -l host -d 'host targets to build' -r -f
complete -c x -n "__fish_x_using_subcommand clean" -l target -d 'target targets to build' -r -f
complete -c x -n "__fish_x_using_subcommand clean" -l exclude -d 'build paths to exclude' -r -F
@ -460,7 +460,7 @@ complete -c x -n "__fish_x_using_subcommand clean" -l skip-std-check-if-no-downl
complete -c x -n "__fish_x_using_subcommand clean" -s h -l help -d 'Print help (see more with \'--help\')'
complete -c x -n "__fish_x_using_subcommand dist" -l config -d 'TOML configuration file for build' -r -F
complete -c x -n "__fish_x_using_subcommand dist" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)"
complete -c x -n "__fish_x_using_subcommand dist" -l build -d 'build target of the stage0 compiler' -r -f
complete -c x -n "__fish_x_using_subcommand dist" -l build -d 'host target of the stage0 compiler' -r -f
complete -c x -n "__fish_x_using_subcommand dist" -l host -d 'host targets to build' -r -f
complete -c x -n "__fish_x_using_subcommand dist" -l target -d 'target targets to build' -r -f
complete -c x -n "__fish_x_using_subcommand dist" -l exclude -d 'build paths to exclude' -r -F
@ -495,7 +495,7 @@ complete -c x -n "__fish_x_using_subcommand dist" -l skip-std-check-if-no-downlo
complete -c x -n "__fish_x_using_subcommand dist" -s h -l help -d 'Print help (see more with \'--help\')'
complete -c x -n "__fish_x_using_subcommand install" -l config -d 'TOML configuration file for build' -r -F
complete -c x -n "__fish_x_using_subcommand install" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)"
complete -c x -n "__fish_x_using_subcommand install" -l build -d 'build target of the stage0 compiler' -r -f
complete -c x -n "__fish_x_using_subcommand install" -l build -d 'host target of the stage0 compiler' -r -f
complete -c x -n "__fish_x_using_subcommand install" -l host -d 'host targets to build' -r -f
complete -c x -n "__fish_x_using_subcommand install" -l target -d 'target targets to build' -r -f
complete -c x -n "__fish_x_using_subcommand install" -l exclude -d 'build paths to exclude' -r -F
@ -531,7 +531,7 @@ complete -c x -n "__fish_x_using_subcommand install" -s h -l help -d 'Print help
complete -c x -n "__fish_x_using_subcommand run" -l args -d 'arguments for the tool' -r
complete -c x -n "__fish_x_using_subcommand run" -l config -d 'TOML configuration file for build' -r -F
complete -c x -n "__fish_x_using_subcommand run" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)"
complete -c x -n "__fish_x_using_subcommand run" -l build -d 'build target of the stage0 compiler' -r -f
complete -c x -n "__fish_x_using_subcommand run" -l build -d 'host target of the stage0 compiler' -r -f
complete -c x -n "__fish_x_using_subcommand run" -l host -d 'host targets to build' -r -f
complete -c x -n "__fish_x_using_subcommand run" -l target -d 'target targets to build' -r -f
complete -c x -n "__fish_x_using_subcommand run" -l exclude -d 'build paths to exclude' -r -F
@ -566,7 +566,7 @@ complete -c x -n "__fish_x_using_subcommand run" -l skip-std-check-if-no-downloa
complete -c x -n "__fish_x_using_subcommand run" -s h -l help -d 'Print help (see more with \'--help\')'
complete -c x -n "__fish_x_using_subcommand setup" -l config -d 'TOML configuration file for build' -r -F
complete -c x -n "__fish_x_using_subcommand setup" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)"
complete -c x -n "__fish_x_using_subcommand setup" -l build -d 'build target of the stage0 compiler' -r -f
complete -c x -n "__fish_x_using_subcommand setup" -l build -d 'host target of the stage0 compiler' -r -f
complete -c x -n "__fish_x_using_subcommand setup" -l host -d 'host targets to build' -r -f
complete -c x -n "__fish_x_using_subcommand setup" -l target -d 'target targets to build' -r -f
complete -c x -n "__fish_x_using_subcommand setup" -l exclude -d 'build paths to exclude' -r -F
@ -601,7 +601,7 @@ complete -c x -n "__fish_x_using_subcommand setup" -l skip-std-check-if-no-downl
complete -c x -n "__fish_x_using_subcommand setup" -s h -l help -d 'Print help (see more with \'--help\')'
complete -c x -n "__fish_x_using_subcommand suggest" -l config -d 'TOML configuration file for build' -r -F
complete -c x -n "__fish_x_using_subcommand suggest" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)"
complete -c x -n "__fish_x_using_subcommand suggest" -l build -d 'build target of the stage0 compiler' -r -f
complete -c x -n "__fish_x_using_subcommand suggest" -l build -d 'host target of the stage0 compiler' -r -f
complete -c x -n "__fish_x_using_subcommand suggest" -l host -d 'host targets to build' -r -f
complete -c x -n "__fish_x_using_subcommand suggest" -l target -d 'target targets to build' -r -f
complete -c x -n "__fish_x_using_subcommand suggest" -l exclude -d 'build paths to exclude' -r -F
@ -638,7 +638,7 @@ complete -c x -n "__fish_x_using_subcommand suggest" -s h -l help -d 'Print help
complete -c x -n "__fish_x_using_subcommand vendor" -l sync -d 'Additional `Cargo.toml` to sync and vendor' -r -F
complete -c x -n "__fish_x_using_subcommand vendor" -l config -d 'TOML configuration file for build' -r -F
complete -c x -n "__fish_x_using_subcommand vendor" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)"
complete -c x -n "__fish_x_using_subcommand vendor" -l build -d 'build target of the stage0 compiler' -r -f
complete -c x -n "__fish_x_using_subcommand vendor" -l build -d 'host target of the stage0 compiler' -r -f
complete -c x -n "__fish_x_using_subcommand vendor" -l host -d 'host targets to build' -r -f
complete -c x -n "__fish_x_using_subcommand vendor" -l target -d 'target targets to build' -r -f
complete -c x -n "__fish_x_using_subcommand vendor" -l exclude -d 'build paths to exclude' -r -F
@ -674,7 +674,7 @@ complete -c x -n "__fish_x_using_subcommand vendor" -l skip-std-check-if-no-down
complete -c x -n "__fish_x_using_subcommand vendor" -s h -l help -d 'Print help (see more with \'--help\')'
complete -c x -n "__fish_x_using_subcommand perf; and not __fish_seen_subcommand_from eprintln samply cachegrind benchmark compare" -l config -d 'TOML configuration file for build' -r -F
complete -c x -n "__fish_x_using_subcommand perf; and not __fish_seen_subcommand_from eprintln samply cachegrind benchmark compare" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)"
complete -c x -n "__fish_x_using_subcommand perf; and not __fish_seen_subcommand_from eprintln samply cachegrind benchmark compare" -l build -d 'build target of the stage0 compiler' -r -f
complete -c x -n "__fish_x_using_subcommand perf; and not __fish_seen_subcommand_from eprintln samply cachegrind benchmark compare" -l build -d 'host target of the stage0 compiler' -r -f
complete -c x -n "__fish_x_using_subcommand perf; and not __fish_seen_subcommand_from eprintln samply cachegrind benchmark compare" -l host -d 'host targets to build' -r -f
complete -c x -n "__fish_x_using_subcommand perf; and not __fish_seen_subcommand_from eprintln samply cachegrind benchmark compare" -l target -d 'target targets to build' -r -f
complete -c x -n "__fish_x_using_subcommand perf; and not __fish_seen_subcommand_from eprintln samply cachegrind benchmark compare" -l exclude -d 'build paths to exclude' -r -F
@ -718,7 +718,7 @@ complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_fro
complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from eprintln" -l profiles -d 'Select the profiles that should be benchmarked' -r -f -a "{Check\t'',Debug\t'',Doc\t'',Opt\t'',Clippy\t''}"
complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from eprintln" -l config -d 'TOML configuration file for build' -r -F
complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from eprintln" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)"
complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from eprintln" -l build -d 'build target of the stage0 compiler' -r -f
complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from eprintln" -l build -d 'host target of the stage0 compiler' -r -f
complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from eprintln" -l host -d 'host targets to build' -r -f
complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from eprintln" -l target -d 'target targets to build' -r -f
complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from eprintln" -l skip -d 'build paths to skip' -r -F
@ -756,7 +756,7 @@ complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_fro
complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from samply" -l profiles -d 'Select the profiles that should be benchmarked' -r -f -a "{Check\t'',Debug\t'',Doc\t'',Opt\t'',Clippy\t''}"
complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from samply" -l config -d 'TOML configuration file for build' -r -F
complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from samply" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)"
complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from samply" -l build -d 'build target of the stage0 compiler' -r -f
complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from samply" -l build -d 'host target of the stage0 compiler' -r -f
complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from samply" -l host -d 'host targets to build' -r -f
complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from samply" -l target -d 'target targets to build' -r -f
complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from samply" -l skip -d 'build paths to skip' -r -F
@ -794,7 +794,7 @@ complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_fro
complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from cachegrind" -l profiles -d 'Select the profiles that should be benchmarked' -r -f -a "{Check\t'',Debug\t'',Doc\t'',Opt\t'',Clippy\t''}"
complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from cachegrind" -l config -d 'TOML configuration file for build' -r -F
complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from cachegrind" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)"
complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from cachegrind" -l build -d 'build target of the stage0 compiler' -r -f
complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from cachegrind" -l build -d 'host target of the stage0 compiler' -r -f
complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from cachegrind" -l host -d 'host targets to build' -r -f
complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from cachegrind" -l target -d 'target targets to build' -r -f
complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from cachegrind" -l skip -d 'build paths to skip' -r -F
@ -832,7 +832,7 @@ complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_fro
complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from benchmark" -l profiles -d 'Select the profiles that should be benchmarked' -r -f -a "{Check\t'',Debug\t'',Doc\t'',Opt\t'',Clippy\t''}"
complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from benchmark" -l config -d 'TOML configuration file for build' -r -F
complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from benchmark" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)"
complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from benchmark" -l build -d 'build target of the stage0 compiler' -r -f
complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from benchmark" -l build -d 'host target of the stage0 compiler' -r -f
complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from benchmark" -l host -d 'host targets to build' -r -f
complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from benchmark" -l target -d 'target targets to build' -r -f
complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from benchmark" -l skip -d 'build paths to skip' -r -F
@ -866,7 +866,7 @@ complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_fro
complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from benchmark" -s h -l help -d 'Print help (see more with \'--help\')'
complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from compare" -l config -d 'TOML configuration file for build' -r -F
complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from compare" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)"
complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from compare" -l build -d 'build target of the stage0 compiler' -r -f
complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from compare" -l build -d 'host target of the stage0 compiler' -r -f
complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from compare" -l host -d 'host targets to build' -r -f
complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from compare" -l target -d 'target targets to build' -r -f
complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from compare" -l exclude -d 'build paths to exclude' -r -F

View file

@ -23,7 +23,7 @@ Register-ArgumentCompleter -Native -CommandName 'x' -ScriptBlock {
'x' {
[CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build')
[CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `bootstrap.toml`')
[CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler')
[CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'host target of the stage0 compiler')
[CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build')
[CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build')
[CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude')
@ -82,7 +82,7 @@ Register-ArgumentCompleter -Native -CommandName 'x' -ScriptBlock {
'x;build' {
[CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build')
[CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `bootstrap.toml`')
[CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler')
[CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'host target of the stage0 compiler')
[CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build')
[CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build')
[CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude')
@ -124,7 +124,7 @@ Register-ArgumentCompleter -Native -CommandName 'x' -ScriptBlock {
'x;check' {
[CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build')
[CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `bootstrap.toml`')
[CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler')
[CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'host target of the stage0 compiler')
[CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build')
[CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build')
[CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude')
@ -171,7 +171,7 @@ Register-ArgumentCompleter -Native -CommandName 'x' -ScriptBlock {
[CompletionResult]::new('-F', '-F ', [CompletionResultType]::ParameterName, 'clippy lints to forbid')
[CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build')
[CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `bootstrap.toml`')
[CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler')
[CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'host target of the stage0 compiler')
[CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build')
[CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build')
[CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude')
@ -216,7 +216,7 @@ Register-ArgumentCompleter -Native -CommandName 'x' -ScriptBlock {
'x;fix' {
[CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build')
[CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `bootstrap.toml`')
[CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler')
[CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'host target of the stage0 compiler')
[CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build')
[CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build')
[CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude')
@ -258,7 +258,7 @@ Register-ArgumentCompleter -Native -CommandName 'x' -ScriptBlock {
'x;fmt' {
[CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build')
[CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `bootstrap.toml`')
[CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler')
[CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'host target of the stage0 compiler')
[CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build')
[CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build')
[CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude')
@ -302,7 +302,7 @@ Register-ArgumentCompleter -Native -CommandName 'x' -ScriptBlock {
'x;doc' {
[CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build')
[CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `bootstrap.toml`')
[CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler')
[CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'host target of the stage0 compiler')
[CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build')
[CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build')
[CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude')
@ -352,7 +352,7 @@ Register-ArgumentCompleter -Native -CommandName 'x' -ScriptBlock {
[CompletionResult]::new('--run', '--run', [CompletionResultType]::ParameterName, 'whether to execute run-* tests')
[CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build')
[CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `bootstrap.toml`')
[CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler')
[CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'host target of the stage0 compiler')
[CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build')
[CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build')
[CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude')
@ -403,7 +403,7 @@ Register-ArgumentCompleter -Native -CommandName 'x' -ScriptBlock {
[CompletionResult]::new('--test-args', '--test-args', [CompletionResultType]::ParameterName, 'extra arguments to be passed for the test tool being used (e.g. libtest, compiletest or rustdoc)')
[CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build')
[CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `bootstrap.toml`')
[CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler')
[CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'host target of the stage0 compiler')
[CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build')
[CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build')
[CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude')
@ -449,7 +449,7 @@ Register-ArgumentCompleter -Native -CommandName 'x' -ScriptBlock {
[CompletionResult]::new('--test-args', '--test-args', [CompletionResultType]::ParameterName, 'test-args')
[CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build')
[CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `bootstrap.toml`')
[CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler')
[CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'host target of the stage0 compiler')
[CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build')
[CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build')
[CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude')
@ -492,7 +492,7 @@ Register-ArgumentCompleter -Native -CommandName 'x' -ScriptBlock {
[CompletionResult]::new('--stage', '--stage', [CompletionResultType]::ParameterName, 'Clean a specific stage without touching other artifacts. By default, every stage is cleaned if this option is not used')
[CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build')
[CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `bootstrap.toml`')
[CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler')
[CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'host target of the stage0 compiler')
[CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build')
[CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build')
[CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude')
@ -534,7 +534,7 @@ Register-ArgumentCompleter -Native -CommandName 'x' -ScriptBlock {
'x;dist' {
[CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build')
[CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `bootstrap.toml`')
[CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler')
[CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'host target of the stage0 compiler')
[CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build')
[CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build')
[CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude')
@ -576,7 +576,7 @@ Register-ArgumentCompleter -Native -CommandName 'x' -ScriptBlock {
'x;install' {
[CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build')
[CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `bootstrap.toml`')
[CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler')
[CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'host target of the stage0 compiler')
[CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build')
[CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build')
[CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude')
@ -619,7 +619,7 @@ Register-ArgumentCompleter -Native -CommandName 'x' -ScriptBlock {
[CompletionResult]::new('--args', '--args', [CompletionResultType]::ParameterName, 'arguments for the tool')
[CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build')
[CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `bootstrap.toml`')
[CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler')
[CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'host target of the stage0 compiler')
[CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build')
[CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build')
[CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude')
@ -661,7 +661,7 @@ Register-ArgumentCompleter -Native -CommandName 'x' -ScriptBlock {
'x;setup' {
[CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build')
[CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `bootstrap.toml`')
[CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler')
[CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'host target of the stage0 compiler')
[CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build')
[CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build')
[CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude')
@ -703,7 +703,7 @@ Register-ArgumentCompleter -Native -CommandName 'x' -ScriptBlock {
'x;suggest' {
[CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build')
[CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `bootstrap.toml`')
[CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler')
[CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'host target of the stage0 compiler')
[CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build')
[CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build')
[CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude')
@ -747,7 +747,7 @@ Register-ArgumentCompleter -Native -CommandName 'x' -ScriptBlock {
[CompletionResult]::new('--sync', '--sync', [CompletionResultType]::ParameterName, 'Additional `Cargo.toml` to sync and vendor')
[CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build')
[CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `bootstrap.toml`')
[CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler')
[CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'host target of the stage0 compiler')
[CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build')
[CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build')
[CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude')
@ -790,7 +790,7 @@ Register-ArgumentCompleter -Native -CommandName 'x' -ScriptBlock {
'x;perf' {
[CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build')
[CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `bootstrap.toml`')
[CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler')
[CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'host target of the stage0 compiler')
[CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build')
[CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build')
[CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude')
@ -841,7 +841,7 @@ Register-ArgumentCompleter -Native -CommandName 'x' -ScriptBlock {
[CompletionResult]::new('--profiles', '--profiles', [CompletionResultType]::ParameterName, 'Select the profiles that should be benchmarked')
[CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build')
[CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `bootstrap.toml`')
[CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler')
[CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'host target of the stage0 compiler')
[CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build')
[CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build')
[CompletionResult]::new('--skip', '--skip', [CompletionResultType]::ParameterName, 'build paths to skip')
@ -886,7 +886,7 @@ Register-ArgumentCompleter -Native -CommandName 'x' -ScriptBlock {
[CompletionResult]::new('--profiles', '--profiles', [CompletionResultType]::ParameterName, 'Select the profiles that should be benchmarked')
[CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build')
[CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `bootstrap.toml`')
[CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler')
[CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'host target of the stage0 compiler')
[CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build')
[CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build')
[CompletionResult]::new('--skip', '--skip', [CompletionResultType]::ParameterName, 'build paths to skip')
@ -931,7 +931,7 @@ Register-ArgumentCompleter -Native -CommandName 'x' -ScriptBlock {
[CompletionResult]::new('--profiles', '--profiles', [CompletionResultType]::ParameterName, 'Select the profiles that should be benchmarked')
[CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build')
[CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `bootstrap.toml`')
[CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler')
[CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'host target of the stage0 compiler')
[CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build')
[CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build')
[CompletionResult]::new('--skip', '--skip', [CompletionResultType]::ParameterName, 'build paths to skip')
@ -976,7 +976,7 @@ Register-ArgumentCompleter -Native -CommandName 'x' -ScriptBlock {
[CompletionResult]::new('--profiles', '--profiles', [CompletionResultType]::ParameterName, 'Select the profiles that should be benchmarked')
[CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build')
[CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `bootstrap.toml`')
[CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler')
[CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'host target of the stage0 compiler')
[CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build')
[CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build')
[CompletionResult]::new('--skip', '--skip', [CompletionResultType]::ParameterName, 'build paths to skip')
@ -1017,7 +1017,7 @@ Register-ArgumentCompleter -Native -CommandName 'x' -ScriptBlock {
'x;perf;compare' {
[CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build')
[CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `bootstrap.toml`')
[CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler')
[CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'host target of the stage0 compiler')
[CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build')
[CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build')
[CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude')

View file

@ -26,7 +26,7 @@ end
complete -c x.py -n "__fish_x.py_needs_command" -l config -d 'TOML configuration file for build' -r -F
complete -c x.py -n "__fish_x.py_needs_command" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)"
complete -c x.py -n "__fish_x.py_needs_command" -l build -d 'build target of the stage0 compiler' -r -f
complete -c x.py -n "__fish_x.py_needs_command" -l build -d 'host target of the stage0 compiler' -r -f
complete -c x.py -n "__fish_x.py_needs_command" -l host -d 'host targets to build' -r -f
complete -c x.py -n "__fish_x.py_needs_command" -l target -d 'target targets to build' -r -f
complete -c x.py -n "__fish_x.py_needs_command" -l exclude -d 'build paths to exclude' -r -F
@ -78,7 +78,7 @@ complete -c x.py -n "__fish_x.py_needs_command" -a "vendor" -d 'Vendor dependenc
complete -c x.py -n "__fish_x.py_needs_command" -a "perf" -d 'Perform profiling and benchmarking of the compiler using `rustc-perf`'
complete -c x.py -n "__fish_x.py_using_subcommand build" -l config -d 'TOML configuration file for build' -r -F
complete -c x.py -n "__fish_x.py_using_subcommand build" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)"
complete -c x.py -n "__fish_x.py_using_subcommand build" -l build -d 'build target of the stage0 compiler' -r -f
complete -c x.py -n "__fish_x.py_using_subcommand build" -l build -d 'host target of the stage0 compiler' -r -f
complete -c x.py -n "__fish_x.py_using_subcommand build" -l host -d 'host targets to build' -r -f
complete -c x.py -n "__fish_x.py_using_subcommand build" -l target -d 'target targets to build' -r -f
complete -c x.py -n "__fish_x.py_using_subcommand build" -l exclude -d 'build paths to exclude' -r -F
@ -113,7 +113,7 @@ complete -c x.py -n "__fish_x.py_using_subcommand build" -l skip-std-check-if-no
complete -c x.py -n "__fish_x.py_using_subcommand build" -s h -l help -d 'Print help (see more with \'--help\')'
complete -c x.py -n "__fish_x.py_using_subcommand check" -l config -d 'TOML configuration file for build' -r -F
complete -c x.py -n "__fish_x.py_using_subcommand check" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)"
complete -c x.py -n "__fish_x.py_using_subcommand check" -l build -d 'build target of the stage0 compiler' -r -f
complete -c x.py -n "__fish_x.py_using_subcommand check" -l build -d 'host target of the stage0 compiler' -r -f
complete -c x.py -n "__fish_x.py_using_subcommand check" -l host -d 'host targets to build' -r -f
complete -c x.py -n "__fish_x.py_using_subcommand check" -l target -d 'target targets to build' -r -f
complete -c x.py -n "__fish_x.py_using_subcommand check" -l exclude -d 'build paths to exclude' -r -F
@ -153,7 +153,7 @@ complete -c x.py -n "__fish_x.py_using_subcommand clippy" -s W -d 'clippy lints
complete -c x.py -n "__fish_x.py_using_subcommand clippy" -s F -d 'clippy lints to forbid' -r
complete -c x.py -n "__fish_x.py_using_subcommand clippy" -l config -d 'TOML configuration file for build' -r -F
complete -c x.py -n "__fish_x.py_using_subcommand clippy" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)"
complete -c x.py -n "__fish_x.py_using_subcommand clippy" -l build -d 'build target of the stage0 compiler' -r -f
complete -c x.py -n "__fish_x.py_using_subcommand clippy" -l build -d 'host target of the stage0 compiler' -r -f
complete -c x.py -n "__fish_x.py_using_subcommand clippy" -l host -d 'host targets to build' -r -f
complete -c x.py -n "__fish_x.py_using_subcommand clippy" -l target -d 'target targets to build' -r -f
complete -c x.py -n "__fish_x.py_using_subcommand clippy" -l exclude -d 'build paths to exclude' -r -F
@ -191,7 +191,7 @@ complete -c x.py -n "__fish_x.py_using_subcommand clippy" -l skip-std-check-if-n
complete -c x.py -n "__fish_x.py_using_subcommand clippy" -s h -l help -d 'Print help (see more with \'--help\')'
complete -c x.py -n "__fish_x.py_using_subcommand fix" -l config -d 'TOML configuration file for build' -r -F
complete -c x.py -n "__fish_x.py_using_subcommand fix" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)"
complete -c x.py -n "__fish_x.py_using_subcommand fix" -l build -d 'build target of the stage0 compiler' -r -f
complete -c x.py -n "__fish_x.py_using_subcommand fix" -l build -d 'host target of the stage0 compiler' -r -f
complete -c x.py -n "__fish_x.py_using_subcommand fix" -l host -d 'host targets to build' -r -f
complete -c x.py -n "__fish_x.py_using_subcommand fix" -l target -d 'target targets to build' -r -f
complete -c x.py -n "__fish_x.py_using_subcommand fix" -l exclude -d 'build paths to exclude' -r -F
@ -226,7 +226,7 @@ complete -c x.py -n "__fish_x.py_using_subcommand fix" -l skip-std-check-if-no-d
complete -c x.py -n "__fish_x.py_using_subcommand fix" -s h -l help -d 'Print help (see more with \'--help\')'
complete -c x.py -n "__fish_x.py_using_subcommand fmt" -l config -d 'TOML configuration file for build' -r -F
complete -c x.py -n "__fish_x.py_using_subcommand fmt" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)"
complete -c x.py -n "__fish_x.py_using_subcommand fmt" -l build -d 'build target of the stage0 compiler' -r -f
complete -c x.py -n "__fish_x.py_using_subcommand fmt" -l build -d 'host target of the stage0 compiler' -r -f
complete -c x.py -n "__fish_x.py_using_subcommand fmt" -l host -d 'host targets to build' -r -f
complete -c x.py -n "__fish_x.py_using_subcommand fmt" -l target -d 'target targets to build' -r -f
complete -c x.py -n "__fish_x.py_using_subcommand fmt" -l exclude -d 'build paths to exclude' -r -F
@ -263,7 +263,7 @@ complete -c x.py -n "__fish_x.py_using_subcommand fmt" -l skip-std-check-if-no-d
complete -c x.py -n "__fish_x.py_using_subcommand fmt" -s h -l help -d 'Print help (see more with \'--help\')'
complete -c x.py -n "__fish_x.py_using_subcommand doc" -l config -d 'TOML configuration file for build' -r -F
complete -c x.py -n "__fish_x.py_using_subcommand doc" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)"
complete -c x.py -n "__fish_x.py_using_subcommand doc" -l build -d 'build target of the stage0 compiler' -r -f
complete -c x.py -n "__fish_x.py_using_subcommand doc" -l build -d 'host target of the stage0 compiler' -r -f
complete -c x.py -n "__fish_x.py_using_subcommand doc" -l host -d 'host targets to build' -r -f
complete -c x.py -n "__fish_x.py_using_subcommand doc" -l target -d 'target targets to build' -r -f
complete -c x.py -n "__fish_x.py_using_subcommand doc" -l exclude -d 'build paths to exclude' -r -F
@ -306,7 +306,7 @@ complete -c x.py -n "__fish_x.py_using_subcommand test" -l pass -d 'force {check
complete -c x.py -n "__fish_x.py_using_subcommand test" -l run -d 'whether to execute run-* tests' -r
complete -c x.py -n "__fish_x.py_using_subcommand test" -l config -d 'TOML configuration file for build' -r -F
complete -c x.py -n "__fish_x.py_using_subcommand test" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)"
complete -c x.py -n "__fish_x.py_using_subcommand test" -l build -d 'build target of the stage0 compiler' -r -f
complete -c x.py -n "__fish_x.py_using_subcommand test" -l build -d 'host target of the stage0 compiler' -r -f
complete -c x.py -n "__fish_x.py_using_subcommand test" -l host -d 'host targets to build' -r -f
complete -c x.py -n "__fish_x.py_using_subcommand test" -l target -d 'target targets to build' -r -f
complete -c x.py -n "__fish_x.py_using_subcommand test" -l exclude -d 'build paths to exclude' -r -F
@ -350,7 +350,7 @@ complete -c x.py -n "__fish_x.py_using_subcommand test" -s h -l help -d 'Print h
complete -c x.py -n "__fish_x.py_using_subcommand miri" -l test-args -d 'extra arguments to be passed for the test tool being used (e.g. libtest, compiletest or rustdoc)' -r
complete -c x.py -n "__fish_x.py_using_subcommand miri" -l config -d 'TOML configuration file for build' -r -F
complete -c x.py -n "__fish_x.py_using_subcommand miri" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)"
complete -c x.py -n "__fish_x.py_using_subcommand miri" -l build -d 'build target of the stage0 compiler' -r -f
complete -c x.py -n "__fish_x.py_using_subcommand miri" -l build -d 'host target of the stage0 compiler' -r -f
complete -c x.py -n "__fish_x.py_using_subcommand miri" -l host -d 'host targets to build' -r -f
complete -c x.py -n "__fish_x.py_using_subcommand miri" -l target -d 'target targets to build' -r -f
complete -c x.py -n "__fish_x.py_using_subcommand miri" -l exclude -d 'build paths to exclude' -r -F
@ -389,7 +389,7 @@ complete -c x.py -n "__fish_x.py_using_subcommand miri" -s h -l help -d 'Print h
complete -c x.py -n "__fish_x.py_using_subcommand bench" -l test-args -r
complete -c x.py -n "__fish_x.py_using_subcommand bench" -l config -d 'TOML configuration file for build' -r -F
complete -c x.py -n "__fish_x.py_using_subcommand bench" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)"
complete -c x.py -n "__fish_x.py_using_subcommand bench" -l build -d 'build target of the stage0 compiler' -r -f
complete -c x.py -n "__fish_x.py_using_subcommand bench" -l build -d 'host target of the stage0 compiler' -r -f
complete -c x.py -n "__fish_x.py_using_subcommand bench" -l host -d 'host targets to build' -r -f
complete -c x.py -n "__fish_x.py_using_subcommand bench" -l target -d 'target targets to build' -r -f
complete -c x.py -n "__fish_x.py_using_subcommand bench" -l exclude -d 'build paths to exclude' -r -F
@ -425,7 +425,7 @@ complete -c x.py -n "__fish_x.py_using_subcommand bench" -s h -l help -d 'Print
complete -c x.py -n "__fish_x.py_using_subcommand clean" -l stage -d 'Clean a specific stage without touching other artifacts. By default, every stage is cleaned if this option is not used' -r
complete -c x.py -n "__fish_x.py_using_subcommand clean" -l config -d 'TOML configuration file for build' -r -F
complete -c x.py -n "__fish_x.py_using_subcommand clean" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)"
complete -c x.py -n "__fish_x.py_using_subcommand clean" -l build -d 'build target of the stage0 compiler' -r -f
complete -c x.py -n "__fish_x.py_using_subcommand clean" -l build -d 'host target of the stage0 compiler' -r -f
complete -c x.py -n "__fish_x.py_using_subcommand clean" -l host -d 'host targets to build' -r -f
complete -c x.py -n "__fish_x.py_using_subcommand clean" -l target -d 'target targets to build' -r -f
complete -c x.py -n "__fish_x.py_using_subcommand clean" -l exclude -d 'build paths to exclude' -r -F
@ -460,7 +460,7 @@ complete -c x.py -n "__fish_x.py_using_subcommand clean" -l skip-std-check-if-no
complete -c x.py -n "__fish_x.py_using_subcommand clean" -s h -l help -d 'Print help (see more with \'--help\')'
complete -c x.py -n "__fish_x.py_using_subcommand dist" -l config -d 'TOML configuration file for build' -r -F
complete -c x.py -n "__fish_x.py_using_subcommand dist" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)"
complete -c x.py -n "__fish_x.py_using_subcommand dist" -l build -d 'build target of the stage0 compiler' -r -f
complete -c x.py -n "__fish_x.py_using_subcommand dist" -l build -d 'host target of the stage0 compiler' -r -f
complete -c x.py -n "__fish_x.py_using_subcommand dist" -l host -d 'host targets to build' -r -f
complete -c x.py -n "__fish_x.py_using_subcommand dist" -l target -d 'target targets to build' -r -f
complete -c x.py -n "__fish_x.py_using_subcommand dist" -l exclude -d 'build paths to exclude' -r -F
@ -495,7 +495,7 @@ complete -c x.py -n "__fish_x.py_using_subcommand dist" -l skip-std-check-if-no-
complete -c x.py -n "__fish_x.py_using_subcommand dist" -s h -l help -d 'Print help (see more with \'--help\')'
complete -c x.py -n "__fish_x.py_using_subcommand install" -l config -d 'TOML configuration file for build' -r -F
complete -c x.py -n "__fish_x.py_using_subcommand install" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)"
complete -c x.py -n "__fish_x.py_using_subcommand install" -l build -d 'build target of the stage0 compiler' -r -f
complete -c x.py -n "__fish_x.py_using_subcommand install" -l build -d 'host target of the stage0 compiler' -r -f
complete -c x.py -n "__fish_x.py_using_subcommand install" -l host -d 'host targets to build' -r -f
complete -c x.py -n "__fish_x.py_using_subcommand install" -l target -d 'target targets to build' -r -f
complete -c x.py -n "__fish_x.py_using_subcommand install" -l exclude -d 'build paths to exclude' -r -F
@ -531,7 +531,7 @@ complete -c x.py -n "__fish_x.py_using_subcommand install" -s h -l help -d 'Prin
complete -c x.py -n "__fish_x.py_using_subcommand run" -l args -d 'arguments for the tool' -r
complete -c x.py -n "__fish_x.py_using_subcommand run" -l config -d 'TOML configuration file for build' -r -F
complete -c x.py -n "__fish_x.py_using_subcommand run" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)"
complete -c x.py -n "__fish_x.py_using_subcommand run" -l build -d 'build target of the stage0 compiler' -r -f
complete -c x.py -n "__fish_x.py_using_subcommand run" -l build -d 'host target of the stage0 compiler' -r -f
complete -c x.py -n "__fish_x.py_using_subcommand run" -l host -d 'host targets to build' -r -f
complete -c x.py -n "__fish_x.py_using_subcommand run" -l target -d 'target targets to build' -r -f
complete -c x.py -n "__fish_x.py_using_subcommand run" -l exclude -d 'build paths to exclude' -r -F
@ -566,7 +566,7 @@ complete -c x.py -n "__fish_x.py_using_subcommand run" -l skip-std-check-if-no-d
complete -c x.py -n "__fish_x.py_using_subcommand run" -s h -l help -d 'Print help (see more with \'--help\')'
complete -c x.py -n "__fish_x.py_using_subcommand setup" -l config -d 'TOML configuration file for build' -r -F
complete -c x.py -n "__fish_x.py_using_subcommand setup" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)"
complete -c x.py -n "__fish_x.py_using_subcommand setup" -l build -d 'build target of the stage0 compiler' -r -f
complete -c x.py -n "__fish_x.py_using_subcommand setup" -l build -d 'host target of the stage0 compiler' -r -f
complete -c x.py -n "__fish_x.py_using_subcommand setup" -l host -d 'host targets to build' -r -f
complete -c x.py -n "__fish_x.py_using_subcommand setup" -l target -d 'target targets to build' -r -f
complete -c x.py -n "__fish_x.py_using_subcommand setup" -l exclude -d 'build paths to exclude' -r -F
@ -601,7 +601,7 @@ complete -c x.py -n "__fish_x.py_using_subcommand setup" -l skip-std-check-if-no
complete -c x.py -n "__fish_x.py_using_subcommand setup" -s h -l help -d 'Print help (see more with \'--help\')'
complete -c x.py -n "__fish_x.py_using_subcommand suggest" -l config -d 'TOML configuration file for build' -r -F
complete -c x.py -n "__fish_x.py_using_subcommand suggest" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)"
complete -c x.py -n "__fish_x.py_using_subcommand suggest" -l build -d 'build target of the stage0 compiler' -r -f
complete -c x.py -n "__fish_x.py_using_subcommand suggest" -l build -d 'host target of the stage0 compiler' -r -f
complete -c x.py -n "__fish_x.py_using_subcommand suggest" -l host -d 'host targets to build' -r -f
complete -c x.py -n "__fish_x.py_using_subcommand suggest" -l target -d 'target targets to build' -r -f
complete -c x.py -n "__fish_x.py_using_subcommand suggest" -l exclude -d 'build paths to exclude' -r -F
@ -638,7 +638,7 @@ complete -c x.py -n "__fish_x.py_using_subcommand suggest" -s h -l help -d 'Prin
complete -c x.py -n "__fish_x.py_using_subcommand vendor" -l sync -d 'Additional `Cargo.toml` to sync and vendor' -r -F
complete -c x.py -n "__fish_x.py_using_subcommand vendor" -l config -d 'TOML configuration file for build' -r -F
complete -c x.py -n "__fish_x.py_using_subcommand vendor" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)"
complete -c x.py -n "__fish_x.py_using_subcommand vendor" -l build -d 'build target of the stage0 compiler' -r -f
complete -c x.py -n "__fish_x.py_using_subcommand vendor" -l build -d 'host target of the stage0 compiler' -r -f
complete -c x.py -n "__fish_x.py_using_subcommand vendor" -l host -d 'host targets to build' -r -f
complete -c x.py -n "__fish_x.py_using_subcommand vendor" -l target -d 'target targets to build' -r -f
complete -c x.py -n "__fish_x.py_using_subcommand vendor" -l exclude -d 'build paths to exclude' -r -F
@ -674,7 +674,7 @@ complete -c x.py -n "__fish_x.py_using_subcommand vendor" -l skip-std-check-if-n
complete -c x.py -n "__fish_x.py_using_subcommand vendor" -s h -l help -d 'Print help (see more with \'--help\')'
complete -c x.py -n "__fish_x.py_using_subcommand perf; and not __fish_seen_subcommand_from eprintln samply cachegrind benchmark compare" -l config -d 'TOML configuration file for build' -r -F
complete -c x.py -n "__fish_x.py_using_subcommand perf; and not __fish_seen_subcommand_from eprintln samply cachegrind benchmark compare" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)"
complete -c x.py -n "__fish_x.py_using_subcommand perf; and not __fish_seen_subcommand_from eprintln samply cachegrind benchmark compare" -l build -d 'build target of the stage0 compiler' -r -f
complete -c x.py -n "__fish_x.py_using_subcommand perf; and not __fish_seen_subcommand_from eprintln samply cachegrind benchmark compare" -l build -d 'host target of the stage0 compiler' -r -f
complete -c x.py -n "__fish_x.py_using_subcommand perf; and not __fish_seen_subcommand_from eprintln samply cachegrind benchmark compare" -l host -d 'host targets to build' -r -f
complete -c x.py -n "__fish_x.py_using_subcommand perf; and not __fish_seen_subcommand_from eprintln samply cachegrind benchmark compare" -l target -d 'target targets to build' -r -f
complete -c x.py -n "__fish_x.py_using_subcommand perf; and not __fish_seen_subcommand_from eprintln samply cachegrind benchmark compare" -l exclude -d 'build paths to exclude' -r -F
@ -718,7 +718,7 @@ complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcomma
complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from eprintln" -l profiles -d 'Select the profiles that should be benchmarked' -r -f -a "{Check\t'',Debug\t'',Doc\t'',Opt\t'',Clippy\t''}"
complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from eprintln" -l config -d 'TOML configuration file for build' -r -F
complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from eprintln" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)"
complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from eprintln" -l build -d 'build target of the stage0 compiler' -r -f
complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from eprintln" -l build -d 'host target of the stage0 compiler' -r -f
complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from eprintln" -l host -d 'host targets to build' -r -f
complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from eprintln" -l target -d 'target targets to build' -r -f
complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from eprintln" -l skip -d 'build paths to skip' -r -F
@ -756,7 +756,7 @@ complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcomma
complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from samply" -l profiles -d 'Select the profiles that should be benchmarked' -r -f -a "{Check\t'',Debug\t'',Doc\t'',Opt\t'',Clippy\t''}"
complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from samply" -l config -d 'TOML configuration file for build' -r -F
complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from samply" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)"
complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from samply" -l build -d 'build target of the stage0 compiler' -r -f
complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from samply" -l build -d 'host target of the stage0 compiler' -r -f
complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from samply" -l host -d 'host targets to build' -r -f
complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from samply" -l target -d 'target targets to build' -r -f
complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from samply" -l skip -d 'build paths to skip' -r -F
@ -794,7 +794,7 @@ complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcomma
complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from cachegrind" -l profiles -d 'Select the profiles that should be benchmarked' -r -f -a "{Check\t'',Debug\t'',Doc\t'',Opt\t'',Clippy\t''}"
complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from cachegrind" -l config -d 'TOML configuration file for build' -r -F
complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from cachegrind" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)"
complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from cachegrind" -l build -d 'build target of the stage0 compiler' -r -f
complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from cachegrind" -l build -d 'host target of the stage0 compiler' -r -f
complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from cachegrind" -l host -d 'host targets to build' -r -f
complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from cachegrind" -l target -d 'target targets to build' -r -f
complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from cachegrind" -l skip -d 'build paths to skip' -r -F
@ -832,7 +832,7 @@ complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcomma
complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from benchmark" -l profiles -d 'Select the profiles that should be benchmarked' -r -f -a "{Check\t'',Debug\t'',Doc\t'',Opt\t'',Clippy\t''}"
complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from benchmark" -l config -d 'TOML configuration file for build' -r -F
complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from benchmark" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)"
complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from benchmark" -l build -d 'build target of the stage0 compiler' -r -f
complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from benchmark" -l build -d 'host target of the stage0 compiler' -r -f
complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from benchmark" -l host -d 'host targets to build' -r -f
complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from benchmark" -l target -d 'target targets to build' -r -f
complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from benchmark" -l skip -d 'build paths to skip' -r -F
@ -866,7 +866,7 @@ complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcomma
complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from benchmark" -s h -l help -d 'Print help (see more with \'--help\')'
complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from compare" -l config -d 'TOML configuration file for build' -r -F
complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from compare" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)"
complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from compare" -l build -d 'build target of the stage0 compiler' -r -f
complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from compare" -l build -d 'host target of the stage0 compiler' -r -f
complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from compare" -l host -d 'host targets to build' -r -f
complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from compare" -l target -d 'target targets to build' -r -f
complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from compare" -l exclude -d 'build paths to exclude' -r -F

View file

@ -23,7 +23,7 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
'x.py' {
[CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build')
[CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `bootstrap.toml`')
[CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler')
[CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'host target of the stage0 compiler')
[CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build')
[CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build')
[CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude')
@ -82,7 +82,7 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
'x.py;build' {
[CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build')
[CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `bootstrap.toml`')
[CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler')
[CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'host target of the stage0 compiler')
[CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build')
[CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build')
[CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude')
@ -124,7 +124,7 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
'x.py;check' {
[CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build')
[CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `bootstrap.toml`')
[CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler')
[CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'host target of the stage0 compiler')
[CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build')
[CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build')
[CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude')
@ -171,7 +171,7 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
[CompletionResult]::new('-F', '-F ', [CompletionResultType]::ParameterName, 'clippy lints to forbid')
[CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build')
[CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `bootstrap.toml`')
[CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler')
[CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'host target of the stage0 compiler')
[CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build')
[CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build')
[CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude')
@ -216,7 +216,7 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
'x.py;fix' {
[CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build')
[CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `bootstrap.toml`')
[CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler')
[CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'host target of the stage0 compiler')
[CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build')
[CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build')
[CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude')
@ -258,7 +258,7 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
'x.py;fmt' {
[CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build')
[CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `bootstrap.toml`')
[CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler')
[CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'host target of the stage0 compiler')
[CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build')
[CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build')
[CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude')
@ -302,7 +302,7 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
'x.py;doc' {
[CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build')
[CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `bootstrap.toml`')
[CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler')
[CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'host target of the stage0 compiler')
[CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build')
[CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build')
[CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude')
@ -352,7 +352,7 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
[CompletionResult]::new('--run', '--run', [CompletionResultType]::ParameterName, 'whether to execute run-* tests')
[CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build')
[CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `bootstrap.toml`')
[CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler')
[CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'host target of the stage0 compiler')
[CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build')
[CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build')
[CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude')
@ -403,7 +403,7 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
[CompletionResult]::new('--test-args', '--test-args', [CompletionResultType]::ParameterName, 'extra arguments to be passed for the test tool being used (e.g. libtest, compiletest or rustdoc)')
[CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build')
[CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `bootstrap.toml`')
[CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler')
[CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'host target of the stage0 compiler')
[CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build')
[CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build')
[CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude')
@ -449,7 +449,7 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
[CompletionResult]::new('--test-args', '--test-args', [CompletionResultType]::ParameterName, 'test-args')
[CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build')
[CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `bootstrap.toml`')
[CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler')
[CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'host target of the stage0 compiler')
[CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build')
[CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build')
[CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude')
@ -492,7 +492,7 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
[CompletionResult]::new('--stage', '--stage', [CompletionResultType]::ParameterName, 'Clean a specific stage without touching other artifacts. By default, every stage is cleaned if this option is not used')
[CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build')
[CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `bootstrap.toml`')
[CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler')
[CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'host target of the stage0 compiler')
[CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build')
[CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build')
[CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude')
@ -534,7 +534,7 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
'x.py;dist' {
[CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build')
[CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `bootstrap.toml`')
[CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler')
[CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'host target of the stage0 compiler')
[CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build')
[CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build')
[CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude')
@ -576,7 +576,7 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
'x.py;install' {
[CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build')
[CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `bootstrap.toml`')
[CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler')
[CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'host target of the stage0 compiler')
[CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build')
[CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build')
[CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude')
@ -619,7 +619,7 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
[CompletionResult]::new('--args', '--args', [CompletionResultType]::ParameterName, 'arguments for the tool')
[CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build')
[CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `bootstrap.toml`')
[CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler')
[CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'host target of the stage0 compiler')
[CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build')
[CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build')
[CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude')
@ -661,7 +661,7 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
'x.py;setup' {
[CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build')
[CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `bootstrap.toml`')
[CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler')
[CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'host target of the stage0 compiler')
[CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build')
[CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build')
[CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude')
@ -703,7 +703,7 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
'x.py;suggest' {
[CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build')
[CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `bootstrap.toml`')
[CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler')
[CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'host target of the stage0 compiler')
[CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build')
[CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build')
[CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude')
@ -747,7 +747,7 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
[CompletionResult]::new('--sync', '--sync', [CompletionResultType]::ParameterName, 'Additional `Cargo.toml` to sync and vendor')
[CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build')
[CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `bootstrap.toml`')
[CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler')
[CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'host target of the stage0 compiler')
[CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build')
[CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build')
[CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude')
@ -790,7 +790,7 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
'x.py;perf' {
[CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build')
[CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `bootstrap.toml`')
[CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler')
[CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'host target of the stage0 compiler')
[CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build')
[CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build')
[CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude')
@ -841,7 +841,7 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
[CompletionResult]::new('--profiles', '--profiles', [CompletionResultType]::ParameterName, 'Select the profiles that should be benchmarked')
[CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build')
[CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `bootstrap.toml`')
[CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler')
[CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'host target of the stage0 compiler')
[CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build')
[CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build')
[CompletionResult]::new('--skip', '--skip', [CompletionResultType]::ParameterName, 'build paths to skip')
@ -886,7 +886,7 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
[CompletionResult]::new('--profiles', '--profiles', [CompletionResultType]::ParameterName, 'Select the profiles that should be benchmarked')
[CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build')
[CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `bootstrap.toml`')
[CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler')
[CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'host target of the stage0 compiler')
[CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build')
[CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build')
[CompletionResult]::new('--skip', '--skip', [CompletionResultType]::ParameterName, 'build paths to skip')
@ -931,7 +931,7 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
[CompletionResult]::new('--profiles', '--profiles', [CompletionResultType]::ParameterName, 'Select the profiles that should be benchmarked')
[CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build')
[CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `bootstrap.toml`')
[CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler')
[CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'host target of the stage0 compiler')
[CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build')
[CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build')
[CompletionResult]::new('--skip', '--skip', [CompletionResultType]::ParameterName, 'build paths to skip')
@ -976,7 +976,7 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
[CompletionResult]::new('--profiles', '--profiles', [CompletionResultType]::ParameterName, 'Select the profiles that should be benchmarked')
[CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build')
[CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `bootstrap.toml`')
[CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler')
[CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'host target of the stage0 compiler')
[CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build')
[CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build')
[CompletionResult]::new('--skip', '--skip', [CompletionResultType]::ParameterName, 'build paths to skip')
@ -1017,7 +1017,7 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
'x.py;perf;compare' {
[CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build')
[CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `bootstrap.toml`')
[CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler')
[CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'host target of the stage0 compiler')
[CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build')
[CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build')
[CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude')

View file

@ -17,7 +17,7 @@ _x.py() {
_arguments "${_arguments_options[@]}" : \
'--config=[TOML configuration file for build]:FILE:_files' \
'--build-dir=[Build directory, overrides \`build.build-dir\` in \`bootstrap.toml\`]:DIR:_files -/' \
'--build=[build target of the stage0 compiler]:BUILD:' \
'--build=[host target of the stage0 compiler]:BUILD:' \
'--host=[host targets to build]:HOST:' \
'--target=[target targets to build]:TARGET:' \
'*--exclude=[build paths to exclude]:PATH:_files' \
@ -69,7 +69,7 @@ _x.py() {
_arguments "${_arguments_options[@]}" : \
'--config=[TOML configuration file for build]:FILE:_files' \
'--build-dir=[Build directory, overrides \`build.build-dir\` in \`bootstrap.toml\`]:DIR:_files -/' \
'--build=[build target of the stage0 compiler]:BUILD:' \
'--build=[host target of the stage0 compiler]:BUILD:' \
'--host=[host targets to build]:HOST:' \
'--target=[target targets to build]:TARGET:' \
'*--exclude=[build paths to exclude]:PATH:_files' \
@ -113,7 +113,7 @@ _arguments "${_arguments_options[@]}" : \
_arguments "${_arguments_options[@]}" : \
'--config=[TOML configuration file for build]:FILE:_files' \
'--build-dir=[Build directory, overrides \`build.build-dir\` in \`bootstrap.toml\`]:DIR:_files -/' \
'--build=[build target of the stage0 compiler]:BUILD:' \
'--build=[host target of the stage0 compiler]:BUILD:' \
'--host=[host targets to build]:HOST:' \
'--target=[target targets to build]:TARGET:' \
'*--exclude=[build paths to exclude]:PATH:_files' \
@ -162,7 +162,7 @@ _arguments "${_arguments_options[@]}" : \
'*-F+[clippy lints to forbid]:LINT:_default' \
'--config=[TOML configuration file for build]:FILE:_files' \
'--build-dir=[Build directory, overrides \`build.build-dir\` in \`bootstrap.toml\`]:DIR:_files -/' \
'--build=[build target of the stage0 compiler]:BUILD:' \
'--build=[host target of the stage0 compiler]:BUILD:' \
'--host=[host targets to build]:HOST:' \
'--target=[target targets to build]:TARGET:' \
'*--exclude=[build paths to exclude]:PATH:_files' \
@ -209,7 +209,7 @@ _arguments "${_arguments_options[@]}" : \
_arguments "${_arguments_options[@]}" : \
'--config=[TOML configuration file for build]:FILE:_files' \
'--build-dir=[Build directory, overrides \`build.build-dir\` in \`bootstrap.toml\`]:DIR:_files -/' \
'--build=[build target of the stage0 compiler]:BUILD:' \
'--build=[host target of the stage0 compiler]:BUILD:' \
'--host=[host targets to build]:HOST:' \
'--target=[target targets to build]:TARGET:' \
'*--exclude=[build paths to exclude]:PATH:_files' \
@ -253,7 +253,7 @@ _arguments "${_arguments_options[@]}" : \
_arguments "${_arguments_options[@]}" : \
'--config=[TOML configuration file for build]:FILE:_files' \
'--build-dir=[Build directory, overrides \`build.build-dir\` in \`bootstrap.toml\`]:DIR:_files -/' \
'--build=[build target of the stage0 compiler]:BUILD:' \
'--build=[host target of the stage0 compiler]:BUILD:' \
'--host=[host targets to build]:HOST:' \
'--target=[target targets to build]:TARGET:' \
'*--exclude=[build paths to exclude]:PATH:_files' \
@ -299,7 +299,7 @@ _arguments "${_arguments_options[@]}" : \
_arguments "${_arguments_options[@]}" : \
'--config=[TOML configuration file for build]:FILE:_files' \
'--build-dir=[Build directory, overrides \`build.build-dir\` in \`bootstrap.toml\`]:DIR:_files -/' \
'--build=[build target of the stage0 compiler]:BUILD:' \
'--build=[host target of the stage0 compiler]:BUILD:' \
'--host=[host targets to build]:HOST:' \
'--target=[target targets to build]:TARGET:' \
'*--exclude=[build paths to exclude]:PATH:_files' \
@ -351,7 +351,7 @@ _arguments "${_arguments_options[@]}" : \
'--run=[whether to execute run-* tests]:auto | always | never:_default' \
'--config=[TOML configuration file for build]:FILE:_files' \
'--build-dir=[Build directory, overrides \`build.build-dir\` in \`bootstrap.toml\`]:DIR:_files -/' \
'--build=[build target of the stage0 compiler]:BUILD:' \
'--build=[host target of the stage0 compiler]:BUILD:' \
'--host=[host targets to build]:HOST:' \
'--target=[target targets to build]:TARGET:' \
'*--exclude=[build paths to exclude]:PATH:_files' \
@ -404,7 +404,7 @@ _arguments "${_arguments_options[@]}" : \
'*--test-args=[extra arguments to be passed for the test tool being used (e.g. libtest, compiletest or rustdoc)]:ARGS:_default' \
'--config=[TOML configuration file for build]:FILE:_files' \
'--build-dir=[Build directory, overrides \`build.build-dir\` in \`bootstrap.toml\`]:DIR:_files -/' \
'--build=[build target of the stage0 compiler]:BUILD:' \
'--build=[host target of the stage0 compiler]:BUILD:' \
'--host=[host targets to build]:HOST:' \
'--target=[target targets to build]:TARGET:' \
'*--exclude=[build paths to exclude]:PATH:_files' \
@ -452,7 +452,7 @@ _arguments "${_arguments_options[@]}" : \
'*--test-args=[]:TEST_ARGS:_default' \
'--config=[TOML configuration file for build]:FILE:_files' \
'--build-dir=[Build directory, overrides \`build.build-dir\` in \`bootstrap.toml\`]:DIR:_files -/' \
'--build=[build target of the stage0 compiler]:BUILD:' \
'--build=[host target of the stage0 compiler]:BUILD:' \
'--host=[host targets to build]:HOST:' \
'--target=[target targets to build]:TARGET:' \
'*--exclude=[build paths to exclude]:PATH:_files' \
@ -497,7 +497,7 @@ _arguments "${_arguments_options[@]}" : \
'--stage=[Clean a specific stage without touching other artifacts. By default, every stage is cleaned if this option is not used]:N:_default' \
'--config=[TOML configuration file for build]:FILE:_files' \
'--build-dir=[Build directory, overrides \`build.build-dir\` in \`bootstrap.toml\`]:DIR:_files -/' \
'--build=[build target of the stage0 compiler]:BUILD:' \
'--build=[host target of the stage0 compiler]:BUILD:' \
'--host=[host targets to build]:HOST:' \
'--target=[target targets to build]:TARGET:' \
'*--exclude=[build paths to exclude]:PATH:_files' \
@ -541,7 +541,7 @@ _arguments "${_arguments_options[@]}" : \
_arguments "${_arguments_options[@]}" : \
'--config=[TOML configuration file for build]:FILE:_files' \
'--build-dir=[Build directory, overrides \`build.build-dir\` in \`bootstrap.toml\`]:DIR:_files -/' \
'--build=[build target of the stage0 compiler]:BUILD:' \
'--build=[host target of the stage0 compiler]:BUILD:' \
'--host=[host targets to build]:HOST:' \
'--target=[target targets to build]:TARGET:' \
'*--exclude=[build paths to exclude]:PATH:_files' \
@ -585,7 +585,7 @@ _arguments "${_arguments_options[@]}" : \
_arguments "${_arguments_options[@]}" : \
'--config=[TOML configuration file for build]:FILE:_files' \
'--build-dir=[Build directory, overrides \`build.build-dir\` in \`bootstrap.toml\`]:DIR:_files -/' \
'--build=[build target of the stage0 compiler]:BUILD:' \
'--build=[host target of the stage0 compiler]:BUILD:' \
'--host=[host targets to build]:HOST:' \
'--target=[target targets to build]:TARGET:' \
'*--exclude=[build paths to exclude]:PATH:_files' \
@ -630,7 +630,7 @@ _arguments "${_arguments_options[@]}" : \
'*--args=[arguments for the tool]:ARGS:_default' \
'--config=[TOML configuration file for build]:FILE:_files' \
'--build-dir=[Build directory, overrides \`build.build-dir\` in \`bootstrap.toml\`]:DIR:_files -/' \
'--build=[build target of the stage0 compiler]:BUILD:' \
'--build=[host target of the stage0 compiler]:BUILD:' \
'--host=[host targets to build]:HOST:' \
'--target=[target targets to build]:TARGET:' \
'*--exclude=[build paths to exclude]:PATH:_files' \
@ -674,7 +674,7 @@ _arguments "${_arguments_options[@]}" : \
_arguments "${_arguments_options[@]}" : \
'--config=[TOML configuration file for build]:FILE:_files' \
'--build-dir=[Build directory, overrides \`build.build-dir\` in \`bootstrap.toml\`]:DIR:_files -/' \
'--build=[build target of the stage0 compiler]:BUILD:' \
'--build=[host target of the stage0 compiler]:BUILD:' \
'--host=[host targets to build]:HOST:' \
'--target=[target targets to build]:TARGET:' \
'*--exclude=[build paths to exclude]:PATH:_files' \
@ -719,7 +719,7 @@ _arguments "${_arguments_options[@]}" : \
_arguments "${_arguments_options[@]}" : \
'--config=[TOML configuration file for build]:FILE:_files' \
'--build-dir=[Build directory, overrides \`build.build-dir\` in \`bootstrap.toml\`]:DIR:_files -/' \
'--build=[build target of the stage0 compiler]:BUILD:' \
'--build=[host target of the stage0 compiler]:BUILD:' \
'--host=[host targets to build]:HOST:' \
'--target=[target targets to build]:TARGET:' \
'*--exclude=[build paths to exclude]:PATH:_files' \
@ -765,7 +765,7 @@ _arguments "${_arguments_options[@]}" : \
'*--sync=[Additional \`Cargo.toml\` to sync and vendor]:SYNC:_files' \
'--config=[TOML configuration file for build]:FILE:_files' \
'--build-dir=[Build directory, overrides \`build.build-dir\` in \`bootstrap.toml\`]:DIR:_files -/' \
'--build=[build target of the stage0 compiler]:BUILD:' \
'--build=[host target of the stage0 compiler]:BUILD:' \
'--host=[host targets to build]:HOST:' \
'--target=[target targets to build]:TARGET:' \
'*--exclude=[build paths to exclude]:PATH:_files' \
@ -810,7 +810,7 @@ _arguments "${_arguments_options[@]}" : \
_arguments "${_arguments_options[@]}" : \
'--config=[TOML configuration file for build]:FILE:_files' \
'--build-dir=[Build directory, overrides \`build.build-dir\` in \`bootstrap.toml\`]:DIR:_files -/' \
'--build=[build target of the stage0 compiler]:BUILD:' \
'--build=[host target of the stage0 compiler]:BUILD:' \
'--host=[host targets to build]:HOST:' \
'--target=[target targets to build]:TARGET:' \
'*--exclude=[build paths to exclude]:PATH:_files' \
@ -867,7 +867,7 @@ _arguments "${_arguments_options[@]}" : \
'*--profiles=[Select the profiles that should be benchmarked]:PROFILES:(Check Debug Doc Opt Clippy)' \
'--config=[TOML configuration file for build]:FILE:_files' \
'--build-dir=[Build directory, overrides \`build.build-dir\` in \`bootstrap.toml\`]:DIR:_files -/' \
'--build=[build target of the stage0 compiler]:BUILD:' \
'--build=[host target of the stage0 compiler]:BUILD:' \
'--host=[host targets to build]:HOST:' \
'--target=[target targets to build]:TARGET:' \
'*--skip=[build paths to skip]:PATH:_files' \
@ -914,7 +914,7 @@ _arguments "${_arguments_options[@]}" : \
'*--profiles=[Select the profiles that should be benchmarked]:PROFILES:(Check Debug Doc Opt Clippy)' \
'--config=[TOML configuration file for build]:FILE:_files' \
'--build-dir=[Build directory, overrides \`build.build-dir\` in \`bootstrap.toml\`]:DIR:_files -/' \
'--build=[build target of the stage0 compiler]:BUILD:' \
'--build=[host target of the stage0 compiler]:BUILD:' \
'--host=[host targets to build]:HOST:' \
'--target=[target targets to build]:TARGET:' \
'*--skip=[build paths to skip]:PATH:_files' \
@ -961,7 +961,7 @@ _arguments "${_arguments_options[@]}" : \
'*--profiles=[Select the profiles that should be benchmarked]:PROFILES:(Check Debug Doc Opt Clippy)' \
'--config=[TOML configuration file for build]:FILE:_files' \
'--build-dir=[Build directory, overrides \`build.build-dir\` in \`bootstrap.toml\`]:DIR:_files -/' \
'--build=[build target of the stage0 compiler]:BUILD:' \
'--build=[host target of the stage0 compiler]:BUILD:' \
'--host=[host targets to build]:HOST:' \
'--target=[target targets to build]:TARGET:' \
'*--skip=[build paths to skip]:PATH:_files' \
@ -1008,7 +1008,7 @@ _arguments "${_arguments_options[@]}" : \
'*--profiles=[Select the profiles that should be benchmarked]:PROFILES:(Check Debug Doc Opt Clippy)' \
'--config=[TOML configuration file for build]:FILE:_files' \
'--build-dir=[Build directory, overrides \`build.build-dir\` in \`bootstrap.toml\`]:DIR:_files -/' \
'--build=[build target of the stage0 compiler]:BUILD:' \
'--build=[host target of the stage0 compiler]:BUILD:' \
'--host=[host targets to build]:HOST:' \
'--target=[target targets to build]:TARGET:' \
'*--skip=[build paths to skip]:PATH:_files' \
@ -1052,7 +1052,7 @@ _arguments "${_arguments_options[@]}" : \
_arguments "${_arguments_options[@]}" : \
'--config=[TOML configuration file for build]:FILE:_files' \
'--build-dir=[Build directory, overrides \`build.build-dir\` in \`bootstrap.toml\`]:DIR:_files -/' \
'--build=[build target of the stage0 compiler]:BUILD:' \
'--build=[host target of the stage0 compiler]:BUILD:' \
'--host=[host targets to build]:HOST:' \
'--target=[target targets to build]:TARGET:' \
'*--exclude=[build paths to exclude]:PATH:_files' \

View file

@ -17,7 +17,7 @@ _x() {
_arguments "${_arguments_options[@]}" : \
'--config=[TOML configuration file for build]:FILE:_files' \
'--build-dir=[Build directory, overrides \`build.build-dir\` in \`bootstrap.toml\`]:DIR:_files -/' \
'--build=[build target of the stage0 compiler]:BUILD:' \
'--build=[host target of the stage0 compiler]:BUILD:' \
'--host=[host targets to build]:HOST:' \
'--target=[target targets to build]:TARGET:' \
'*--exclude=[build paths to exclude]:PATH:_files' \
@ -69,7 +69,7 @@ _x() {
_arguments "${_arguments_options[@]}" : \
'--config=[TOML configuration file for build]:FILE:_files' \
'--build-dir=[Build directory, overrides \`build.build-dir\` in \`bootstrap.toml\`]:DIR:_files -/' \
'--build=[build target of the stage0 compiler]:BUILD:' \
'--build=[host target of the stage0 compiler]:BUILD:' \
'--host=[host targets to build]:HOST:' \
'--target=[target targets to build]:TARGET:' \
'*--exclude=[build paths to exclude]:PATH:_files' \
@ -113,7 +113,7 @@ _arguments "${_arguments_options[@]}" : \
_arguments "${_arguments_options[@]}" : \
'--config=[TOML configuration file for build]:FILE:_files' \
'--build-dir=[Build directory, overrides \`build.build-dir\` in \`bootstrap.toml\`]:DIR:_files -/' \
'--build=[build target of the stage0 compiler]:BUILD:' \
'--build=[host target of the stage0 compiler]:BUILD:' \
'--host=[host targets to build]:HOST:' \
'--target=[target targets to build]:TARGET:' \
'*--exclude=[build paths to exclude]:PATH:_files' \
@ -162,7 +162,7 @@ _arguments "${_arguments_options[@]}" : \
'*-F+[clippy lints to forbid]:LINT:_default' \
'--config=[TOML configuration file for build]:FILE:_files' \
'--build-dir=[Build directory, overrides \`build.build-dir\` in \`bootstrap.toml\`]:DIR:_files -/' \
'--build=[build target of the stage0 compiler]:BUILD:' \
'--build=[host target of the stage0 compiler]:BUILD:' \
'--host=[host targets to build]:HOST:' \
'--target=[target targets to build]:TARGET:' \
'*--exclude=[build paths to exclude]:PATH:_files' \
@ -209,7 +209,7 @@ _arguments "${_arguments_options[@]}" : \
_arguments "${_arguments_options[@]}" : \
'--config=[TOML configuration file for build]:FILE:_files' \
'--build-dir=[Build directory, overrides \`build.build-dir\` in \`bootstrap.toml\`]:DIR:_files -/' \
'--build=[build target of the stage0 compiler]:BUILD:' \
'--build=[host target of the stage0 compiler]:BUILD:' \
'--host=[host targets to build]:HOST:' \
'--target=[target targets to build]:TARGET:' \
'*--exclude=[build paths to exclude]:PATH:_files' \
@ -253,7 +253,7 @@ _arguments "${_arguments_options[@]}" : \
_arguments "${_arguments_options[@]}" : \
'--config=[TOML configuration file for build]:FILE:_files' \
'--build-dir=[Build directory, overrides \`build.build-dir\` in \`bootstrap.toml\`]:DIR:_files -/' \
'--build=[build target of the stage0 compiler]:BUILD:' \
'--build=[host target of the stage0 compiler]:BUILD:' \
'--host=[host targets to build]:HOST:' \
'--target=[target targets to build]:TARGET:' \
'*--exclude=[build paths to exclude]:PATH:_files' \
@ -299,7 +299,7 @@ _arguments "${_arguments_options[@]}" : \
_arguments "${_arguments_options[@]}" : \
'--config=[TOML configuration file for build]:FILE:_files' \
'--build-dir=[Build directory, overrides \`build.build-dir\` in \`bootstrap.toml\`]:DIR:_files -/' \
'--build=[build target of the stage0 compiler]:BUILD:' \
'--build=[host target of the stage0 compiler]:BUILD:' \
'--host=[host targets to build]:HOST:' \
'--target=[target targets to build]:TARGET:' \
'*--exclude=[build paths to exclude]:PATH:_files' \
@ -351,7 +351,7 @@ _arguments "${_arguments_options[@]}" : \
'--run=[whether to execute run-* tests]:auto | always | never:_default' \
'--config=[TOML configuration file for build]:FILE:_files' \
'--build-dir=[Build directory, overrides \`build.build-dir\` in \`bootstrap.toml\`]:DIR:_files -/' \
'--build=[build target of the stage0 compiler]:BUILD:' \
'--build=[host target of the stage0 compiler]:BUILD:' \
'--host=[host targets to build]:HOST:' \
'--target=[target targets to build]:TARGET:' \
'*--exclude=[build paths to exclude]:PATH:_files' \
@ -404,7 +404,7 @@ _arguments "${_arguments_options[@]}" : \
'*--test-args=[extra arguments to be passed for the test tool being used (e.g. libtest, compiletest or rustdoc)]:ARGS:_default' \
'--config=[TOML configuration file for build]:FILE:_files' \
'--build-dir=[Build directory, overrides \`build.build-dir\` in \`bootstrap.toml\`]:DIR:_files -/' \
'--build=[build target of the stage0 compiler]:BUILD:' \
'--build=[host target of the stage0 compiler]:BUILD:' \
'--host=[host targets to build]:HOST:' \
'--target=[target targets to build]:TARGET:' \
'*--exclude=[build paths to exclude]:PATH:_files' \
@ -452,7 +452,7 @@ _arguments "${_arguments_options[@]}" : \
'*--test-args=[]:TEST_ARGS:_default' \
'--config=[TOML configuration file for build]:FILE:_files' \
'--build-dir=[Build directory, overrides \`build.build-dir\` in \`bootstrap.toml\`]:DIR:_files -/' \
'--build=[build target of the stage0 compiler]:BUILD:' \
'--build=[host target of the stage0 compiler]:BUILD:' \
'--host=[host targets to build]:HOST:' \
'--target=[target targets to build]:TARGET:' \
'*--exclude=[build paths to exclude]:PATH:_files' \
@ -497,7 +497,7 @@ _arguments "${_arguments_options[@]}" : \
'--stage=[Clean a specific stage without touching other artifacts. By default, every stage is cleaned if this option is not used]:N:_default' \
'--config=[TOML configuration file for build]:FILE:_files' \
'--build-dir=[Build directory, overrides \`build.build-dir\` in \`bootstrap.toml\`]:DIR:_files -/' \
'--build=[build target of the stage0 compiler]:BUILD:' \
'--build=[host target of the stage0 compiler]:BUILD:' \
'--host=[host targets to build]:HOST:' \
'--target=[target targets to build]:TARGET:' \
'*--exclude=[build paths to exclude]:PATH:_files' \
@ -541,7 +541,7 @@ _arguments "${_arguments_options[@]}" : \
_arguments "${_arguments_options[@]}" : \
'--config=[TOML configuration file for build]:FILE:_files' \
'--build-dir=[Build directory, overrides \`build.build-dir\` in \`bootstrap.toml\`]:DIR:_files -/' \
'--build=[build target of the stage0 compiler]:BUILD:' \
'--build=[host target of the stage0 compiler]:BUILD:' \
'--host=[host targets to build]:HOST:' \
'--target=[target targets to build]:TARGET:' \
'*--exclude=[build paths to exclude]:PATH:_files' \
@ -585,7 +585,7 @@ _arguments "${_arguments_options[@]}" : \
_arguments "${_arguments_options[@]}" : \
'--config=[TOML configuration file for build]:FILE:_files' \
'--build-dir=[Build directory, overrides \`build.build-dir\` in \`bootstrap.toml\`]:DIR:_files -/' \
'--build=[build target of the stage0 compiler]:BUILD:' \
'--build=[host target of the stage0 compiler]:BUILD:' \
'--host=[host targets to build]:HOST:' \
'--target=[target targets to build]:TARGET:' \
'*--exclude=[build paths to exclude]:PATH:_files' \
@ -630,7 +630,7 @@ _arguments "${_arguments_options[@]}" : \
'*--args=[arguments for the tool]:ARGS:_default' \
'--config=[TOML configuration file for build]:FILE:_files' \
'--build-dir=[Build directory, overrides \`build.build-dir\` in \`bootstrap.toml\`]:DIR:_files -/' \
'--build=[build target of the stage0 compiler]:BUILD:' \
'--build=[host target of the stage0 compiler]:BUILD:' \
'--host=[host targets to build]:HOST:' \
'--target=[target targets to build]:TARGET:' \
'*--exclude=[build paths to exclude]:PATH:_files' \
@ -674,7 +674,7 @@ _arguments "${_arguments_options[@]}" : \
_arguments "${_arguments_options[@]}" : \
'--config=[TOML configuration file for build]:FILE:_files' \
'--build-dir=[Build directory, overrides \`build.build-dir\` in \`bootstrap.toml\`]:DIR:_files -/' \
'--build=[build target of the stage0 compiler]:BUILD:' \
'--build=[host target of the stage0 compiler]:BUILD:' \
'--host=[host targets to build]:HOST:' \
'--target=[target targets to build]:TARGET:' \
'*--exclude=[build paths to exclude]:PATH:_files' \
@ -719,7 +719,7 @@ _arguments "${_arguments_options[@]}" : \
_arguments "${_arguments_options[@]}" : \
'--config=[TOML configuration file for build]:FILE:_files' \
'--build-dir=[Build directory, overrides \`build.build-dir\` in \`bootstrap.toml\`]:DIR:_files -/' \
'--build=[build target of the stage0 compiler]:BUILD:' \
'--build=[host target of the stage0 compiler]:BUILD:' \
'--host=[host targets to build]:HOST:' \
'--target=[target targets to build]:TARGET:' \
'*--exclude=[build paths to exclude]:PATH:_files' \
@ -765,7 +765,7 @@ _arguments "${_arguments_options[@]}" : \
'*--sync=[Additional \`Cargo.toml\` to sync and vendor]:SYNC:_files' \
'--config=[TOML configuration file for build]:FILE:_files' \
'--build-dir=[Build directory, overrides \`build.build-dir\` in \`bootstrap.toml\`]:DIR:_files -/' \
'--build=[build target of the stage0 compiler]:BUILD:' \
'--build=[host target of the stage0 compiler]:BUILD:' \
'--host=[host targets to build]:HOST:' \
'--target=[target targets to build]:TARGET:' \
'*--exclude=[build paths to exclude]:PATH:_files' \
@ -810,7 +810,7 @@ _arguments "${_arguments_options[@]}" : \
_arguments "${_arguments_options[@]}" : \
'--config=[TOML configuration file for build]:FILE:_files' \
'--build-dir=[Build directory, overrides \`build.build-dir\` in \`bootstrap.toml\`]:DIR:_files -/' \
'--build=[build target of the stage0 compiler]:BUILD:' \
'--build=[host target of the stage0 compiler]:BUILD:' \
'--host=[host targets to build]:HOST:' \
'--target=[target targets to build]:TARGET:' \
'*--exclude=[build paths to exclude]:PATH:_files' \
@ -867,7 +867,7 @@ _arguments "${_arguments_options[@]}" : \
'*--profiles=[Select the profiles that should be benchmarked]:PROFILES:(Check Debug Doc Opt Clippy)' \
'--config=[TOML configuration file for build]:FILE:_files' \
'--build-dir=[Build directory, overrides \`build.build-dir\` in \`bootstrap.toml\`]:DIR:_files -/' \
'--build=[build target of the stage0 compiler]:BUILD:' \
'--build=[host target of the stage0 compiler]:BUILD:' \
'--host=[host targets to build]:HOST:' \
'--target=[target targets to build]:TARGET:' \
'*--skip=[build paths to skip]:PATH:_files' \
@ -914,7 +914,7 @@ _arguments "${_arguments_options[@]}" : \
'*--profiles=[Select the profiles that should be benchmarked]:PROFILES:(Check Debug Doc Opt Clippy)' \
'--config=[TOML configuration file for build]:FILE:_files' \
'--build-dir=[Build directory, overrides \`build.build-dir\` in \`bootstrap.toml\`]:DIR:_files -/' \
'--build=[build target of the stage0 compiler]:BUILD:' \
'--build=[host target of the stage0 compiler]:BUILD:' \
'--host=[host targets to build]:HOST:' \
'--target=[target targets to build]:TARGET:' \
'*--skip=[build paths to skip]:PATH:_files' \
@ -961,7 +961,7 @@ _arguments "${_arguments_options[@]}" : \
'*--profiles=[Select the profiles that should be benchmarked]:PROFILES:(Check Debug Doc Opt Clippy)' \
'--config=[TOML configuration file for build]:FILE:_files' \
'--build-dir=[Build directory, overrides \`build.build-dir\` in \`bootstrap.toml\`]:DIR:_files -/' \
'--build=[build target of the stage0 compiler]:BUILD:' \
'--build=[host target of the stage0 compiler]:BUILD:' \
'--host=[host targets to build]:HOST:' \
'--target=[target targets to build]:TARGET:' \
'*--skip=[build paths to skip]:PATH:_files' \
@ -1008,7 +1008,7 @@ _arguments "${_arguments_options[@]}" : \
'*--profiles=[Select the profiles that should be benchmarked]:PROFILES:(Check Debug Doc Opt Clippy)' \
'--config=[TOML configuration file for build]:FILE:_files' \
'--build-dir=[Build directory, overrides \`build.build-dir\` in \`bootstrap.toml\`]:DIR:_files -/' \
'--build=[build target of the stage0 compiler]:BUILD:' \
'--build=[host target of the stage0 compiler]:BUILD:' \
'--host=[host targets to build]:HOST:' \
'--target=[target targets to build]:TARGET:' \
'*--skip=[build paths to skip]:PATH:_files' \
@ -1052,7 +1052,7 @@ _arguments "${_arguments_options[@]}" : \
_arguments "${_arguments_options[@]}" : \
'--config=[TOML configuration file for build]:FILE:_files' \
'--build-dir=[Build directory, overrides \`build.build-dir\` in \`bootstrap.toml\`]:DIR:_files -/' \
'--build=[build target of the stage0 compiler]:BUILD:' \
'--build=[host target of the stage0 compiler]:BUILD:' \
'--host=[host targets to build]:HOST:' \
'--target=[target targets to build]:TARGET:' \
'*--exclude=[build paths to exclude]:PATH:_files' \

View file

@ -0,0 +1,90 @@
//@ run-pass
//! Tests stable mir API for retrieving the body of a closure.
//@ ignore-stage1
//@ ignore-cross-compile
//@ ignore-remote
//@ edition: 2021
#![feature(rustc_private)]
#![feature(assert_matches)]
extern crate rustc_middle;
#[macro_use]
extern crate rustc_smir;
extern crate rustc_driver;
extern crate rustc_interface;
extern crate stable_mir;
use std::io::Write;
use std::ops::ControlFlow;
use stable_mir::mir::{Body, ConstOperand, Operand, TerminatorKind};
use stable_mir::ty::{FnDef, RigidTy, TyKind};
const CRATE_NAME: &str = "crate_closure_body";
fn test_closure_body() -> ControlFlow<()> {
let crate_items = stable_mir::all_local_items();
for item in crate_items {
let item_ty = item.ty();
match &item_ty.kind() {
TyKind::RigidTy(RigidTy::Closure(closure_def, _)) => {
let closure_body = closure_def.body().unwrap();
check_incr_closure_body(closure_body);
}
_ => {}
}
}
ControlFlow::Continue(())
}
fn check_incr_closure_body(body: Body) {
let first_block = &body.blocks[0];
let TerminatorKind::Call { func: Operand::Constant(ConstOperand { const_, .. }), .. } =
&first_block.terminator.kind
else {
panic!("expected Call Terminator, got: ");
};
let TyKind::RigidTy(RigidTy::FnDef(FnDef(def_id), ..), ..) = const_.ty().kind() else {
panic!("expected FnDef");
};
assert_eq!(def_id.name(), "id");
}
fn main() {
let path = "closure_body.rs";
generate_input(&path).unwrap();
let args = &[
"rustc".to_string(),
"-Cpanic=abort".to_string(),
"--crate-name".to_string(),
CRATE_NAME.to_string(),
path.to_string(),
];
run!(args, test_closure_body).unwrap();
}
fn generate_input(path: &str) -> std::io::Result<()> {
let mut file = std::fs::File::create(path)?;
write!(
file,
r#"
fn id<T>(y: T) -> T {{
y
}}
fn main() {{
let cl_id= |x| {{
id(x)
}};
let _= cl_id(5);
}}
"#
)?;
Ok(())
}

View file

@ -0,0 +1,90 @@
//@ run-pass
//! Tests stable mir API for retrieving the body of a closure.
//@ ignore-stage1
//@ ignore-cross-compile
//@ ignore-remote
//@ edition: 2021
#![feature(rustc_private)]
#![feature(assert_matches)]
extern crate rustc_middle;
#[macro_use]
extern crate rustc_smir;
extern crate rustc_driver;
extern crate rustc_interface;
extern crate stable_mir;
use std::io::Write;
use std::ops::ControlFlow;
use stable_mir::mir::{Body, ConstOperand, Operand, TerminatorKind};
use stable_mir::ty::{FnDef, RigidTy, TyKind};
const CRATE_NAME: &str = "crate_closure_body";
fn test_closure_body() -> ControlFlow<()> {
let crate_items = stable_mir::all_local_items();
for item in crate_items {
let item_ty = item.ty();
match &item_ty.kind() {
TyKind::RigidTy(RigidTy::Closure(closure_def, _)) => {
let closure_body = closure_def.body().unwrap();
check_incr_closure_body(closure_body);
}
_ => {}
}
}
ControlFlow::Continue(())
}
fn check_incr_closure_body(body: Body) {
let first_block = &body.blocks[0];
let TerminatorKind::Call { func: Operand::Constant(ConstOperand { const_, .. }), .. } =
&first_block.terminator.kind
else {
panic!("expected Call Terminator, got: ");
};
let TyKind::RigidTy(RigidTy::FnDef(FnDef(def_id), ..), ..) = const_.ty().kind() else {
panic!("expected FnDef");
};
assert_eq!(def_id.name(), "incr");
}
fn main() {
let path = "closure_body.rs";
generate_input(&path).unwrap();
let args = &[
"rustc".to_string(),
"-Cpanic=abort".to_string(),
"--crate-name".to_string(),
CRATE_NAME.to_string(),
path.to_string(),
];
run!(args, test_closure_body).unwrap();
}
fn generate_input(path: &str) -> std::io::Result<()> {
let mut file = std::fs::File::create(path)?;
write!(
file,
r#"
fn incr(y: i32) -> i32 {{
y + 1
}}
fn main() {{
let cl_incr = |x: i32| {{
incr(x)
}};
let _= cl_incr(5);
}}
"#
)?;
Ok(())
}

View file

@ -9,9 +9,9 @@ pub struct E(Result<&'static str, isize>);
pub type F = Option<isize>;
pub type G = usize;
pub type H = &'static str;
pub type I = Box<Fn()>;
pub type I32Iterator = Iterator<Item=i32>;
pub type U32Iterator = Iterator<Item=u32>;
pub type I = Box<dyn Fn()>;
pub type I32Iterator = dyn Iterator<Item=i32>;
pub type U32Iterator = dyn Iterator<Item=u32>;
pub fn id_A() -> TypeId { TypeId::of::<A>() }
pub fn id_B() -> TypeId { TypeId::of::<B>() }

View file

@ -9,9 +9,9 @@ pub struct E(Result<&'static str, isize>);
pub type F = Option<isize>;
pub type G = usize;
pub type H = &'static str;
pub type I = Box<Fn()>;
pub type I32Iterator = Iterator<Item=i32>;
pub type U32Iterator = Iterator<Item=u32>;
pub type I = Box<dyn Fn()>;
pub type I32Iterator = dyn Iterator<Item=i32>;
pub type U32Iterator = dyn Iterator<Item=u32>;
pub fn id_A() -> TypeId { TypeId::of::<A>() }
pub fn id_B() -> TypeId { TypeId::of::<B>() }

View file

@ -0,0 +1,10 @@
//! Smoke test: dereferencing boxed zero-sized types (ZSTs) should not crash.
//!
//! Originally a regression test of github.com/rust-lang/rust/issues/13360
//! but repurposed for a smoke test.
//@ run-pass
pub fn main() {
let _: () = *Box::new(());
}

View file

@ -1,3 +1,5 @@
//! Test that use items with cfg(false) are properly filtered out
//@ run-pass
pub fn main() {

View file

@ -13,7 +13,7 @@ error: generic parameters may not be used in const operations
LL | let _: [u8; bar::<N>()];
| ^ cannot perform const operation using `N`
|
= help: const parameters may only be used as standalone arguments, i.e. `N`
= help: const parameters may only be used as standalone arguments here, i.e. `N`
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error: generic parameters may not be used in const operations
@ -58,7 +58,7 @@ error: generic parameters may not be used in const operations
LL | let _ = [0; bar::<N>()];
| ^ cannot perform const operation using `N`
|
= help: const parameters may only be used as standalone arguments, i.e. `N`
= help: const parameters may only be used as standalone arguments here, i.e. `N`
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error: generic parameters may not be used in const operations
@ -112,7 +112,7 @@ error: generic parameters may not be used in const operations
LL | let _: Foo<{ bar::<N>() }>;
| ^ cannot perform const operation using `N`
|
= help: const parameters may only be used as standalone arguments, i.e. `N`
= help: const parameters may only be used as standalone arguments here, i.e. `N`
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error: generic parameters may not be used in const operations
@ -166,7 +166,7 @@ error: generic parameters may not be used in const operations
LL | let _ = Foo::<{ bar::<N>() }>;
| ^ cannot perform const operation using `N`
|
= help: const parameters may only be used as standalone arguments, i.e. `N`
= help: const parameters may only be used as standalone arguments here, i.e. `N`
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error: generic parameters may not be used in const operations

View file

@ -4,7 +4,7 @@ error: generic parameters may not be used in const operations
LL | struct Foo<const N: usize, const M: usize = { N + 1 }>;
| ^ cannot perform const operation using `N`
|
= help: const parameters may only be used as standalone arguments, i.e. `N`
= help: const parameters may only be used as standalone arguments here, i.e. `N`
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error: generic parameters may not be used in const operations

View file

@ -7,7 +7,7 @@ LL | N
LL | fn foo<const N: usize>() -> Foo<{ arg!{} arg!{} }> { loop {} }
| ------ in this macro invocation
|
= help: const parameters may only be used as standalone arguments, i.e. `N`
= help: const parameters may only be used as standalone arguments here, i.e. `N`
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
= note: this error originates in the macro `arg` (in Nightly builds, run with -Z macro-backtrace for more info)
@ -20,7 +20,7 @@ LL | N
LL | fn foo<const N: usize>() -> Foo<{ arg!{} arg!{} }> { loop {} }
| ------ in this macro invocation
|
= help: const parameters may only be used as standalone arguments, i.e. `N`
= help: const parameters may only be used as standalone arguments here, i.e. `N`
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
= note: this error originates in the macro `arg` (in Nightly builds, run with -Z macro-backtrace for more info)
@ -30,7 +30,7 @@ error: generic parameters may not be used in const operations
LL | fn bar<const N: usize>() -> [(); { empty!{}; N }] { loop {} }
| ^ cannot perform const operation using `N`
|
= help: const parameters may only be used as standalone arguments, i.e. `N`
= help: const parameters may only be used as standalone arguments here, i.e. `N`
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error: aborting due to 3 previous errors

View file

@ -26,7 +26,7 @@ error: generic parameters may not be used in const operations
LL | let _: foo!({{ N }});
| ^ cannot perform const operation using `N`
|
= help: const parameters may only be used as standalone arguments, i.e. `N`
= help: const parameters may only be used as standalone arguments here, i.e. `N`
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error: generic parameters may not be used in const operations
@ -35,7 +35,7 @@ error: generic parameters may not be used in const operations
LL | let _: bar!({ N });
| ^ cannot perform const operation using `N`
|
= help: const parameters may only be used as standalone arguments, i.e. `N`
= help: const parameters may only be used as standalone arguments here, i.e. `N`
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error: generic parameters may not be used in const operations
@ -44,7 +44,7 @@ error: generic parameters may not be used in const operations
LL | let _: baz!({{ N }});
| ^ cannot perform const operation using `N`
|
= help: const parameters may only be used as standalone arguments, i.e. `N`
= help: const parameters may only be used as standalone arguments here, i.e. `N`
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error: generic parameters may not be used in const operations
@ -53,7 +53,7 @@ error: generic parameters may not be used in const operations
LL | let _: biz!({ N });
| ^ cannot perform const operation using `N`
|
= help: const parameters may only be used as standalone arguments, i.e. `N`
= help: const parameters may only be used as standalone arguments here, i.e. `N`
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error: aborting due to 6 previous errors

View file

@ -7,7 +7,7 @@ LL | N
LL | fn foo<const N: usize>() -> A<{{ y!() }}> {
| ---- in this macro invocation
|
= help: const parameters may only be used as standalone arguments, i.e. `N`
= help: const parameters may only be used as standalone arguments here, i.e. `N`
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
= note: this error originates in the macro `y` (in Nightly builds, run with -Z macro-backtrace for more info)

View file

@ -7,7 +7,7 @@ LL | { N }
LL | fn foo<const N: usize>() -> A<{ y!() }> {
| ---- in this macro invocation
|
= help: const parameters may only be used as standalone arguments, i.e. `N`
= help: const parameters may only be used as standalone arguments here, i.e. `N`
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
= note: this error originates in the macro `y` (in Nightly builds, run with -Z macro-backtrace for more info)

View file

@ -4,7 +4,7 @@ error: generic parameters may not be used in const operations
LL | fn foo<const N: usize>() -> A<{ { N } }> {
| ^ cannot perform const operation using `N`
|
= help: const parameters may only be used as standalone arguments, i.e. `N`
= help: const parameters may only be used as standalone arguments here, i.e. `N`
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error: aborting due to 1 previous error

View file

@ -4,7 +4,7 @@ error: generic parameters may not be used in const operations
LL | struct ArithArrayLen<const N: usize>([u32; 0 + N]);
| ^ cannot perform const operation using `N`
|
= help: const parameters may only be used as standalone arguments, i.e. `N`
= help: const parameters may only be used as standalone arguments here, i.e. `N`
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error: generic parameters may not be used in const operations
@ -13,7 +13,7 @@ error: generic parameters may not be used in const operations
LL | arr: [u8; CFG.arr_size],
| ^^^ cannot perform const operation using `CFG`
|
= help: const parameters may only be used as standalone arguments, i.e. `CFG`
= help: const parameters may only be used as standalone arguments here, i.e. `CFG`
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error: `Config` is forbidden as the type of a const generic parameter

View file

@ -4,7 +4,7 @@ error: generic parameters may not be used in const operations
LL | SmallVec<{ D * 2 }>:,
| ^ cannot perform const operation using `D`
|
= help: const parameters may only be used as standalone arguments, i.e. `D`
= help: const parameters may only be used as standalone arguments here, i.e. `D`
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error[E0747]: constant provided when a type was expected

View file

@ -4,7 +4,7 @@ error: generic parameters may not be used in const operations
LL | type Arr<const N: usize> = [u8; N - 1];
| ^ cannot perform const operation using `N`
|
= help: const parameters may only be used as standalone arguments, i.e. `N`
= help: const parameters may only be used as standalone arguments here, i.e. `N`
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error: aborting due to 1 previous error

View file

@ -4,7 +4,7 @@ error: generic parameters may not be used in const operations
LL | Condition<{ LHS <= RHS }>: True
| ^^^ cannot perform const operation using `LHS`
|
= help: const parameters may only be used as standalone arguments, i.e. `LHS`
= help: const parameters may only be used as standalone arguments here, i.e. `LHS`
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error: generic parameters may not be used in const operations
@ -13,7 +13,7 @@ error: generic parameters may not be used in const operations
LL | Condition<{ LHS <= RHS }>: True
| ^^^ cannot perform const operation using `RHS`
|
= help: const parameters may only be used as standalone arguments, i.e. `RHS`
= help: const parameters may only be used as standalone arguments here, i.e. `RHS`
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error: generic parameters may not be used in const operations
@ -22,7 +22,7 @@ error: generic parameters may not be used in const operations
LL | IsLessOrEqual<{ 8 - I }, { 8 - J }>: True,
| ^ cannot perform const operation using `I`
|
= help: const parameters may only be used as standalone arguments, i.e. `I`
= help: const parameters may only be used as standalone arguments here, i.e. `I`
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error: generic parameters may not be used in const operations
@ -31,7 +31,7 @@ error: generic parameters may not be used in const operations
LL | IsLessOrEqual<{ 8 - I }, { 8 - J }>: True,
| ^ cannot perform const operation using `J`
|
= help: const parameters may only be used as standalone arguments, i.e. `J`
= help: const parameters may only be used as standalone arguments here, i.e. `J`
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error: aborting due to 4 previous errors

View file

@ -4,7 +4,7 @@ error: generic parameters may not be used in const operations
LL | where Assert::<{N < usize::MAX / 2}>: IsTrue,
| ^ cannot perform const operation using `N`
|
= help: const parameters may only be used as standalone arguments, i.e. `N`
= help: const parameters may only be used as standalone arguments here, i.e. `N`
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error: aborting due to 1 previous error

View file

@ -0,0 +1,13 @@
error: unconstrained generic constant
--> $DIR/trivial-anon-const-use-cases.rs:14:12
|
LL | stuff: [u8; { S + 1 }], // `S + 1` is NOT a valid const expression in this context.
| ^^^^^^^^^^^^^^^
|
help: try adding a `where` bound
|
LL | struct Y<const S: usize> where [(); { S + 1 }]: {
| ++++++++++++++++++++++
error: aborting due to 1 previous error

View file

@ -0,0 +1,11 @@
error: generic parameters may not be used in const operations
--> $DIR/trivial-anon-const-use-cases.rs:14:19
|
LL | stuff: [u8; { S + 1 }], // `S + 1` is NOT a valid const expression in this context.
| ^ cannot perform const operation using `S`
|
= help: const parameters may only be used as standalone arguments here, i.e. `S`
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error: aborting due to 1 previous error

View file

@ -0,0 +1,19 @@
//! Regression test for <https://github.com/rust-lang/rust/issues/79429>.
//@ revisions: full min
#![cfg_attr(full, feature(generic_const_exprs))]
#![cfg_attr(full, allow(incomplete_features))]
struct X<const S: usize>;
impl<const S: usize> X<S> {
const LEN: usize = S + 1; // `S + 1` is a valid const expression in this context.
}
struct Y<const S: usize> {
stuff: [u8; { S + 1 }], // `S + 1` is NOT a valid const expression in this context.
//[min]~^ ERROR generic parameters may not be used in const operations
//[full]~^^ ERROR unconstrained generic constant
}
fn main() {}

View file

@ -4,7 +4,7 @@ error: generic parameters may not be used in const operations
LL | impl <const N: usize> Collatz<{Some(N)}> {}
| ^ cannot perform const operation using `N`
|
= help: const parameters may only be used as standalone arguments, i.e. `N`
= help: const parameters may only be used as standalone arguments here, i.e. `N`
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error: `Option<usize>` is forbidden as the type of a const generic parameter

View file

@ -13,7 +13,7 @@ error: generic parameters may not be used in const operations
LL | fn const_param<const N: usize>() -> [u8; N + 1] {
| ^ cannot perform const operation using `N`
|
= help: const parameters may only be used as standalone arguments, i.e. `N`
= help: const parameters may only be used as standalone arguments here, i.e. `N`
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error: aborting due to 2 previous errors

View file

@ -4,7 +4,7 @@ error: generic parameters may not be used in const operations
LL | struct MyArray<const COUNT: usize>([u8; COUNT + 1]);
| ^^^^^ cannot perform const operation using `COUNT`
|
= help: const parameters may only be used as standalone arguments, i.e. `COUNT`
= help: const parameters may only be used as standalone arguments here, i.e. `COUNT`
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error: aborting due to 1 previous error

View file

@ -16,7 +16,7 @@ error: generic parameters may not be used in const operations
LL | legacy_const_generics::foo(0, N + 1, 2);
| ^ cannot perform const operation using `N`
|
= help: const parameters may only be used as standalone arguments, i.e. `N`
= help: const parameters may only be used as standalone arguments here, i.e. `N`
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error: aborting due to 2 previous errors

View file

@ -4,7 +4,7 @@ error: generic parameters may not be used in const operations
LL | struct Break0<const N: usize>([u8; { N + 1 }]);
| ^ cannot perform const operation using `N`
|
= help: const parameters may only be used as standalone arguments, i.e. `N`
= help: const parameters may only be used as standalone arguments here, i.e. `N`
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error: generic parameters may not be used in const operations
@ -13,7 +13,7 @@ error: generic parameters may not be used in const operations
LL | struct Break1<const N: usize>([u8; { { N } }]);
| ^ cannot perform const operation using `N`
|
= help: const parameters may only be used as standalone arguments, i.e. `N`
= help: const parameters may only be used as standalone arguments here, i.e. `N`
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error: generic parameters may not be used in const operations
@ -22,7 +22,7 @@ error: generic parameters may not be used in const operations
LL | let _: [u8; N + 1];
| ^ cannot perform const operation using `N`
|
= help: const parameters may only be used as standalone arguments, i.e. `N`
= help: const parameters may only be used as standalone arguments here, i.e. `N`
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error: generic parameters may not be used in const operations
@ -31,7 +31,7 @@ error: generic parameters may not be used in const operations
LL | let _ = [0; N + 1];
| ^ cannot perform const operation using `N`
|
= help: const parameters may only be used as standalone arguments, i.e. `N`
= help: const parameters may only be used as standalone arguments here, i.e. `N`
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error: generic parameters may not be used in const operations

View file

@ -4,7 +4,7 @@ error: generic parameters may not be used in const operations
LL | bar::<{ [1; N] }>();
| ^ cannot perform const operation using `N`
|
= help: const parameters may only be used as standalone arguments, i.e. `N`
= help: const parameters may only be used as standalone arguments here, i.e. `N`
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error: generic parameters may not be used in const operations
@ -13,7 +13,7 @@ error: generic parameters may not be used in const operations
LL | bar::<{ [1; { N + 1 }] }>();
| ^ cannot perform const operation using `N`
|
= help: const parameters may only be used as standalone arguments, i.e. `N`
= help: const parameters may only be used as standalone arguments here, i.e. `N`
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error: aborting due to 2 previous errors

View file

@ -1,4 +1,4 @@
// issue #20126
//! Regression test for issue #20126: Copy and Drop traits are mutually exclusive
#[derive(Copy, Clone)] //~ ERROR the trait `Copy` cannot be implemented
struct Foo;

View file

@ -1,11 +1,11 @@
error[E0184]: the trait `Copy` cannot be implemented for this type; the type has a destructor
--> $DIR/exclusive-drop-and-copy.rs:3:10
--> $DIR/copy-drop-mutually-exclusive.rs:3:10
|
LL | #[derive(Copy, Clone)]
| ^^^^ `Copy` not allowed on types with destructors
error[E0184]: the trait `Copy` cannot be implemented for this type; the type has a destructor
--> $DIR/exclusive-drop-and-copy.rs:10:10
--> $DIR/copy-drop-mutually-exclusive.rs:10:10
|
LL | #[derive(Copy, Clone)]
| ^^^^ `Copy` not allowed on types with destructors

View file

@ -1,3 +1,5 @@
//! Test error for explicit destructor method calls via UFCS
//@ run-rustfix
#![allow(dropping_references)]

View file

@ -1,3 +1,5 @@
//! Test error for explicit destructor method calls via UFCS
//@ run-rustfix
#![allow(dropping_references)]

View file

@ -1,5 +1,5 @@
error[E0040]: explicit use of destructor method
--> $DIR/illegal-ufcs-drop.rs:12:5
--> $DIR/explicit-drop-call-error.rs:14:5
|
LL | Drop::drop(&mut Foo)
| ^^^^^^^^^^

View file

@ -0,0 +1,24 @@
error: unsafe attribute used without unsafe
--> $DIR/unsafe-attr-edition-span.rs:21:3
|
LL | #[no_mangle]
| ^^^^^^^^^ usage of unsafe attribute
|
help: wrap the attribute in `unsafe(...)`
|
LL | #[unsafe(no_mangle)]
| +++++++ +
error: unsafe attribute used without unsafe
--> $DIR/unsafe-attr-edition-span.rs:25:7
|
LL | #[no_mangle]
| ^^^^^^^^^ usage of unsafe attribute
|
help: wrap the attribute in `unsafe(...)`
|
LL | #[unsafe(no_mangle)]
| +++++++ +
error: aborting due to 2 previous errors

View file

@ -0,0 +1,27 @@
// Tests that the correct span is used to determine the edition of an attribute that was safe to use
// in earlier editions, but has become `unsafe` in later editions.
//
// Determining the correct edition is non-trivial because of macro expansion. For instance,
// the `thread_local!` macro (defined in std and hence using the most recent edition) parses the
// attribute, and then re-emits it. Therefore, the span of the `#` token starting the
// `#[no_mangle]` attribute has std's edition, while the attribute name has the edition of this
// file, which may be different.
//@ revisions: e2015 e2018 e2021 e2024
//@[e2018] edition:2018
//@[e2021] edition:2021
//@[e2024] edition:2024
//
//@[e2015] check-pass
//@[e2018] check-pass
//@[e2021] check-pass
#![crate_type = "lib"]
#[no_mangle] //[e2024]~ ERROR unsafe attribute used without unsafe
static TEST_OUTSIDE: usize = 0;
thread_local! {
#[no_mangle]//[e2024]~ ERROR unsafe attribute used without unsafe
static TEST: usize = 0;
}

View file

@ -1,7 +0,0 @@
//@ run-pass
#![allow(unused_variables)]
pub fn main() {
let x: () = *Box::new(());
}

View file

@ -1,24 +0,0 @@
//@ run-pass
// Test that empty type parameter list (<>) is synonymous with
// no type parameters at all
struct S<>;
trait T<> {} //~ WARN trait `T` is never used
enum E<> { V }
impl<> T<> for S<> {}
impl T for E {}
fn foo<>() {}
fn bar() {}
fn main() {
let _ = S;
let _ = S::<>;
let _ = E::V;
let _ = E::<>::V;
foo();
foo::<>();
// Test that we can supply <> to non generic things
bar::<>();
let _: i32<>;
}

View file

@ -1,7 +0,0 @@
// Tests that the error message uses the word Copy, not Pod.
fn check_bound<T:Copy>(_: T) {}
fn main() {
check_bound("nocopy".to_string()); //~ ERROR : Copy` is not satisfied
}

View file

@ -1,22 +0,0 @@
error[E0277]: the trait bound `String: Copy` is not satisfied
--> $DIR/error-should-say-copy-not-pod.rs:6:17
|
LL | check_bound("nocopy".to_string());
| ----------- ^^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `String`
| |
| required by a bound introduced by this call
|
note: required by a bound in `check_bound`
--> $DIR/error-should-say-copy-not-pod.rs:3:18
|
LL | fn check_bound<T:Copy>(_: T) {}
| ^^^^ required by this bound in `check_bound`
help: consider removing this method call, as the receiver has type `&'static str` and `&'static str: Copy` trivially holds
|
LL - check_bound("nocopy".to_string());
LL + check_bound("nocopy");
|
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0277`.

View file

@ -1,13 +0,0 @@
//@ run-pass
#![allow(unused_must_use)]
pub fn main() {
let x: isize = 8;
let y = 9;
x + y;
let q: isize = -8;
let r = -9;
q + r;
}

View file

@ -1,2 +0,0 @@
fn main() { iamnotanextensionthatexists!(""); }
//~^ ERROR cannot find macro `iamnotanextensionthatexists` in this scope

View file

@ -1,8 +0,0 @@
error: cannot find macro `iamnotanextensionthatexists` in this scope
--> $DIR/ext-nonexistent.rs:1:13
|
LL | fn main() { iamnotanextensionthatexists!(""); }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to 1 previous error

View file

@ -1,26 +0,0 @@
//@ run-pass
fn f(x: isize) -> isize {
// println!("in f:");
println!("{}", x);
if x == 1 {
// println!("bottoming out");
return 1;
} else {
// println!("recurring");
let y: isize = x * f(x - 1);
// println!("returned");
println!("{}", y);
return y;
}
}
pub fn main() {
assert_eq!(f(5), 120);
// println!("all done");
}

View file

@ -1,3 +1,5 @@
//! Test format! macro functionality in no_std environment
//@ run-pass
//@ ignore-emscripten no no_std executables
//@ ignore-wasm different `main` convention
@ -9,7 +11,8 @@
// Import global allocator and panic handler.
extern crate std as other;
#[macro_use] extern crate alloc;
#[macro_use]
extern crate alloc;
use alloc::string::ToString;
@ -21,7 +24,7 @@ extern "C" fn main(_argc: core::ffi::c_int, _argv: *const *const u8) -> core::ff
let s = format!("test");
assert_eq!(s, "test".to_string());
let s = format!("{test}", test=3_isize);
let s = format!("{test}", test = 3_isize);
assert_eq!(s, "3".to_string());
let s = format!("hello {}", "world");

View file

@ -1,9 +0,0 @@
//@ run-pass
fn f() -> isize { return 42; }
pub fn main() {
let g: fn() -> isize = f;
let i: isize = g();
assert_eq!(i, 42);
}

View file

@ -1,15 +0,0 @@
// Ensure that the future_incompatible lint group only includes
// lints for changes that are not tied to an edition
#![deny(future_incompatible)]
// Error since this is a `future_incompatible` lint
macro_rules! m { ($i) => {} } //~ ERROR missing fragment specifier
//~| WARN this was previously accepted
trait Tr {
// Warn only since this is not a `future_incompatible` lint
fn f(u8) {} //~ WARN anonymous parameters are deprecated
//~| WARN this is accepted in the current edition
}
fn main() {}

Some files were not shown because too many files have changed in this diff Show more