Skip to content

Commit 55f8b2f

Browse files
committed
Merge remote-tracking branch 'origin' into test-codebuild-runner
2 parents 278c6f0 + a2016aa commit 55f8b2f

File tree

379 files changed

+7543
-4194
lines changed

Some content is hidden

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

379 files changed

+7543
-4194
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4158,6 +4158,7 @@ dependencies = [
41584158
"rustc_apfloat",
41594159
"rustc_arena",
41604160
"rustc_ast",
4161+
"rustc_attr_parsing",
41614162
"rustc_data_structures",
41624163
"rustc_errors",
41634164
"rustc_fluent_macro",

RELEASES.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ Compatibility Notes
111111
- Support for the target named `wasm32-wasi` has been removed as the target is now named `wasm32-wasip1`. This completes the [transition](https://github.com/rust-lang/compiler-team/issues/607) [plan](https://github.com/rust-lang/compiler-team/issues/695) for this target following [the introduction of `wasm32-wasip1`](https://github.com/rust-lang/rust/pull/120468) in Rust 1.78. Compiler warnings on [use of `wasm32-wasi`](https://github.com/rust-lang/rust/pull/126662) introduced in Rust 1.81 are now gone as well as the target is removed.
112112
- [The syntax `&pin (mut|const) T` is now parsed as a type which in theory could affect macro expansion results in some edge cases](https://github.com/rust-lang/rust/pull/130635#issuecomment-2375462821)
113113
- [Legacy syntax for calling `std::arch` functions is no longer permitted to declare items or bodies (such as closures, inline consts, or async blocks).](https://github.com/rust-lang/rust/pull/130443#issuecomment-2445678945)
114-
- The `wasm32-unknown-emscripten` target's binary release of the standard library is now [built with the latest emsdk 3.1.68](https://github.com/rust-lang/rust/pull/131533), which fixes an ABI-incompatibility with Emscripten >= 3.1.42. If you are locally using a version of emsdk with an incompatible ABI (e.g. before 3.1.42 or a future one), you should build your code with `-Zbuild-std` to ensure that `std` uses the correct ABI.
115114
- [Declaring functions with a calling convention not supported on the current target now triggers a hard error](https://github.com/rust-lang/rust/pull/129935)
116115
- [The next-generation trait solver is now enabled for coherence, fixing multiple soundness issues](https://github.com/rust-lang/rust/pull/130654)
117116

@@ -2184,7 +2183,7 @@ Language
21842183
--------
21852184

21862185
- [Stabilize default_alloc_error_handler](https://github.com/rust-lang/rust/pull/102318/)
2187-
This allows usage of `alloc` on stable without requiring the
2186+
This allows usage of `alloc` on stable without requiring the
21882187
definition of a handler for allocation failure. Defining custom handlers is still unstable.
21892188
- [Stabilize `efiapi` calling convention.](https://github.com/rust-lang/rust/pull/105795/)
21902189
- [Remove implicit promotion for types with drop glue](https://github.com/rust-lang/rust/pull/105085/)

compiler/rustc_arena/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ impl<T> ArenaChunk<T> {
7878
// been initialized.
7979
unsafe {
8080
let slice = self.storage.as_mut();
81-
ptr::drop_in_place(MaybeUninit::slice_assume_init_mut(&mut slice[..len]));
81+
slice[..len].assume_init_drop();
8282
}
8383
}
8484
}

compiler/rustc_ast/src/token.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -909,7 +909,8 @@ impl Token {
909909
self.is_keyword(kw)
910910
|| (case == Case::Insensitive
911911
&& self.is_non_raw_ident_where(|id| {
912-
id.name.as_str().to_lowercase() == kw.as_str().to_lowercase()
912+
// Do an ASCII case-insensitive match, because all keywords are ASCII.
913+
id.name.as_str().eq_ignore_ascii_case(kw.as_str())
913914
}))
914915
}
915916

compiler/rustc_attr_data_structures/src/attributes.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,22 @@ pub enum InlineAttr {
1111
Hint,
1212
Always,
1313
Never,
14+
/// `#[rustc_force_inline]` forces inlining to happen in the MIR inliner - it reports an error
15+
/// if the inlining cannot happen. It is limited to only free functions so that the calls
16+
/// can always be resolved.
17+
Force {
18+
attr_span: Span,
19+
reason: Option<Symbol>,
20+
},
21+
}
22+
23+
impl InlineAttr {
24+
pub fn always(&self) -> bool {
25+
match self {
26+
InlineAttr::Always | InlineAttr::Force { .. } => true,
27+
InlineAttr::None | InlineAttr::Hint | InlineAttr::Never => false,
28+
}
29+
}
1430
}
1531

1632
#[derive(Clone, Encodable, Decodable, Debug, PartialEq, Eq, HashStable_Generic)]

compiler/rustc_borrowck/src/borrow_set.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use std::fmt;
22
use std::ops::Index;
33

44
use rustc_data_structures::fx::{FxIndexMap, FxIndexSet};
5-
use rustc_index::bit_set::BitSet;
5+
use rustc_index::bit_set::DenseBitSet;
66
use rustc_middle::mir::visit::{MutatingUseContext, NonUseContext, PlaceContext, Visitor};
77
use rustc_middle::mir::{self, Body, Local, Location, traversal};
88
use rustc_middle::span_bug;
@@ -131,7 +131,7 @@ impl<'tcx> fmt::Display for BorrowData<'tcx> {
131131

132132
pub enum LocalsStateAtExit {
133133
AllAreInvalidated,
134-
SomeAreInvalidated { has_storage_dead_or_moved: BitSet<Local> },
134+
SomeAreInvalidated { has_storage_dead_or_moved: DenseBitSet<Local> },
135135
}
136136

137137
impl LocalsStateAtExit {
@@ -140,7 +140,7 @@ impl LocalsStateAtExit {
140140
body: &Body<'tcx>,
141141
move_data: &MoveData<'tcx>,
142142
) -> Self {
143-
struct HasStorageDead(BitSet<Local>);
143+
struct HasStorageDead(DenseBitSet<Local>);
144144

145145
impl<'tcx> Visitor<'tcx> for HasStorageDead {
146146
fn visit_local(&mut self, local: Local, ctx: PlaceContext, _: Location) {
@@ -153,7 +153,8 @@ impl LocalsStateAtExit {
153153
if locals_are_invalidated_at_exit {
154154
LocalsStateAtExit::AllAreInvalidated
155155
} else {
156-
let mut has_storage_dead = HasStorageDead(BitSet::new_empty(body.local_decls.len()));
156+
let mut has_storage_dead =
157+
HasStorageDead(DenseBitSet::new_empty(body.local_decls.len()));
157158
has_storage_dead.visit_body(body);
158159
let mut has_storage_dead_or_moved = has_storage_dead.0;
159160
for move_out in &move_data.moves {

compiler/rustc_borrowck/src/dataflow.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use std::fmt;
22

33
use rustc_data_structures::fx::FxIndexMap;
44
use rustc_data_structures::graph;
5-
use rustc_index::bit_set::BitSet;
5+
use rustc_index::bit_set::DenseBitSet;
66
use rustc_middle::mir::{
77
self, BasicBlock, Body, CallReturnPlaces, Location, Place, TerminatorEdges,
88
};
@@ -180,7 +180,7 @@ pub struct Borrows<'a, 'tcx> {
180180
}
181181

182182
struct OutOfScopePrecomputer<'a, 'tcx> {
183-
visited: BitSet<mir::BasicBlock>,
183+
visited: DenseBitSet<mir::BasicBlock>,
184184
visit_stack: Vec<mir::BasicBlock>,
185185
body: &'a Body<'tcx>,
186186
regioncx: &'a RegionInferenceContext<'tcx>,
@@ -190,7 +190,7 @@ struct OutOfScopePrecomputer<'a, 'tcx> {
190190
impl<'a, 'tcx> OutOfScopePrecomputer<'a, 'tcx> {
191191
fn new(body: &'a Body<'tcx>, regioncx: &'a RegionInferenceContext<'tcx>) -> Self {
192192
OutOfScopePrecomputer {
193-
visited: BitSet::new_empty(body.basic_blocks.len()),
193+
visited: DenseBitSet::new_empty(body.basic_blocks.len()),
194194
visit_stack: vec![],
195195
body,
196196
regioncx,
@@ -292,7 +292,7 @@ pub fn calculate_borrows_out_of_scope_at_location<'tcx>(
292292
}
293293

294294
struct PoloniusOutOfScopePrecomputer<'a, 'tcx> {
295-
visited: BitSet<mir::BasicBlock>,
295+
visited: DenseBitSet<mir::BasicBlock>,
296296
visit_stack: Vec<mir::BasicBlock>,
297297
body: &'a Body<'tcx>,
298298
regioncx: &'a RegionInferenceContext<'tcx>,
@@ -303,7 +303,7 @@ struct PoloniusOutOfScopePrecomputer<'a, 'tcx> {
303303
impl<'a, 'tcx> PoloniusOutOfScopePrecomputer<'a, 'tcx> {
304304
fn new(body: &'a Body<'tcx>, regioncx: &'a RegionInferenceContext<'tcx>) -> Self {
305305
Self {
306-
visited: BitSet::new_empty(body.basic_blocks.len()),
306+
visited: DenseBitSet::new_empty(body.basic_blocks.len()),
307307
visit_stack: vec![],
308308
body,
309309
regioncx,
@@ -559,7 +559,7 @@ impl<'a, 'tcx> Borrows<'a, 'tcx> {
559559
}
560560
}
561561

562-
type BorrowsDomain = BitSet<BorrowIndex>;
562+
type BorrowsDomain = DenseBitSet<BorrowIndex>;
563563

564564
/// Forward dataflow computation of the set of borrows that are in scope at a particular location.
565565
/// - we gen the introduced loans
@@ -575,7 +575,7 @@ impl<'tcx> rustc_mir_dataflow::Analysis<'tcx> for Borrows<'_, 'tcx> {
575575

576576
fn bottom_value(&self, _: &mir::Body<'tcx>) -> Self::Domain {
577577
// bottom = nothing is reserved or activated yet;
578-
BitSet::new_empty(self.borrow_set.len())
578+
DenseBitSet::new_empty(self.borrow_set.len())
579579
}
580580

581581
fn initialize_start_block(&self, _: &mir::Body<'tcx>, _: &mut Self::Domain) {

compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2680,22 +2680,19 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
26802680
return;
26812681
}
26822682

2683-
let mut sugg = vec![];
26842683
let sm = self.infcx.tcx.sess.source_map();
2685-
2686-
if let Some(span) = finder.closure_arg_span {
2687-
sugg.push((sm.next_point(span.shrink_to_lo()).shrink_to_hi(), finder.suggest_arg));
2688-
}
2689-
for span in finder.closure_change_spans {
2690-
sugg.push((span, "this".to_string()));
2691-
}
2692-
2693-
for (span, suggest) in finder.closure_call_changes {
2694-
sugg.push((span, suggest));
2695-
}
2684+
let sugg = finder
2685+
.closure_arg_span
2686+
.map(|span| (sm.next_point(span.shrink_to_lo()).shrink_to_hi(), finder.suggest_arg))
2687+
.into_iter()
2688+
.chain(
2689+
finder.closure_change_spans.into_iter().map(|span| (span, "this".to_string())),
2690+
)
2691+
.chain(finder.closure_call_changes)
2692+
.collect();
26962693

26972694
err.multipart_suggestion_verbose(
2698-
"try explicitly pass `&Self` into the Closure as an argument",
2695+
"try explicitly passing `&Self` into the closure as an argument",
26992696
sugg,
27002697
Applicability::MachineApplicable,
27012698
);

compiler/rustc_borrowck/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ use rustc_errors::LintDiagnostic;
2828
use rustc_hir as hir;
2929
use rustc_hir::CRATE_HIR_ID;
3030
use rustc_hir::def_id::LocalDefId;
31-
use rustc_index::bit_set::{BitSet, MixedBitSet};
31+
use rustc_index::bit_set::{DenseBitSet, MixedBitSet};
3232
use rustc_index::{IndexSlice, IndexVec};
3333
use rustc_infer::infer::{
3434
InferCtxt, NllRegionVariableOrigin, RegionVariableOrigin, TyCtxtInferExt,
@@ -1017,11 +1017,11 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, '_, 'tcx> {
10171017
&self,
10181018
location: Location,
10191019
state: &'s BorrowckDomain,
1020-
) -> Cow<'s, BitSet<BorrowIndex>> {
1020+
) -> Cow<'s, DenseBitSet<BorrowIndex>> {
10211021
if let Some(polonius) = &self.polonius_output {
10221022
// Use polonius output if it has been enabled.
10231023
let location = self.location_table.start_index(location);
1024-
let mut polonius_output = BitSet::new_empty(self.borrow_set.len());
1024+
let mut polonius_output = DenseBitSet::new_empty(self.borrow_set.len());
10251025
for &idx in polonius.errors_at(location) {
10261026
polonius_output.insert(idx);
10271027
}

compiler/rustc_borrowck/src/region_infer/opaque_types.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,6 @@ impl<'tcx> RegionInferenceContext<'tcx> {
152152
let (Ok(e) | Err(e)) = prev
153153
.build_mismatch_error(
154154
&OpaqueHiddenType { ty, span: concrete_type.span },
155-
opaque_type_key.def_id,
156155
infcx.tcx,
157156
)
158157
.map(|d| d.emit());

0 commit comments

Comments
 (0)