Skip to content

Commit 4624dad

Browse files
authored
Merge pull request rust-lang#4063 from rust-lang/rustup-2024-11-28
Automatic Rustup
2 parents 987d642 + 8e2d72b commit 4624dad

File tree

1,582 files changed

+11790
-8451
lines changed

Some content is hidden

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

1,582 files changed

+11790
-8451
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ jobs:
6565
defaults:
6666
run:
6767
shell: ${{ contains(matrix.os, 'windows') && 'msys2 {0}' || 'bash' }}
68-
timeout-minutes: 240
68+
timeout-minutes: 360
6969
env:
7070
CI_JOB_NAME: ${{ matrix.image }}
7171
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse

COPYRIGHT

Lines changed: 36 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -343,49 +343,42 @@ their own copyright notices and license terms:
343343
* Portions of internationalization code use code or data from Unicode, which
344344
carry the following license:
345345

346-
UNICODE, INC. LICENSE AGREEMENT - DATA FILES AND SOFTWARE
347-
348-
See Terms of Use <https://www.unicode.org/copyright.html>
349-
for definitions of Unicode Inc.’s Data Files and Software.
350-
351-
NOTICE TO USER: Carefully read the following legal agreement.
352-
BY DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S
353-
DATA FILES ("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"),
354-
YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE
355-
TERMS AND CONDITIONS OF THIS AGREEMENT.
356-
IF YOU DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE
357-
THE DATA FILES OR SOFTWARE.
346+
UNICODE LICENSE V3
358347

359348
COPYRIGHT AND PERMISSION NOTICE
360349

361-
Copyright © 1991-2022 Unicode, Inc. All rights reserved.
362-
Distributed under the Terms of Use in https://www.unicode.org/copyright.html.
363-
364-
Permission is hereby granted, free of charge, to any person obtaining
365-
a copy of the Unicode data files and any associated documentation
366-
(the "Data Files") or Unicode software and any associated documentation
367-
(the "Software") to deal in the Data Files or Software
368-
without restriction, including without limitation the rights to use,
369-
copy, modify, merge, publish, distribute, and/or sell copies of
370-
the Data Files or Software, and to permit persons to whom the Data Files
371-
or Software are furnished to do so, provided that either
372-
(a) this copyright and permission notice appear with all copies
373-
of the Data Files or Software, or
374-
(b) this copyright and permission notice appear in associated
375-
Documentation.
376-
377-
THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF
378-
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
379-
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
380-
NONINFRINGEMENT OF THIRD PARTY RIGHTS.
381-
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS
382-
NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL
383-
DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
384-
DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
385-
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
386-
PERFORMANCE OF THE DATA FILES OR SOFTWARE.
387-
388-
Except as contained in this notice, the name of a copyright holder
389-
shall not be used in advertising or otherwise to promote the sale,
390-
use or other dealings in these Data Files or Software without prior
391-
written authorization of the copyright holder.
350+
Copyright © 1991-2024 Unicode, Inc.
351+
352+
NOTICE TO USER: Carefully read the following legal agreement. BY
353+
DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING DATA FILES, AND/OR
354+
SOFTWARE, YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE
355+
TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU DO NOT AGREE, DO NOT
356+
DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE THE DATA FILES OR SOFTWARE.
357+
358+
Permission is hereby granted, free of charge, to any person obtaining a
359+
copy of data files and any associated documentation (the "Data Files") or
360+
software and any associated documentation (the "Software") to deal in the
361+
Data Files or Software without restriction, including without limitation
362+
the rights to use, copy, modify, merge, publish, distribute, and/or sell
363+
copies of the Data Files or Software, and to permit persons to whom the
364+
Data Files or Software are furnished to do so, provided that either (a)
365+
this copyright and permission notice appear with all copies of the Data
366+
Files or Software, or (b) this copyright and permission notice appear in
367+
associated Documentation.
368+
369+
THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
370+
KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
371+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
372+
THIRD PARTY RIGHTS.
373+
374+
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE
375+
BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES,
376+
OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
377+
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
378+
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA
379+
FILES OR SOFTWARE.
380+
381+
Except as contained in this notice, the name of a copyright holder shall
382+
not be used in advertising or otherwise to promote the sale, use or other
383+
dealings in these Data Files or Software without prior written
384+
authorization of the copyright holder.

Cargo.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -411,9 +411,9 @@ version = "0.1.0"
411411

