Skip to content

Commit

Permalink
Auto merge of rust-lang#3126 - rust-lang:rustup-2023-10-17, r=RalfJung
Browse files Browse the repository at this point in the history
Automatic Rustup
  • Loading branch information
bors committed Oct 17, 2023
2 parents c1dbc19 + d6f52bf commit f408492
Show file tree
Hide file tree
Showing 787 changed files with 8,973 additions and 5,939 deletions.
2 changes: 2 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@ b39a1d6f1a30ba29f25d7141038b9a5bf0126e36
f97fddab91fbf290ea5b691fe355d6f915220b6e
# format let-else
cc907f80b95c6ec530c5ee1b05b044a468f07eca
# format let-chains
b2d2184edea578109a48ec3d8decbee5948e8f35
6 changes: 5 additions & 1 deletion .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,9 @@ Lindsey Kuper <lindsey@composition.al> <lindsey@rockstargirl.org>
Lindsey Kuper <lindsey@composition.al> <lkuper@mozilla.com>
Liu Dingming <liudingming@bytedance.com>
Loo Maclin <loo.maclin@protonmail.com>
Loïc BRANSTETT <lolo.branstett@numericable.fr>
Urgau <urgau@numericable.fr>
Urgau <urgau@numericable.fr> <lolo.branstett@numericable.fr>
Urgau <urgau@numericable.fr> <3616612+Urgau@users.noreply.github.com>
Lucy <luxx4x@protonmail.com>
Lukas H. <lukaramu@users.noreply.github.com>
Lukas Lueg <lukas.lueg@gmail.com>
Expand Down Expand Up @@ -445,6 +447,8 @@ Oliver Scherer <oli-obk@users.noreply.github.com> <public.oliver.schneider@kit.e
Oliver Scherer <oli-obk@users.noreply.github.com> <oliver.schneider@kit.edu>
Oliver Scherer <oli-obk@users.noreply.github.com> <obk8176014uqher834@olio-obk.de>
Oliver Scherer <oli-obk@users.noreply.github.com>
Onur Özkan <onurozkan.dev@outlook.com> <work@onurozkan.dev>
Onur Özkan <onurozkan.dev@outlook.com>
Ömer Sinan Ağacan <omeragacan@gmail.com>
Ophir LOJKINE <pere.jobs@gmail.com>
Ožbolt Menegatti <ozbolt.menegatti@gmail.com> gareins <ozbolt.menegatti@gmail.com>
Expand Down
55 changes: 9 additions & 46 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2150,9 +2150,9 @@ checksum = "db13adb97ab515a3691f56e4dbab09283d0b86cb45abd991d8634a9d6f501760"

