Skip to content

Commit

Permalink
Auto merge of #3975 - rust-lang:rustup-2024-10-17, r=RalfJung
Browse files Browse the repository at this point in the history
Automatic Rustup
  • Loading branch information
bors committed Oct 17, 2024
2 parents 1f501a7 + 8640c43 commit f7ccac9
Show file tree
Hide file tree
Showing 648 changed files with 9,558 additions and 4,423 deletions.
1 change: 1 addition & 0 deletions .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ Jerry Hardee <hardeejj9@gmail.com>
Jesús Rubio <jesusprubio@gmail.com>
Jethro Beekman <github@jbeekman.nl>
Jian Zeng <knight42@mail.ustc.edu.cn>
Jieyou Xu <jieyouxu@outlook.com> <39484203+jieyouxu@users.noreply.github.com>
Jihyun Yu <j.yu@navercorp.com> <yjh0502@gmail.com>
Jihyun Yu <j.yu@navercorp.com> jihyun <jihyun@nablecomm.com>
Jihyun Yu <j.yu@navercorp.com> Jihyun Yu <jihyun@nclab.kaist.ac.kr>
Expand Down
5 changes: 4 additions & 1 deletion Cargo.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 3
version = 4

[[package]]
name = "addr2line"
Expand Down Expand Up @@ -3857,6 +3857,7 @@ dependencies = [
"rustc_target",
"rustc_type_ir",
"smallvec",
"thin-vec",
"tracing",
]

Expand Down Expand Up @@ -4496,6 +4497,7 @@ dependencies = [
"rustc_transmute",
"rustc_type_ir",
"smallvec",
"thin-vec",
"tracing",
]

Expand Down Expand Up @@ -4567,6 +4569,7 @@ dependencies = [
"rustc_span",
"rustc_type_ir_macros",
"smallvec",
"thin-vec",
"tracing",
]

Expand Down
177 changes: 177 additions & 0 deletions RELEASES.md

Large diffs are not rendered by default.

32 changes: 25 additions & 7 deletions compiler/rustc_ast/src/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use std::{cmp, fmt, mem};

pub use GenericArgs::*;
pub use UnsafeSource::*;
pub use rustc_ast_ir::{Movability, Mutability};
pub use rustc_ast_ir::{Movability, Mutability, Pinnedness};
use rustc_data_structures::packed::Pu128;
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
use rustc_data_structures::stack::ensure_sufficient_stack;
Expand Down Expand Up @@ -308,7 +308,7 @@ impl TraitBoundModifiers {

#[derive(Clone, Encodable, Decodable, Debug)]
pub enum GenericBound {
Trait(PolyTraitRef, TraitBoundModifiers),
Trait(PolyTraitRef),
Outlives(Lifetime),
/// Precise capturing syntax: `impl Sized + use<'a>`
Use(ThinVec<PreciseCapturingArg>, Span),
Expand Down Expand Up @@ -1213,10 +1213,12 @@ impl Expr {

pub fn to_bound(&self) -> Option<GenericBound> {
match &self.kind {
ExprKind::Path(None, path) => Some(GenericBound::Trait(
PolyTraitRef::new(ThinVec::new(), path.clone(), self.span),
ExprKind::Path(None, path) => Some(GenericBound::Trait(PolyTraitRef::new(
ThinVec::new(),
path.clone(),
TraitBoundModifiers::NONE,
)),
self.span,
))),
_ => None,
}
}
Expand Down Expand Up @@ -2161,6 +2163,10 @@ pub enum TyKind {
Ptr(MutTy),
/// A reference (`&'a T` or `&'a mut T`).
Ref(Option<Lifetime>, MutTy),
/// A pinned reference (`&'a pin const T` or `&'a pin mut T`).
///
/// Desugars into `Pin<&'a T>` or `Pin<&'a mut T>`.
PinnedRef(Option<Lifetime>, MutTy),
/// A bare function (e.g., `fn(usize) -> bool`).
BareFn(P<BareFnTy>),
/// The never type (`!`).
Expand Down Expand Up @@ -2501,7 +2507,10 @@ impl Param {
if ident.name == kw::SelfLower {
return match self.ty.kind {
TyKind::ImplicitSelf => Some(respan(self.pat.span, SelfKind::Value(mutbl))),
TyKind::Ref(lt, MutTy { ref ty, mutbl }) if ty.kind.is_implicit_self() => {
TyKind::Ref(lt, MutTy { ref ty, mutbl })
| TyKind::PinnedRef(lt, MutTy { ref ty, mutbl })
if ty.kind.is_implicit_self() =>
{
Some(respan(self.pat.span, SelfKind::Region(lt, mutbl)))
}
_ => Some(respan(
Expand Down Expand Up @@ -2965,16 +2974,25 @@ pub struct PolyTraitRef {
/// The `'a` in `for<'a> Foo<&'a T>`.
pub bound_generic_params: ThinVec<GenericParam>,

// Optional constness, asyncness, or polarity.
pub modifiers: TraitBoundModifiers,

/// The `Foo<&'a T>` in `<'a> Foo<&'a T>`.
pub trait_ref: TraitRef,

pub span: Span,
}

impl PolyTraitRef {
pub fn new(generic_params: ThinVec<GenericParam>, path: Path, span: Span) -> Self {
pub fn new(
generic_params: ThinVec<GenericParam>,
path: Path,
modifiers: TraitBoundModifiers,
span: Span,
) -> Self {
PolyTraitRef {
bound_generic_params: generic_params,
modifiers,
trait_ref: TraitRef { path, ref_id: DUMMY_NODE_ID },
span,
}
Expand Down
Loading

0 comments on commit f7ccac9

Please sign in to comment.