412412
[[package]]
413413
name = "cc"
414-
version = "1.1.34"
414+
version = "1.2.0"
415415
source = "registry+https://github.com/rust-lang/crates.io-index"
416-
checksum = "67b9470d453346108f93a59222a9a1a5724db32d0a4727b7ab7ace4b4d822dc9"
416+
checksum = "1aeb932158bd710538c73702db6945cb68a8fb08c519e6e12706b94263b36db8"
417417
dependencies = [
418418
"shlex",
419419
]

LICENSES/Unicode-3.0.txt

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
UNICODE LICENSE V3
2+
3+
COPYRIGHT AND PERMISSION NOTICE
4+
5+
Copyright © 1991-2024 Unicode, Inc.
6+
7+
NOTICE TO USER: Carefully read the following legal agreement. BY
8+
DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING DATA FILES, AND/OR
9+
SOFTWARE, YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE
10+
TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU DO NOT AGREE, DO NOT
11+
DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE THE DATA FILES OR SOFTWARE.
12+
13+
Permission is hereby granted, free of charge, to any person obtaining a
14+
copy of data files and any associated documentation (the "Data Files") or
15+
software and any associated documentation (the "Software") to deal in the
16+
Data Files or Software without restriction, including without limitation
17+
the rights to use, copy, modify, merge, publish, distribute, and/or sell
18+
copies of the Data Files or Software, and to permit persons to whom the
19+
Data Files or Software are furnished to do so, provided that either (a)
20+
this copyright and permission notice appear with all copies of the Data
21+
Files or Software, or (b) this copyright and permission notice appear in
22+
associated Documentation.
23+
24+
THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
25+
KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
26+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
27+
THIRD PARTY RIGHTS.
28+
29+
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE
30+
BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES,
31+
OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
32+
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
33+
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA
34+
FILES OR SOFTWARE.
35+
36+
Except as contained in this notice, the name of a copyright holder shall
37+
not be used in advertising or otherwise to promote the sale, use or other
38+
dealings in these Data Files or Software without prior written
39+
authorization of the copyright holder.

LICENSES/Unicode-DFS-2016.txt

Lines changed: 0 additions & 22 deletions
This file was deleted.

