Skip to content

Commit 43a4909

Browse files
committed
Auto merge of #157558 - jhpratt:rollup-DWtXTfN, r=jhpratt
Rollup of 25 pull requests Successful merges: - #157251 (`rust-analyzer` subtree update) - #157533 (Subtree sync for rustc_codegen_cranelift) - #154742 (Add APIs for case folding to the standard library) - #155144 (mir_build: Add an extra intermediate step in MIR building for patterns ) - #156222 (Stabilize `Result::map_or_default` and `Option::map_or_default`) - #157016 (add `extern "tail"` calling convention) - #157264 (diagnostics: Fix ICE building a trait ref in method suggestions) - #157386 (Parse deprecated note links separately in rustc_resolve) - #157483 (fix windows-gnu TLS leak) - #157488 (compiletest: inject `#![windows_subsystem = "windows"]` to debuginfo tests on Windows) - #157509 (remove solaris implementation for File::lock, it has the wrong semantics) - #157521 (Rename `SyncView::{as_pin => as_pin_ref}`) - #156136 (Move tests box) - #156573 (Add unwinder_private_data_size for wasm64 target) - #156783 (docs: make `Rc::into_raw` clickable in `Rc::increment_strong_count` doc) - #156840 (Stabilize `PathBuf::into_string`) - #156936 (Remove FIXME about impl PinCoerceUnsized for UnsafePinned<T>) - #157365 (Revert "LLVM 23: Run AssignGUIDPass in some places") - #157380 (clarify compiler_fence (and fence) docs) - #157471 (Debug assert that parsed attributes are in the `BUILTIN_ATTRIBUTE_MAP`) - #157485 (Rename `errors.rs` file to `diagnostics.rs` (1/N)) - #157494 (Convert `QueryRegionConstraint` into a struct) - #157526 (std tests: skip a slow test on Miri) - #157531 (ci: bump x86_64-gnu base image to 26.04) - #157556 (Add `BTree::append()` change to 1.96.0 relnotes) Failed merges: - #155527 (Replace printables table with `unicode_data.rs` tables)
2 parents 61d7280 + 24d92b5 commit 43a4909

429 files changed

Lines changed: 11071 additions & 4644 deletions

File tree

Some content is hidden

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

Cargo.lock

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6070,6 +6070,7 @@ checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493"
60706070
name = "unicode-table-generator"
60716071
version = "0.1.0"
60726072
dependencies = [
6073+
"rustc-hash 2.1.1",
60736074
"ucd-parse",
60746075
]
60756076