[[package]]
name = "libc"
version = "0.2.148"
version = "0.2.149"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9cdc71e17332e86d2e1d38c1f99edcb6288ee11b815fb1a4b049eaa2114d369b"
checksum = "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b"
dependencies = [
"rustc-std-workspace-core",
]
Expand Down Expand Up @@ -2245,9 +2245,9 @@ dependencies = [

[[package]]
name = "linux-raw-sys"
version = "0.4.7"
version = "0.4.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1a9bad9f94746442c783ca431b22403b519cd7fbeed0533fdd6328b2f2212128"
checksum = "da2479e8c062e40bf0066ffa0bc823de0a9368974af99c9f6df941d2c231e03f"

[[package]]
name = "litemap"
Expand Down Expand Up @@ -2418,9 +2418,9 @@ dependencies = [

[[package]]
name = "minifier"
version = "0.2.2"
version = "0.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8eb022374af2f446981254e6bf9efb6e2c9e1a53176d395fca02792fd4435729"
checksum = "5394aa376422b4b2b6c02fd9cfcb657e4ec544ae98e43d7d5d785fd0d042fd6d"

[[package]]
name = "minimal-lexical"
Expand Down Expand Up @@ -2970,30 +2970,6 @@ dependencies = [
"pad",
]

[[package]]
name = "proc-macro-error"
version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c"
dependencies = [
"proc-macro-error-attr",
"proc-macro2",
"quote",
"syn 1.0.109",
"version_check",
]

[[package]]
name = "proc-macro-error-attr"
version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869"
dependencies = [
"proc-macro2",
"quote",
"version_check",
]

[[package]]
name = "proc-macro-hack"
version = "0.5.20+deprecated"
Expand Down Expand Up @@ -4480,6 +4456,7 @@ dependencies = [
name = "rustc_session"
version = "0.0.0"
dependencies = [
"bitflags 1.3.2",
"getopts",
"libc",
"rustc_ast",
Expand Down Expand Up @@ -4779,9 +4756,9 @@ dependencies = [

[[package]]
name = "rustix"
version = "0.38.14"
version = "0.38.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "747c788e9ce8e92b12cd485c49ddf90723550b654b32508f979b71a7b1ecda4f"
checksum = "745ecfa778e66b2b63c88a61cb36e0eea109e803b0b86bf9879fbc77c70e86ed"
dependencies = [
"bitflags 2.4.0",
"errno",
Expand Down Expand Up @@ -5252,23 +5229,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4d38d39c754ae037a9bc3ca1580a985db7371cd14f1229172d1db9093feb6739"
dependencies = [
"papergrid",
"tabled_derive",
"unicode-width",
]

[[package]]
name = "tabled_derive"
version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "99f688a08b54f4f02f0a3c382aefdb7884d3d69609f785bd253dc033243e3fe4"
dependencies = [
"heck",
"proc-macro-error",
"proc-macro2",
"quote",
"syn 1.0.109",
]

[[package]]
name = "tar"
version = "0.4.38"
Expand Down
3 changes: 3 additions & 0 deletions compiler/rustc_abi/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#![cfg_attr(feature = "nightly", feature(step_trait))]
#![cfg_attr(feature = "nightly", allow(internal_features))]
#![cfg_attr(all(not(bootstrap), feature = "nightly"), doc(rust_logo))]
#![cfg_attr(all(not(bootstrap), feature = "nightly"), feature(rustdoc_internals))]

use std::fmt;
use std::num::{NonZeroUsize, ParseIntError};
Expand Down Expand Up @@ -681,6 +683,7 @@ impl fmt::Display for AlignFromBytesError {

impl Align {
pub const ONE: Align = Align { pow2: 0 };
// LLVM has a maximal supported alignment of 2^29, we inherit that.
pub const MAX: Align = Align { pow2: 29 };

#[inline]
Expand Down
4 changes: 1 addition & 3 deletions compiler/rustc_ast/src/attr/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -520,9 +520,7 @@ impl NestedMetaItem {
I: Iterator<Item = &'a TokenTree>,
{
match tokens.peek() {
Some(TokenTree::Token(token, _))
if let Some(lit) = MetaItemLit::from_token(token) =>
{
Some(TokenTree::Token(token, _)) if let Some(lit) = MetaItemLit::from_token(token) => {
tokens.next();
return Some(NestedMetaItem::Lit(lit));
}
Expand Down
4 changes: 3 additions & 1 deletion compiler/rustc_ast/src/entry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ pub fn entry_point_type(
} else if attr::contains_name(attrs, sym::rustc_main) {
EntryPointType::RustcMainAttr
} else {
if let Some(name) = name && name == sym::main {
if let Some(name) = name
&& name == sym::main
{
if at_root {
// This is a top-level function so it can be `main`.
EntryPointType::MainNamed
Expand Down
41 changes: 35 additions & 6 deletions compiler/rustc_ast/src/token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,11 @@ impl Lit {
/// Keep this in sync with `Token::can_begin_literal_or_bool` excluding unary negation.
pub fn from_token(token: &Token) -> Option<Lit> {
match token.uninterpolate().kind {
Ident(name, false) if name.is_bool_lit() => {
Some(Lit::new(Bool, name, None))
}
Ident(name, false) if name.is_bool_lit() => Some(Lit::new(Bool, name, None)),
Literal(token_lit) => Some(token_lit),
Interpolated(ref nt)
if let NtExpr(expr) | NtLiteral(expr) = &**nt
&& let ast::ExprKind::Lit(token_lit) = expr.kind =>
&& let ast::ExprKind::Lit(token_lit) = expr.kind =>
{
Some(token_lit)
}
Expand Down Expand Up @@ -229,35 +227,61 @@ fn ident_can_begin_type(name: Symbol, span: Span, is_raw: bool) -> bool {
#[derive(PartialEq, Encodable, Decodable, Debug, HashStable_Generic)]
pub enum TokenKind {
/* Expression-operator symbols. */
/// `=`
Eq,
/// `<`
Lt,
/// `<=`
Le,
/// `==`
EqEq,
/// `!=`
Ne,
/// `>`
Ge,
/// `>=`
Gt,
/// `&&`
AndAnd,
/// `||`
OrOr,
/// `!`
Not,
/// `~`
Tilde,
BinOp(BinOpToken),
BinOpEq(BinOpToken),

/* Structural symbols */
/// `@`
At,
/// `.`
Dot,
/// `..`
DotDot,
/// `...`
DotDotDot,
/// `..=`
DotDotEq,
/// `,`
Comma,
/// `;`
Semi,
/// `:`
Colon,
/// `::`
ModSep,
/// `->`
RArrow,
/// `<-`
LArrow,
/// `=>`
FatArrow,
/// `#`
Pound,
/// `$`
Dollar,
/// `?`
Question,
/// Used by proc macros for representing lifetimes, not generated by lexer right now.
SingleQuote,
Expand Down Expand Up @@ -296,6 +320,7 @@ pub enum TokenKind {
/// similarly to symbols in string literal tokens.
DocComment(CommentKind, ast::AttrStyle, Symbol),

/// End Of File
Eof,
}

Expand Down Expand Up @@ -628,7 +653,9 @@ impl Token {

/// Returns `true` if the token is an interpolated path.
fn is_path(&self) -> bool {
if let Interpolated(nt) = &self.kind && let NtPath(..) = **nt {
if let Interpolated(nt) = &self.kind
&& let NtPath(..) = **nt
{
return true;
}

Expand All @@ -650,7 +677,9 @@ impl Token {

/// Is the token an interpolated block (`$b:block`)?
pub fn is_whole_block(&self) -> bool {
if let Interpolated(nt) = &self.kind && let NtBlock(..) = **nt {
if let Interpolated(nt) = &self.kind
&& let NtBlock(..) = **nt
{
return true;
}

Expand Down
4 changes: 3 additions & 1 deletion compiler/rustc_ast/src/tokenstream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,9 @@ impl TokenStream {

let stream_iter = stream.0.iter().cloned();

if let Some(first) = stream.0.first() && Self::try_glue_to_last(vec_mut, first) {
if let Some(first) = stream.0.first()
&& Self::try_glue_to_last(vec_mut, first)
{
// Now skip the first token tree from `stream`.
vec_mut.extend(stream_iter.skip(1));
} else {
Expand Down
6 changes: 0 additions & 6 deletions compiler/rustc_ast_lowering/messages.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,6 @@ ast_lowering_template_modifier = template modifier
ast_lowering_this_not_async = this is not `async`
ast_lowering_trait_fn_async =
functions in traits cannot be declared `async`
.label = `async` because of this
.note = `async` trait functions are not currently supported
.note2 = consider using the `async-trait` crate: https://crates.io/crates/async-trait
ast_lowering_underscore_expr_lhs_assign =
in expressions, `_` can only be used on the left-hand side of an assignment
.label = `_` not allowed here
Expand Down
11 changes: 0 additions & 11 deletions compiler/rustc_ast_lowering/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -354,17 +354,6 @@ pub struct InclusiveRangeWithNoEnd {
pub span: Span,
}

#[derive(Diagnostic, Clone, Copy)]
#[diag(ast_lowering_trait_fn_async, code = "E0706")]
#[note]
#[note(ast_lowering_note2)]
pub struct TraitFnAsync {
#[primary_span]
pub fn_span: Span,
#[label]
pub span: Span,
}

#[derive(Diagnostic)]
pub enum BadReturnTypeNotation {
#[diag(ast_lowering_bad_return_type_notation_inputs)]
Expand Down
20 changes: 15 additions & 5 deletions compiler/rustc_ast_lowering/src/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -673,12 +673,18 @@ impl<'hir> LoweringContext<'_, 'hir> {
&& let Some(attrs) = self.attrs.get(&outer_hir_id.local_id)
&& attrs.into_iter().any(|attr| attr.has_name(sym::track_caller))
{
let unstable_span =
self.mark_span_with_reason(DesugaringKind::Async, span, self.allow_gen_future.clone());
let unstable_span = self.mark_span_with_reason(
DesugaringKind::Async,
span,
self.allow_gen_future.clone(),
);
self.lower_attrs(
inner_hir_id,
&[Attribute {
kind: AttrKind::Normal(ptr::P(NormalAttr::from_ident(Ident::new(sym::track_caller, span)))),
kind: AttrKind::Normal(ptr::P(NormalAttr::from_ident(Ident::new(
sym::track_caller,
span,
)))),
id: self.tcx.sess.parse_sess.attr_id_generator.mk_attr_id(),
style: AttrStyle::Outer,
span: unstable_span,
Expand Down Expand Up @@ -1102,7 +1108,9 @@ impl<'hir> LoweringContext<'_, 'hir> {
if let ExprKind::Path(qself, path) = &expr.kind {
// Does the path resolve to something disallowed in a tuple struct/variant pattern?
if let Some(partial_res) = self.resolver.get_partial_res(expr.id) {
if let Some(res) = partial_res.full_res() && !res.expected_in_tuple_struct_pat() {
if let Some(res) = partial_res.full_res()
&& !res.expected_in_tuple_struct_pat()
{
return None;
}
}
Expand All @@ -1122,7 +1130,9 @@ impl<'hir> LoweringContext<'_, 'hir> {
if let ExprKind::Path(qself, path) = &expr.kind {
// Does the path resolve to something disallowed in a unit struct/variant pattern?
if let Some(partial_res) = self.resolver.get_partial_res(expr.id) {
if let Some(res) = partial_res.full_res() && !res.expected_in_unit_struct_pat() {
if let Some(res) = partial_res.full_res()
&& !res.expected_in_unit_struct_pat()
{
return None;
}
}
Expand Down
7 changes: 5 additions & 2 deletions compiler/rustc_ast_lowering/src/format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,12 @@ fn flatten_format_args(mut fmt: Cow<'_, FormatArgs>) -> Cow<'_, FormatArgs> {
let remaining_args = args.split_off(arg_index + 1);
let old_arg_offset = args.len();
let mut fmt2 = &mut args.pop().unwrap().expr; // The inner FormatArgs.
let fmt2 = loop { // Unwrap the Expr to get to the FormatArgs.
let fmt2 = loop {
// Unwrap the Expr to get to the FormatArgs.
match &mut fmt2.kind {
ExprKind::Paren(inner) | ExprKind::AddrOf(BorrowKind::Ref, _, inner) => fmt2 = inner,
ExprKind::Paren(inner) | ExprKind::AddrOf(BorrowKind::Ref, _, inner) => {
fmt2 = inner
}
ExprKind::FormatArgs(fmt2) => break fmt2,
_ => unreachable!(),
}
Expand Down
Loading

0 comments on commit f408492

Please sign in to comment.