REUSE.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ path = [
2828
"COPYRIGHT",
2929
"INSTALL.md",
3030
"LICENSE-APACHE",
31+
"license-metadata.json",
3132
"LICENSE-MIT",
3233
"README.md",
3334
"RELEASES.md",
@@ -63,8 +64,8 @@ SPDX-License-Identifier = "Apache-2.0 WITH LLVM-exception AND (Apache-2.0 OR MIT
6364
[[annotations]]
6465
path = "library/core/src/unicode/unicode_data.rs"
6566
precedence = "override"
66-
SPDX-FileCopyrightText = "1991-2022 Unicode, Inc. All rights reserved."
67-
SPDX-License-Identifier = "Unicode-DFS-2016"
67+
SPDX-FileCopyrightText = "1991-2024 Unicode, Inc."
68+
SPDX-License-Identifier = "Unicode-3.0"
6869

6970
[[annotations]]
7071
path = "library/std/src/sync/mpmc/**"

compiler/rustc_abi/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,7 @@ impl AddAssign for Size {
638638
#[cfg(feature = "nightly")]
639639
impl Step for Size {
640640
#[inline]
641-
fn steps_between(start: &Self, end: &Self) -> Option<usize> {
641+
fn steps_between(start: &Self, end: &Self) -> (usize, Option<usize>) {
642642
u64::steps_between(&start.bytes(), &end.bytes())
643643
}
644644

compiler/rustc_ast/src/ast.rs

Lines changed: 76 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ pub use crate::format::*;
3939
use crate::ptr::P;
4040
use crate::token::{self, CommentKind, Delimiter};
4141
use crate::tokenstream::{DelimSpan, LazyAttrTokenStream, TokenStream};
42-
pub use crate::util::parser::ExprPrecedence;
42+
use crate::util::parser::{
43+
AssocOp, PREC_CLOSURE, PREC_JUMP, PREC_PREFIX, PREC_RANGE, PREC_UNAMBIGUOUS,
44+
};
4345

4446
/// A "Label" is an identifier of some point in sources,
4547
/// e.g. in the following code:
@@ -428,7 +430,15 @@ impl Default for WhereClause {
428430

429431
/// A single predicate in a where-clause.
430432
#[derive(Clone, Encodable, Decodable, Debug)]
431-
pub enum WherePredicate {
433+
pub struct WherePredicate {
434+
pub kind: WherePredicateKind,
435+
pub id: NodeId,
436+
pub span: Span,
437+
}
438+
439+
/// Predicate kind in where-clause.
440+
#[derive(Clone, Encodable, Decodable, Debug)]
441+
pub enum WherePredicateKind {
432442
/// A type bound (e.g., `for<'c> Foo: Send + Clone + 'c`).
433443
BoundPredicate(WhereBoundPredicate),
434444
/// A lifetime predicate (e.g., `'a: 'b + 'c`).
@@ -437,22 +447,11 @@ pub enum WherePredicate {
437447
EqPredicate(WhereEqPredicate),
438448
}
439449

440-
impl WherePredicate {
441-
pub fn span(&self) -> Span {
442-
match self {
443-
WherePredicate::BoundPredicate(p) => p.span,
444-
WherePredicate::RegionPredicate(p) => p.span,
445-
WherePredicate::EqPredicate(p) => p.span,
446-
}
447-
}
448-
}
449-
450450
/// A type bound.
451451
///
452452
/// E.g., `for<'c> Foo: Send + Clone + 'c`.
453453
#[derive(Clone, Encodable, Decodable, Debug)]
454454
pub struct WhereBoundPredicate {
455-
pub span: Span,
456455
/// Any generics from a `for` binding.
457456
pub bound_generic_params: ThinVec<GenericParam>,
458457
/// The type being bounded.
@@ -466,7 +465,6 @@ pub struct WhereBoundPredicate {
466465
/// E.g., `'a: 'b + 'c`.
467466
#[derive(Clone, Encodable, Decodable, Debug)]
468467
pub struct WhereRegionPredicate {
469-
pub span: Span,
470468
pub lifetime: Lifetime,
471469
pub bounds: GenericBounds,
472470
}
@@ -476,7 +474,6 @@ pub struct WhereRegionPredicate {
476474
/// E.g., `T = int`.
477475
#[derive(Clone, Encodable, Decodable, Debug)]
478476
pub struct WhereEqPredicate {
479-
pub span: Span,
480477
pub lhs_ty: P<Ty>,
481478
pub rhs_ty: P<Ty>,
482479
}
@@ -1319,53 +1316,71 @@ impl Expr {
13191316
Some(P(Ty { kind, id: self.id, span: self.span, tokens: None }))
13201317
}
13211318

1322-
pub fn precedence(&self) -> ExprPrecedence {
1319+
pub fn precedence(&self) -> i8 {
13231320
match self.kind {
1324-
ExprKind::Array(_) => ExprPrecedence::Array,
1325-
ExprKind::ConstBlock(_) => ExprPrecedence::ConstBlock,
1326-
ExprKind::Call(..) => ExprPrecedence::Call,
1327-
ExprKind::MethodCall(..) => ExprPrecedence::MethodCall,
1328-
ExprKind::Tup(_) => ExprPrecedence::Tup,
1329-
ExprKind::Binary(op, ..) => ExprPrecedence::Binary(op.node),
1330-
ExprKind::Unary(..) => ExprPrecedence::Unary,
1331-
ExprKind::Lit(_) | ExprKind::IncludedBytes(..) => ExprPrecedence::Lit,
1332-
ExprKind::Cast(..) => ExprPrecedence::Cast,
1333-
ExprKind::Let(..) => ExprPrecedence::Let,
1334-
ExprKind::If(..) => ExprPrecedence::If,
1335-
ExprKind::While(..) => ExprPrecedence::While,
1336-
ExprKind::ForLoop { .. } => ExprPrecedence::ForLoop,
1337-
ExprKind::Loop(..) => ExprPrecedence::Loop,
1338-
ExprKind::Match(_, _, MatchKind::Prefix) => ExprPrecedence::Match,
1339-
ExprKind::Match(_, _, MatchKind::Postfix) => ExprPrecedence::PostfixMatch,
1340-
ExprKind::Closure(..) => ExprPrecedence::Closure,
1341-
ExprKind::Block(..) => ExprPrecedence::Block,
1342-
ExprKind::TryBlock(..) => ExprPrecedence::TryBlock,
1343-
ExprKind::Gen(..) => ExprPrecedence::Gen,
1344-
ExprKind::Await(..) => ExprPrecedence::Await,
1345-
ExprKind::Assign(..) => ExprPrecedence::Assign,
1346-
ExprKind::AssignOp(..) => ExprPrecedence::AssignOp,
1347-
ExprKind::Field(..) => ExprPrecedence::Field,
1348-
ExprKind::Index(..) => ExprPrecedence::Index,
1349-
ExprKind::Range(..) => ExprPrecedence::Range,
1350-
ExprKind::Underscore => ExprPrecedence::Path,
1351-
ExprKind::Path(..) => ExprPrecedence::Path,
1352-
ExprKind::AddrOf(..) => ExprPrecedence::AddrOf,
1353-
ExprKind::Break(..) => ExprPrecedence::Break,
1354-
ExprKind::Continue(..) => ExprPrecedence::Continue,
1355-
ExprKind::Ret(..) => ExprPrecedence::Ret,
1356-
ExprKind::Struct(..) => ExprPrecedence::Struct,
1357-
ExprKind::Repeat(..) => ExprPrecedence::Repeat,
1358-
ExprKind::Paren(..) => ExprPrecedence::Paren,
1359-
ExprKind::Try(..) => ExprPrecedence::Try,
1360-
ExprKind::Yield(..) => ExprPrecedence::Yield,
1361-
ExprKind::Yeet(..) => ExprPrecedence::Yeet,
1362-
ExprKind::Become(..) => ExprPrecedence::Become,
1363-
ExprKind::InlineAsm(..)
1364-
| ExprKind::Type(..)
1365-
| ExprKind::OffsetOf(..)
1321+
ExprKind::Closure(..) => PREC_CLOSURE,
1322+
1323+
ExprKind::Break(..)
1324+
| ExprKind::Continue(..)
1325+
| ExprKind::Ret(..)
1326+
| ExprKind::Yield(..)
1327+
| ExprKind::Yeet(..)
1328+
| ExprKind::Become(..) => PREC_JUMP,
1329+
1330+
// `Range` claims to have higher precedence than `Assign`, but `x .. x = x` fails to
1331+
// parse, instead of parsing as `(x .. x) = x`. Giving `Range` a lower precedence
1332+
// ensures that `pprust` will add parentheses in the right places to get the desired
1333+
// parse.
1334+
ExprKind::Range(..) => PREC_RANGE,
1335+
1336+
// Binop-like expr kinds, handled by `AssocOp`.
1337+
ExprKind::Binary(op, ..) => AssocOp::from_ast_binop(op.node).precedence() as i8,
1338+
ExprKind::Cast(..) => AssocOp::As.precedence() as i8,
1339+
1340+
ExprKind::Assign(..) |
1341+
ExprKind::AssignOp(..) => AssocOp::Assign.precedence() as i8,
1342+
1343+
// Unary, prefix
1344+
ExprKind::AddrOf(..)
1345+
// Here `let pats = expr` has `let pats =` as a "unary" prefix of `expr`.
1346+
// However, this is not exactly right. When `let _ = a` is the LHS of a binop we
1347+
// need parens sometimes. E.g. we can print `(let _ = a) && b` as `let _ = a && b`
1348+
// but we need to print `(let _ = a) < b` as-is with parens.
1349+
| ExprKind::Let(..)
1350+
| ExprKind::Unary(..) => PREC_PREFIX,
1351+
1352+
// Never need parens
1353+
ExprKind::Array(_)
1354+
| ExprKind::Await(..)
1355+
| ExprKind::Block(..)
1356+
| ExprKind::Call(..)
1357+
| ExprKind::ConstBlock(_)
1358+
| ExprKind::Field(..)
1359+
| ExprKind::ForLoop { .. }
13661360
| ExprKind::FormatArgs(..)
1367-
| ExprKind::MacCall(..) => ExprPrecedence::Mac,
1368-
ExprKind::Err(_) | ExprKind::Dummy => ExprPrecedence::Err,
1361+
| ExprKind::Gen(..)
1362+
| ExprKind::If(..)
1363+
| ExprKind::IncludedBytes(..)
1364+
| ExprKind::Index(..)
1365+
| ExprKind::InlineAsm(..)
1366+
| ExprKind::Lit(_)
1367+
| ExprKind::Loop(..)
1368+
| ExprKind::MacCall(..)
1369+
| ExprKind::Match(..)
1370+
| ExprKind::MethodCall(..)
1371+
| ExprKind::OffsetOf(..)
1372+
| ExprKind::Paren(..)
1373+
| ExprKind::Path(..)
1374+
| ExprKind::Repeat(..)
1375+
| ExprKind::Struct(..)
1376+
| ExprKind::Try(..)
1377+
| ExprKind::TryBlock(..)
1378+
| ExprKind::Tup(_)
1379+
| ExprKind::Type(..)
1380+
| ExprKind::Underscore
1381+
| ExprKind::While(..)
1382+
| ExprKind::Err(_)
1383+
| ExprKind::Dummy => PREC_UNAMBIGUOUS,
13691384
}
13701385
}
13711386

@@ -3063,6 +3078,7 @@ pub struct FieldDef {
30633078
pub id: NodeId,
30643079
pub span: Span,
30653080
pub vis: Visibility,
3081+
pub safety: Safety,
30663082
pub ident: Option<Ident>,
30673083

30683084
pub ty: P<Ty>,

0 commit comments

Comments
 (0)