Skip to content

Commit f7ccac9

Browse files
committed
Auto merge of rust-lang#3975 - rust-lang:rustup-2024-10-17, r=RalfJung
Automatic Rustup
2 parents 1f501a7 + 8640c43 commit f7ccac9

File tree

648 files changed

+9558
-4423
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

648 files changed

+9558
-4423
lines changed

.mailmap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,7 @@ Jerry Hardee <[email protected]>
280280
Jesús Rubio <[email protected]>
281281
Jethro Beekman <[email protected]>
282282
Jian Zeng <[email protected]>
283+
283284
284285
285286
Jihyun Yu <[email protected]> Jihyun Yu <[email protected]>

Cargo.lock

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This file is automatically @generated by Cargo.
22
# It is not intended for manual editing.
3-
version = 3
3+
version = 4
44

55
[[package]]
66
name = "addr2line"
@@ -3857,6 +3857,7 @@ dependencies = [
38573857
"rustc_target",
38583858
"rustc_type_ir",
38593859
"smallvec",
3860+
"thin-vec",
38603861
"tracing",
38613862
]
38623863

@@ -4496,6 +4497,7 @@ dependencies = [
44964497
"rustc_transmute",
44974498
"rustc_type_ir",
44984499
"smallvec",
4500+
"thin-vec",
44994501
"tracing",
45004502
]
45014503

@@ -4567,6 +4569,7 @@ dependencies = [
45674569
"rustc_span",
45684570
"rustc_type_ir_macros",
45694571
"smallvec",
4572+
"thin-vec",
45704573
"tracing",
45714574
]
45724575

RELEASES.md

Lines changed: 177 additions & 0 deletions
Large diffs are not rendered by default.

compiler/rustc_ast/src/ast.rs

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ use std::{cmp, fmt, mem};
2323

2424
pub use GenericArgs::*;
2525
pub use UnsafeSource::*;
26-
pub use rustc_ast_ir::{Movability, Mutability};
26+
pub use rustc_ast_ir::{Movability, Mutability, Pinnedness};
2727
use rustc_data_structures::packed::Pu128;
2828
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
2929
use rustc_data_structures::stack::ensure_sufficient_stack;
@@ -308,7 +308,7 @@ impl TraitBoundModifiers {
308308

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

12141214
pub fn to_bound(&self) -> Option<GenericBound> {
12151215
match &self.kind {
1216-
ExprKind::Path(None, path) => Some(GenericBound::Trait(
1217-
PolyTraitRef::new(ThinVec::new(), path.clone(), self.span),
1216+
ExprKind::Path(None, path) => Some(GenericBound::Trait(PolyTraitRef::new(
1217+
ThinVec::new(),
1218+
path.clone(),
12181219
TraitBoundModifiers::NONE,
1219-
)),
1220+
self.span,
1221+
))),
12201222
_ => None,
12211223
}
12221224
}
@@ -2161,6 +2163,10 @@ pub enum TyKind {
21612163
Ptr(MutTy),
21622164
/// A reference (`&'a T` or `&'a mut T`).
21632165
Ref(Option<Lifetime>, MutTy),
2166+
/// A pinned reference (`&'a pin const T` or `&'a pin mut T`).
2167+
///
2168+
/// Desugars into `Pin<&'a T>` or `Pin<&'a mut T>`.
2169+
PinnedRef(Option<Lifetime>, MutTy),
21642170
/// A bare function (e.g., `fn(usize) -> bool`).
21652171
BareFn(P<BareFnTy>),
21662172
/// The never type (`!`).
@@ -2501,7 +2507,10 @@ impl Param {
25012507
if ident.name == kw::SelfLower {
25022508
return match self.ty.kind {
25032509
TyKind::ImplicitSelf => Some(respan(self.pat.span, SelfKind::Value(mutbl))),
2504-
TyKind::Ref(lt, MutTy { ref ty, mutbl }) if ty.kind.is_implicit_self() => {
2510+
TyKind::Ref(lt, MutTy { ref ty, mutbl })
2511+
| TyKind::PinnedRef(lt, MutTy { ref ty, mutbl })
2512+
if ty.kind.is_implicit_self() =>
2513+
{
25052514
Some(respan(self.pat.span, SelfKind::Region(lt, mutbl)))
25062515
}
25072516
_ => Some(respan(
@@ -2965,16 +2974,25 @@ pub struct PolyTraitRef {
29652974
/// The `'a` in `for<'a> Foo<&'a T>`.
29662975
pub bound_generic_params: ThinVec<GenericParam>,
29672976

2977+
// Optional constness, asyncness, or polarity.
2978+
pub modifiers: TraitBoundModifiers,
2979+
29682980
/// The `Foo<&'a T>` in `<'a> Foo<&'a T>`.
29692981
pub trait_ref: TraitRef,
29702982

29712983
pub span: Span,
29722984
}
29732985

29742986
impl PolyTraitRef {
2975-
pub fn new(generic_params: ThinVec<GenericParam>, path: Path, span: Span) -> Self {
2987+
pub fn new(
2988+
generic_params: ThinVec<GenericParam>,
2989+
path: Path,
2990+
modifiers: TraitBoundModifiers,
2991+
span: Span,
2992+
) -> Self {
29762993
PolyTraitRef {
29772994
bound_generic_params: generic_params,
2995+
modifiers,
29782996
trait_ref: TraitRef { path, ref_id: DUMMY_NODE_ID },
29792997
span,
29802998
}

0 commit comments

Comments
 (0)