Auto merge of #130091 - matthiaskrgr:rollup-kalu1cs, r=matthiaskrgr
Rollup of 10 pull requests Successful merges: - #126452 (Implement raw lifetimes and labels (`'r#ident`)) - #129555 (stabilize const_float_bits_conv) - #129594 (explain the options bootstrap passes to curl) - #129677 (Don't build by-move body when async closure is tainted) - #129847 (Do not call query to compute coroutine layout for synthetic body of async closure) - #129869 (add a few more crashtests) - #130009 (rustdoc-search: allow trailing `Foo ->` arg search) - #130046 (str: make as_mut_ptr and as_bytes_mut unstably const) - #130047 (Win: Add dbghelp to the list of import libraries) - #130059 (Remove the unused `llvm-skip-rebuild` option from x.py) r? `@ghost` `@rustbot` modify labels: rollup
This commit is contained in:
commit
878f49f5ff
79 changed files with 886 additions and 350 deletions
|
@ -752,7 +752,7 @@ fn visit_lazy_tts<T: MutVisitor>(vis: &mut T, lazy_tts: &mut Option<LazyAttrToke
|
|||
pub fn visit_token<T: MutVisitor>(vis: &mut T, t: &mut Token) {
|
||||
let Token { kind, span } = t;
|
||||
match kind {
|
||||
token::Ident(name, _ /*raw*/) | token::Lifetime(name) => {
|
||||
token::Ident(name, _is_raw) | token::Lifetime(name, _is_raw) => {
|
||||
let mut ident = Ident::new(*name, *span);
|
||||
vis.visit_ident(&mut ident);
|
||||
*name = ident.name;
|
||||
|
@ -762,7 +762,7 @@ pub fn visit_token<T: MutVisitor>(vis: &mut T, t: &mut Token) {
|
|||
token::NtIdent(ident, _is_raw) => {
|
||||
vis.visit_ident(ident);
|
||||
}
|
||||
token::NtLifetime(ident) => {
|
||||
token::NtLifetime(ident, _is_raw) => {
|
||||
vis.visit_ident(ident);
|
||||
}
|
||||
token::Interpolated(nt) => {
|
||||
|
|
|
@ -331,11 +331,11 @@ pub enum TokenKind {
|
|||
/// Do not forget about `NtLifetime` when you want to match on lifetime identifiers.
|
||||
/// It's recommended to use `Token::(lifetime,uninterpolate,uninterpolated_span)` to
|
||||
/// treat regular and interpolated lifetime identifiers in the same way.
|
||||
Lifetime(Symbol),
|
||||
Lifetime(Symbol, IdentIsRaw),
|
||||
/// This identifier (and its span) is the lifetime passed to the
|
||||
/// declarative macro. The span in the surrounding `Token` is the span of
|
||||
/// the `lifetime` metavariable in the macro's RHS.
|
||||
NtLifetime(Ident),
|
||||
NtLifetime(Ident, IdentIsRaw),
|
||||
|
||||
/// An embedded AST node, as produced by a macro. This only exists for
|
||||
/// historical reasons. We'd like to get rid of it, for multiple reasons.
|
||||
|
@ -458,7 +458,7 @@ impl Token {
|
|||
/// if they keep spans or perform edition checks.
|
||||
pub fn uninterpolated_span(&self) -> Span {
|
||||
match self.kind {
|
||||
NtIdent(ident, _) | NtLifetime(ident) => ident.span,
|
||||
NtIdent(ident, _) | NtLifetime(ident, _) => ident.span,
|
||||
Interpolated(ref nt) => nt.use_span(),
|
||||
_ => self.span,
|
||||
}
|
||||
|
@ -661,7 +661,9 @@ impl Token {
|
|||
pub fn uninterpolate(&self) -> Cow<'_, Token> {
|
||||
match self.kind {
|
||||
NtIdent(ident, is_raw) => Cow::Owned(Token::new(Ident(ident.name, is_raw), ident.span)),
|
||||
NtLifetime(ident) => Cow::Owned(Token::new(Lifetime(ident.name), ident.span)),
|
||||
NtLifetime(ident, is_raw) => {
|
||||
Cow::Owned(Token::new(Lifetime(ident.name, is_raw), ident.span))
|
||||
}
|
||||
_ => Cow::Borrowed(self),
|
||||
}
|
||||
}
|
||||
|
@ -679,11 +681,11 @@ impl Token {
|
|||
|
||||
/// Returns a lifetime identifier if this token is a lifetime.
|
||||
#[inline]
|
||||
pub fn lifetime(&self) -> Option<Ident> {
|
||||
pub fn lifetime(&self) -> Option<(Ident, IdentIsRaw)> {
|
||||
// We avoid using `Token::uninterpolate` here because it's slow.
|
||||
match self.kind {
|
||||
Lifetime(name) => Some(Ident::new(name, self.span)),
|
||||
NtLifetime(ident) => Some(ident),
|
||||
Lifetime(name, is_raw) => Some((Ident::new(name, self.span), is_raw)),
|
||||
NtLifetime(ident, is_raw) => Some((ident, is_raw)),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
@ -865,7 +867,7 @@ impl Token {
|
|||
_ => return None,
|
||||
},
|
||||
SingleQuote => match joint.kind {
|
||||
Ident(name, IdentIsRaw::No) => Lifetime(Symbol::intern(&format!("'{name}"))),
|
||||
Ident(name, is_raw) => Lifetime(Symbol::intern(&format!("'{name}")), is_raw),
|
||||
_ => return None,
|
||||
},
|
||||
|
||||
|
|
|
@ -482,11 +482,11 @@ impl TokenStream {
|
|||
token::NtIdent(ident, is_raw) => {
|
||||
TokenTree::Token(Token::new(token::Ident(ident.name, is_raw), ident.span), spacing)
|
||||
}
|
||||
token::NtLifetime(ident) => TokenTree::Delimited(
|
||||
token::NtLifetime(ident, is_raw) => TokenTree::Delimited(
|
||||
DelimSpan::from_single(token.span),
|
||||
DelimSpacing::new(Spacing::JointHidden, spacing),
|
||||
Delimiter::Invisible,
|
||||
TokenStream::token_alone(token::Lifetime(ident.name), ident.span),
|
||||
TokenStream::token_alone(token::Lifetime(ident.name, is_raw), ident.span),
|
||||
),
|
||||
token::Interpolated(ref nt) => TokenTree::Delimited(
|
||||
DelimSpan::from_single(token.span),
|
||||
|
|
|
@ -11,7 +11,9 @@ use std::borrow::Cow;
|
|||
use ast::TraitBoundModifiers;
|
||||
use rustc_ast::attr::AttrIdGenerator;
|
||||
use rustc_ast::ptr::P;
|
||||
use rustc_ast::token::{self, BinOpToken, CommentKind, Delimiter, Nonterminal, Token, TokenKind};
|
||||
use rustc_ast::token::{
|
||||
self, BinOpToken, CommentKind, Delimiter, IdentIsRaw, Nonterminal, Token, TokenKind,
|
||||
};
|
||||
use rustc_ast::tokenstream::{Spacing, TokenStream, TokenTree};
|
||||
use rustc_ast::util::classify;
|
||||
use rustc_ast::util::comments::{Comment, CommentStyle};
|
||||
|
@ -947,8 +949,13 @@ pub trait PrintState<'a>: std::ops::Deref<Target = pp::Printer> + std::ops::Dere
|
|||
token::NtIdent(ident, is_raw) => {
|
||||
IdentPrinter::for_ast_ident(ident, is_raw.into()).to_string().into()
|
||||
}
|
||||
token::Lifetime(name) => name.to_string().into(),
|
||||
token::NtLifetime(ident) => ident.name.to_string().into(),
|
||||
|
||||
token::Lifetime(name, IdentIsRaw::No)
|
||||
| token::NtLifetime(Ident { name, .. }, IdentIsRaw::No) => name.to_string().into(),
|
||||
token::Lifetime(name, IdentIsRaw::Yes)
|
||||
| token::NtLifetime(Ident { name, .. }, IdentIsRaw::Yes) => {
|
||||
format!("'r#{}", &name.as_str()[1..]).into()
|
||||
}
|
||||
|
||||
/* Other */
|
||||
token::DocComment(comment_kind, attr_style, data) => {
|
||||
|
|
|
@ -398,8 +398,10 @@ pub(crate) enum NamedMatch {
|
|||
fn token_name_eq(t1: &Token, t2: &Token) -> bool {
|
||||
if let (Some((ident1, is_raw1)), Some((ident2, is_raw2))) = (t1.ident(), t2.ident()) {
|
||||
ident1.name == ident2.name && is_raw1 == is_raw2
|
||||
} else if let (Some(ident1), Some(ident2)) = (t1.lifetime(), t2.lifetime()) {
|
||||
ident1.name == ident2.name
|
||||
} else if let (Some((ident1, is_raw1)), Some((ident2, is_raw2))) =
|
||||
(t1.lifetime(), t2.lifetime())
|
||||
{
|
||||
ident1.name == ident2.name && is_raw1 == is_raw2
|
||||
} else {
|
||||
t1.kind == t2.kind
|
||||
}
|
||||
|
|
|
@ -283,9 +283,9 @@ pub(super) fn transcribe<'a>(
|
|||
let kind = token::NtIdent(*ident, *is_raw);
|
||||
TokenTree::token_alone(kind, sp)
|
||||
}
|
||||
MatchedSingle(ParseNtResult::Lifetime(ident)) => {
|
||||
MatchedSingle(ParseNtResult::Lifetime(ident, is_raw)) => {
|
||||
marker.visit_span(&mut sp);
|
||||
let kind = token::NtLifetime(*ident);
|
||||
let kind = token::NtLifetime(*ident, *is_raw);
|
||||
TokenTree::token_alone(kind, sp)
|
||||
}
|
||||
MatchedSingle(ParseNtResult::Nt(nt)) => {
|
||||
|
|
|
@ -229,15 +229,16 @@ impl FromInternal<(TokenStream, &mut Rustc<'_, '_>)> for Vec<TokenTree<TokenStre
|
|||
span: ident.span,
|
||||
})),
|
||||
|
||||
Lifetime(name) => {
|
||||
Lifetime(name, is_raw) => {
|
||||
let ident = symbol::Ident::new(name, span).without_first_quote();
|
||||
trees.extend([
|
||||
TokenTree::Punct(Punct { ch: b'\'', joint: true, span }),
|
||||
TokenTree::Ident(Ident { sym: ident.name, is_raw: false, span }),
|
||||
TokenTree::Ident(Ident { sym: ident.name, is_raw: is_raw.into(), span }),
|
||||
]);
|
||||
}
|
||||
NtLifetime(ident) => {
|
||||
let stream = TokenStream::token_alone(token::Lifetime(ident.name), ident.span);
|
||||
NtLifetime(ident, is_raw) => {
|
||||
let stream =
|
||||
TokenStream::token_alone(token::Lifetime(ident.name, is_raw), ident.span);
|
||||
trees.push(TokenTree::Group(Group {
|
||||
delimiter: pm::Delimiter::None,
|
||||
stream: Some(stream),
|
||||
|
|
|
@ -91,6 +91,15 @@ pub enum TokenKind {
|
|||
/// tokens.
|
||||
UnknownPrefix,
|
||||
|
||||
/// An unknown prefix in a lifetime, like `'foo#`.
|
||||
///
|
||||
/// Note that like above, only the `'` and prefix are included in the token
|
||||
/// and not the separator.
|
||||
UnknownPrefixLifetime,
|
||||
|
||||
/// `'r#lt`, which in edition < 2021 is split into several tokens: `'r # lt`.
|
||||
RawLifetime,
|
||||
|
||||
/// Similar to the above, but *always* an error on every edition. This is used
|
||||
/// for emoji identifier recovery, as those are not meant to be ever accepted.
|
||||
InvalidPrefix,
|
||||
|
@ -677,9 +686,17 @@ impl Cursor<'_> {
|
|||
return Literal { kind, suffix_start };
|
||||
}
|
||||
|
||||
if self.first() == 'r' && self.second() == '#' && is_id_start(self.third()) {
|
||||
// Eat "r" and `#`, and identifier start characters.
|
||||
self.bump();
|
||||
self.bump();
|
||||
self.bump();
|
||||
self.eat_while(is_id_continue);
|
||||
return RawLifetime;
|
||||
}
|
||||
|
||||
// Either a lifetime or a character literal with
|
||||
// length greater than 1.
|
||||
|
||||
let starts_with_number = self.first().is_ascii_digit();
|
||||
|
||||
// Skip the literal contents.
|
||||
|
@ -688,15 +705,17 @@ impl Cursor<'_> {
|
|||
self.bump();
|
||||
self.eat_while(is_id_continue);
|
||||
|
||||
// Check if after skipping literal contents we've met a closing
|
||||
// single quote (which means that user attempted to create a
|
||||
// string with single quotes).
|
||||
if self.first() == '\'' {
|
||||
self.bump();
|
||||
let kind = Char { terminated: true };
|
||||
Literal { kind, suffix_start: self.pos_within_token() }
|
||||
} else {
|
||||
Lifetime { starts_with_number }
|
||||
match self.first() {
|
||||
// Check if after skipping literal contents we've met a closing
|
||||
// single quote (which means that user attempted to create a
|
||||
// string with single quotes).
|
||||
'\'' => {
|
||||
self.bump();
|
||||
let kind = Char { terminated: true };
|
||||
Literal { kind, suffix_start: self.pos_within_token() }
|
||||
}
|
||||
'#' if !starts_with_number => UnknownPrefixLifetime,
|
||||
_ => Lifetime { starts_with_number },
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -708,6 +708,10 @@ lint_range_endpoint_out_of_range = range endpoint is out of range for `{$ty}`
|
|||
lint_range_use_inclusive_range = use an inclusive range instead
|
||||
|
||||
|
||||
lint_raw_prefix = prefix `'r` is reserved
|
||||
.label = reserved prefix
|
||||
.suggestion = insert whitespace here to avoid this being parsed as a prefix in Rust 2021
|
||||
|
||||
lint_reason_must_be_string_literal = reason must be a string literal
|
||||
|
||||
lint_reason_must_come_last = reason in lint attribute must come last
|
||||
|
|
|
@ -1851,9 +1851,16 @@ impl KeywordIdents {
|
|||
TokenTree::Token(token, _) => {
|
||||
if let Some((ident, token::IdentIsRaw::No)) = token.ident() {
|
||||
if !prev_dollar {
|
||||
self.check_ident_token(cx, UnderMacro(true), ident);
|
||||
self.check_ident_token(cx, UnderMacro(true), ident, "");
|
||||
}
|
||||
} else if *token == TokenKind::Dollar {
|
||||
} else if let Some((ident, token::IdentIsRaw::No)) = token.lifetime() {
|
||||
self.check_ident_token(
|
||||
cx,
|
||||
UnderMacro(true),
|
||||
ident.without_first_quote(),
|
||||
"'",
|
||||
);
|
||||
} else if token.kind == TokenKind::Dollar {
|
||||
prev_dollar = true;
|
||||
continue;
|
||||
}
|
||||
|
@ -1869,6 +1876,7 @@ impl KeywordIdents {
|
|||
cx: &EarlyContext<'_>,
|
||||
UnderMacro(under_macro): UnderMacro,
|
||||
ident: Ident,
|
||||
prefix: &'static str,
|
||||
) {
|
||||
let (lint, edition) = match ident.name {
|
||||
kw::Async | kw::Await | kw::Try => (KEYWORD_IDENTS_2018, Edition::Edition2018),
|
||||
|
@ -1902,7 +1910,7 @@ impl KeywordIdents {
|
|||
cx.emit_span_lint(
|
||||
lint,
|
||||
ident.span,
|
||||
BuiltinKeywordIdents { kw: ident, next: edition, suggestion: ident.span },
|
||||
BuiltinKeywordIdents { kw: ident, next: edition, suggestion: ident.span, prefix },
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -1915,7 +1923,11 @@ impl EarlyLintPass for KeywordIdents {
|
|||
self.check_tokens(cx, &mac.args.tokens);
|
||||
}
|
||||
fn check_ident(&mut self, cx: &EarlyContext<'_>, ident: Ident) {
|
||||
self.check_ident_token(cx, UnderMacro(false), ident);
|
||||
if ident.name.as_str().starts_with('\'') {
|
||||
self.check_ident_token(cx, UnderMacro(false), ident.without_first_quote(), "'");
|
||||
} else {
|
||||
self.check_ident_token(cx, UnderMacro(false), ident, "");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -172,6 +172,10 @@ pub(super) fn decorate_lint(sess: &Session, diagnostic: BuiltinLintDiag, diag: &
|
|||
}
|
||||
.decorate_lint(diag);
|
||||
}
|
||||
BuiltinLintDiag::RawPrefix(label_span) => {
|
||||
lints::RawPrefix { label: label_span, suggestion: label_span.shrink_to_hi() }
|
||||
.decorate_lint(diag);
|
||||
}
|
||||
BuiltinLintDiag::UnusedBuiltinAttribute { attr_name, macro_name, invoc_span } => {
|
||||
lints::UnusedBuiltinAttribute { invoc_span, attr_name, macro_name }.decorate_lint(diag);
|
||||
}
|
||||
|
|
|
@ -363,8 +363,9 @@ pub(crate) enum BuiltinEllipsisInclusiveRangePatternsLint {
|
|||
pub(crate) struct BuiltinKeywordIdents {
|
||||
pub kw: Ident,
|
||||
pub next: Edition,
|
||||
#[suggestion(code = "r#{kw}", applicability = "machine-applicable")]
|
||||
#[suggestion(code = "{prefix}r#{kw}", applicability = "machine-applicable")]
|
||||
pub suggestion: Span,
|
||||
pub prefix: &'static str,
|
||||
}
|
||||
|
||||
#[derive(LintDiagnostic)]
|
||||
|
@ -2814,6 +2815,15 @@ pub(crate) struct ReservedPrefix {
|
|||
pub prefix: String,
|
||||
}
|
||||
|
||||
#[derive(LintDiagnostic)]
|
||||
#[diag(lint_raw_prefix)]
|
||||
pub(crate) struct RawPrefix {
|
||||
#[label]
|
||||
pub label: Span,
|
||||
#[suggestion(code = " ", applicability = "machine-applicable")]
|
||||
pub suggestion: Span,
|
||||
}
|
||||
|
||||
#[derive(LintDiagnostic)]
|
||||
#[diag(lint_unused_builtin_attribute)]
|
||||
pub(crate) struct UnusedBuiltinAttribute {
|
||||
|
|
|
@ -612,6 +612,8 @@ pub enum BuiltinLintDiag {
|
|||
LegacyDeriveHelpers(Span),
|
||||
OrPatternsBackCompat(Span, String),
|
||||
ReservedPrefix(Span, String),
|
||||
/// `'r#` in edition < 2021.
|
||||
RawPrefix(Span),
|
||||
TrailingMacro(bool, Ident),
|
||||
BreakWithLabelAndLoop(Span),
|
||||
UnicodeTextFlow(Span, String),
|
||||
|
|
|
@ -88,6 +88,11 @@ pub fn coroutine_by_move_body_def_id<'tcx>(
|
|||
) -> DefId {
|
||||
let body = tcx.mir_built(coroutine_def_id).borrow();
|
||||
|
||||
// If the typeck results are tainted, no need to make a by-ref body.
|
||||
if body.tainted_by_errors.is_some() {
|
||||
return coroutine_def_id.to_def_id();
|
||||
}
|
||||
|
||||
let Some(hir::CoroutineKind::Desugared(_, hir::CoroutineSource::Closure)) =
|
||||
tcx.coroutine_kind(coroutine_def_id)
|
||||
else {
|
||||
|
@ -98,7 +103,9 @@ pub fn coroutine_by_move_body_def_id<'tcx>(
|
|||
// the MIR body will be constructed well.
|
||||
let coroutine_ty = body.local_decls[ty::CAPTURE_STRUCT_LOCAL].ty;
|
||||
|
||||
let ty::Coroutine(_, args) = *coroutine_ty.kind() else { bug!("{body:#?}") };
|
||||
let ty::Coroutine(_, args) = *coroutine_ty.kind() else {
|
||||
bug!("tried to create by-move body of non-coroutine receiver");
|
||||
};
|
||||
let args = args.as_coroutine();
|
||||
|
||||
let coroutine_kind = args.kind_ty().to_opt_closure_kind().unwrap();
|
||||
|
@ -107,7 +114,7 @@ pub fn coroutine_by_move_body_def_id<'tcx>(
|
|||
let ty::CoroutineClosure(_, parent_args) =
|
||||
*tcx.type_of(parent_def_id).instantiate_identity().kind()
|
||||
else {
|
||||
bug!();
|
||||
bug!("coroutine's parent was not a coroutine-closure");
|
||||
};
|
||||
if parent_args.references_error() {
|
||||
return coroutine_def_id.to_def_id();
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
//! Validates the MIR to ensure that invariants are upheld.
|
||||
|
||||
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
|
||||
use rustc_hir as hir;
|
||||
use rustc_hir::LangItem;
|
||||
use rustc_index::bit_set::BitSet;
|
||||
use rustc_index::IndexVec;
|
||||
|
@ -714,7 +715,17 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
|
|||
// since we may be in the process of computing this MIR in the
|
||||
// first place.
|
||||
let layout = if def_id == self.caller_body.source.def_id() {
|
||||
// FIXME: This is not right for async closures.
|
||||
self.caller_body.coroutine_layout_raw()
|
||||
} else if let Some(hir::CoroutineKind::Desugared(
|
||||
_,
|
||||
hir::CoroutineSource::Closure,
|
||||
)) = self.tcx.coroutine_kind(def_id)
|
||||
&& let ty::ClosureKind::FnOnce =
|
||||
args.as_coroutine().kind_ty().to_opt_closure_kind().unwrap()
|
||||
&& self.caller_body.source.def_id()
|
||||
== self.tcx.coroutine_by_move_body_def_id(def_id)
|
||||
{
|
||||
// Same if this is the by-move body of a coroutine-closure.
|
||||
self.caller_body.coroutine_layout_raw()
|
||||
} else {
|
||||
self.tcx.coroutine_layout(def_id, args.as_coroutine().kind_ty())
|
||||
|
|
|
@ -13,7 +13,6 @@ use rustc_session::lint::builtin::{
|
|||
};
|
||||
use rustc_session::lint::BuiltinLintDiag;
|
||||
use rustc_session::parse::ParseSess;
|
||||
use rustc_span::edition::Edition;
|
||||
use rustc_span::symbol::Symbol;
|
||||
use rustc_span::{BytePos, Pos, Span};
|
||||
use tracing::debug;
|
||||
|
@ -188,9 +187,7 @@ impl<'psess, 'src> StringReader<'psess, 'src> {
|
|||
preceded_by_whitespace = true;
|
||||
continue;
|
||||
}
|
||||
rustc_lexer::TokenKind::Ident => {
|
||||
self.ident(start)
|
||||
}
|
||||
rustc_lexer::TokenKind::Ident => self.ident(start),
|
||||
rustc_lexer::TokenKind::RawIdent => {
|
||||
let sym = nfc_normalize(self.str_from(start + BytePos(2)));
|
||||
let span = self.mk_sp(start, self.pos);
|
||||
|
@ -205,20 +202,31 @@ impl<'psess, 'src> StringReader<'psess, 'src> {
|
|||
self.report_unknown_prefix(start);
|
||||
self.ident(start)
|
||||
}
|
||||
rustc_lexer::TokenKind::InvalidIdent
|
||||
| rustc_lexer::TokenKind::InvalidPrefix
|
||||
rustc_lexer::TokenKind::UnknownPrefixLifetime => {
|
||||
self.report_unknown_prefix(start);
|
||||
// Include the leading `'` in the real identifier, for macro
|
||||
// expansion purposes. See #12512 for the gory details of why
|
||||
// this is necessary.
|
||||
let lifetime_name = self.str_from(start);
|
||||
self.last_lifetime = Some(self.mk_sp(start, start + BytePos(1)));
|
||||
let ident = Symbol::intern(lifetime_name);
|
||||
token::Lifetime(ident, IdentIsRaw::No)
|
||||
}
|
||||
rustc_lexer::TokenKind::InvalidIdent | rustc_lexer::TokenKind::InvalidPrefix
|
||||
// Do not recover an identifier with emoji if the codepoint is a confusable
|
||||
// with a recoverable substitution token, like `➖`.
|
||||
if !UNICODE_ARRAY
|
||||
.iter()
|
||||
.any(|&(c, _, _)| {
|
||||
let sym = self.str_from(start);
|
||||
sym.chars().count() == 1 && c == sym.chars().next().unwrap()
|
||||
}) =>
|
||||
if !UNICODE_ARRAY.iter().any(|&(c, _, _)| {
|
||||
let sym = self.str_from(start);
|
||||
sym.chars().count() == 1 && c == sym.chars().next().unwrap()
|
||||
}) =>
|
||||
{
|
||||
let sym = nfc_normalize(self.str_from(start));
|
||||
let span = self.mk_sp(start, self.pos);
|
||||
self.psess.bad_unicode_identifiers.borrow_mut().entry(sym).or_default()
|
||||
self.psess
|
||||
.bad_unicode_identifiers
|
||||
.borrow_mut()
|
||||
.entry(sym)
|
||||
.or_default()
|
||||
.push(span);
|
||||
token::Ident(sym, IdentIsRaw::No)
|
||||
}
|
||||
|
@ -249,9 +257,9 @@ impl<'psess, 'src> StringReader<'psess, 'src> {
|
|||
let suffix = if suffix_start < self.pos {
|
||||
let string = self.str_from(suffix_start);
|
||||
if string == "_" {
|
||||
self
|
||||
.dcx()
|
||||
.emit_err(errors::UnderscoreLiteralSuffix { span: self.mk_sp(suffix_start, self.pos) });
|
||||
self.dcx().emit_err(errors::UnderscoreLiteralSuffix {
|
||||
span: self.mk_sp(suffix_start, self.pos),
|
||||
});
|
||||
None
|
||||
} else {
|
||||
Some(Symbol::intern(string))
|
||||
|
@ -269,12 +277,47 @@ impl<'psess, 'src> StringReader<'psess, 'src> {
|
|||
self.last_lifetime = Some(self.mk_sp(start, start + BytePos(1)));
|
||||
if starts_with_number {
|
||||
let span = self.mk_sp(start, self.pos);
|
||||
self.dcx().struct_err("lifetimes cannot start with a number")
|
||||
self.dcx()
|
||||
.struct_err("lifetimes cannot start with a number")
|
||||
.with_span(span)
|
||||
.stash(span, StashKey::LifetimeIsChar);
|
||||
}
|
||||
let ident = Symbol::intern(lifetime_name);
|
||||
token::Lifetime(ident)
|
||||
token::Lifetime(ident, IdentIsRaw::No)
|
||||
}
|
||||
rustc_lexer::TokenKind::RawLifetime => {
|
||||
self.last_lifetime = Some(self.mk_sp(start, start + BytePos(1)));
|
||||
|
||||
let ident_start = start + BytePos(3);
|
||||
let prefix_span = self.mk_sp(start, ident_start);
|
||||
|
||||
if prefix_span.at_least_rust_2021() {
|
||||
let lifetime_name_without_tick = self.str_from(ident_start);
|
||||
// Put the `'` back onto the lifetime name.
|
||||
let mut lifetime_name = String::with_capacity(lifetime_name_without_tick.len() + 1);
|
||||
lifetime_name.push('\'');
|
||||
lifetime_name += lifetime_name_without_tick;
|
||||
let sym = Symbol::intern(&lifetime_name);
|
||||
|
||||
token::Lifetime(sym, IdentIsRaw::Yes)
|
||||
} else {
|
||||
// Otherwise, this should be parsed like `'r`. Warn about it though.
|
||||
self.psess.buffer_lint(
|
||||
RUST_2021_PREFIXES_INCOMPATIBLE_SYNTAX,
|
||||
prefix_span,
|
||||
ast::CRATE_NODE_ID,
|
||||
BuiltinLintDiag::RawPrefix(prefix_span),
|
||||
);
|
||||
|
||||
// Reset the state so we just lex the `'r`.
|
||||
let lt_start = start + BytePos(2);
|
||||
self.pos = lt_start;
|
||||
self.cursor = Cursor::new(&str_before[2 as usize..]);
|
||||
|
||||
let lifetime_name = self.str_from(start);
|
||||
let ident = Symbol::intern(lifetime_name);
|
||||
token::Lifetime(ident, IdentIsRaw::No)
|
||||
}
|
||||
}
|
||||
rustc_lexer::TokenKind::Semi => token::Semi,
|
||||
rustc_lexer::TokenKind::Comma => token::Comma,
|
||||
|
@ -331,16 +374,19 @@ impl<'psess, 'src> StringReader<'psess, 'src> {
|
|||
// first remove compound tokens like `<<` from `rustc_lexer`, and then add
|
||||
// fancier error recovery to it, as there will be less overall work to do this
|
||||
// way.
|
||||
let (token, sugg) = unicode_chars::check_for_substitution(self, start, c, repeats+1);
|
||||
let (token, sugg) =
|
||||
unicode_chars::check_for_substitution(self, start, c, repeats + 1);
|
||||
self.dcx().emit_err(errors::UnknownTokenStart {
|
||||
span: self.mk_sp(start, self.pos + Pos::from_usize(repeats * c.len_utf8())),
|
||||
escaped: escaped_char(c),
|
||||
sugg,
|
||||
null: if c == '\x00' {Some(errors::UnknownTokenNull)} else {None},
|
||||
null: if c == '\x00' { Some(errors::UnknownTokenNull) } else { None },
|
||||
repeat: if repeats > 0 {
|
||||
swallow_next_invalid = repeats;
|
||||
Some(errors::UnknownTokenRepeat { repeats })
|
||||
} else {None}
|
||||
} else {
|
||||
None
|
||||
},
|
||||
});
|
||||
|
||||
if let Some(token) = token {
|
||||
|
@ -699,7 +745,7 @@ impl<'psess, 'src> StringReader<'psess, 'src> {
|
|||
|
||||
let expn_data = prefix_span.ctxt().outer_expn_data();
|
||||
|
||||
if expn_data.edition >= Edition::Edition2021 {
|
||||
if expn_data.edition.at_least_rust_2021() {
|
||||
// In Rust 2021, this is a hard error.
|
||||
let sugg = if prefix == "rb" {
|
||||
Some(errors::UnknownPrefixSugg::UseBr(prefix_span))
|
||||
|
|
|
@ -2050,7 +2050,7 @@ impl<'a> Parser<'a> {
|
|||
};
|
||||
// On an error path, eagerly consider a lifetime to be an unclosed character lit, if that
|
||||
// makes sense.
|
||||
if let Some(ident) = self.token.lifetime()
|
||||
if let Some((ident, IdentIsRaw::No)) = self.token.lifetime()
|
||||
&& could_be_unclosed_char_literal(ident)
|
||||
{
|
||||
let lt = self.expect_lifetime();
|
||||
|
@ -2925,9 +2925,9 @@ impl<'a> Parser<'a> {
|
|||
}
|
||||
|
||||
pub(crate) fn eat_label(&mut self) -> Option<Label> {
|
||||
if let Some(ident) = self.token.lifetime() {
|
||||
if let Some((ident, is_raw)) = self.token.lifetime() {
|
||||
// Disallow `'fn`, but with a better error message than `expect_lifetime`.
|
||||
if ident.without_first_quote().is_reserved() {
|
||||
if matches!(is_raw, IdentIsRaw::No) && ident.without_first_quote().is_reserved() {
|
||||
self.dcx().emit_err(errors::InvalidLabel { span: ident.span, name: ident.name });
|
||||
}
|
||||
|
||||
|
|
|
@ -1666,7 +1666,7 @@ enum FlatToken {
|
|||
pub enum ParseNtResult {
|
||||
Tt(TokenTree),
|
||||
Ident(Ident, IdentIsRaw),
|
||||
Lifetime(Ident),
|
||||
Lifetime(Ident, IdentIsRaw),
|
||||
|
||||
/// This case will eventually be removed, along with `Token::Interpolate`.
|
||||
Nt(Lrc<Nonterminal>),
|
||||
|
|
|
@ -88,7 +88,7 @@ impl<'a> Parser<'a> {
|
|||
},
|
||||
NonterminalKind::Pat(pat_kind) => token.can_begin_pattern(pat_kind),
|
||||
NonterminalKind::Lifetime => match &token.kind {
|
||||
token::Lifetime(_) | token::NtLifetime(..) => true,
|
||||
token::Lifetime(..) | token::NtLifetime(..) => true,
|
||||
_ => false,
|
||||
},
|
||||
NonterminalKind::TT | NonterminalKind::Item | NonterminalKind::Stmt => {
|
||||
|
@ -171,9 +171,9 @@ impl<'a> Parser<'a> {
|
|||
NonterminalKind::Lifetime => {
|
||||
// We want to keep `'keyword` parsing, just like `keyword` is still
|
||||
// an ident for nonterminal purposes.
|
||||
return if let Some(ident) = self.token.lifetime() {
|
||||
return if let Some((ident, is_raw)) = self.token.lifetime() {
|
||||
self.bump();
|
||||
Ok(ParseNtResult::Lifetime(ident))
|
||||
Ok(ParseNtResult::Lifetime(ident, is_raw))
|
||||
} else {
|
||||
Err(self.dcx().create_err(UnexpectedNonterminal::Lifetime {
|
||||
span: self.token.span,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use rustc_ast::mut_visit::{walk_pat, MutVisitor};
|
||||
use rustc_ast::ptr::P;
|
||||
use rustc_ast::token::{self, BinOpToken, Delimiter, Token};
|
||||
use rustc_ast::token::{self, BinOpToken, Delimiter, IdentIsRaw, Token};
|
||||
use rustc_ast::{
|
||||
self as ast, AttrVec, BindingMode, ByRef, Expr, ExprKind, MacCall, Mutability, Pat, PatField,
|
||||
PatFieldsRest, PatKind, Path, QSelf, RangeEnd, RangeSyntax,
|
||||
|
@ -548,7 +548,7 @@ impl<'a> Parser<'a> {
|
|||
None => PatKind::Path(qself, path),
|
||||
}
|
||||
}
|
||||
} else if let Some(lt) = self.token.lifetime()
|
||||
} else if let Some((lt, IdentIsRaw::No)) = self.token.lifetime()
|
||||
// In pattern position, we're totally fine with using "next token isn't colon"
|
||||
// as a heuristic. We could probably just always try to recover if it's a lifetime,
|
||||
// because we never have `'a: label {}` in a pattern position anyways, but it does
|
||||
|
@ -689,7 +689,7 @@ impl<'a> Parser<'a> {
|
|||
/// Parse `&pat` / `&mut pat`.
|
||||
fn parse_pat_deref(&mut self, expected: Option<Expected>) -> PResult<'a, PatKind> {
|
||||
self.expect_and()?;
|
||||
if let Some(lifetime) = self.token.lifetime() {
|
||||
if let Some((lifetime, _)) = self.token.lifetime() {
|
||||
self.bump(); // `'a`
|
||||
|
||||
self.dcx().emit_err(UnexpectedLifetimeInPattern {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
use rustc_ast::ptr::P;
|
||||
use rustc_ast::token::{self, BinOpToken, Delimiter, Token, TokenKind};
|
||||
use rustc_ast::token::{self, BinOpToken, Delimiter, IdentIsRaw, Token, TokenKind};
|
||||
use rustc_ast::util::case::Case;
|
||||
use rustc_ast::{
|
||||
self as ast, BareFnTy, BoundAsyncness, BoundConstness, BoundPolarity, FnRetTy, GenericBound,
|
||||
|
@ -1285,8 +1285,9 @@ impl<'a> Parser<'a> {
|
|||
|
||||
/// Parses a single lifetime `'a` or panics.
|
||||
pub(super) fn expect_lifetime(&mut self) -> Lifetime {
|
||||
if let Some(ident) = self.token.lifetime() {
|
||||
if ident.without_first_quote().is_reserved()
|
||||
if let Some((ident, is_raw)) = self.token.lifetime() {
|
||||
if matches!(is_raw, IdentIsRaw::No)
|
||||
&& ident.without_first_quote().is_reserved()
|
||||
&& ![kw::UnderscoreLifetime, kw::StaticLifetime].contains(&ident.name)
|
||||
{
|
||||
self.dcx().emit_err(errors::KeywordLifetime { span: ident.span });
|
||||
|
|
|
@ -121,7 +121,6 @@
|
|||
#![feature(const_cell_into_inner)]
|
||||
#![feature(const_eval_select)]
|
||||
#![feature(const_exact_div)]
|
||||
#![feature(const_float_bits_conv)]
|
||||
#![feature(const_float_classify)]
|
||||
#![feature(const_fmt_arguments_new)]
|
||||
#![feature(const_hash)]
|
||||
|
@ -165,6 +164,8 @@
|
|||
#![feature(coverage_attribute)]
|
||||
#![feature(do_not_recommend)]
|
||||
#![feature(duration_consts_float)]
|
||||
#![feature(f128_const)]
|
||||
#![feature(f16_const)]
|
||||
#![feature(internal_impls_macro)]
|
||||
#![feature(ip)]
|
||||
#![feature(is_ascii_octdigit)]
|
||||
|
|
|
@ -914,7 +914,7 @@ impl f128 {
|
|||
/// ```
|
||||
#[inline]
|
||||
#[unstable(feature = "f128", issue = "116909")]
|
||||
#[rustc_const_unstable(feature = "const_float_bits_conv", issue = "72447")]
|
||||
#[rustc_const_unstable(feature = "f128_const", issue = "116909")]
|
||||
#[must_use = "this returns the result of the operation, without modifying the original"]
|
||||
pub const fn to_bits(self) -> u128 {
|
||||
// SAFETY: `u128` is a plain old datatype so we can always transmute to it.
|
||||
|
@ -963,7 +963,7 @@ impl f128 {
|
|||
#[inline]
|
||||
#[must_use]
|
||||
#[unstable(feature = "f128", issue = "116909")]
|
||||
#[rustc_const_unstable(feature = "const_float_bits_conv", issue = "72447")]
|
||||
#[rustc_const_unstable(feature = "f128_const", issue = "116909")]
|
||||
pub const fn from_bits(v: u128) -> Self {
|
||||
// It turns out the safety issues with sNaN were overblown! Hooray!
|
||||
// SAFETY: `u128` is a plain old datatype so we can always transmute from it.
|
||||
|
@ -990,7 +990,7 @@ impl f128 {
|
|||
/// ```
|
||||
#[inline]
|
||||
#[unstable(feature = "f128", issue = "116909")]
|
||||
#[rustc_const_unstable(feature = "const_float_bits_conv", issue = "72447")]
|
||||
#[rustc_const_unstable(feature = "f128_const", issue = "116909")]
|
||||
#[must_use = "this returns the result of the operation, without modifying the original"]
|
||||
pub const fn to_be_bytes(self) -> [u8; 16] {
|
||||
self.to_bits().to_be_bytes()
|
||||
|
@ -1016,7 +1016,7 @@ impl f128 {
|
|||
/// ```
|
||||
#[inline]
|
||||
#[unstable(feature = "f128", issue = "116909")]
|
||||
#[rustc_const_unstable(feature = "const_float_bits_conv", issue = "72447")]
|
||||
#[rustc_const_unstable(feature = "f128_const", issue = "116909")]
|
||||
#[must_use = "this returns the result of the operation, without modifying the original"]
|
||||
pub const fn to_le_bytes(self) -> [u8; 16] {
|
||||
self.to_bits().to_le_bytes()
|
||||
|
@ -1053,7 +1053,7 @@ impl f128 {
|
|||
/// ```
|
||||
#[inline]
|
||||
#[unstable(feature = "f128", issue = "116909")]
|
||||
#[rustc_const_unstable(feature = "const_float_bits_conv", issue = "72447")]
|
||||
#[rustc_const_unstable(feature = "f128_const", issue = "116909")]
|
||||
#[must_use = "this returns the result of the operation, without modifying the original"]
|
||||
pub const fn to_ne_bytes(self) -> [u8; 16] {
|
||||
self.to_bits().to_ne_bytes()
|
||||
|
@ -1081,7 +1081,7 @@ impl f128 {
|
|||
#[inline]
|
||||
#[must_use]
|
||||
#[unstable(feature = "f128", issue = "116909")]
|
||||
#[rustc_const_unstable(feature = "const_float_bits_conv", issue = "72447")]
|
||||
#[rustc_const_unstable(feature = "f128_const", issue = "116909")]
|
||||
pub const fn from_be_bytes(bytes: [u8; 16]) -> Self {
|
||||
Self::from_bits(u128::from_be_bytes(bytes))
|
||||
}
|
||||
|
@ -1108,7 +1108,7 @@ impl f128 {
|
|||
#[inline]
|
||||
#[must_use]
|
||||
#[unstable(feature = "f128", issue = "116909")]
|
||||
#[rustc_const_unstable(feature = "const_float_bits_conv", issue = "72447")]
|
||||
#[rustc_const_unstable(feature = "f128_const", issue = "116909")]
|
||||
pub const fn from_le_bytes(bytes: [u8; 16]) -> Self {
|
||||
Self::from_bits(u128::from_le_bytes(bytes))
|
||||
}
|
||||
|
@ -1145,7 +1145,7 @@ impl f128 {
|
|||
#[inline]
|
||||
#[must_use]
|
||||
#[unstable(feature = "f128", issue = "116909")]
|
||||
#[rustc_const_unstable(feature = "const_float_bits_conv", issue = "72447")]
|
||||
#[rustc_const_unstable(feature = "f128_const", issue = "116909")]
|
||||
pub const fn from_ne_bytes(bytes: [u8; 16]) -> Self {
|
||||
Self::from_bits(u128::from_ne_bytes(bytes))
|
||||
}
|
||||
|
|
|
@ -925,7 +925,7 @@ impl f16 {
|
|||
/// ```
|
||||
#[inline]
|
||||
#[unstable(feature = "f16", issue = "116909")]
|
||||
#[rustc_const_unstable(feature = "const_float_bits_conv", issue = "72447")]
|
||||
#[rustc_const_unstable(feature = "f16_const", issue = "116909")]
|
||||
#[must_use = "this returns the result of the operation, without modifying the original"]
|
||||
pub const fn to_bits(self) -> u16 {
|
||||
// SAFETY: `u16` is a plain old datatype so we can always transmute to it.
|
||||
|
@ -973,7 +973,7 @@ impl f16 {
|
|||
#[inline]
|
||||
#[must_use]
|
||||
#[unstable(feature = "f16", issue = "116909")]
|
||||
#[rustc_const_unstable(feature = "const_float_bits_conv", issue = "72447")]
|
||||
#[rustc_const_unstable(feature = "f16_const", issue = "116909")]
|
||||
pub const fn from_bits(v: u16) -> Self {
|
||||
// It turns out the safety issues with sNaN were overblown! Hooray!
|
||||
// SAFETY: `u16` is a plain old datatype so we can always transmute from it.
|
||||
|
@ -999,7 +999,7 @@ impl f16 {
|
|||
/// ```
|
||||
#[inline]
|
||||
#[unstable(feature = "f16", issue = "116909")]
|
||||
#[rustc_const_unstable(feature = "const_float_bits_conv", issue = "72447")]
|
||||
#[rustc_const_unstable(feature = "f16_const", issue = "116909")]
|
||||
#[must_use = "this returns the result of the operation, without modifying the original"]
|
||||
pub const fn to_be_bytes(self) -> [u8; 2] {
|
||||
self.to_bits().to_be_bytes()
|
||||
|
@ -1024,7 +1024,7 @@ impl f16 {
|
|||
/// ```
|
||||
#[inline]
|
||||
#[unstable(feature = "f16", issue = "116909")]
|
||||
#[rustc_const_unstable(feature = "const_float_bits_conv", issue = "72447")]
|
||||
#[rustc_const_unstable(feature = "f16_const", issue = "116909")]
|
||||
#[must_use = "this returns the result of the operation, without modifying the original"]
|
||||
pub const fn to_le_bytes(self) -> [u8; 2] {
|
||||
self.to_bits().to_le_bytes()
|
||||
|
@ -1062,7 +1062,7 @@ impl f16 {
|
|||
/// ```
|
||||
#[inline]
|
||||
#[unstable(feature = "f16", issue = "116909")]
|
||||
#[rustc_const_unstable(feature = "const_float_bits_conv", issue = "72447")]
|
||||
#[rustc_const_unstable(feature = "f16_const", issue = "116909")]
|
||||
#[must_use = "this returns the result of the operation, without modifying the original"]
|
||||
pub const fn to_ne_bytes(self) -> [u8; 2] {
|
||||
self.to_bits().to_ne_bytes()
|
||||
|
@ -1086,7 +1086,7 @@ impl f16 {
|
|||
#[inline]
|
||||
#[must_use]
|
||||
#[unstable(feature = "f16", issue = "116909")]
|
||||
#[rustc_const_unstable(feature = "const_float_bits_conv", issue = "72447")]
|
||||
#[rustc_const_unstable(feature = "f16_const", issue = "116909")]
|
||||
pub const fn from_be_bytes(bytes: [u8; 2]) -> Self {
|
||||
Self::from_bits(u16::from_be_bytes(bytes))
|
||||
}
|
||||
|
@ -1109,7 +1109,7 @@ impl f16 {
|
|||
#[inline]
|
||||
#[must_use]
|
||||
#[unstable(feature = "f16", issue = "116909")]
|
||||
#[rustc_const_unstable(feature = "const_float_bits_conv", issue = "72447")]
|
||||
#[rustc_const_unstable(feature = "f16_const", issue = "116909")]
|
||||
pub const fn from_le_bytes(bytes: [u8; 2]) -> Self {
|
||||
Self::from_bits(u16::from_le_bytes(bytes))
|
||||
}
|
||||
|
@ -1143,7 +1143,7 @@ impl f16 {
|
|||
#[inline]
|
||||
#[must_use]
|
||||
#[unstable(feature = "f16", issue = "116909")]
|
||||
#[rustc_const_unstable(feature = "const_float_bits_conv", issue = "72447")]
|
||||
#[rustc_const_unstable(feature = "f16_const", issue = "116909")]
|
||||
pub const fn from_ne_bytes(bytes: [u8; 2]) -> Self {
|
||||
Self::from_bits(u16::from_ne_bytes(bytes))
|
||||
}
|
||||
|
|
|
@ -1115,7 +1115,7 @@ impl f32 {
|
|||
#[must_use = "this returns the result of the operation, \
|
||||
without modifying the original"]
|
||||
#[stable(feature = "float_bits_conv", since = "1.20.0")]
|
||||
#[rustc_const_unstable(feature = "const_float_bits_conv", issue = "72447")]
|
||||
#[rustc_const_stable(feature = "const_float_bits_conv", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[inline]
|
||||
pub const fn to_bits(self) -> u32 {
|
||||
// SAFETY: `u32` is a plain old datatype so we can always transmute to it.
|
||||
|
@ -1159,7 +1159,7 @@ impl f32 {
|
|||
/// assert_eq!(v, 12.5);
|
||||
/// ```
|
||||
#[stable(feature = "float_bits_conv", since = "1.20.0")]
|
||||
#[rustc_const_unstable(feature = "const_float_bits_conv", issue = "72447")]
|
||||
#[rustc_const_stable(feature = "const_float_bits_conv", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[must_use]
|
||||
#[inline]
|
||||
pub const fn from_bits(v: u32) -> Self {
|
||||
|
@ -1183,7 +1183,7 @@ impl f32 {
|
|||
#[must_use = "this returns the result of the operation, \
|
||||
without modifying the original"]
|
||||
#[stable(feature = "float_to_from_bytes", since = "1.40.0")]
|
||||
#[rustc_const_unstable(feature = "const_float_bits_conv", issue = "72447")]
|
||||
#[rustc_const_stable(feature = "const_float_bits_conv", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[inline]
|
||||
pub const fn to_be_bytes(self) -> [u8; 4] {
|
||||
self.to_bits().to_be_bytes()
|
||||
|
@ -1204,7 +1204,7 @@ impl f32 {
|
|||
#[must_use = "this returns the result of the operation, \
|
||||
without modifying the original"]
|
||||
#[stable(feature = "float_to_from_bytes", since = "1.40.0")]
|
||||
#[rustc_const_unstable(feature = "const_float_bits_conv", issue = "72447")]
|
||||
#[rustc_const_stable(feature = "const_float_bits_conv", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[inline]
|
||||
pub const fn to_le_bytes(self) -> [u8; 4] {
|
||||
self.to_bits().to_le_bytes()
|
||||
|
@ -1238,7 +1238,7 @@ impl f32 {
|
|||
#[must_use = "this returns the result of the operation, \
|
||||
without modifying the original"]
|
||||
#[stable(feature = "float_to_from_bytes", since = "1.40.0")]
|
||||
#[rustc_const_unstable(feature = "const_float_bits_conv", issue = "72447")]
|
||||
#[rustc_const_stable(feature = "const_float_bits_conv", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[inline]
|
||||
pub const fn to_ne_bytes(self) -> [u8; 4] {
|
||||
self.to_bits().to_ne_bytes()
|
||||
|
@ -1256,7 +1256,7 @@ impl f32 {
|
|||
/// assert_eq!(value, 12.5);
|
||||
/// ```
|
||||
#[stable(feature = "float_to_from_bytes", since = "1.40.0")]
|
||||
#[rustc_const_unstable(feature = "const_float_bits_conv", issue = "72447")]
|
||||
#[rustc_const_stable(feature = "const_float_bits_conv", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[must_use]
|
||||
#[inline]
|
||||
pub const fn from_be_bytes(bytes: [u8; 4]) -> Self {
|
||||
|
@ -1275,7 +1275,7 @@ impl f32 {
|
|||
/// assert_eq!(value, 12.5);
|
||||
/// ```
|
||||
#[stable(feature = "float_to_from_bytes", since = "1.40.0")]
|
||||
#[rustc_const_unstable(feature = "const_float_bits_conv", issue = "72447")]
|
||||
#[rustc_const_stable(feature = "const_float_bits_conv", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[must_use]
|
||||
#[inline]
|
||||
pub const fn from_le_bytes(bytes: [u8; 4]) -> Self {
|
||||
|
@ -1305,7 +1305,7 @@ impl f32 {
|
|||
/// assert_eq!(value, 12.5);
|
||||
/// ```
|
||||
#[stable(feature = "float_to_from_bytes", since = "1.40.0")]
|
||||
#[rustc_const_unstable(feature = "const_float_bits_conv", issue = "72447")]
|
||||
#[rustc_const_stable(feature = "const_float_bits_conv", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[must_use]
|
||||
#[inline]
|
||||
pub const fn from_ne_bytes(bytes: [u8; 4]) -> Self {
|
||||
|
|
|
@ -1111,7 +1111,7 @@ impl f64 {
|
|||
#[must_use = "this returns the result of the operation, \
|
||||
without modifying the original"]
|
||||
#[stable(feature = "float_bits_conv", since = "1.20.0")]
|
||||
#[rustc_const_unstable(feature = "const_float_bits_conv", issue = "72447")]
|
||||
#[rustc_const_stable(feature = "const_float_bits_conv", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[inline]
|
||||
pub const fn to_bits(self) -> u64 {
|
||||
// SAFETY: `u64` is a plain old datatype so we can always transmute to it.
|
||||
|
@ -1155,7 +1155,7 @@ impl f64 {
|
|||
/// assert_eq!(v, 12.5);
|
||||
/// ```
|
||||
#[stable(feature = "float_bits_conv", since = "1.20.0")]
|
||||
#[rustc_const_unstable(feature = "const_float_bits_conv", issue = "72447")]
|
||||
#[rustc_const_stable(feature = "const_float_bits_conv", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[must_use]
|
||||
#[inline]
|
||||
pub const fn from_bits(v: u64) -> Self {
|
||||
|
@ -1179,7 +1179,7 @@ impl f64 {
|
|||
#[must_use = "this returns the result of the operation, \
|
||||
without modifying the original"]
|
||||
#[stable(feature = "float_to_from_bytes", since = "1.40.0")]
|
||||
#[rustc_const_unstable(feature = "const_float_bits_conv", issue = "72447")]
|
||||
#[rustc_const_stable(feature = "const_float_bits_conv", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[inline]
|
||||
pub const fn to_be_bytes(self) -> [u8; 8] {
|
||||
self.to_bits().to_be_bytes()
|
||||
|
@ -1200,7 +1200,7 @@ impl f64 {
|
|||
#[must_use = "this returns the result of the operation, \
|
||||
without modifying the original"]
|
||||
#[stable(feature = "float_to_from_bytes", since = "1.40.0")]
|
||||
#[rustc_const_unstable(feature = "const_float_bits_conv", issue = "72447")]
|
||||
#[rustc_const_stable(feature = "const_float_bits_conv", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[inline]
|
||||
pub const fn to_le_bytes(self) -> [u8; 8] {
|
||||
self.to_bits().to_le_bytes()
|
||||
|
@ -1234,7 +1234,7 @@ impl f64 {
|
|||
#[must_use = "this returns the result of the operation, \
|
||||
without modifying the original"]
|
||||
#[stable(feature = "float_to_from_bytes", since = "1.40.0")]
|
||||
#[rustc_const_unstable(feature = "const_float_bits_conv", issue = "72447")]
|
||||
#[rustc_const_stable(feature = "const_float_bits_conv", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[inline]
|
||||
pub const fn to_ne_bytes(self) -> [u8; 8] {
|
||||
self.to_bits().to_ne_bytes()
|
||||
|
@ -1252,7 +1252,7 @@ impl f64 {
|
|||
/// assert_eq!(value, 12.5);
|
||||
/// ```
|
||||
#[stable(feature = "float_to_from_bytes", since = "1.40.0")]
|
||||
#[rustc_const_unstable(feature = "const_float_bits_conv", issue = "72447")]
|
||||
#[rustc_const_stable(feature = "const_float_bits_conv", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[must_use]
|
||||
#[inline]
|
||||
pub const fn from_be_bytes(bytes: [u8; 8]) -> Self {
|
||||
|
@ -1271,7 +1271,7 @@ impl f64 {
|
|||
/// assert_eq!(value, 12.5);
|
||||
/// ```
|
||||
#[stable(feature = "float_to_from_bytes", since = "1.40.0")]
|
||||
#[rustc_const_unstable(feature = "const_float_bits_conv", issue = "72447")]
|
||||
#[rustc_const_stable(feature = "const_float_bits_conv", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[must_use]
|
||||
#[inline]
|
||||
pub const fn from_le_bytes(bytes: [u8; 8]) -> Self {
|
||||
|
@ -1301,7 +1301,7 @@ impl f64 {
|
|||
/// assert_eq!(value, 12.5);
|
||||
/// ```
|
||||
#[stable(feature = "float_to_from_bytes", since = "1.40.0")]
|
||||
#[rustc_const_unstable(feature = "const_float_bits_conv", issue = "72447")]
|
||||
#[rustc_const_stable(feature = "const_float_bits_conv", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[must_use]
|
||||
#[inline]
|
||||
pub const fn from_ne_bytes(bytes: [u8; 8]) -> Self {
|
||||
|
|
|
@ -338,9 +338,10 @@ impl str {
|
|||
/// assert_eq!("🍔∈🌏", s);
|
||||
/// ```
|
||||
#[stable(feature = "str_mut_extras", since = "1.20.0")]
|
||||
#[rustc_const_unstable(feature = "const_str_as_mut", issue = "130086")]
|
||||
#[must_use]
|
||||
#[inline(always)]
|
||||
pub unsafe fn as_bytes_mut(&mut self) -> &mut [u8] {
|
||||
pub const unsafe fn as_bytes_mut(&mut self) -> &mut [u8] {
|
||||
// SAFETY: the cast from `&str` to `&[u8]` is safe since `str`
|
||||
// has the same layout as `&[u8]` (only std can make this guarantee).
|
||||
// The pointer dereference is safe since it comes from a mutable reference which
|
||||
|
@ -383,10 +384,11 @@ impl str {
|
|||
/// It is your responsibility to make sure that the string slice only gets
|
||||
/// modified in a way that it remains valid UTF-8.
|
||||
#[stable(feature = "str_as_mut_ptr", since = "1.36.0")]
|
||||
#[rustc_const_unstable(feature = "const_str_as_mut", issue = "130086")]
|
||||
#[rustc_never_returns_null_ptr]
|
||||
#[must_use]
|
||||
#[inline(always)]
|
||||
pub fn as_mut_ptr(&mut self) -> *mut u8 {
|
||||
pub const fn as_mut_ptr(&mut self) -> *mut u8 {
|
||||
self as *mut str as *mut u8
|
||||
}
|
||||
|
||||
|
|
|
@ -38,4 +38,5 @@ pub macro link {
|
|||
#[link(name = "ntdll")]
|
||||
#[link(name = "userenv")]
|
||||
#[link(name = "ws2_32")]
|
||||
#[link(name = "dbghelp")] // required for backtrace-rs symbolization
|
||||
extern "C" {}
|
||||
|
|
|
@ -106,22 +106,29 @@ def _download(path, url, probably_big, verbose, exception):
|
|||
|
||||
try:
|
||||
if (probably_big or verbose) and "GITHUB_ACTIONS" not in os.environ:
|
||||
option = "-#"
|
||||
option = "--progress-bar"
|
||||
else:
|
||||
option = "-s"
|
||||
option = "--silent"
|
||||
# If curl is not present on Win32, we should not sys.exit
|
||||
# but raise `CalledProcessError` or `OSError` instead
|
||||
require(["curl", "--version"], exception=platform_is_win32())
|
||||
extra_flags = []
|
||||
if curl_version() > (7, 70):
|
||||
extra_flags = [ "--retry-all-errors" ]
|
||||
# options should be kept in sync with
|
||||
# src/bootstrap/src/core/download.rs
|
||||
# for consistency.
|
||||
# they are also more compreprensivly explained in that file.
|
||||
run(["curl", option] + extra_flags + [
|
||||
"-L", # Follow redirect.
|
||||
"-y", "30", "-Y", "10", # timeout if speed is < 10 bytes/sec for > 30 seconds
|
||||
"--connect-timeout", "30", # timeout if cannot connect within 30 seconds
|
||||
"-o", path,
|
||||
# Follow redirect.
|
||||
"--location",
|
||||
# timeout if speed is < 10 bytes/sec for > 30 seconds
|
||||
"--speed-time", "30", "--speed-limit", "10",
|
||||
# timeout if cannot connect within 30 seconds
|
||||
"--connect-timeout", "30",
|
||||
"--output", path,
|
||||
"--continue-at", "-",
|
||||
"--retry", "3", "-SRf", url],
|
||||
"--retry", "3", "--show-error", "--remote-time", "--fail", url],
|
||||
verbose=verbose,
|
||||
exception=True, # Will raise RuntimeError on failure
|
||||
)
|
||||
|
|
|
@ -143,9 +143,6 @@ pub struct Flags {
|
|||
/// Unless you know exactly what you are doing, you probably don't need this.
|
||||
pub bypass_bootstrap_lock: bool,
|
||||
|
||||
/// whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml
|
||||
#[arg(global = true, long, value_name = "VALUE")]
|
||||
pub llvm_skip_rebuild: Option<bool>,
|
||||
/// generate PGO profile with rustc build
|
||||
#[arg(global = true, value_hint = clap::ValueHint::FilePath, long, value_name = "PROFILE")]
|
||||
pub rust_profile_generate: Option<String>,
|
||||
|
|
|
@ -228,25 +228,42 @@ impl Config {
|
|||
fn download_http_with_retries(&self, tempfile: &Path, url: &str, help_on_error: &str) {
|
||||
println!("downloading {url}");
|
||||
// Try curl. If that fails and we are on windows, fallback to PowerShell.
|
||||
// options should be kept in sync with
|
||||
// src/bootstrap/src/core/download.rs
|
||||
// for consistency
|
||||
let mut curl = command("curl");
|
||||
curl.args([
|
||||
"-y",
|
||||
// follow redirect
|
||||
"--location",
|
||||
// timeout if speed is < 10 bytes/sec for > 30 seconds
|
||||
"--speed-time",
|
||||
"30",
|
||||
"-Y",
|
||||
"10", // timeout if speed is < 10 bytes/sec for > 30 seconds
|
||||
"--speed-limit",
|
||||
"10",
|
||||
// timeout if cannot connect within 30 seconds
|
||||
"--connect-timeout",
|
||||
"30", // timeout if cannot connect within 30 seconds
|
||||
"-o",
|
||||
"30",
|
||||
// output file
|
||||
"--output",
|
||||
tempfile.to_str().unwrap(),
|
||||
// if there is an error, don't restart the download,
|
||||
// instead continue where it left off.
|
||||
"--continue-at",
|
||||
"-",
|
||||
// retry up to 3 times. note that this means a maximum of 4
|
||||
// attempts will be made, since the first attempt isn't a *re*try.
|
||||
"--retry",
|
||||
"3",
|
||||
"-SRf",
|
||||
// show errors, even if --silent is specified
|
||||
"--show-error",
|
||||
// set timestamp of downloaded file to that of the server
|
||||
"--remote-time",
|
||||
// fail on non-ok http status
|
||||
"--fail",
|
||||
]);
|
||||
// Don't print progress in CI; the \r wrapping looks bad and downloads don't take long enough for progress to be useful.
|
||||
if CiEnv::is_ci() {
|
||||
curl.arg("-s");
|
||||
curl.arg("--silent");
|
||||
} else {
|
||||
curl.arg("--progress-bar");
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Print an optspec for argparse to handle cmd's options that are independent of any subcommand.
|
||||
function __fish_x.py_global_optspecs
|
||||
string join \n v/verbose i/incremental config= build-dir= build= host= target= exclude= skip= include-default-paths rustc-error-format= on-fail= dry-run dump-bootstrap-shims stage= keep-stage= keep-stage-std= src= j/jobs= warnings= error-format= json-output color= bypass-bootstrap-lock llvm-skip-rebuild= rust-profile-generate= rust-profile-use= llvm-profile-use= llvm-profile-generate enable-bolt-settings skip-stage0-validation reproducible-artifact= set= h/help
|
||||
string join \n v/verbose i/incremental config= build-dir= build= host= target= exclude= skip= include-default-paths rustc-error-format= on-fail= dry-run dump-bootstrap-shims stage= keep-stage= keep-stage-std= src= j/jobs= warnings= error-format= json-output color= bypass-bootstrap-lock rust-profile-generate= rust-profile-use= llvm-profile-use= llvm-profile-generate enable-bolt-settings skip-stage0-validation reproducible-artifact= set= h/help
|
||||
end
|
||||
|
||||
function __fish_x.py_needs_command
|
||||
|
@ -41,7 +41,6 @@ complete -c x.py -n "__fish_x.py_needs_command" -s j -l jobs -d 'number of jobs
|
|||
complete -c x.py -n "__fish_x.py_needs_command" -l warnings -d 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour' -r -f -a "{deny\t'',warn\t'',default\t''}"
|
||||
complete -c x.py -n "__fish_x.py_needs_command" -l error-format -d 'rustc error format' -r -f
|
||||
complete -c x.py -n "__fish_x.py_needs_command" -l color -d 'whether to use color in cargo and rustc output' -r -f -a "{always\t'',never\t'',auto\t''}"
|
||||
complete -c x.py -n "__fish_x.py_needs_command" -l llvm-skip-rebuild -d 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml' -r -f -a "{true\t'',false\t''}"
|
||||
complete -c x.py -n "__fish_x.py_needs_command" -l rust-profile-generate -d 'generate PGO profile with rustc build' -r -F
|
||||
complete -c x.py -n "__fish_x.py_needs_command" -l rust-profile-use -d 'use PGO profile for rustc build' -r -F
|
||||
complete -c x.py -n "__fish_x.py_needs_command" -l llvm-profile-use -d 'use PGO profile for LLVM build' -r -F
|
||||
|
@ -92,7 +91,6 @@ complete -c x.py -n "__fish_x.py_using_subcommand build" -s j -l jobs -d 'number
|
|||
complete -c x.py -n "__fish_x.py_using_subcommand build" -l warnings -d 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour' -r -f -a "{deny\t'',warn\t'',default\t''}"
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand build" -l error-format -d 'rustc error format' -r -f
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand build" -l color -d 'whether to use color in cargo and rustc output' -r -f -a "{always\t'',never\t'',auto\t''}"
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand build" -l llvm-skip-rebuild -d 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml' -r -f -a "{true\t'',false\t''}"
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand build" -l rust-profile-generate -d 'generate PGO profile with rustc build' -r -F
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand build" -l rust-profile-use -d 'use PGO profile for rustc build' -r -F
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand build" -l llvm-profile-use -d 'use PGO profile for LLVM build' -r -F
|
||||
|
@ -126,7 +124,6 @@ complete -c x.py -n "__fish_x.py_using_subcommand check" -s j -l jobs -d 'number
|
|||
complete -c x.py -n "__fish_x.py_using_subcommand check" -l warnings -d 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour' -r -f -a "{deny\t'',warn\t'',default\t''}"
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand check" -l error-format -d 'rustc error format' -r -f
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand check" -l color -d 'whether to use color in cargo and rustc output' -r -f -a "{always\t'',never\t'',auto\t''}"
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand check" -l llvm-skip-rebuild -d 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml' -r -f -a "{true\t'',false\t''}"
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand check" -l rust-profile-generate -d 'generate PGO profile with rustc build' -r -F
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand check" -l rust-profile-use -d 'use PGO profile for rustc build' -r -F
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand check" -l llvm-profile-use -d 'use PGO profile for LLVM build' -r -F
|
||||
|
@ -165,7 +162,6 @@ complete -c x.py -n "__fish_x.py_using_subcommand clippy" -s j -l jobs -d 'numbe
|
|||
complete -c x.py -n "__fish_x.py_using_subcommand clippy" -l warnings -d 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour' -r -f -a "{deny\t'',warn\t'',default\t''}"
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand clippy" -l error-format -d 'rustc error format' -r -f
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand clippy" -l color -d 'whether to use color in cargo and rustc output' -r -f -a "{always\t'',never\t'',auto\t''}"
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand clippy" -l llvm-skip-rebuild -d 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml' -r -f -a "{true\t'',false\t''}"
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand clippy" -l rust-profile-generate -d 'generate PGO profile with rustc build' -r -F
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand clippy" -l rust-profile-use -d 'use PGO profile for rustc build' -r -F
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand clippy" -l llvm-profile-use -d 'use PGO profile for LLVM build' -r -F
|
||||
|
@ -202,7 +198,6 @@ complete -c x.py -n "__fish_x.py_using_subcommand fix" -s j -l jobs -d 'number o
|
|||
complete -c x.py -n "__fish_x.py_using_subcommand fix" -l warnings -d 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour' -r -f -a "{deny\t'',warn\t'',default\t''}"
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand fix" -l error-format -d 'rustc error format' -r -f
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand fix" -l color -d 'whether to use color in cargo and rustc output' -r -f -a "{always\t'',never\t'',auto\t''}"
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand fix" -l llvm-skip-rebuild -d 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml' -r -f -a "{true\t'',false\t''}"
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand fix" -l rust-profile-generate -d 'generate PGO profile with rustc build' -r -F
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand fix" -l rust-profile-use -d 'use PGO profile for rustc build' -r -F
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand fix" -l llvm-profile-use -d 'use PGO profile for LLVM build' -r -F
|
||||
|
@ -236,7 +231,6 @@ complete -c x.py -n "__fish_x.py_using_subcommand fmt" -s j -l jobs -d 'number o
|
|||
complete -c x.py -n "__fish_x.py_using_subcommand fmt" -l warnings -d 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour' -r -f -a "{deny\t'',warn\t'',default\t''}"
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand fmt" -l error-format -d 'rustc error format' -r -f
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand fmt" -l color -d 'whether to use color in cargo and rustc output' -r -f -a "{always\t'',never\t'',auto\t''}"
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand fmt" -l llvm-skip-rebuild -d 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml' -r -f -a "{true\t'',false\t''}"
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand fmt" -l rust-profile-generate -d 'generate PGO profile with rustc build' -r -F
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand fmt" -l rust-profile-use -d 'use PGO profile for rustc build' -r -F
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand fmt" -l llvm-profile-use -d 'use PGO profile for LLVM build' -r -F
|
||||
|
@ -272,7 +266,6 @@ complete -c x.py -n "__fish_x.py_using_subcommand doc" -s j -l jobs -d 'number o
|
|||
complete -c x.py -n "__fish_x.py_using_subcommand doc" -l warnings -d 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour' -r -f -a "{deny\t'',warn\t'',default\t''}"
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand doc" -l error-format -d 'rustc error format' -r -f
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand doc" -l color -d 'whether to use color in cargo and rustc output' -r -f -a "{always\t'',never\t'',auto\t''}"
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand doc" -l llvm-skip-rebuild -d 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml' -r -f -a "{true\t'',false\t''}"
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand doc" -l rust-profile-generate -d 'generate PGO profile with rustc build' -r -F
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand doc" -l rust-profile-use -d 'use PGO profile for rustc build' -r -F
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand doc" -l llvm-profile-use -d 'use PGO profile for LLVM build' -r -F
|
||||
|
@ -314,7 +307,6 @@ complete -c x.py -n "__fish_x.py_using_subcommand test" -s j -l jobs -d 'number
|
|||
complete -c x.py -n "__fish_x.py_using_subcommand test" -l warnings -d 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour' -r -f -a "{deny\t'',warn\t'',default\t''}"
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand test" -l error-format -d 'rustc error format' -r -f
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand test" -l color -d 'whether to use color in cargo and rustc output' -r -f -a "{always\t'',never\t'',auto\t''}"
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand test" -l llvm-skip-rebuild -d 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml' -r -f -a "{true\t'',false\t''}"
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand test" -l rust-profile-generate -d 'generate PGO profile with rustc build' -r -F
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand test" -l rust-profile-use -d 'use PGO profile for rustc build' -r -F
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand test" -l llvm-profile-use -d 'use PGO profile for LLVM build' -r -F
|
||||
|
@ -356,7 +348,6 @@ complete -c x.py -n "__fish_x.py_using_subcommand miri" -s j -l jobs -d 'number
|
|||
complete -c x.py -n "__fish_x.py_using_subcommand miri" -l warnings -d 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour' -r -f -a "{deny\t'',warn\t'',default\t''}"
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand miri" -l error-format -d 'rustc error format' -r -f
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand miri" -l color -d 'whether to use color in cargo and rustc output' -r -f -a "{always\t'',never\t'',auto\t''}"
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand miri" -l llvm-skip-rebuild -d 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml' -r -f -a "{true\t'',false\t''}"
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand miri" -l rust-profile-generate -d 'generate PGO profile with rustc build' -r -F
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand miri" -l rust-profile-use -d 'use PGO profile for rustc build' -r -F
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand miri" -l llvm-profile-use -d 'use PGO profile for LLVM build' -r -F
|
||||
|
@ -394,7 +385,6 @@ complete -c x.py -n "__fish_x.py_using_subcommand bench" -s j -l jobs -d 'number
|
|||
complete -c x.py -n "__fish_x.py_using_subcommand bench" -l warnings -d 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour' -r -f -a "{deny\t'',warn\t'',default\t''}"
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand bench" -l error-format -d 'rustc error format' -r -f
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand bench" -l color -d 'whether to use color in cargo and rustc output' -r -f -a "{always\t'',never\t'',auto\t''}"
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand bench" -l llvm-skip-rebuild -d 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml' -r -f -a "{true\t'',false\t''}"
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand bench" -l rust-profile-generate -d 'generate PGO profile with rustc build' -r -F
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand bench" -l rust-profile-use -d 'use PGO profile for rustc build' -r -F
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand bench" -l llvm-profile-use -d 'use PGO profile for LLVM build' -r -F
|
||||
|
@ -428,7 +418,6 @@ complete -c x.py -n "__fish_x.py_using_subcommand clean" -s j -l jobs -d 'number
|
|||
complete -c x.py -n "__fish_x.py_using_subcommand clean" -l warnings -d 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour' -r -f -a "{deny\t'',warn\t'',default\t''}"
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand clean" -l error-format -d 'rustc error format' -r -f
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand clean" -l color -d 'whether to use color in cargo and rustc output' -r -f -a "{always\t'',never\t'',auto\t''}"
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand clean" -l llvm-skip-rebuild -d 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml' -r -f -a "{true\t'',false\t''}"
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand clean" -l rust-profile-generate -d 'generate PGO profile with rustc build' -r -F
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand clean" -l rust-profile-use -d 'use PGO profile for rustc build' -r -F
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand clean" -l llvm-profile-use -d 'use PGO profile for LLVM build' -r -F
|
||||
|
@ -463,7 +452,6 @@ complete -c x.py -n "__fish_x.py_using_subcommand dist" -s j -l jobs -d 'number
|
|||
complete -c x.py -n "__fish_x.py_using_subcommand dist" -l warnings -d 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour' -r -f -a "{deny\t'',warn\t'',default\t''}"
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand dist" -l error-format -d 'rustc error format' -r -f
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand dist" -l color -d 'whether to use color in cargo and rustc output' -r -f -a "{always\t'',never\t'',auto\t''}"
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand dist" -l llvm-skip-rebuild -d 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml' -r -f -a "{true\t'',false\t''}"
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand dist" -l rust-profile-generate -d 'generate PGO profile with rustc build' -r -F
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand dist" -l rust-profile-use -d 'use PGO profile for rustc build' -r -F
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand dist" -l llvm-profile-use -d 'use PGO profile for LLVM build' -r -F
|
||||
|
@ -497,7 +485,6 @@ complete -c x.py -n "__fish_x.py_using_subcommand install" -s j -l jobs -d 'numb
|
|||
complete -c x.py -n "__fish_x.py_using_subcommand install" -l warnings -d 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour' -r -f -a "{deny\t'',warn\t'',default\t''}"
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand install" -l error-format -d 'rustc error format' -r -f
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand install" -l color -d 'whether to use color in cargo and rustc output' -r -f -a "{always\t'',never\t'',auto\t''}"
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand install" -l llvm-skip-rebuild -d 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml' -r -f -a "{true\t'',false\t''}"
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand install" -l rust-profile-generate -d 'generate PGO profile with rustc build' -r -F
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand install" -l rust-profile-use -d 'use PGO profile for rustc build' -r -F
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand install" -l llvm-profile-use -d 'use PGO profile for LLVM build' -r -F
|
||||
|
@ -532,7 +519,6 @@ complete -c x.py -n "__fish_x.py_using_subcommand run" -s j -l jobs -d 'number o
|
|||
complete -c x.py -n "__fish_x.py_using_subcommand run" -l warnings -d 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour' -r -f -a "{deny\t'',warn\t'',default\t''}"
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand run" -l error-format -d 'rustc error format' -r -f
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand run" -l color -d 'whether to use color in cargo and rustc output' -r -f -a "{always\t'',never\t'',auto\t''}"
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand run" -l llvm-skip-rebuild -d 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml' -r -f -a "{true\t'',false\t''}"
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand run" -l rust-profile-generate -d 'generate PGO profile with rustc build' -r -F
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand run" -l rust-profile-use -d 'use PGO profile for rustc build' -r -F
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand run" -l llvm-profile-use -d 'use PGO profile for LLVM build' -r -F
|
||||
|
@ -566,7 +552,6 @@ complete -c x.py -n "__fish_x.py_using_subcommand setup" -s j -l jobs -d 'number
|
|||
complete -c x.py -n "__fish_x.py_using_subcommand setup" -l warnings -d 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour' -r -f -a "{deny\t'',warn\t'',default\t''}"
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand setup" -l error-format -d 'rustc error format' -r -f
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand setup" -l color -d 'whether to use color in cargo and rustc output' -r -f -a "{always\t'',never\t'',auto\t''}"
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand setup" -l llvm-skip-rebuild -d 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml' -r -f -a "{true\t'',false\t''}"
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand setup" -l rust-profile-generate -d 'generate PGO profile with rustc build' -r -F
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand setup" -l rust-profile-use -d 'use PGO profile for rustc build' -r -F
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand setup" -l llvm-profile-use -d 'use PGO profile for LLVM build' -r -F
|
||||
|
@ -600,7 +585,6 @@ complete -c x.py -n "__fish_x.py_using_subcommand suggest" -s j -l jobs -d 'numb
|
|||
complete -c x.py -n "__fish_x.py_using_subcommand suggest" -l warnings -d 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour' -r -f -a "{deny\t'',warn\t'',default\t''}"
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand suggest" -l error-format -d 'rustc error format' -r -f
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand suggest" -l color -d 'whether to use color in cargo and rustc output' -r -f -a "{always\t'',never\t'',auto\t''}"
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand suggest" -l llvm-skip-rebuild -d 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml' -r -f -a "{true\t'',false\t''}"
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand suggest" -l rust-profile-generate -d 'generate PGO profile with rustc build' -r -F
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand suggest" -l rust-profile-use -d 'use PGO profile for rustc build' -r -F
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand suggest" -l llvm-profile-use -d 'use PGO profile for LLVM build' -r -F
|
||||
|
@ -636,7 +620,6 @@ complete -c x.py -n "__fish_x.py_using_subcommand vendor" -s j -l jobs -d 'numbe
|
|||
complete -c x.py -n "__fish_x.py_using_subcommand vendor" -l warnings -d 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour' -r -f -a "{deny\t'',warn\t'',default\t''}"
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand vendor" -l error-format -d 'rustc error format' -r -f
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand vendor" -l color -d 'whether to use color in cargo and rustc output' -r -f -a "{always\t'',never\t'',auto\t''}"
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand vendor" -l llvm-skip-rebuild -d 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml' -r -f -a "{true\t'',false\t''}"
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand vendor" -l rust-profile-generate -d 'generate PGO profile with rustc build' -r -F
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand vendor" -l rust-profile-use -d 'use PGO profile for rustc build' -r -F
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand vendor" -l llvm-profile-use -d 'use PGO profile for LLVM build' -r -F
|
||||
|
@ -671,7 +654,6 @@ complete -c x.py -n "__fish_x.py_using_subcommand perf" -s j -l jobs -d 'number
|
|||
complete -c x.py -n "__fish_x.py_using_subcommand perf" -l warnings -d 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour' -r -f -a "{deny\t'',warn\t'',default\t''}"
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand perf" -l error-format -d 'rustc error format' -r -f
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand perf" -l color -d 'whether to use color in cargo and rustc output' -r -f -a "{always\t'',never\t'',auto\t''}"
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand perf" -l llvm-skip-rebuild -d 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml' -r -f -a "{true\t'',false\t''}"
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand perf" -l rust-profile-generate -d 'generate PGO profile with rustc build' -r -F
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand perf" -l rust-profile-use -d 'use PGO profile for rustc build' -r -F
|
||||
complete -c x.py -n "__fish_x.py_using_subcommand perf" -l llvm-profile-use -d 'use PGO profile for LLVM build' -r -F
|
||||
|
|
|
@ -39,7 +39,6 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
|
|||
[CompletionResult]::new('--warnings', '--warnings', [CompletionResultType]::ParameterName, 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour')
|
||||
[CompletionResult]::new('--error-format', '--error-format', [CompletionResultType]::ParameterName, 'rustc error format')
|
||||
[CompletionResult]::new('--color', '--color', [CompletionResultType]::ParameterName, 'whether to use color in cargo and rustc output')
|
||||
[CompletionResult]::new('--llvm-skip-rebuild', '--llvm-skip-rebuild', [CompletionResultType]::ParameterName, 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml')
|
||||
[CompletionResult]::new('--rust-profile-generate', '--rust-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with rustc build')
|
||||
[CompletionResult]::new('--rust-profile-use', '--rust-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for rustc build')
|
||||
[CompletionResult]::new('--llvm-profile-use', '--llvm-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for LLVM build')
|
||||
|
@ -97,7 +96,6 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
|
|||
[CompletionResult]::new('--warnings', '--warnings', [CompletionResultType]::ParameterName, 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour')
|
||||
[CompletionResult]::new('--error-format', '--error-format', [CompletionResultType]::ParameterName, 'rustc error format')
|
||||
[CompletionResult]::new('--color', '--color', [CompletionResultType]::ParameterName, 'whether to use color in cargo and rustc output')
|
||||
[CompletionResult]::new('--llvm-skip-rebuild', '--llvm-skip-rebuild', [CompletionResultType]::ParameterName, 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml')
|
||||
[CompletionResult]::new('--rust-profile-generate', '--rust-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with rustc build')
|
||||
[CompletionResult]::new('--rust-profile-use', '--rust-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for rustc build')
|
||||
[CompletionResult]::new('--llvm-profile-use', '--llvm-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for LLVM build')
|
||||
|
@ -138,7 +136,6 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
|
|||
[CompletionResult]::new('--warnings', '--warnings', [CompletionResultType]::ParameterName, 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour')
|
||||
[CompletionResult]::new('--error-format', '--error-format', [CompletionResultType]::ParameterName, 'rustc error format')
|
||||
[CompletionResult]::new('--color', '--color', [CompletionResultType]::ParameterName, 'whether to use color in cargo and rustc output')
|
||||
[CompletionResult]::new('--llvm-skip-rebuild', '--llvm-skip-rebuild', [CompletionResultType]::ParameterName, 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml')
|
||||
[CompletionResult]::new('--rust-profile-generate', '--rust-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with rustc build')
|
||||
[CompletionResult]::new('--rust-profile-use', '--rust-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for rustc build')
|
||||
[CompletionResult]::new('--llvm-profile-use', '--llvm-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for LLVM build')
|
||||
|
@ -184,7 +181,6 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
|
|||
[CompletionResult]::new('--warnings', '--warnings', [CompletionResultType]::ParameterName, 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour')
|
||||
[CompletionResult]::new('--error-format', '--error-format', [CompletionResultType]::ParameterName, 'rustc error format')
|
||||
[CompletionResult]::new('--color', '--color', [CompletionResultType]::ParameterName, 'whether to use color in cargo and rustc output')
|
||||
[CompletionResult]::new('--llvm-skip-rebuild', '--llvm-skip-rebuild', [CompletionResultType]::ParameterName, 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml')
|
||||
[CompletionResult]::new('--rust-profile-generate', '--rust-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with rustc build')
|
||||
[CompletionResult]::new('--rust-profile-use', '--rust-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for rustc build')
|
||||
[CompletionResult]::new('--llvm-profile-use', '--llvm-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for LLVM build')
|
||||
|
@ -228,7 +224,6 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
|
|||
[CompletionResult]::new('--warnings', '--warnings', [CompletionResultType]::ParameterName, 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour')
|
||||
[CompletionResult]::new('--error-format', '--error-format', [CompletionResultType]::ParameterName, 'rustc error format')
|
||||
[CompletionResult]::new('--color', '--color', [CompletionResultType]::ParameterName, 'whether to use color in cargo and rustc output')
|
||||
[CompletionResult]::new('--llvm-skip-rebuild', '--llvm-skip-rebuild', [CompletionResultType]::ParameterName, 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml')
|
||||
[CompletionResult]::new('--rust-profile-generate', '--rust-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with rustc build')
|
||||
[CompletionResult]::new('--rust-profile-use', '--rust-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for rustc build')
|
||||
[CompletionResult]::new('--llvm-profile-use', '--llvm-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for LLVM build')
|
||||
|
@ -269,7 +264,6 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
|
|||
[CompletionResult]::new('--warnings', '--warnings', [CompletionResultType]::ParameterName, 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour')
|
||||
[CompletionResult]::new('--error-format', '--error-format', [CompletionResultType]::ParameterName, 'rustc error format')
|
||||
[CompletionResult]::new('--color', '--color', [CompletionResultType]::ParameterName, 'whether to use color in cargo and rustc output')
|
||||
[CompletionResult]::new('--llvm-skip-rebuild', '--llvm-skip-rebuild', [CompletionResultType]::ParameterName, 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml')
|
||||
[CompletionResult]::new('--rust-profile-generate', '--rust-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with rustc build')
|
||||
[CompletionResult]::new('--rust-profile-use', '--rust-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for rustc build')
|
||||
[CompletionResult]::new('--llvm-profile-use', '--llvm-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for LLVM build')
|
||||
|
@ -312,7 +306,6 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
|
|||
[CompletionResult]::new('--warnings', '--warnings', [CompletionResultType]::ParameterName, 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour')
|
||||
[CompletionResult]::new('--error-format', '--error-format', [CompletionResultType]::ParameterName, 'rustc error format')
|
||||
[CompletionResult]::new('--color', '--color', [CompletionResultType]::ParameterName, 'whether to use color in cargo and rustc output')
|
||||
[CompletionResult]::new('--llvm-skip-rebuild', '--llvm-skip-rebuild', [CompletionResultType]::ParameterName, 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml')
|
||||
[CompletionResult]::new('--rust-profile-generate', '--rust-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with rustc build')
|
||||
[CompletionResult]::new('--rust-profile-use', '--rust-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for rustc build')
|
||||
[CompletionResult]::new('--llvm-profile-use', '--llvm-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for LLVM build')
|
||||
|
@ -361,7 +354,6 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
|
|||
[CompletionResult]::new('--warnings', '--warnings', [CompletionResultType]::ParameterName, 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour')
|
||||
[CompletionResult]::new('--error-format', '--error-format', [CompletionResultType]::ParameterName, 'rustc error format')
|
||||
[CompletionResult]::new('--color', '--color', [CompletionResultType]::ParameterName, 'whether to use color in cargo and rustc output')
|
||||
[CompletionResult]::new('--llvm-skip-rebuild', '--llvm-skip-rebuild', [CompletionResultType]::ParameterName, 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml')
|
||||
[CompletionResult]::new('--rust-profile-generate', '--rust-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with rustc build')
|
||||
[CompletionResult]::new('--rust-profile-use', '--rust-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for rustc build')
|
||||
[CompletionResult]::new('--llvm-profile-use', '--llvm-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for LLVM build')
|
||||
|
@ -410,7 +402,6 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
|
|||
[CompletionResult]::new('--warnings', '--warnings', [CompletionResultType]::ParameterName, 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour')
|
||||
[CompletionResult]::new('--error-format', '--error-format', [CompletionResultType]::ParameterName, 'rustc error format')
|
||||
[CompletionResult]::new('--color', '--color', [CompletionResultType]::ParameterName, 'whether to use color in cargo and rustc output')
|
||||
[CompletionResult]::new('--llvm-skip-rebuild', '--llvm-skip-rebuild', [CompletionResultType]::ParameterName, 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml')
|
||||
[CompletionResult]::new('--rust-profile-generate', '--rust-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with rustc build')
|
||||
[CompletionResult]::new('--rust-profile-use', '--rust-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for rustc build')
|
||||
[CompletionResult]::new('--llvm-profile-use', '--llvm-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for LLVM build')
|
||||
|
@ -455,7 +446,6 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
|
|||
[CompletionResult]::new('--warnings', '--warnings', [CompletionResultType]::ParameterName, 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour')
|
||||
[CompletionResult]::new('--error-format', '--error-format', [CompletionResultType]::ParameterName, 'rustc error format')
|
||||
[CompletionResult]::new('--color', '--color', [CompletionResultType]::ParameterName, 'whether to use color in cargo and rustc output')
|
||||
[CompletionResult]::new('--llvm-skip-rebuild', '--llvm-skip-rebuild', [CompletionResultType]::ParameterName, 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml')
|
||||
[CompletionResult]::new('--rust-profile-generate', '--rust-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with rustc build')
|
||||
[CompletionResult]::new('--rust-profile-use', '--rust-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for rustc build')
|
||||
[CompletionResult]::new('--llvm-profile-use', '--llvm-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for LLVM build')
|
||||
|
@ -496,7 +486,6 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
|
|||
[CompletionResult]::new('--warnings', '--warnings', [CompletionResultType]::ParameterName, 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour')
|
||||
[CompletionResult]::new('--error-format', '--error-format', [CompletionResultType]::ParameterName, 'rustc error format')
|
||||
[CompletionResult]::new('--color', '--color', [CompletionResultType]::ParameterName, 'whether to use color in cargo and rustc output')
|
||||
[CompletionResult]::new('--llvm-skip-rebuild', '--llvm-skip-rebuild', [CompletionResultType]::ParameterName, 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml')
|
||||
[CompletionResult]::new('--rust-profile-generate', '--rust-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with rustc build')
|
||||
[CompletionResult]::new('--rust-profile-use', '--rust-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for rustc build')
|
||||
[CompletionResult]::new('--llvm-profile-use', '--llvm-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for LLVM build')
|
||||
|
@ -538,7 +527,6 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
|
|||
[CompletionResult]::new('--warnings', '--warnings', [CompletionResultType]::ParameterName, 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour')
|
||||
[CompletionResult]::new('--error-format', '--error-format', [CompletionResultType]::ParameterName, 'rustc error format')
|
||||
[CompletionResult]::new('--color', '--color', [CompletionResultType]::ParameterName, 'whether to use color in cargo and rustc output')
|
||||
[CompletionResult]::new('--llvm-skip-rebuild', '--llvm-skip-rebuild', [CompletionResultType]::ParameterName, 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml')
|
||||
[CompletionResult]::new('--rust-profile-generate', '--rust-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with rustc build')
|
||||
[CompletionResult]::new('--rust-profile-use', '--rust-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for rustc build')
|
||||
[CompletionResult]::new('--llvm-profile-use', '--llvm-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for LLVM build')
|
||||
|
@ -579,7 +567,6 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
|
|||
[CompletionResult]::new('--warnings', '--warnings', [CompletionResultType]::ParameterName, 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour')
|
||||
[CompletionResult]::new('--error-format', '--error-format', [CompletionResultType]::ParameterName, 'rustc error format')
|
||||
[CompletionResult]::new('--color', '--color', [CompletionResultType]::ParameterName, 'whether to use color in cargo and rustc output')
|
||||
[CompletionResult]::new('--llvm-skip-rebuild', '--llvm-skip-rebuild', [CompletionResultType]::ParameterName, 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml')
|
||||
[CompletionResult]::new('--rust-profile-generate', '--rust-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with rustc build')
|
||||
[CompletionResult]::new('--rust-profile-use', '--rust-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for rustc build')
|
||||
[CompletionResult]::new('--llvm-profile-use', '--llvm-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for LLVM build')
|
||||
|
@ -621,7 +608,6 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
|
|||
[CompletionResult]::new('--warnings', '--warnings', [CompletionResultType]::ParameterName, 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour')
|
||||
[CompletionResult]::new('--error-format', '--error-format', [CompletionResultType]::ParameterName, 'rustc error format')
|
||||
[CompletionResult]::new('--color', '--color', [CompletionResultType]::ParameterName, 'whether to use color in cargo and rustc output')
|
||||
[CompletionResult]::new('--llvm-skip-rebuild', '--llvm-skip-rebuild', [CompletionResultType]::ParameterName, 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml')
|
||||
[CompletionResult]::new('--rust-profile-generate', '--rust-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with rustc build')
|
||||
[CompletionResult]::new('--rust-profile-use', '--rust-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for rustc build')
|
||||
[CompletionResult]::new('--llvm-profile-use', '--llvm-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for LLVM build')
|
||||
|
@ -662,7 +648,6 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
|
|||
[CompletionResult]::new('--warnings', '--warnings', [CompletionResultType]::ParameterName, 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour')
|
||||
[CompletionResult]::new('--error-format', '--error-format', [CompletionResultType]::ParameterName, 'rustc error format')
|
||||
[CompletionResult]::new('--color', '--color', [CompletionResultType]::ParameterName, 'whether to use color in cargo and rustc output')
|
||||
[CompletionResult]::new('--llvm-skip-rebuild', '--llvm-skip-rebuild', [CompletionResultType]::ParameterName, 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml')
|
||||
[CompletionResult]::new('--rust-profile-generate', '--rust-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with rustc build')
|
||||
[CompletionResult]::new('--rust-profile-use', '--rust-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for rustc build')
|
||||
[CompletionResult]::new('--llvm-profile-use', '--llvm-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for LLVM build')
|
||||
|
@ -703,7 +688,6 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
|
|||
[CompletionResult]::new('--warnings', '--warnings', [CompletionResultType]::ParameterName, 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour')
|
||||
[CompletionResult]::new('--error-format', '--error-format', [CompletionResultType]::ParameterName, 'rustc error format')
|
||||
[CompletionResult]::new('--color', '--color', [CompletionResultType]::ParameterName, 'whether to use color in cargo and rustc output')
|
||||
[CompletionResult]::new('--llvm-skip-rebuild', '--llvm-skip-rebuild', [CompletionResultType]::ParameterName, 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml')
|
||||
[CompletionResult]::new('--rust-profile-generate', '--rust-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with rustc build')
|
||||
[CompletionResult]::new('--rust-profile-use', '--rust-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for rustc build')
|
||||
[CompletionResult]::new('--llvm-profile-use', '--llvm-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for LLVM build')
|
||||
|
@ -746,7 +730,6 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
|
|||
[CompletionResult]::new('--warnings', '--warnings', [CompletionResultType]::ParameterName, 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour')
|
||||
[CompletionResult]::new('--error-format', '--error-format', [CompletionResultType]::ParameterName, 'rustc error format')
|
||||
[CompletionResult]::new('--color', '--color', [CompletionResultType]::ParameterName, 'whether to use color in cargo and rustc output')
|
||||
[CompletionResult]::new('--llvm-skip-rebuild', '--llvm-skip-rebuild', [CompletionResultType]::ParameterName, 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml')
|
||||
[CompletionResult]::new('--rust-profile-generate', '--rust-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with rustc build')
|
||||
[CompletionResult]::new('--rust-profile-use', '--rust-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for rustc build')
|
||||
[CompletionResult]::new('--llvm-profile-use', '--llvm-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for LLVM build')
|
||||
|
@ -788,7 +771,6 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
|
|||
[CompletionResult]::new('--warnings', '--warnings', [CompletionResultType]::ParameterName, 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour')
|
||||
[CompletionResult]::new('--error-format', '--error-format', [CompletionResultType]::ParameterName, 'rustc error format')
|
||||
[CompletionResult]::new('--color', '--color', [CompletionResultType]::ParameterName, 'whether to use color in cargo and rustc output')
|
||||
[CompletionResult]::new('--llvm-skip-rebuild', '--llvm-skip-rebuild', [CompletionResultType]::ParameterName, 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml')
|
||||
[CompletionResult]::new('--rust-profile-generate', '--rust-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with rustc build')
|
||||
[CompletionResult]::new('--rust-profile-use', '--rust-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for rustc build')
|
||||
[CompletionResult]::new('--llvm-profile-use', '--llvm-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for LLVM build')
|
||||
|
|
|
@ -70,7 +70,7 @@ _x.py() {
|
|||
|
||||
case "${cmd}" in
|
||||
x.py)
|
||||
opts="-v -i -j -h --verbose --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --error-format --json-output --color --bypass-bootstrap-lock --llvm-skip-rebuild --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --help [PATHS]... [ARGS]... build check clippy fix fmt doc test miri bench clean dist install run setup suggest vendor perf"
|
||||
opts="-v -i -j -h --verbose --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --error-format --json-output --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --help [PATHS]... [ARGS]... build check clippy fix fmt doc test miri bench clean dist install run setup suggest vendor perf"
|
||||
if [[ ${cur} == -* || ${COMP_CWORD} -eq 1 ]] ; then
|
||||
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
||||
return 0
|
||||
|
@ -195,10 +195,6 @@ _x.py() {
|
|||
COMPREPLY=($(compgen -W "always never auto" -- "${cur}"))
|
||||
return 0
|
||||
;;
|
||||
--llvm-skip-rebuild)
|
||||
COMPREPLY=($(compgen -W "true false" -- "${cur}"))
|
||||
return 0
|
||||
;;
|
||||
--rust-profile-generate)
|
||||
local oldifs
|
||||
if [ -n "${IFS+x}" ]; then
|
||||
|
@ -263,7 +259,7 @@ _x.py() {
|
|||
return 0
|
||||
;;
|
||||
x.py__bench)
|
||||
opts="-v -i -j -h --test-args --verbose --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --error-format --json-output --color --bypass-bootstrap-lock --llvm-skip-rebuild --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --help [PATHS]... [ARGS]..."
|
||||
opts="-v -i -j -h --test-args --verbose --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --error-format --json-output --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --help [PATHS]... [ARGS]..."
|
||||
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
|
||||
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
||||
return 0
|
||||
|
@ -392,10 +388,6 @@ _x.py() {
|
|||
COMPREPLY=($(compgen -W "always never auto" -- "${cur}"))
|
||||
return 0
|
||||
;;
|
||||
--llvm-skip-rebuild)
|
||||
COMPREPLY=($(compgen -W "true false" -- "${cur}"))
|
||||
return 0
|
||||
;;
|
||||
--rust-profile-generate)
|
||||
local oldifs
|
||||
if [ -n "${IFS+x}" ]; then
|
||||
|
@ -460,7 +452,7 @@ _x.py() {
|
|||
return 0
|
||||
;;
|
||||
x.py__build)
|
||||
opts="-v -i -j -h --verbose --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --error-format --json-output --color --bypass-bootstrap-lock --llvm-skip-rebuild --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --help [PATHS]... [ARGS]..."
|
||||
opts="-v -i -j -h --verbose --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --error-format --json-output --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --help [PATHS]... [ARGS]..."
|
||||
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
|
||||
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
||||
return 0
|
||||
|
@ -585,10 +577,6 @@ _x.py() {
|
|||
COMPREPLY=($(compgen -W "always never auto" -- "${cur}"))
|
||||
return 0
|
||||
;;
|
||||
--llvm-skip-rebuild)
|
||||
COMPREPLY=($(compgen -W "true false" -- "${cur}"))
|
||||
return 0
|
||||
;;
|
||||
--rust-profile-generate)
|
||||
local oldifs
|
||||
if [ -n "${IFS+x}" ]; then
|
||||
|
@ -653,7 +641,7 @@ _x.py() {
|
|||
return 0
|
||||
;;
|
||||
x.py__check)
|
||||
opts="-v -i -j -h --all-targets --verbose --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --error-format --json-output --color --bypass-bootstrap-lock --llvm-skip-rebuild --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --help [PATHS]... [ARGS]..."
|
||||
opts="-v -i -j -h --all-targets --verbose --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --error-format --json-output --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --help [PATHS]... [ARGS]..."
|
||||
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
|
||||
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
||||
return 0
|
||||
|
@ -778,10 +766,6 @@ _x.py() {
|
|||
COMPREPLY=($(compgen -W "always never auto" -- "${cur}"))
|
||||
return 0
|
||||
;;
|
||||
--llvm-skip-rebuild)
|
||||
COMPREPLY=($(compgen -W "true false" -- "${cur}"))
|
||||
return 0
|
||||
;;
|
||||
--rust-profile-generate)
|
||||
local oldifs
|
||||
if [ -n "${IFS+x}" ]; then
|
||||
|
@ -846,7 +830,7 @@ _x.py() {
|
|||
return 0
|
||||
;;
|
||||
x.py__clean)
|
||||
opts="-v -i -j -h --all --stage --verbose --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --keep-stage --keep-stage-std --src --jobs --warnings --error-format --json-output --color --bypass-bootstrap-lock --llvm-skip-rebuild --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --help [PATHS]... [ARGS]..."
|
||||
opts="-v -i -j -h --all --stage --verbose --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --keep-stage --keep-stage-std --src --jobs --warnings --error-format --json-output --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --help [PATHS]... [ARGS]..."
|
||||
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
|
||||
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
||||
return 0
|
||||
|
@ -968,10 +952,6 @@ _x.py() {
|
|||
COMPREPLY=($(compgen -W "always never auto" -- "${cur}"))
|
||||
return 0
|
||||
;;
|
||||
--llvm-skip-rebuild)
|
||||
COMPREPLY=($(compgen -W "true false" -- "${cur}"))
|
||||
return 0
|
||||
;;
|
||||
--rust-profile-generate)
|
||||
local oldifs
|
||||
if [ -n "${IFS+x}" ]; then
|
||||
|
@ -1036,7 +1016,7 @@ _x.py() {
|
|||
return 0
|
||||
;;
|
||||
x.py__clippy)
|
||||
opts="-A -D -W -F -v -i -j -h --fix --allow-dirty --allow-staged --verbose --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --error-format --json-output --color --bypass-bootstrap-lock --llvm-skip-rebuild --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --help [PATHS]... [ARGS]..."
|
||||
opts="-A -D -W -F -v -i -j -h --fix --allow-dirty --allow-staged --verbose --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --error-format --json-output --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --help [PATHS]... [ARGS]..."
|
||||
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
|
||||
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
||||
return 0
|
||||
|
@ -1177,10 +1157,6 @@ _x.py() {
|
|||
COMPREPLY=($(compgen -W "always never auto" -- "${cur}"))
|
||||
return 0
|
||||
;;
|
||||
--llvm-skip-rebuild)
|
||||
COMPREPLY=($(compgen -W "true false" -- "${cur}"))
|
||||
return 0
|
||||
;;
|
||||
--rust-profile-generate)
|
||||
local oldifs
|
||||
if [ -n "${IFS+x}" ]; then
|
||||
|
@ -1245,7 +1221,7 @@ _x.py() {
|
|||
return 0
|
||||
;;
|
||||
x.py__dist)
|
||||
opts="-v -i -j -h --verbose --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --error-format --json-output --color --bypass-bootstrap-lock --llvm-skip-rebuild --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --help [PATHS]... [ARGS]..."
|
||||
opts="-v -i -j -h --verbose --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --error-format --json-output --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --help [PATHS]... [ARGS]..."
|
||||
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
|
||||
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
||||
return 0
|
||||
|
@ -1370,10 +1346,6 @@ _x.py() {
|
|||
COMPREPLY=($(compgen -W "always never auto" -- "${cur}"))
|
||||
return 0
|
||||
;;
|
||||
--llvm-skip-rebuild)
|
||||
COMPREPLY=($(compgen -W "true false" -- "${cur}"))
|
||||
return 0
|
||||
;;
|
||||
--rust-profile-generate)
|
||||
local oldifs
|
||||
if [ -n "${IFS+x}" ]; then
|
||||
|
@ -1438,7 +1410,7 @@ _x.py() {
|
|||
return 0
|
||||
;;
|
||||
x.py__doc)
|
||||
opts="-v -i -j -h --open --json --verbose --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --error-format --json-output --color --bypass-bootstrap-lock --llvm-skip-rebuild --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --help [PATHS]... [ARGS]..."
|
||||
opts="-v -i -j -h --open --json --verbose --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --error-format --json-output --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --help [PATHS]... [ARGS]..."
|
||||
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
|
||||
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
||||
return 0
|
||||
|
@ -1563,10 +1535,6 @@ _x.py() {
|
|||
COMPREPLY=($(compgen -W "always never auto" -- "${cur}"))
|
||||
return 0
|
||||
;;
|
||||
--llvm-skip-rebuild)
|
||||
COMPREPLY=($(compgen -W "true false" -- "${cur}"))
|
||||
return 0
|
||||
;;
|
||||
--rust-profile-generate)
|
||||
local oldifs
|
||||
if [ -n "${IFS+x}" ]; then
|
||||
|
@ -1631,7 +1599,7 @@ _x.py() {
|
|||
return 0
|
||||
;;
|
||||
x.py__fix)
|
||||
opts="-v -i -j -h --verbose --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --error-format --json-output --color --bypass-bootstrap-lock --llvm-skip-rebuild --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --help [PATHS]... [ARGS]..."
|
||||
opts="-v -i -j -h --verbose --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --error-format --json-output --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --help [PATHS]... [ARGS]..."
|
||||
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
|
||||
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
||||
return 0
|
||||
|
@ -1756,10 +1724,6 @@ _x.py() {
|
|||
COMPREPLY=($(compgen -W "always never auto" -- "${cur}"))
|
||||
return 0
|
||||
;;
|
||||
--llvm-skip-rebuild)
|
||||
COMPREPLY=($(compgen -W "true false" -- "${cur}"))
|
||||
return 0
|
||||
;;
|
||||
--rust-profile-generate)
|
||||
local oldifs
|
||||
if [ -n "${IFS+x}" ]; then
|
||||
|
@ -1824,7 +1788,7 @@ _x.py() {
|
|||
return 0
|
||||
;;
|
||||
x.py__fmt)
|
||||
opts="-v -i -j -h --check --all --verbose --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --error-format --json-output --color --bypass-bootstrap-lock --llvm-skip-rebuild --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --help [PATHS]... [ARGS]..."
|
||||
opts="-v -i -j -h --check --all --verbose --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --error-format --json-output --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --help [PATHS]... [ARGS]..."
|
||||
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
|
||||
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
||||
return 0
|
||||
|
@ -1949,10 +1913,6 @@ _x.py() {
|
|||
COMPREPLY=($(compgen -W "always never auto" -- "${cur}"))
|
||||
return 0
|
||||
;;
|
||||
--llvm-skip-rebuild)
|
||||
COMPREPLY=($(compgen -W "true false" -- "${cur}"))
|
||||
return 0
|
||||
;;
|
||||
--rust-profile-generate)
|
||||
local oldifs
|
||||
if [ -n "${IFS+x}" ]; then
|
||||
|
@ -2017,7 +1977,7 @@ _x.py() {
|
|||
return 0
|
||||
;;
|
||||
x.py__install)
|
||||
opts="-v -i -j -h --verbose --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --error-format --json-output --color --bypass-bootstrap-lock --llvm-skip-rebuild --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --help [PATHS]... [ARGS]..."
|
||||
opts="-v -i -j -h --verbose --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --error-format --json-output --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --help [PATHS]... [ARGS]..."
|
||||
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
|
||||
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
||||
return 0
|
||||
|
@ -2142,10 +2102,6 @@ _x.py() {
|
|||
COMPREPLY=($(compgen -W "always never auto" -- "${cur}"))
|
||||
return 0
|
||||
;;
|
||||
--llvm-skip-rebuild)
|
||||
COMPREPLY=($(compgen -W "true false" -- "${cur}"))
|
||||
return 0
|
||||
;;
|
||||
--rust-profile-generate)
|
||||
local oldifs
|
||||
if [ -n "${IFS+x}" ]; then
|
||||
|
@ -2210,7 +2166,7 @@ _x.py() {
|
|||
return 0
|
||||
;;
|
||||
x.py__miri)
|
||||
opts="-v -i -j -h --no-fail-fast --test-args --no-doc --doc --verbose --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --error-format --json-output --color --bypass-bootstrap-lock --llvm-skip-rebuild --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --help [PATHS]... [ARGS]..."
|
||||
opts="-v -i -j -h --no-fail-fast --test-args --no-doc --doc --verbose --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --error-format --json-output --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --help [PATHS]... [ARGS]..."
|
||||
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
|
||||
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
||||
return 0
|
||||
|
@ -2339,10 +2295,6 @@ _x.py() {
|
|||
COMPREPLY=($(compgen -W "always never auto" -- "${cur}"))
|
||||
return 0
|
||||
;;
|
||||
--llvm-skip-rebuild)
|
||||
COMPREPLY=($(compgen -W "true false" -- "${cur}"))
|
||||
return 0
|
||||
;;
|
||||
--rust-profile-generate)
|
||||
local oldifs
|
||||
if [ -n "${IFS+x}" ]; then
|
||||
|
@ -2407,7 +2359,7 @@ _x.py() {
|
|||
return 0
|
||||
;;
|
||||
x.py__perf)
|
||||
opts="-v -i -j -h --verbose --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --error-format --json-output --color --bypass-bootstrap-lock --llvm-skip-rebuild --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --help [PATHS]... [ARGS]..."
|
||||
opts="-v -i -j -h --verbose --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --error-format --json-output --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --help [PATHS]... [ARGS]..."
|
||||
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
|
||||
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
||||
return 0
|
||||
|
@ -2532,10 +2484,6 @@ _x.py() {
|
|||
COMPREPLY=($(compgen -W "always never auto" -- "${cur}"))
|
||||
return 0
|
||||
;;
|
||||
--llvm-skip-rebuild)
|
||||
COMPREPLY=($(compgen -W "true false" -- "${cur}"))
|
||||
return 0
|
||||
;;
|
||||
--rust-profile-generate)
|
||||
local oldifs
|
||||
if [ -n "${IFS+x}" ]; then
|
||||
|
@ -2600,7 +2548,7 @@ _x.py() {
|
|||
return 0
|
||||
;;
|
||||
x.py__run)
|
||||
opts="-v -i -j -h --args --verbose --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --error-format --json-output --color --bypass-bootstrap-lock --llvm-skip-rebuild --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --help [PATHS]... [ARGS]..."
|
||||
opts="-v -i -j -h --args --verbose --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --error-format --json-output --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --help [PATHS]... [ARGS]..."
|
||||
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
|
||||
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
||||
return 0
|
||||
|
@ -2729,10 +2677,6 @@ _x.py() {
|
|||
COMPREPLY=($(compgen -W "always never auto" -- "${cur}"))
|
||||
return 0
|
||||
;;
|
||||
--llvm-skip-rebuild)
|
||||
COMPREPLY=($(compgen -W "true false" -- "${cur}"))
|
||||
return 0
|
||||
;;
|
||||
--rust-profile-generate)
|
||||
local oldifs
|
||||
if [ -n "${IFS+x}" ]; then
|
||||
|
@ -2797,7 +2741,7 @@ _x.py() {
|
|||
return 0
|
||||
;;
|
||||
x.py__setup)
|
||||
opts="-v -i -j -h --verbose --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --error-format --json-output --color --bypass-bootstrap-lock --llvm-skip-rebuild --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --help [<PROFILE>|hook|vscode|link] [PATHS]... [ARGS]..."
|
||||
opts="-v -i -j -h --verbose --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --error-format --json-output --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --help [<PROFILE>|hook|vscode|link] [PATHS]... [ARGS]..."
|
||||
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
|
||||
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
||||
return 0
|
||||
|
@ -2922,10 +2866,6 @@ _x.py() {
|
|||
COMPREPLY=($(compgen -W "always never auto" -- "${cur}"))
|
||||
return 0
|
||||
;;
|
||||
--llvm-skip-rebuild)
|
||||
COMPREPLY=($(compgen -W "true false" -- "${cur}"))
|
||||
return 0
|
||||
;;
|
||||
--rust-profile-generate)
|
||||
local oldifs
|
||||
if [ -n "${IFS+x}" ]; then
|
||||
|
@ -2990,7 +2930,7 @@ _x.py() {
|
|||
return 0
|
||||
;;
|
||||
x.py__suggest)
|
||||
opts="-v -i -j -h --run --verbose --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --error-format --json-output --color --bypass-bootstrap-lock --llvm-skip-rebuild --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --help [PATHS]... [ARGS]..."
|
||||
opts="-v -i -j -h --run --verbose --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --error-format --json-output --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --help [PATHS]... [ARGS]..."
|
||||
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
|
||||
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
||||
return 0
|
||||
|
@ -3115,10 +3055,6 @@ _x.py() {
|
|||
COMPREPLY=($(compgen -W "always never auto" -- "${cur}"))
|
||||
return 0
|
||||
;;
|
||||
--llvm-skip-rebuild)
|
||||
COMPREPLY=($(compgen -W "true false" -- "${cur}"))
|
||||
return 0
|
||||
;;
|
||||
--rust-profile-generate)
|
||||
local oldifs
|
||||
if [ -n "${IFS+x}" ]; then
|
||||
|
@ -3183,7 +3119,7 @@ _x.py() {
|
|||
return 0
|
||||
;;
|
||||
x.py__test)
|
||||
opts="-v -i -j -h --no-fail-fast --test-args --compiletest-rustc-args --no-doc --doc --bless --extra-checks --force-rerun --only-modified --compare-mode --pass --run --rustfix-coverage --verbose --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --error-format --json-output --color --bypass-bootstrap-lock --llvm-skip-rebuild --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --help [PATHS]... [ARGS]..."
|
||||
opts="-v -i -j -h --no-fail-fast --test-args --compiletest-rustc-args --no-doc --doc --bless --extra-checks --force-rerun --only-modified --compare-mode --pass --run --rustfix-coverage --verbose --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --error-format --json-output --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --help [PATHS]... [ARGS]..."
|
||||
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
|
||||
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
||||
return 0
|
||||
|
@ -3332,10 +3268,6 @@ _x.py() {
|
|||
COMPREPLY=($(compgen -W "always never auto" -- "${cur}"))
|
||||
return 0
|
||||
;;
|
||||
--llvm-skip-rebuild)
|
||||
COMPREPLY=($(compgen -W "true false" -- "${cur}"))
|
||||
return 0
|
||||
;;
|
||||
--rust-profile-generate)
|
||||
local oldifs
|
||||
if [ -n "${IFS+x}" ]; then
|
||||
|
@ -3400,7 +3332,7 @@ _x.py() {
|
|||
return 0
|
||||
;;
|
||||
x.py__vendor)
|
||||
opts="-v -i -j -h --sync --versioned-dirs --verbose --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --error-format --json-output --color --bypass-bootstrap-lock --llvm-skip-rebuild --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --help [PATHS]... [ARGS]..."
|
||||
opts="-v -i -j -h --sync --versioned-dirs --verbose --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --error-format --json-output --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --help [PATHS]... [ARGS]..."
|
||||
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
|
||||
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
||||
return 0
|
||||
|
@ -3529,10 +3461,6 @@ _x.py() {
|
|||
COMPREPLY=($(compgen -W "always never auto" -- "${cur}"))
|
||||
return 0
|
||||
;;
|
||||
--llvm-skip-rebuild)
|
||||
COMPREPLY=($(compgen -W "true false" -- "${cur}"))
|
||||
return 0
|
||||
;;
|
||||
--rust-profile-generate)
|
||||
local oldifs
|
||||
if [ -n "${IFS+x}" ]; then
|
||||
|
|
|
@ -33,7 +33,6 @@ _x.py() {
|
|||
'--warnings=[if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour]:deny|warn:(deny warn default)' \
|
||||
'--error-format=[rustc error format]:FORMAT:( )' \
|
||||
'--color=[whether to use color in cargo and rustc output]:STYLE:(always never auto)' \
|
||||
'--llvm-skip-rebuild=[whether rebuilding llvm should be skipped, overriding \`skip-rebuld\` in config.toml]:VALUE:(true false)' \
|
||||
'--rust-profile-generate=[generate PGO profile with rustc build]:PROFILE:_files' \
|
||||
'--rust-profile-use=[use PGO profile for rustc build]:PROFILE:_files' \
|
||||
'--llvm-profile-use=[use PGO profile for LLVM build]:PROFILE:_files' \
|
||||
|
@ -84,7 +83,6 @@ _arguments "${_arguments_options[@]}" : \
|
|||
'--warnings=[if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour]:deny|warn:(deny warn default)' \
|
||||
'--error-format=[rustc error format]:FORMAT:( )' \
|
||||
'--color=[whether to use color in cargo and rustc output]:STYLE:(always never auto)' \
|
||||
'--llvm-skip-rebuild=[whether rebuilding llvm should be skipped, overriding \`skip-rebuld\` in config.toml]:VALUE:(true false)' \
|
||||
'--rust-profile-generate=[generate PGO profile with rustc build]:PROFILE:_files' \
|
||||
'--rust-profile-use=[use PGO profile for rustc build]:PROFILE:_files' \
|
||||
'--llvm-profile-use=[use PGO profile for LLVM build]:PROFILE:_files' \
|
||||
|
@ -127,7 +125,6 @@ _arguments "${_arguments_options[@]}" : \
|
|||
'--warnings=[if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour]:deny|warn:(deny warn default)' \
|
||||
'--error-format=[rustc error format]:FORMAT:( )' \
|
||||
'--color=[whether to use color in cargo and rustc output]:STYLE:(always never auto)' \
|
||||
'--llvm-skip-rebuild=[whether rebuilding llvm should be skipped, overriding \`skip-rebuld\` in config.toml]:VALUE:(true false)' \
|
||||
'--rust-profile-generate=[generate PGO profile with rustc build]:PROFILE:_files' \
|
||||
'--rust-profile-use=[use PGO profile for rustc build]:PROFILE:_files' \
|
||||
'--llvm-profile-use=[use PGO profile for LLVM build]:PROFILE:_files' \
|
||||
|
@ -175,7 +172,6 @@ _arguments "${_arguments_options[@]}" : \
|
|||
'--warnings=[if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour]:deny|warn:(deny warn default)' \
|
||||
'--error-format=[rustc error format]:FORMAT:( )' \
|
||||
'--color=[whether to use color in cargo and rustc output]:STYLE:(always never auto)' \
|
||||
'--llvm-skip-rebuild=[whether rebuilding llvm should be skipped, overriding \`skip-rebuld\` in config.toml]:VALUE:(true false)' \
|
||||
'--rust-profile-generate=[generate PGO profile with rustc build]:PROFILE:_files' \
|
||||
'--rust-profile-use=[use PGO profile for rustc build]:PROFILE:_files' \
|
||||
'--llvm-profile-use=[use PGO profile for LLVM build]:PROFILE:_files' \
|
||||
|
@ -221,7 +217,6 @@ _arguments "${_arguments_options[@]}" : \
|
|||
'--warnings=[if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour]:deny|warn:(deny warn default)' \
|
||||
'--error-format=[rustc error format]:FORMAT:( )' \
|
||||
'--color=[whether to use color in cargo and rustc output]:STYLE:(always never auto)' \
|
||||
'--llvm-skip-rebuild=[whether rebuilding llvm should be skipped, overriding \`skip-rebuld\` in config.toml]:VALUE:(true false)' \
|
||||
'--rust-profile-generate=[generate PGO profile with rustc build]:PROFILE:_files' \
|
||||
'--rust-profile-use=[use PGO profile for rustc build]:PROFILE:_files' \
|
||||
'--llvm-profile-use=[use PGO profile for LLVM build]:PROFILE:_files' \
|
||||
|
@ -264,7 +259,6 @@ _arguments "${_arguments_options[@]}" : \
|
|||
'--warnings=[if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour]:deny|warn:(deny warn default)' \
|
||||
'--error-format=[rustc error format]:FORMAT:( )' \
|
||||
'--color=[whether to use color in cargo and rustc output]:STYLE:(always never auto)' \
|
||||
'--llvm-skip-rebuild=[whether rebuilding llvm should be skipped, overriding \`skip-rebuld\` in config.toml]:VALUE:(true false)' \
|
||||
'--rust-profile-generate=[generate PGO profile with rustc build]:PROFILE:_files' \
|
||||
'--rust-profile-use=[use PGO profile for rustc build]:PROFILE:_files' \
|
||||
'--llvm-profile-use=[use PGO profile for LLVM build]:PROFILE:_files' \
|
||||
|
@ -309,7 +303,6 @@ _arguments "${_arguments_options[@]}" : \
|
|||
'--warnings=[if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour]:deny|warn:(deny warn default)' \
|
||||
'--error-format=[rustc error format]:FORMAT:( )' \
|
||||
'--color=[whether to use color in cargo and rustc output]:STYLE:(always never auto)' \
|
||||
'--llvm-skip-rebuild=[whether rebuilding llvm should be skipped, overriding \`skip-rebuld\` in config.toml]:VALUE:(true false)' \
|
||||
'--rust-profile-generate=[generate PGO profile with rustc build]:PROFILE:_files' \
|
||||
'--rust-profile-use=[use PGO profile for rustc build]:PROFILE:_files' \
|
||||
'--llvm-profile-use=[use PGO profile for LLVM build]:PROFILE:_files' \
|
||||
|
@ -360,7 +353,6 @@ _arguments "${_arguments_options[@]}" : \
|
|||
'--warnings=[if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour]:deny|warn:(deny warn default)' \
|
||||
'--error-format=[rustc error format]:FORMAT:( )' \
|
||||
'--color=[whether to use color in cargo and rustc output]:STYLE:(always never auto)' \
|
||||
'--llvm-skip-rebuild=[whether rebuilding llvm should be skipped, overriding \`skip-rebuld\` in config.toml]:VALUE:(true false)' \
|
||||
'--rust-profile-generate=[generate PGO profile with rustc build]:PROFILE:_files' \
|
||||
'--rust-profile-use=[use PGO profile for rustc build]:PROFILE:_files' \
|
||||
'--llvm-profile-use=[use PGO profile for LLVM build]:PROFILE:_files' \
|
||||
|
@ -411,7 +403,6 @@ _arguments "${_arguments_options[@]}" : \
|
|||
'--warnings=[if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour]:deny|warn:(deny warn default)' \
|
||||
'--error-format=[rustc error format]:FORMAT:( )' \
|
||||
'--color=[whether to use color in cargo and rustc output]:STYLE:(always never auto)' \
|
||||
'--llvm-skip-rebuild=[whether rebuilding llvm should be skipped, overriding \`skip-rebuld\` in config.toml]:VALUE:(true false)' \
|
||||
'--rust-profile-generate=[generate PGO profile with rustc build]:PROFILE:_files' \
|
||||
'--rust-profile-use=[use PGO profile for rustc build]:PROFILE:_files' \
|
||||
'--llvm-profile-use=[use PGO profile for LLVM build]:PROFILE:_files' \
|
||||
|
@ -458,7 +449,6 @@ _arguments "${_arguments_options[@]}" : \
|
|||
'--warnings=[if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour]:deny|warn:(deny warn default)' \
|
||||
'--error-format=[rustc error format]:FORMAT:( )' \
|
||||
'--color=[whether to use color in cargo and rustc output]:STYLE:(always never auto)' \
|
||||
'--llvm-skip-rebuild=[whether rebuilding llvm should be skipped, overriding \`skip-rebuld\` in config.toml]:VALUE:(true false)' \
|
||||
'--rust-profile-generate=[generate PGO profile with rustc build]:PROFILE:_files' \
|
||||
'--rust-profile-use=[use PGO profile for rustc build]:PROFILE:_files' \
|
||||
'--llvm-profile-use=[use PGO profile for LLVM build]:PROFILE:_files' \
|
||||
|
@ -501,7 +491,6 @@ _arguments "${_arguments_options[@]}" : \
|
|||
'--warnings=[if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour]:deny|warn:(deny warn default)' \
|
||||
'--error-format=[rustc error format]:FORMAT:( )' \
|
||||
'--color=[whether to use color in cargo and rustc output]:STYLE:(always never auto)' \
|
||||
'--llvm-skip-rebuild=[whether rebuilding llvm should be skipped, overriding \`skip-rebuld\` in config.toml]:VALUE:(true false)' \
|
||||
'--rust-profile-generate=[generate PGO profile with rustc build]:PROFILE:_files' \
|
||||
'--rust-profile-use=[use PGO profile for rustc build]:PROFILE:_files' \
|
||||
'--llvm-profile-use=[use PGO profile for LLVM build]:PROFILE:_files' \
|
||||
|
@ -545,7 +534,6 @@ _arguments "${_arguments_options[@]}" : \
|
|||
'--warnings=[if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour]:deny|warn:(deny warn default)' \
|
||||
'--error-format=[rustc error format]:FORMAT:( )' \
|
||||
'--color=[whether to use color in cargo and rustc output]:STYLE:(always never auto)' \
|
||||
'--llvm-skip-rebuild=[whether rebuilding llvm should be skipped, overriding \`skip-rebuld\` in config.toml]:VALUE:(true false)' \
|
||||
'--rust-profile-generate=[generate PGO profile with rustc build]:PROFILE:_files' \
|
||||
'--rust-profile-use=[use PGO profile for rustc build]:PROFILE:_files' \
|
||||
'--llvm-profile-use=[use PGO profile for LLVM build]:PROFILE:_files' \
|
||||
|
@ -588,7 +576,6 @@ _arguments "${_arguments_options[@]}" : \
|
|||
'--warnings=[if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour]:deny|warn:(deny warn default)' \
|
||||
'--error-format=[rustc error format]:FORMAT:( )' \
|
||||
'--color=[whether to use color in cargo and rustc output]:STYLE:(always never auto)' \
|
||||
'--llvm-skip-rebuild=[whether rebuilding llvm should be skipped, overriding \`skip-rebuld\` in config.toml]:VALUE:(true false)' \
|
||||
'--rust-profile-generate=[generate PGO profile with rustc build]:PROFILE:_files' \
|
||||
'--rust-profile-use=[use PGO profile for rustc build]:PROFILE:_files' \
|
||||
'--llvm-profile-use=[use PGO profile for LLVM build]:PROFILE:_files' \
|
||||
|
@ -632,7 +619,6 @@ _arguments "${_arguments_options[@]}" : \
|
|||
'--warnings=[if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour]:deny|warn:(deny warn default)' \
|
||||
'--error-format=[rustc error format]:FORMAT:( )' \
|
||||
'--color=[whether to use color in cargo and rustc output]:STYLE:(always never auto)' \
|
||||
'--llvm-skip-rebuild=[whether rebuilding llvm should be skipped, overriding \`skip-rebuld\` in config.toml]:VALUE:(true false)' \
|
||||
'--rust-profile-generate=[generate PGO profile with rustc build]:PROFILE:_files' \
|
||||
'--rust-profile-use=[use PGO profile for rustc build]:PROFILE:_files' \
|
||||
'--llvm-profile-use=[use PGO profile for LLVM build]:PROFILE:_files' \
|
||||
|
@ -675,7 +661,6 @@ _arguments "${_arguments_options[@]}" : \
|
|||
'--warnings=[if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour]:deny|warn:(deny warn default)' \
|
||||
'--error-format=[rustc error format]:FORMAT:( )' \
|
||||
'--color=[whether to use color in cargo and rustc output]:STYLE:(always never auto)' \
|
||||
'--llvm-skip-rebuild=[whether rebuilding llvm should be skipped, overriding \`skip-rebuld\` in config.toml]:VALUE:(true false)' \
|
||||
'--rust-profile-generate=[generate PGO profile with rustc build]:PROFILE:_files' \
|
||||
'--rust-profile-use=[use PGO profile for rustc build]:PROFILE:_files' \
|
||||
'--llvm-profile-use=[use PGO profile for LLVM build]:PROFILE:_files' \
|
||||
|
@ -719,7 +704,6 @@ _arguments "${_arguments_options[@]}" : \
|
|||
'--warnings=[if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour]:deny|warn:(deny warn default)' \
|
||||
'--error-format=[rustc error format]:FORMAT:( )' \
|
||||
'--color=[whether to use color in cargo and rustc output]:STYLE:(always never auto)' \
|
||||
'--llvm-skip-rebuild=[whether rebuilding llvm should be skipped, overriding \`skip-rebuld\` in config.toml]:VALUE:(true false)' \
|
||||
'--rust-profile-generate=[generate PGO profile with rustc build]:PROFILE:_files' \
|
||||
'--rust-profile-use=[use PGO profile for rustc build]:PROFILE:_files' \
|
||||
'--llvm-profile-use=[use PGO profile for LLVM build]:PROFILE:_files' \
|
||||
|
@ -764,7 +748,6 @@ _arguments "${_arguments_options[@]}" : \
|
|||
'--warnings=[if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour]:deny|warn:(deny warn default)' \
|
||||
'--error-format=[rustc error format]:FORMAT:( )' \
|
||||
'--color=[whether to use color in cargo and rustc output]:STYLE:(always never auto)' \
|
||||
'--llvm-skip-rebuild=[whether rebuilding llvm should be skipped, overriding \`skip-rebuld\` in config.toml]:VALUE:(true false)' \
|
||||
'--rust-profile-generate=[generate PGO profile with rustc build]:PROFILE:_files' \
|
||||
'--rust-profile-use=[use PGO profile for rustc build]:PROFILE:_files' \
|
||||
'--llvm-profile-use=[use PGO profile for LLVM build]:PROFILE:_files' \
|
||||
|
@ -808,7 +791,6 @@ _arguments "${_arguments_options[@]}" : \
|
|||
'--warnings=[if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour]:deny|warn:(deny warn default)' \
|
||||
'--error-format=[rustc error format]:FORMAT:( )' \
|
||||
'--color=[whether to use color in cargo and rustc output]:STYLE:(always never auto)' \
|
||||
'--llvm-skip-rebuild=[whether rebuilding llvm should be skipped, overriding \`skip-rebuld\` in config.toml]:VALUE:(true false)' \
|
||||
'--rust-profile-generate=[generate PGO profile with rustc build]:PROFILE:_files' \
|
||||
'--rust-profile-use=[use PGO profile for rustc build]:PROFILE:_files' \
|
||||
'--llvm-profile-use=[use PGO profile for LLVM build]:PROFILE:_files' \
|
||||
|
|
|
@ -879,7 +879,9 @@ impl<'src> Classifier<'src> {
|
|||
| TokenKind::UnknownPrefix
|
||||
| TokenKind::InvalidPrefix
|
||||
| TokenKind::InvalidIdent => Class::Ident(self.new_span(before, text)),
|
||||
TokenKind::Lifetime { .. } => Class::Lifetime,
|
||||
TokenKind::Lifetime { .. }
|
||||
| TokenKind::RawLifetime
|
||||
| TokenKind::UnknownPrefixLifetime => Class::Lifetime,
|
||||
TokenKind::Eof => panic!("Eof in advance"),
|
||||
};
|
||||
// Anything that didn't return above is the simple case where we the
|
||||
|
|
|
@ -41,6 +41,7 @@ let ParserState;
|
|||
* foundElems: number,
|
||||
* totalElems: number,
|
||||
* literalSearch: boolean,
|
||||
* hasReturnArrow: boolean,
|
||||
* corrections: Array<{from: string, to: integer}> | null,
|
||||
* typeFingerprint: Uint32Array,
|
||||
* error: Array<string> | null,
|
||||
|
|
|
@ -657,7 +657,7 @@ function createQueryElement(query, parserState, name, generics, isInGenerics) {
|
|||
}
|
||||
const typeFilter = parserState.typeFilter;
|
||||
parserState.typeFilter = null;
|
||||
if (name === "!") {
|
||||
if (name.trim() === "!") {
|
||||
if (typeFilter !== null && typeFilter !== "primitive") {
|
||||
throw [
|
||||
"Invalid search type: primitive never type ",
|
||||
|
@ -1795,6 +1795,7 @@ class DocSearch {
|
|||
// Total number of elements (includes generics).
|
||||
totalElems: 0,
|
||||
literalSearch: false,
|
||||
hasReturnArrow: false,
|
||||
error: null,
|
||||
correction: null,
|
||||
proposeCorrectionFrom: null,
|
||||
|
@ -1823,6 +1824,7 @@ class DocSearch {
|
|||
continue;
|
||||
} else if (c === "-" || c === ">") {
|
||||
if (isReturnArrow(parserState)) {
|
||||
query.hasReturnArrow = true;
|
||||
break;
|
||||
}
|
||||
throw ["Unexpected ", c, " (did you mean ", "->", "?)"];
|
||||
|
@ -1889,9 +1891,7 @@ class DocSearch {
|
|||
// Get returned elements.
|
||||
getItemsBefore(query, parserState, query.returned, "");
|
||||
// Nothing can come afterward!
|
||||
if (query.returned.length === 0) {
|
||||
throw ["Expected at least one item after ", "->"];
|
||||
}
|
||||
query.hasReturnArrow = true;
|
||||
break;
|
||||
} else {
|
||||
parserState.pos += 1;
|
||||
|
@ -3249,7 +3249,7 @@ class DocSearch {
|
|||
this.buildFunctionTypeFingerprint(elem, parsedQuery.typeFingerprint, fps);
|
||||
}
|
||||
|
||||
if (parsedQuery.foundElems === 1 && parsedQuery.returned.length === 0) {
|
||||
if (parsedQuery.foundElems === 1 && !parsedQuery.hasReturnArrow) {
|
||||
if (parsedQuery.elems.length === 1) {
|
||||
const elem = parsedQuery.elems[0];
|
||||
const length = this.searchIndex.length;
|
||||
|
|
|
@ -619,10 +619,10 @@ impl<'tcx> LateLintPass<'tcx> for Transmute {
|
|||
| transmute_ref_to_ref::check(cx, e, from_ty, to_ty, arg, const_context)
|
||||
| transmute_ptr_to_ptr::check(cx, e, from_ty, to_ty, arg, &self.msrv)
|
||||
| transmute_int_to_bool::check(cx, e, from_ty, to_ty, arg)
|
||||
| transmute_int_to_float::check(cx, e, from_ty, to_ty, arg, const_context)
|
||||
| transmute_int_to_float::check(cx, e, from_ty, to_ty, arg)
|
||||
| transmute_int_to_non_zero::check(cx, e, from_ty, to_ty, arg)
|
||||
| transmute_float_to_int::check(cx, e, from_ty, to_ty, arg, const_context)
|
||||
| transmute_num_to_bytes::check(cx, e, from_ty, to_ty, arg, const_context)
|
||||
| transmute_float_to_int::check(cx, e, from_ty, to_ty, arg)
|
||||
| transmute_num_to_bytes::check(cx, e, from_ty, to_ty, arg)
|
||||
| (unsound_collection_transmute::check(cx, e, from_ty, to_ty)
|
||||
|| transmute_undefined_repr::check(cx, e, from_ty, to_ty))
|
||||
| (eager_transmute::check(cx, e, arg, from_ty, to_ty));
|
||||
|
|
|
@ -15,10 +15,9 @@ pub(super) fn check<'tcx>(
|
|||
from_ty: Ty<'tcx>,
|
||||
to_ty: Ty<'tcx>,
|
||||
mut arg: &'tcx Expr<'_>,
|
||||
const_context: bool,
|
||||
) -> bool {
|
||||
match (&from_ty.kind(), &to_ty.kind()) {
|
||||
(ty::Float(float_ty), ty::Int(_) | ty::Uint(_)) if !const_context => {
|
||||
(ty::Float(float_ty), ty::Int(_) | ty::Uint(_)) => {
|
||||
span_lint_and_then(
|
||||
cx,
|
||||
TRANSMUTE_FLOAT_TO_INT,
|
||||
|
|
|
@ -14,10 +14,9 @@ pub(super) fn check<'tcx>(
|
|||
from_ty: Ty<'tcx>,
|
||||
to_ty: Ty<'tcx>,
|
||||
arg: &'tcx Expr<'_>,
|
||||
const_context: bool,
|
||||
) -> bool {
|
||||
match (&from_ty.kind(), &to_ty.kind()) {
|
||||
(ty::Int(_) | ty::Uint(_), ty::Float(_)) if !const_context => {
|
||||
(ty::Int(_) | ty::Uint(_), ty::Float(_)) => {
|
||||
span_lint_and_then(
|
||||
cx,
|
||||
TRANSMUTE_INT_TO_FLOAT,
|
||||
|
|
|
@ -14,18 +14,12 @@ pub(super) fn check<'tcx>(
|
|||
from_ty: Ty<'tcx>,
|
||||
to_ty: Ty<'tcx>,
|
||||
arg: &'tcx Expr<'_>,
|
||||
const_context: bool,
|
||||
) -> bool {
|
||||
match (&from_ty.kind(), &to_ty.kind()) {
|
||||
(ty::Int(_) | ty::Uint(_) | ty::Float(_), ty::Array(arr_ty, _)) => {
|
||||
if !matches!(arr_ty.kind(), ty::Uint(UintTy::U8)) {
|
||||
return false;
|
||||
}
|
||||
if matches!(from_ty.kind(), ty::Float(_)) && const_context {
|
||||
// TODO: Remove when const_float_bits_conv is stabilized
|
||||
// rust#72447
|
||||
return false;
|
||||
}
|
||||
|
||||
span_lint_and_then(
|
||||
cx,
|
||||
|
|
|
@ -140,24 +140,32 @@ mod int_to_float {
|
|||
|
||||
mod issue_5747 {
|
||||
const VALUE16: f16 = unsafe { std::mem::transmute(0_u16) };
|
||||
//~^ ERROR: transmute from a `u16` to a `f16`
|
||||
const VALUE32: f32 = unsafe { std::mem::transmute(0_u32) };
|
||||
//~^ ERROR: transmute from a `u32` to a `f32`
|
||||
const VALUE64: f64 = unsafe { std::mem::transmute(0_i64) };
|
||||
//~^ ERROR: transmute from a `i64` to a `f64`
|
||||
const VALUE128: f128 = unsafe { std::mem::transmute(0_i128) };
|
||||
//~^ ERROR: transmute from a `i128` to a `f128`
|
||||
|
||||
const fn from_bits_16(v: i16) -> f16 {
|
||||
unsafe { std::mem::transmute(v) }
|
||||
//~^ ERROR: transmute from a `i16` to a `f16`
|
||||
}
|
||||
|
||||
const fn from_bits_32(v: i32) -> f32 {
|
||||
unsafe { std::mem::transmute(v) }
|
||||
//~^ ERROR: transmute from a `i32` to a `f32`
|
||||
}
|
||||
|
||||
const fn from_bits_64(v: u64) -> f64 {
|
||||
unsafe { std::mem::transmute(v) }
|
||||
//~^ ERROR: transmute from a `u64` to a `f64`
|
||||
}
|
||||
|
||||
const fn from_bits_128(v: u128) -> f128 {
|
||||
unsafe { std::mem::transmute(v) }
|
||||
//~^ ERROR: transmute from a `u128` to a `f128`
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -205,9 +213,13 @@ mod num_to_bytes {
|
|||
//~^ ERROR: transmute from a `i128` to a `[u8; 16]`
|
||||
|
||||
let _: [u8; 2] = std::mem::transmute(0.0f16);
|
||||
//~^ ERROR: transmute from a `f16` to a `[u8; 2]`
|
||||
let _: [u8; 4] = std::mem::transmute(0.0f32);
|
||||
//~^ ERROR: transmute from a `f32` to a `[u8; 4]`
|
||||
let _: [u8; 8] = std::mem::transmute(0.0f64);
|
||||
//~^ ERROR: transmute from a `f64` to a `[u8; 8]`
|
||||
let _: [u8; 16] = std::mem::transmute(0.0f128);
|
||||
//~^ ERROR: transmute from a `f128` to a `[u8; 16]`
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -148,8 +148,56 @@ error: transmute from a `i128` to a `f128`
|
|||
LL | let _: f128 = unsafe { std::mem::transmute(0_i128) };
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `f128::from_bits(0_i128 as u128)`
|
||||
|
||||
error: transmute from a `u16` to a `f16`
|
||||
--> tests/ui/transmute.rs:142:39
|
||||
|
|
||||
LL | const VALUE16: f16 = unsafe { std::mem::transmute(0_u16) };
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `f16::from_bits(0_u16)`
|
||||
|
||||
error: transmute from a `u32` to a `f32`
|
||||
--> tests/ui/transmute.rs:144:39
|
||||
|
|
||||
LL | const VALUE32: f32 = unsafe { std::mem::transmute(0_u32) };
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `f32::from_bits(0_u32)`
|
||||
|
||||
error: transmute from a `i64` to a `f64`
|
||||
--> tests/ui/transmute.rs:146:39
|
||||
|
|
||||
LL | const VALUE64: f64 = unsafe { std::mem::transmute(0_i64) };
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `f64::from_bits(0_i64 as u64)`
|
||||
|
||||
error: transmute from a `i128` to a `f128`
|
||||
--> tests/ui/transmute.rs:148:41
|
||||
|
|
||||
LL | const VALUE128: f128 = unsafe { std::mem::transmute(0_i128) };
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `f128::from_bits(0_i128 as u128)`
|
||||
|
||||
error: transmute from a `i16` to a `f16`
|
||||
--> tests/ui/transmute.rs:152:22
|
||||
|
|
||||
LL | unsafe { std::mem::transmute(v) }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `f16::from_bits(v as u16)`
|
||||
|
||||
error: transmute from a `i32` to a `f32`
|
||||
--> tests/ui/transmute.rs:157:22
|
||||
|
|
||||
LL | unsafe { std::mem::transmute(v) }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `f32::from_bits(v as u32)`
|
||||
|
||||
error: transmute from a `u64` to a `f64`
|
||||
--> tests/ui/transmute.rs:162:22
|
||||
|
|
||||
LL | unsafe { std::mem::transmute(v) }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `f64::from_bits(v)`
|
||||
|
||||
error: transmute from a `u128` to a `f128`
|
||||
--> tests/ui/transmute.rs:167:22
|
||||
|
|
||||
LL | unsafe { std::mem::transmute(v) }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `f128::from_bits(v)`
|
||||
|
||||
error: transmute from a `u8` to a `[u8; 1]`
|
||||
--> tests/ui/transmute.rs:168:30
|
||||
--> tests/ui/transmute.rs:176:30
|
||||
|
|
||||
LL | let _: [u8; 1] = std::mem::transmute(0u8);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0u8.to_ne_bytes()`
|
||||
|
@ -158,97 +206,121 @@ LL | let _: [u8; 1] = std::mem::transmute(0u8);
|
|||
= help: to override `-D warnings` add `#[allow(clippy::transmute_num_to_bytes)]`
|
||||
|
||||
error: transmute from a `u32` to a `[u8; 4]`
|
||||
--> tests/ui/transmute.rs:171:30
|
||||
--> tests/ui/transmute.rs:179:30
|
||||
|
|
||||
LL | let _: [u8; 4] = std::mem::transmute(0u32);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0u32.to_ne_bytes()`
|
||||
|
||||
error: transmute from a `u128` to a `[u8; 16]`
|
||||
--> tests/ui/transmute.rs:173:31
|
||||
--> tests/ui/transmute.rs:181:31
|
||||
|
|
||||
LL | let _: [u8; 16] = std::mem::transmute(0u128);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0u128.to_ne_bytes()`
|
||||
|
||||
error: transmute from a `i8` to a `[u8; 1]`
|
||||
--> tests/ui/transmute.rs:175:30
|
||||
--> tests/ui/transmute.rs:183:30
|
||||
|
|
||||
LL | let _: [u8; 1] = std::mem::transmute(0i8);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0i8.to_ne_bytes()`
|
||||
|
||||
error: transmute from a `i32` to a `[u8; 4]`
|
||||
--> tests/ui/transmute.rs:177:30
|
||||
--> tests/ui/transmute.rs:185:30
|
||||
|
|
||||
LL | let _: [u8; 4] = std::mem::transmute(0i32);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0i32.to_ne_bytes()`
|
||||
|
||||
error: transmute from a `i128` to a `[u8; 16]`
|
||||
--> tests/ui/transmute.rs:179:31
|
||||
--> tests/ui/transmute.rs:187:31
|
||||
|
|
||||
LL | let _: [u8; 16] = std::mem::transmute(0i128);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0i128.to_ne_bytes()`
|
||||
|
||||
error: transmute from a `f16` to a `[u8; 2]`
|
||||
--> tests/ui/transmute.rs:182:30
|
||||
--> tests/ui/transmute.rs:190:30
|
||||
|
|
||||
LL | let _: [u8; 2] = std::mem::transmute(0.0f16);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0.0f16.to_ne_bytes()`
|
||||
|
||||
error: transmute from a `f32` to a `[u8; 4]`
|
||||
--> tests/ui/transmute.rs:184:30
|
||||
--> tests/ui/transmute.rs:192:30
|
||||
|
|
||||
LL | let _: [u8; 4] = std::mem::transmute(0.0f32);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0.0f32.to_ne_bytes()`
|
||||
|
||||
error: transmute from a `f64` to a `[u8; 8]`
|
||||
--> tests/ui/transmute.rs:186:30
|
||||
--> tests/ui/transmute.rs:194:30
|
||||
|
|
||||
LL | let _: [u8; 8] = std::mem::transmute(0.0f64);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0.0f64.to_ne_bytes()`
|
||||
|
||||
error: transmute from a `f128` to a `[u8; 16]`
|
||||
--> tests/ui/transmute.rs:188:31
|
||||
--> tests/ui/transmute.rs:196:31
|
||||
|
|
||||
LL | let _: [u8; 16] = std::mem::transmute(0.0f128);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0.0f128.to_ne_bytes()`
|
||||
|
||||
error: transmute from a `u8` to a `[u8; 1]`
|
||||
--> tests/ui/transmute.rs:194:30
|
||||
--> tests/ui/transmute.rs:202:30
|
||||
|
|
||||
LL | let _: [u8; 1] = std::mem::transmute(0u8);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0u8.to_ne_bytes()`
|
||||
|
||||
error: transmute from a `u32` to a `[u8; 4]`
|
||||
--> tests/ui/transmute.rs:196:30
|
||||
--> tests/ui/transmute.rs:204:30
|
||||
|
|
||||
LL | let _: [u8; 4] = std::mem::transmute(0u32);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0u32.to_ne_bytes()`
|
||||
|
||||
error: transmute from a `u128` to a `[u8; 16]`
|
||||
--> tests/ui/transmute.rs:198:31
|
||||
--> tests/ui/transmute.rs:206:31
|
||||
|
|
||||
LL | let _: [u8; 16] = std::mem::transmute(0u128);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0u128.to_ne_bytes()`
|
||||
|
||||
error: transmute from a `i8` to a `[u8; 1]`
|
||||
--> tests/ui/transmute.rs:200:30
|
||||
--> tests/ui/transmute.rs:208:30
|
||||
|
|
||||
LL | let _: [u8; 1] = std::mem::transmute(0i8);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0i8.to_ne_bytes()`
|
||||
|
||||
error: transmute from a `i32` to a `[u8; 4]`
|
||||
--> tests/ui/transmute.rs:202:30
|
||||
--> tests/ui/transmute.rs:210:30
|
||||
|
|
||||
LL | let _: [u8; 4] = std::mem::transmute(0i32);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0i32.to_ne_bytes()`
|
||||
|
||||
error: transmute from a `i128` to a `[u8; 16]`
|
||||
--> tests/ui/transmute.rs:204:31
|
||||
--> tests/ui/transmute.rs:212:31
|
||||
|
|
||||
LL | let _: [u8; 16] = std::mem::transmute(0i128);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0i128.to_ne_bytes()`
|
||||
|
||||
error: transmute from a `f16` to a `[u8; 2]`
|
||||
--> tests/ui/transmute.rs:215:30
|
||||
|
|
||||
LL | let _: [u8; 2] = std::mem::transmute(0.0f16);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0.0f16.to_ne_bytes()`
|
||||
|
||||
error: transmute from a `f32` to a `[u8; 4]`
|
||||
--> tests/ui/transmute.rs:217:30
|
||||
|
|
||||
LL | let _: [u8; 4] = std::mem::transmute(0.0f32);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0.0f32.to_ne_bytes()`
|
||||
|
||||
error: transmute from a `f64` to a `[u8; 8]`
|
||||
--> tests/ui/transmute.rs:219:30
|
||||
|
|
||||
LL | let _: [u8; 8] = std::mem::transmute(0.0f64);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0.0f64.to_ne_bytes()`
|
||||
|
||||
error: transmute from a `f128` to a `[u8; 16]`
|
||||
--> tests/ui/transmute.rs:221:31
|
||||
|
|
||||
LL | let _: [u8; 16] = std::mem::transmute(0.0f128);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0.0f128.to_ne_bytes()`
|
||||
|
||||
error: transmute from a `&[u8]` to a `&str`
|
||||
--> tests/ui/transmute.rs:218:28
|
||||
--> tests/ui/transmute.rs:230:28
|
||||
|
|
||||
LL | let _: &str = unsafe { std::mem::transmute(B) };
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::str::from_utf8(B).unwrap()`
|
||||
|
@ -257,16 +329,16 @@ LL | let _: &str = unsafe { std::mem::transmute(B) };
|
|||
= help: to override `-D warnings` add `#[allow(clippy::transmute_bytes_to_str)]`
|
||||
|
||||
error: transmute from a `&mut [u8]` to a `&mut str`
|
||||
--> tests/ui/transmute.rs:221:32
|
||||
--> tests/ui/transmute.rs:233:32
|
||||
|
|
||||
LL | let _: &mut str = unsafe { std::mem::transmute(mb) };
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::str::from_utf8_mut(mb).unwrap()`
|
||||
|
||||
error: transmute from a `&[u8]` to a `&str`
|
||||
--> tests/ui/transmute.rs:223:30
|
||||
--> tests/ui/transmute.rs:235:30
|
||||
|
|
||||
LL | const _: &str = unsafe { std::mem::transmute(B) };
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::str::from_utf8_unchecked(B)`
|
||||
|
||||
error: aborting due to 42 previous errors
|
||||
error: aborting due to 54 previous errors
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#![warn(clippy::transmute_float_to_int)]
|
||||
#![allow(clippy::missing_transmute_annotations)]
|
||||
#![feature(f128)]
|
||||
#![feature(f16)]
|
||||
#![feature(f128, f128_const)]
|
||||
#![feature(f16, f16_const)]
|
||||
|
||||
fn float_to_int() {
|
||||
let _: u32 = unsafe { 1f32.to_bits() };
|
||||
|
@ -20,25 +20,33 @@ fn float_to_int() {
|
|||
}
|
||||
|
||||
mod issue_5747 {
|
||||
const VALUE16: i16 = unsafe { std::mem::transmute(1f16) };
|
||||
const VALUE32: i32 = unsafe { std::mem::transmute(1f32) };
|
||||
const VALUE64: u64 = unsafe { std::mem::transmute(1f64) };
|
||||
const VALUE128: u128 = unsafe { std::mem::transmute(1f128) };
|
||||
const VALUE16: i16 = unsafe { 1f16.to_bits() as i16 };
|
||||
//~^ ERROR: transmute from a `f16` to a `i16`
|
||||
const VALUE32: i32 = unsafe { 1f32.to_bits() as i32 };
|
||||
//~^ ERROR: transmute from a `f32` to a `i32`
|
||||
const VALUE64: u64 = unsafe { 1f64.to_bits() };
|
||||
//~^ ERROR: transmute from a `f64` to a `u64`
|
||||
const VALUE128: u128 = unsafe { 1f128.to_bits() };
|
||||
//~^ ERROR: transmute from a `f128` to a `u128`
|
||||
|
||||
const fn to_bits_16(v: f16) -> u16 {
|
||||
unsafe { std::mem::transmute(v) }
|
||||
unsafe { v.to_bits() }
|
||||
//~^ ERROR: transmute from a `f16` to a `u16`
|
||||
}
|
||||
|
||||
const fn to_bits_32(v: f32) -> u32 {
|
||||
unsafe { std::mem::transmute(v) }
|
||||
unsafe { v.to_bits() }
|
||||
//~^ ERROR: transmute from a `f32` to a `u32`
|
||||
}
|
||||
|
||||
const fn to_bits_64(v: f64) -> i64 {
|
||||
unsafe { std::mem::transmute(v) }
|
||||
unsafe { v.to_bits() as i64 }
|
||||
//~^ ERROR: transmute from a `f64` to a `i64`
|
||||
}
|
||||
|
||||
const fn to_bits_128(v: f128) -> i128 {
|
||||
unsafe { std::mem::transmute(v) }
|
||||
unsafe { v.to_bits() as i128 }
|
||||
//~^ ERROR: transmute from a `f128` to a `i128`
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#![warn(clippy::transmute_float_to_int)]
|
||||
#![allow(clippy::missing_transmute_annotations)]
|
||||
#![feature(f128)]
|
||||
#![feature(f16)]
|
||||
#![feature(f128, f128_const)]
|
||||
#![feature(f16, f16_const)]
|
||||
|
||||
fn float_to_int() {
|
||||
let _: u32 = unsafe { std::mem::transmute(1f32) };
|
||||
|
@ -21,24 +21,32 @@ fn float_to_int() {
|
|||
|
||||
mod issue_5747 {
|
||||
const VALUE16: i16 = unsafe { std::mem::transmute(1f16) };
|
||||
//~^ ERROR: transmute from a `f16` to a `i16`
|
||||
const VALUE32: i32 = unsafe { std::mem::transmute(1f32) };
|
||||
//~^ ERROR: transmute from a `f32` to a `i32`
|
||||
const VALUE64: u64 = unsafe { std::mem::transmute(1f64) };
|
||||
//~^ ERROR: transmute from a `f64` to a `u64`
|
||||
const VALUE128: u128 = unsafe { std::mem::transmute(1f128) };
|
||||
//~^ ERROR: transmute from a `f128` to a `u128`
|
||||
|
||||
const fn to_bits_16(v: f16) -> u16 {
|
||||
unsafe { std::mem::transmute(v) }
|
||||
//~^ ERROR: transmute from a `f16` to a `u16`
|
||||
}
|
||||
|
||||
const fn to_bits_32(v: f32) -> u32 {
|
||||
unsafe { std::mem::transmute(v) }
|
||||
//~^ ERROR: transmute from a `f32` to a `u32`
|
||||
}
|
||||
|
||||
const fn to_bits_64(v: f64) -> i64 {
|
||||
unsafe { std::mem::transmute(v) }
|
||||
//~^ ERROR: transmute from a `f64` to a `i64`
|
||||
}
|
||||
|
||||
const fn to_bits_128(v: f128) -> i128 {
|
||||
unsafe { std::mem::transmute(v) }
|
||||
//~^ ERROR: transmute from a `f128` to a `i128`
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -37,5 +37,53 @@ error: transmute from a `f64` to a `u64`
|
|||
LL | let _: u64 = unsafe { std::mem::transmute(-1.0) };
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `(-1.0f64).to_bits()`
|
||||
|
||||
error: aborting due to 6 previous errors
|
||||
error: transmute from a `f16` to a `i16`
|
||||
--> tests/ui/transmute_float_to_int.rs:23:35
|
||||
|
|
||||
LL | const VALUE16: i16 = unsafe { std::mem::transmute(1f16) };
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `1f16.to_bits() as i16`
|
||||
|
||||
error: transmute from a `f32` to a `i32`
|
||||
--> tests/ui/transmute_float_to_int.rs:25:35
|
||||
|
|
||||
LL | const VALUE32: i32 = unsafe { std::mem::transmute(1f32) };
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `1f32.to_bits() as i32`
|
||||
|
||||
error: transmute from a `f64` to a `u64`
|
||||
--> tests/ui/transmute_float_to_int.rs:27:35
|
||||
|
|
||||
LL | const VALUE64: u64 = unsafe { std::mem::transmute(1f64) };
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `1f64.to_bits()`
|
||||
|
||||
error: transmute from a `f128` to a `u128`
|
||||
--> tests/ui/transmute_float_to_int.rs:29:37
|
||||
|
|
||||
LL | const VALUE128: u128 = unsafe { std::mem::transmute(1f128) };
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `1f128.to_bits()`
|
||||
|
||||
error: transmute from a `f16` to a `u16`
|
||||
--> tests/ui/transmute_float_to_int.rs:33:18
|
||||
|
|
||||
LL | unsafe { std::mem::transmute(v) }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `v.to_bits()`
|
||||
|
||||
error: transmute from a `f32` to a `u32`
|
||||
--> tests/ui/transmute_float_to_int.rs:38:18
|
||||
|
|
||||
LL | unsafe { std::mem::transmute(v) }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `v.to_bits()`
|
||||
|
||||
error: transmute from a `f64` to a `i64`
|
||||
--> tests/ui/transmute_float_to_int.rs:43:18
|
||||
|
|
||||
LL | unsafe { std::mem::transmute(v) }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `v.to_bits() as i64`
|
||||
|
||||
error: transmute from a `f128` to a `i128`
|
||||
--> tests/ui/transmute_float_to_int.rs:48:18
|
||||
|
|
||||
LL | unsafe { std::mem::transmute(v) }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `v.to_bits() as i128`
|
||||
|
||||
error: aborting due to 14 previous errors
|
||||
|
||||
|
|
|
@ -198,6 +198,13 @@ impl<'a> Converter<'a> {
|
|||
}
|
||||
LIFETIME_IDENT
|
||||
}
|
||||
rustc_lexer::TokenKind::UnknownPrefixLifetime => {
|
||||
err = "Unknown lifetime prefix";
|
||||
LIFETIME_IDENT
|
||||
}
|
||||
rustc_lexer::TokenKind::RawLifetime => {
|
||||
LIFETIME_IDENT
|
||||
}
|
||||
|
||||
rustc_lexer::TokenKind::Semi => T![;],
|
||||
rustc_lexer::TokenKind::Comma => T![,],
|
||||
|
|
|
@ -462,7 +462,7 @@ fn rewrite_empty_block(
|
|||
return None;
|
||||
}
|
||||
|
||||
let label_str = rewrite_label(label);
|
||||
let label_str = rewrite_label(context, label);
|
||||
if attrs.map_or(false, |a| !inner_attributes(a).is_empty()) {
|
||||
return None;
|
||||
}
|
||||
|
@ -527,7 +527,7 @@ fn rewrite_single_line_block(
|
|||
if let Some(block_expr) = stmt::Stmt::from_simple_block(context, block, attrs) {
|
||||
let expr_shape = shape.offset_left(last_line_width(prefix))?;
|
||||
let expr_str = block_expr.rewrite(context, expr_shape)?;
|
||||
let label_str = rewrite_label(label);
|
||||
let label_str = rewrite_label(context, label);
|
||||
let result = format!("{prefix}{label_str}{{ {expr_str} }}");
|
||||
if result.len() <= shape.width && !result.contains('\n') {
|
||||
return Some(result);
|
||||
|
@ -562,7 +562,7 @@ pub(crate) fn rewrite_block_with_visitor(
|
|||
}
|
||||
|
||||
let inner_attrs = attrs.map(inner_attributes);
|
||||
let label_str = rewrite_label(label);
|
||||
let label_str = rewrite_label(context, label);
|
||||
visitor.visit_block(block, inner_attrs.as_deref(), has_braces);
|
||||
let visitor_context = visitor.get_context();
|
||||
context
|
||||
|
@ -939,7 +939,7 @@ impl<'a> ControlFlow<'a> {
|
|||
fresh_shape
|
||||
};
|
||||
|
||||
let label_string = rewrite_label(self.label);
|
||||
let label_string = rewrite_label(context, self.label);
|
||||
// 1 = space after keyword.
|
||||
let offset = self.keyword.len() + label_string.len() + 1;
|
||||
|
||||
|
@ -1168,9 +1168,9 @@ impl<'a> Rewrite for ControlFlow<'a> {
|
|||
}
|
||||
}
|
||||
|
||||
fn rewrite_label(opt_label: Option<ast::Label>) -> Cow<'static, str> {
|
||||
fn rewrite_label(context: &RewriteContext<'_>, opt_label: Option<ast::Label>) -> Cow<'static, str> {
|
||||
match opt_label {
|
||||
Some(label) => Cow::from(format!("{}: ", label.ident)),
|
||||
Some(label) => Cow::from(format!("{}: ", context.snippet(label.ident.span))),
|
||||
None => Cow::from(""),
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1074,7 +1074,7 @@ fn force_space_before(tok: &TokenKind) -> bool {
|
|||
fn ident_like(tok: &Token) -> bool {
|
||||
matches!(
|
||||
tok.kind,
|
||||
TokenKind::Ident(..) | TokenKind::Literal(..) | TokenKind::Lifetime(_)
|
||||
TokenKind::Ident(..) | TokenKind::Literal(..) | TokenKind::Lifetime(..)
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -1099,7 +1099,9 @@ fn next_space(tok: &TokenKind) -> SpaceState {
|
|||
| TokenKind::OpenDelim(_)
|
||||
| TokenKind::CloseDelim(_) => SpaceState::Never,
|
||||
|
||||
TokenKind::Literal(..) | TokenKind::Ident(..) | TokenKind::Lifetime(_) => SpaceState::Ident,
|
||||
TokenKind::Literal(..) | TokenKind::Ident(..) | TokenKind::Lifetime(..) => {
|
||||
SpaceState::Ident
|
||||
}
|
||||
|
||||
_ => SpaceState::Always,
|
||||
}
|
||||
|
|
|
@ -548,7 +548,7 @@ impl Rewrite for ast::AnonConst {
|
|||
|
||||
impl Rewrite for ast::Lifetime {
|
||||
fn rewrite(&self, context: &RewriteContext<'_>, _: Shape) -> Option<String> {
|
||||
Some(rewrite_ident(context, self.ident).to_owned())
|
||||
Some(context.snippet(self.ident.span).to_owned())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
15
src/tools/rustfmt/tests/target/raw-lifetimes.rs
Normal file
15
src/tools/rustfmt/tests/target/raw-lifetimes.rs
Normal file
|
@ -0,0 +1,15 @@
|
|||
// rustfmt-edition: 2021
|
||||
|
||||
// Simple idempotence test for raw lifetimes.
|
||||
|
||||
fn test<'r#gen>() -> &'r#gen () {
|
||||
// Test raw lifetimes...
|
||||
}
|
||||
|
||||
fn label() {
|
||||
'r#label: {
|
||||
// Test raw labels.
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {}
|
10
tests/crashes/123629.rs
Normal file
10
tests/crashes/123629.rs
Normal file
|
@ -0,0 +1,10 @@
|
|||
//@ known-bug: #123629
|
||||
#![feature(generic_assert)]
|
||||
|
||||
fn foo()
|
||||
where
|
||||
for<const N: usize = { assert!(u) }> ():,
|
||||
{
|
||||
}
|
||||
|
||||
fn main() {}
|
18
tests/crashes/127033.rs
Normal file
18
tests/crashes/127033.rs
Normal file
|
@ -0,0 +1,18 @@
|
|||
//@ known-bug: #127033
|
||||
//@ compile-flags: --edition=2021
|
||||
|
||||
pub trait RaftLogStorage {
|
||||
fn save_vote(vote: ()) -> impl std::future::Future + Send;
|
||||
}
|
||||
|
||||
struct X;
|
||||
impl RaftLogStorage for X {
|
||||
fn save_vote(vote: ()) -> impl std::future::Future {
|
||||
loop {}
|
||||
async {
|
||||
vote
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {}
|
52
tests/crashes/129372.rs
Normal file
52
tests/crashes/129372.rs
Normal file
|
@ -0,0 +1,52 @@
|
|||
//@ known-bug: #129372
|
||||
//@ compile-flags: -Cdebuginfo=2 -Copt-level=0
|
||||
|
||||
pub struct Wrapper<T>(T);
|
||||
struct Struct;
|
||||
|
||||
pub trait TraitA {
|
||||
type AssocA<'t>;
|
||||
}
|
||||
pub trait TraitB {
|
||||
type AssocB;
|
||||
}
|
||||
|
||||
pub fn helper(v: impl MethodTrait) {
|
||||
let _local_that_causes_ice = v.method();
|
||||
}
|
||||
|
||||
pub fn main() {
|
||||
helper(Wrapper(Struct));
|
||||
}
|
||||
|
||||
pub trait MethodTrait {
|
||||
type Assoc<'a>;
|
||||
|
||||
fn method(self) -> impl for<'a> FnMut(&'a ()) -> Self::Assoc<'a>;
|
||||
}
|
||||
|
||||
impl<T: TraitB> MethodTrait for T
|
||||
where
|
||||
<T as TraitB>::AssocB: TraitA,
|
||||
{
|
||||
type Assoc<'a> = <T::AssocB as TraitA>::AssocA<'a>;
|
||||
|
||||
fn method(self) -> impl for<'a> FnMut(&'a ()) -> Self::Assoc<'a> {
|
||||
move |_| loop {}
|
||||
}
|
||||
}
|
||||
|
||||
impl<T, B> TraitB for Wrapper<B>
|
||||
where
|
||||
B: TraitB<AssocB = T>,
|
||||
{
|
||||
type AssocB = T;
|
||||
}
|
||||
|
||||
impl TraitB for Struct {
|
||||
type AssocB = Struct;
|
||||
}
|
||||
|
||||
impl TraitA for Struct {
|
||||
type AssocA<'t> = Self;
|
||||
}
|
|
@ -251,15 +251,6 @@ const PARSED = [
|
|||
userQuery: "ab'",
|
||||
error: "Unexpected `'` after `b` (not a valid identifier)",
|
||||
},
|
||||
{
|
||||
query: "a->",
|
||||
elems: [],
|
||||
foundElems: 0,
|
||||
original: "a->",
|
||||
returned: [],
|
||||
userQuery: "a->",
|
||||
error: "Expected at least one item after `->`",
|
||||
},
|
||||
{
|
||||
query: '"p" <a>',
|
||||
elems: [],
|
||||
|
|
|
@ -94,4 +94,72 @@ const PARSED = [
|
|||
userQuery: "-> !",
|
||||
error: null,
|
||||
},
|
||||
{
|
||||
query: "a->",
|
||||
elems: [{
|
||||
name: "a",
|
||||
fullPath: ["a"],
|
||||
pathWithoutLast: [],
|
||||
pathLast: "a",
|
||||
generics: [],
|
||||
typeFilter: -1,
|
||||
}],
|
||||
foundElems: 1,
|
||||
original: "a->",
|
||||
returned: [],
|
||||
userQuery: "a->",
|
||||
hasReturnArrow: true,
|
||||
error: null,
|
||||
},
|
||||
{
|
||||
query: "!->",
|
||||
elems: [{
|
||||
name: "never",
|
||||
fullPath: ["never"],
|
||||
pathWithoutLast: [],
|
||||
pathLast: "never",
|
||||
generics: [],
|
||||
typeFilter: 1,
|
||||
}],
|
||||
foundElems: 1,
|
||||
original: "!->",
|
||||
returned: [],
|
||||
userQuery: "!->",
|
||||
hasReturnArrow: true,
|
||||
error: null,
|
||||
},
|
||||
{
|
||||
query: "! ->",
|
||||
elems: [{
|
||||
name: "never",
|
||||
fullPath: ["never"],
|
||||
pathWithoutLast: [],
|
||||
pathLast: "never",
|
||||
generics: [],
|
||||
typeFilter: 1,
|
||||
}],
|
||||
foundElems: 1,
|
||||
original: "! ->",
|
||||
returned: [],
|
||||
userQuery: "! ->",
|
||||
hasReturnArrow: true,
|
||||
error: null,
|
||||
},
|
||||
{
|
||||
query: "primitive:!->",
|
||||
elems: [{
|
||||
name: "never",
|
||||
fullPath: ["never"],
|
||||
pathWithoutLast: [],
|
||||
pathLast: "never",
|
||||
generics: [],
|
||||
typeFilter: 1,
|
||||
}],
|
||||
foundElems: 1,
|
||||
original: "primitive:!->",
|
||||
returned: [],
|
||||
userQuery: "primitive:!->",
|
||||
hasReturnArrow: true,
|
||||
error: null,
|
||||
},
|
||||
];
|
||||
|
|
|
@ -1,6 +1,13 @@
|
|||
// exact-check
|
||||
|
||||
const EXPECTED = [
|
||||
{
|
||||
'query': '! ->',
|
||||
'others': [
|
||||
{ 'path': 'never_search', 'name': 'impossible' },
|
||||
{ 'path': 'never_search', 'name': 'box_impossible' },
|
||||
],
|
||||
},
|
||||
{
|
||||
'query': '-> !',
|
||||
'others': [
|
||||
|
|
18
tests/ui/async-await/async-closures/tainted-body-2.rs
Normal file
18
tests/ui/async-await/async-closures/tainted-body-2.rs
Normal file
|
@ -0,0 +1,18 @@
|
|||
//@ edition: 2021
|
||||
|
||||
#![feature(async_closure)]
|
||||
|
||||
// Ensure that building a by-ref async closure body doesn't ICE when the parent
|
||||
// body is tainted.
|
||||
|
||||
fn main() {
|
||||
missing;
|
||||
//~^ ERROR cannot find value `missing` in this scope
|
||||
|
||||
// We don't do numerical inference fallback when the body is tainted.
|
||||
// This leads to writeback folding the type of the coroutine-closure
|
||||
// into an error type, since its signature contains that numerical
|
||||
// infer var.
|
||||
let c = async |_| {};
|
||||
c(1);
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
error[E0425]: cannot find value `missing` in this scope
|
||||
--> $DIR/tainted-body-2.rs:9:5
|
||||
|
|
||||
LL | missing;
|
||||
| ^^^^^^^ not found in this scope
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0425`.
|
|
@ -0,0 +1,19 @@
|
|||
//@ check-pass
|
||||
//@ edition: 2021
|
||||
|
||||
#![feature(async_closure)]
|
||||
|
||||
// Make sure that we don't hit a query cycle when validating
|
||||
// the by-move coroutine body for an async closure.
|
||||
|
||||
use std::future::Future;
|
||||
|
||||
async fn test<Fut: Future>(operation: impl Fn() -> Fut) {
|
||||
operation().await;
|
||||
}
|
||||
|
||||
pub async fn orchestrate_simple_crud() {
|
||||
test(async || async {}.await).await;
|
||||
}
|
||||
|
||||
fn main() {}
|
|
@ -1,10 +1,9 @@
|
|||
//@ compile-flags: -Zmir-opt-level=0
|
||||
//@ run-pass
|
||||
|
||||
#![feature(const_float_bits_conv)]
|
||||
#![feature(const_float_classify)]
|
||||
#![feature(f16)]
|
||||
#![feature(f128)]
|
||||
#![feature(f16, f16_const)]
|
||||
#![feature(f128, f128_const)]
|
||||
#![allow(unused_macro_rules)]
|
||||
// Don't promote
|
||||
const fn nop<T>(x: T) -> T { x }
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
//@ known-bug: #110395
|
||||
// FIXME(effects) run-pass
|
||||
|
||||
#![feature(const_float_bits_conv)]
|
||||
#![feature(const_float_classify)]
|
||||
#![feature(const_trait_impl, effects)]
|
||||
#![allow(incomplete_features)]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
error: const `impl` for trait `PartialEq` which is not marked with `#[const_trait]`
|
||||
--> $DIR/const-float-classify.rs:13:12
|
||||
--> $DIR/const-float-classify.rs:12:12
|
||||
|
|
||||
LL | impl const PartialEq<NonDet> for bool {
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
|
|
10
tests/ui/lexer/prefixed-lifetime.rs
Normal file
10
tests/ui/lexer/prefixed-lifetime.rs
Normal file
|
@ -0,0 +1,10 @@
|
|||
//@ edition: 2021
|
||||
|
||||
macro_rules! w {
|
||||
($($tt:tt)*) => {};
|
||||
}
|
||||
|
||||
w!('foo#lifetime);
|
||||
//~^ ERROR prefix `'foo` is unknown
|
||||
|
||||
fn main() {}
|
14
tests/ui/lexer/prefixed-lifetime.stderr
Normal file
14
tests/ui/lexer/prefixed-lifetime.stderr
Normal file
|
@ -0,0 +1,14 @@
|
|||
error: prefix `'foo` is unknown
|
||||
--> $DIR/prefixed-lifetime.rs:7:4
|
||||
|
|
||||
LL | w!('foo#lifetime);
|
||||
| ^^^^ unknown prefix
|
||||
|
|
||||
= note: prefixed identifiers and literals are reserved since Rust 2021
|
||||
help: consider inserting whitespace here
|
||||
|
|
||||
LL | w!('foo #lifetime);
|
||||
| +
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
8
tests/ui/lifetimes/raw/gen-lt.e2024.stderr
Normal file
8
tests/ui/lifetimes/raw/gen-lt.e2024.stderr
Normal file
|
@ -0,0 +1,8 @@
|
|||
error: lifetimes cannot use keyword names
|
||||
--> $DIR/gen-lt.rs:11:11
|
||||
|
|
||||
LL | fn gen_lt<'gen>() {}
|
||||
| ^^^^
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
14
tests/ui/lifetimes/raw/gen-lt.rs
Normal file
14
tests/ui/lifetimes/raw/gen-lt.rs
Normal file
|
@ -0,0 +1,14 @@
|
|||
//@ revisions: e2021 e2024
|
||||
|
||||
//@[e2021] edition:2021
|
||||
//@[e2024] edition:2024
|
||||
//@[e2024] compile-flags: -Zunstable-options
|
||||
|
||||
//@[e2021] check-pass
|
||||
|
||||
fn raw_gen_lt<'r#gen>() {}
|
||||
|
||||
fn gen_lt<'gen>() {}
|
||||
//[e2024]~^ ERROR lifetimes cannot use keyword names
|
||||
|
||||
fn main() {}
|
8
tests/ui/lifetimes/raw/lifetimes-eq.rs
Normal file
8
tests/ui/lifetimes/raw/lifetimes-eq.rs
Normal file
|
@ -0,0 +1,8 @@
|
|||
//@ edition: 2021
|
||||
//@ check-pass
|
||||
|
||||
// Test that `'r#a` is `'a`.
|
||||
|
||||
fn test<'r#a>(x: &'a ()) {}
|
||||
|
||||
fn main() {}
|
12
tests/ui/lifetimes/raw/macro-lt.rs
Normal file
12
tests/ui/lifetimes/raw/macro-lt.rs
Normal file
|
@ -0,0 +1,12 @@
|
|||
//@ check-pass
|
||||
//@ edition: 2021
|
||||
|
||||
macro_rules! lifetime {
|
||||
($lt:lifetime) => {
|
||||
fn hello<$lt>() {}
|
||||
}
|
||||
}
|
||||
|
||||
lifetime!('r#struct);
|
||||
|
||||
fn main() {}
|
6
tests/ui/lifetimes/raw/multiple-prefixes.rs
Normal file
6
tests/ui/lifetimes/raw/multiple-prefixes.rs
Normal file
|
@ -0,0 +1,6 @@
|
|||
//@ edition: 2021
|
||||
|
||||
fn test(x: &'r#r#r ()) {}
|
||||
//~^ ERROR expected type, found `#`
|
||||
|
||||
fn main() {}
|
8
tests/ui/lifetimes/raw/multiple-prefixes.stderr
Normal file
8
tests/ui/lifetimes/raw/multiple-prefixes.stderr
Normal file
|
@ -0,0 +1,8 @@
|
|||
error: expected type, found `#`
|
||||
--> $DIR/multiple-prefixes.rs:3:17
|
||||
|
|
||||
LL | fn test(x: &'r#r#r ()) {}
|
||||
| ^ expected type
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
8
tests/ui/lifetimes/raw/prim-lt.rs
Normal file
8
tests/ui/lifetimes/raw/prim-lt.rs
Normal file
|
@ -0,0 +1,8 @@
|
|||
//@ check-pass
|
||||
//@ edition: 2021
|
||||
|
||||
// Checks a primitive name can be defined as a lifetime.
|
||||
|
||||
fn foo<'r#i32>() {}
|
||||
|
||||
fn main() {}
|
21
tests/ui/lifetimes/raw/simple.rs
Normal file
21
tests/ui/lifetimes/raw/simple.rs
Normal file
|
@ -0,0 +1,21 @@
|
|||
//@ check-pass
|
||||
//@ edition: 2021
|
||||
|
||||
fn foo<'r#struct>() {}
|
||||
|
||||
fn hr<T>() where for<'r#struct> T: Into<&'r#struct ()> {}
|
||||
|
||||
trait Foo<'r#struct> {}
|
||||
|
||||
trait Bar<'r#struct> {
|
||||
fn method(&'r#struct self) {}
|
||||
fn method2(self: &'r#struct Self) {}
|
||||
}
|
||||
|
||||
fn labeled() {
|
||||
'r#struct: loop {
|
||||
break 'r#struct;
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {}
|
8
tests/ui/lifetimes/raw/static-lt.rs
Normal file
8
tests/ui/lifetimes/raw/static-lt.rs
Normal file
|
@ -0,0 +1,8 @@
|
|||
//@ check-pass
|
||||
//@ edition: 2021
|
||||
|
||||
// Makes sure that `'r#static` is `'static`
|
||||
|
||||
const FOO: &'r#static str = "hello, world";
|
||||
|
||||
fn main() {}
|
12
tests/ui/lifetimes/raw/three-tokens.rs
Normal file
12
tests/ui/lifetimes/raw/three-tokens.rs
Normal file
|
@ -0,0 +1,12 @@
|
|||
//@ edition: 2015
|
||||
//@ check-pass
|
||||
// Ensure that we parse `'r#lt` as three tokens in edition 2015.
|
||||
|
||||
macro_rules! ed2015 {
|
||||
('r # lt) => {};
|
||||
($lt:lifetime) => { compile_error!() };
|
||||
}
|
||||
|
||||
ed2015!('r#lt);
|
||||
|
||||
fn main() {}
|
|
@ -31,5 +31,14 @@ LL | () => { mod test { fn gen() {} } }
|
|||
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2024!
|
||||
= note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
|
||||
|
||||
error: aborting due to 3 previous errors
|
||||
error: `gen` is a keyword in the 2024 edition
|
||||
--> $DIR/gen-kw.rs:25:9
|
||||
|
|
||||
LL | fn test<'gen>() {}
|
||||
| ^^^^ help: you can use a raw identifier to stay compatible: `'r#gen`
|
||||
|
|
||||
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2024!
|
||||
= note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
|
||||
|
||||
error: aborting due to 4 previous errors
|
||||
|
||||
|
|
|
@ -31,5 +31,14 @@ LL | () => { mod test { fn gen() {} } }
|
|||
= warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2024!
|
||||
= note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
|
||||
|
||||
error: aborting due to 3 previous errors
|
||||
error: `gen` is a keyword in the 2024 edition
|
||||
--> $DIR/gen-kw.rs:25:9
|
||||
|
|
||||
LL | fn test<'gen>() {}
|
||||
| ^^^^ help: you can use a raw identifier to stay compatible: `'r#gen`
|
||||
|
|
||||
= warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2024!
|
||||
= note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
|
||||
|
||||
error: aborting due to 4 previous errors
|
||||
|
||||
|
|
|
@ -22,4 +22,9 @@ macro_rules! t {
|
|||
//[e2018]~| WARNING this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2024!
|
||||
}
|
||||
|
||||
fn test<'gen>() {}
|
||||
//~^ ERROR `gen` is a keyword in the 2024 edition
|
||||
//[e2015]~| WARNING this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2024!
|
||||
//[e2018]~| WARNING this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2024!
|
||||
|
||||
t!();
|
||||
|
|
Loading…
Add table
Reference in a new issue