RELEASES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ Compatibility Notes
7777
- [For `export_name`, `link_name`, and `link_section` attributes, if multiple of the same attribute is present, the first one now takes precedence.](https://github.com/rust-lang/rust/pull/153041)
7878
- [Update the minimum external LLVM to 21](https://github.com/rust-lang/rust/pull/153684)
7979
- On `avr` targets, C's `double` type is 32-bit by default, so [change `c_double` to `f32` on `avr` targets to match](https://github.com/rust-lang/rust/pull/154647). This is a breaking change, but necessary to make `c_double` match C's double.
80+
- [`BTreeMap::append()` was optimized, which may now cause panics for types with incorrect `Ord` impls](https://github.com/rust-lang/rust/pull/153107)
8081

8182
<a id="1.96.0-Internal-Changes"></a>
8283

compiler/rustc_abi/src/canon_abi.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ pub enum CanonAbi {
2828
Rust,
2929
RustCold,
3030
RustPreserveNone,
31+
RustTail,
3132

3233
/// An ABI that rustc does not know how to call or define.
3334
Custom,
@@ -59,7 +60,10 @@ pub enum CanonAbi {
5960
impl CanonAbi {
6061
pub fn is_rustic_abi(self) -> bool {
6162
match self {
62-
CanonAbi::Rust | CanonAbi::RustCold | CanonAbi::RustPreserveNone => true,
63+
CanonAbi::Rust
64+
| CanonAbi::RustCold
65+
| CanonAbi::RustPreserveNone
66+
| CanonAbi::RustTail => true,
6367
CanonAbi::C
6468
| CanonAbi::Custom
6569
| CanonAbi::Swift
@@ -81,6 +85,7 @@ impl fmt::Display for CanonAbi {
8185
CanonAbi::Rust => ExternAbi::Rust,
8286
CanonAbi::RustCold => ExternAbi::RustCold,
8387
CanonAbi::RustPreserveNone => ExternAbi::RustPreserveNone,
88+
CanonAbi::RustTail => ExternAbi::RustTail,
8489
CanonAbi::Custom => ExternAbi::Custom,
8590
CanonAbi::Swift => ExternAbi::Swift,
8691
CanonAbi::Arm(arm_call) => match arm_call {

compiler/rustc_abi/src/extern_abi.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ pub enum ExternAbi {
4949
/// forcing callers to save all registers.
5050
RustPreserveNone,
5151

52+
/// Ensures that calls in tail position can always be optimized into a jump.
53+
///
54+
/// This ABI is not stable, and relies on LLVM implementation details.
55+
RustTail,
56+
5257
/// Unstable impl detail that directly uses Rust types to describe the ABI to LLVM.
5358
/// Even normally-compatible Rust types can become ABI-incompatible with this ABI!
5459
Unadjusted,
@@ -205,6 +210,7 @@ abi_impls! {
205210
System { unwind: true } =><= "system-unwind",
206211
SysV64 { unwind: false } =><= "sysv64",
207212
SysV64 { unwind: true } =><= "sysv64-unwind",
213+
RustTail =><= "tail",
208214
Thiscall { unwind: false } =><= "thiscall",
209215
Thiscall { unwind: true } =><= "thiscall-unwind",
210216
Unadjusted =><= "unadjusted",
@@ -280,7 +286,7 @@ impl ExternAbi {
280286
/// - are subject to change between compiler versions
281287
pub fn is_rustic_abi(self) -> bool {
282288
use ExternAbi::*;
283-
matches!(self, Rust | RustCall | RustCold | RustPreserveNone)
289+
matches!(self, Rust | RustCall | RustCold | RustPreserveNone | RustTail)
284290
}
285291

286292
/// Returns whether the ABI supports C variadics. This only controls whether we allow *imports*
@@ -354,6 +360,7 @@ impl ExternAbi {
354360
| Self::SysV64 { .. }
355361
| Self::Win64 { .. }
356362
| Self::RustPreserveNone
363+
| Self::RustTail
357364
| Self::Swift => true,
358365
}
359366
}

compiler/rustc_ast_lowering/src/asm.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,17 @@ use rustc_session::errors::feature_err;
99
use rustc_span::{Span, sym};
1010
use rustc_target::asm;
1111

12-
use super::LoweringContext;
13-
use super::errors::{
12+
use crate::diagnostics::{
1413
AbiSpecifiedMultipleTimes, AttSyntaxOnlyX86, ClobberAbiNotSupported,
1514
InlineAsmUnsupportedTarget, InvalidAbiClobberAbi, InvalidAsmTemplateModifierConst,
1615
InvalidAsmTemplateModifierLabel, InvalidAsmTemplateModifierRegClass,
1716
InvalidAsmTemplateModifierRegClassSub, InvalidAsmTemplateModifierSym, InvalidRegister,
1817
InvalidRegisterClass, RegisterClassOnlyClobber, RegisterClassOnlyClobberStable,
1918
RegisterConflict,
2019
};
21-
use crate::{AllowReturnTypeNotation, ImplTraitContext, ImplTraitPosition, ParamMode};
20+
use crate::{
21+
AllowReturnTypeNotation, ImplTraitContext, ImplTraitPosition, LoweringContext, ParamMode,
22+
};
2223

2324
impl<'hir> LoweringContext<'_, 'hir> {
2425
pub(crate) fn lower_inline_asm(

compiler/rustc_ast_lowering/src/delegation.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ use rustc_span::symbol::kw;
5656
use rustc_span::{ErrorGuaranteed, Ident, Span, Symbol};
5757

5858
use crate::delegation::generics::{GenericsGenerationResult, GenericsGenerationResults};
59-
use crate::errors::{
59+
use crate::diagnostics::{
6060
CycleInDelegationSignatureResolution, DelegationAttemptedBlockWithDefsDeletion,
6161
DelegationBlockSpecifiedWhenNoParams, UnresolvedDelegationCallee,
6262
};
File renamed without changes.

compiler/rustc_ast_lowering/src/expr.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,17 @@ use visit::{Visitor, walk_expr};
1919

2020
mod closure;
2121

22-
use super::errors::{
22+
use crate::diagnostics::{
2323
AsyncCoroutinesNotSupported, AwaitOnlyInAsyncFnAndBlocks,
24-
FunctionalRecordUpdateDestructuringAssignment, InclusiveRangeWithNoEnd, MatchArmWithNoBody,
25-
MoveExprOnlyInPlainClosures, NeverPatternWithBody, NeverPatternWithGuard,
26-
UnderscoreExprLhsAssign,
24+
FunctionalRecordUpdateDestructuringAssignment, InclusiveRangeWithNoEnd,
25+
InvalidLegacyConstGenericArg, MatchArmWithNoBody, MoveExprOnlyInPlainClosures,
26+
NeverPatternWithBody, NeverPatternWithGuard, UnderscoreExprLhsAssign, UseConstGenericArg,
27+
YieldInClosure,
2728
};
28-
use super::{
29-
GenericArgsMode, ImplTraitContext, LoweringContext, ParamMode, ResolverAstLoweringExt,
29+
use crate::{
30+
AllowReturnTypeNotation, GenericArgsMode, ImplTraitContext, ImplTraitPosition, LoweringContext,
31+
ParamMode, ResolverAstLoweringExt, TryBlockScope,
3032
};
31-
use crate::errors::{InvalidLegacyConstGenericArg, UseConstGenericArg, YieldInClosure};
32-
use crate::{AllowReturnTypeNotation, ImplTraitPosition, TryBlockScope};
3333

3434
pub(super) struct WillCreateDefIdsVisitor;
3535

compiler/rustc_ast_lowering/src/expr/closure.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use rustc_span::Span;
77

88
use super::{LoweringContext, MoveExprInitializerFinder, MoveExprState};
99
use crate::FnDeclKind;
10-
use crate::errors::{ClosureCannotBeStatic, CoroutineTooManyParameters};
10+
use crate::diagnostics::{ClosureCannotBeStatic, CoroutineTooManyParameters};
1111

1212
impl<'hir> LoweringContext<'_, 'hir> {
1313
// Entry point for `ExprKind::Closure`. Plain closures go through

compiler/rustc_ast_lowering/src/item.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ use smallvec::{SmallVec, smallvec};
1919
use thin_vec::ThinVec;
2020
use tracing::instrument;
2121

22-
use super::errors::{InvalidAbi, InvalidAbiSuggestion, TupleStructWithDefault, UnionWithDefault};
22+
use super::diagnostics::{
23+
InvalidAbi, InvalidAbiSuggestion, TupleStructWithDefault, UnionWithDefault,
24+
};
2325
use super::stability::{enabled_names, gate_unstable_abi};
2426
use super::{
2527
AstOwner, FnDeclKind, GenericArgsMode, ImplTraitContext, ImplTraitPosition, LoweringContext,

0 commit comments

Comments
 (0)