Skip to content

Commit 76a596c

Browse files
author
The Miri Conjob Bot
committed
Merge from rustc
2 parents f5ec4cb + c5f69bd commit 76a596c

627 files changed

Lines changed: 12881 additions & 8258 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.

‎.reuse/dep5‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ Copyright: 2019 The Crossbeam Project Developers
5252
The Rust Project Developers (see https://thanks.rust-lang.org)
5353
License: MIT OR Apache-2.0
5454

55-
Files: library/std/src/sys/pal/unix/locks/fuchsia_mutex.rs
55+
Files: library/std/src/sys/locks/mutex/fuchsia.rs
5656
Copyright: 2016 The Fuchsia Authors
5757
The Rust Project Developers (see https://thanks.rust-lang.org)
5858
License: BSD-2-Clause AND (MIT OR Apache-2.0)

‎Cargo.lock‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2627,6 +2627,7 @@ dependencies = [
26272627
"rustc-std-workspace-alloc",
26282628
"rustc-std-workspace-core",
26292629
"ruzstd",
2630+
"wasmparser",
26302631
]
26312632

26322633
[[package]]
@@ -4047,7 +4048,6 @@ dependencies = [
40474048
name = "rustc_interface"
40484049
version = "0.0.0"
40494050
dependencies = [
4050-
"libloading",
40514051
"rustc-rayon",
40524052
"rustc-rayon-core",
40534053
"rustc_ast",
@@ -6128,6 +6128,16 @@ version = "0.2.91"
61286128
source = "registry+https://github.com/rust-lang/crates.io-index"
61296129
checksum = "4f186bd2dcf04330886ce82d6f33dd75a7bfcf69ecf5763b89fcde53b6ac9838"
61306130

6131+
[[package]]
6132+
name = "wasmparser"
6133+
version = "0.118.2"
6134+
source = "registry+https://github.com/rust-lang/crates.io-index"
6135+
checksum = "77f1154f1ab868e2a01d9834a805faca7bf8b50d041b4ca714d005d0dab1c50c"
6136+
dependencies = [
6137+
"indexmap",
6138+
"semver",
6139+
]
6140+
61316141
[[package]]
61326142
name = "web-sys"
61336143
version = "0.3.68"

‎compiler/rustc_arena/src/lib.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ impl<T> ArenaChunk<T> {
9595
unsafe{
9696
if mem::size_of::<T>() == 0{
9797
// A pointer as large as possible for zero-sized elements.
98-
ptr::invalid_mut(!0)
98+
ptr::without_provenance_mut(!0)
9999
}else{
100100
self.start().add(self.storage.len())
101101
}

‎compiler/rustc_ast_lowering/src/errors.rs‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
use rustc_errors::{
2-
codes::*,AddToDiagnostic,Diagnostic,DiagnosticArgFromDisplay,SubdiagnosticMessageOp,
2+
codes::*,AddToDiagnostic,DiagnosticArgFromDisplay,DiagnosticBuilder,EmissionGuarantee,
3+
SubdiagnosticMessageOp,
34
};
45
use rustc_macros::{Diagnostic,Subdiagnostic};
56
use rustc_span::{symbol::Ident,Span,Symbol};
@@ -41,7 +42,11 @@ pub struct InvalidAbi {
4142
pubstructInvalidAbiReason(pub&'staticstr);
4243

4344
implAddToDiagnosticforInvalidAbiReason{
44-
fnadd_to_diagnostic_with<F:SubdiagnosticMessageOp>(self,diag:&mutDiagnostic, _:F){
45+
fnadd_to_diagnostic_with<G:EmissionGuarantee,F:SubdiagnosticMessageOp<G>>(
46+
self,
47+
diag:&mutDiagnosticBuilder<'_,G>,
48+
_:F,
49+
){
4550
#[allow(rustc::untranslatable_diagnostic)]
4651
diag.note(self.0);
4752
}

‎compiler/rustc_ast_lowering/src/lib.rs‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1636,9 +1636,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
16361636
ifletSome(old_def_id) = self.orig_opt_local_def_id(param){
16371637
old_def_id
16381638
}else{
1639-
self.dcx()
1640-
.span_delayed_bug(lifetime.ident.span,"no def-id for fresh lifetime");
1641-
continue;
1639+
self.dcx().span_bug(lifetime.ident.span,"no def-id for fresh lifetime");
16421640
}
16431641
}
16441642

‎compiler/rustc_ast_passes/src/ast_validation.rs‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -881,9 +881,10 @@ impl<'a> Visitor<'a> for AstValidator<'a> {
881881
&item.vis,
882882
errors::VisibilityNotPermittedNote::TraitImpl,
883883
);
884-
// njn: use Dummy here
885-
ifletTyKind::Err(_) = self_ty.kind{
886-
this.dcx().emit_err(errors::ObsoleteAuto{span: item.span});
884+
ifletTyKind::Dummy = self_ty.kind{
885+
// Abort immediately otherwise the `TyKind::Dummy` will reach HIR lowering,
886+
// which isn't allowed. Not a problem for this obscure, obsolete syntax.
887+
this.dcx().emit_fatal(errors::ObsoleteAuto{span: item.span});
887888
}
888889
iflet(&Unsafe::Yes(span),&ImplPolarity::Negative(sp)) = (unsafety, polarity)
889890
{

‎compiler/rustc_ast_passes/src/errors.rs‎

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
//! Errors emitted by ast_passes.
22
33
use rustc_ast::ParamKindOrd;
4-
use rustc_errors::{codes::*,AddToDiagnostic,Applicability,Diagnostic,SubdiagnosticMessageOp};
4+
use rustc_errors::{
5+
codes::*,AddToDiagnostic,Applicability,DiagnosticBuilder,EmissionGuarantee,
6+
SubdiagnosticMessageOp,
7+
};
58
use rustc_macros::{Diagnostic,Subdiagnostic};
69
use rustc_span::{symbol::Ident,Span,Symbol};
710

@@ -372,7 +375,11 @@ pub struct EmptyLabelManySpans(pub Vec<Span>);
372375

373376
// The derive for `Vec<Span>` does multiple calls to `span_label`, adding commas between each
374377
implAddToDiagnosticforEmptyLabelManySpans{
375-
fnadd_to_diagnostic_with<F:SubdiagnosticMessageOp>(self,diag:&mutDiagnostic, _:F){
378+
fnadd_to_diagnostic_with<G:EmissionGuarantee,F:SubdiagnosticMessageOp<G>>(
379+
self,
380+
diag:&mutDiagnosticBuilder<'_,G>,
381+
_:F,
382+
){
376383
diag.span_labels(self.0,"");
377384
}
378385
}
@@ -729,7 +736,11 @@ pub struct StableFeature {
729736
}
730737

731738
implAddToDiagnosticforStableFeature{
732-
fnadd_to_diagnostic_with<F:SubdiagnosticMessageOp>(self,diag:&mutDiagnostic, _:F){
739+
fnadd_to_diagnostic_with<G:EmissionGuarantee,F:SubdiagnosticMessageOp<G>>(
740+
self,
741+
diag:&mutDiagnosticBuilder<'_,G>,
742+
_:F,
743+
){
733744
diag.arg("name",self.name);
734745
diag.arg("since",self.since);
735746
diag.help(fluent::ast_passes_stable_since);

‎compiler/rustc_ast_passes/src/feature_gate.rs‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ macro_rules! gate {
2222
}};
2323
($visitor:expr, $feature:ident, $span:expr, $explain:expr, $help:expr) => {{
2424
if !$visitor.features.$feature && !$span.allows_unstable(sym::$feature){
25+
// FIXME: make this translatable
26+
#[allow(rustc::diagnostic_outside_of_impl)]
27+
#[allow(rustc::untranslatable_diagnostic)]
2528
feature_err(&$visitor.sess, sym::$feature, $span, $explain).with_help($help).emit();
2629
}
2730
}};

‎compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs‎

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66
use either::Either;
77
use rustc_data_structures::captures::Captures;
88
use rustc_data_structures::fx::FxIndexSet;
9-
use rustc_errors::{
10-
codes::*, struct_span_code_err,Applicability,Diagnostic,DiagnosticBuilder,MultiSpan,
11-
};
9+
use rustc_errors::{codes::*, struct_span_code_err,Applicability,DiagnosticBuilder,MultiSpan};
1210
use rustc_hir as hir;
1311
use rustc_hir::def::{DefKind,Res};
1412
use rustc_hir::intravisit::{walk_block, walk_expr,Visitor};
@@ -635,7 +633,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
635633

636634
fnsuggest_assign_value(
637635
&self,
638-
err:&mutDiagnostic,
636+
err:&mutDiagnosticBuilder<'_>,
639637
moved_place:PlaceRef<'tcx>,
640638
sugg_span:Span,
641639
){
@@ -674,7 +672,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
674672

675673
fnsuggest_borrow_fn_like(
676674
&self,
677-
err:&mutDiagnostic,
675+
err:&mutDiagnosticBuilder<'_>,
678676
ty:Ty<'tcx>,
679677
move_sites:&[MoveSite],
680678
value_name:&str,
@@ -742,7 +740,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
742740

743741
fnsuggest_cloning(
744742
&self,
745-
err:&mutDiagnostic,
743+
err:&mutDiagnosticBuilder<'_>,
746744
ty:Ty<'tcx>,
747745
expr:&hir::Expr<'_>,
748746
span:Span,
@@ -778,7 +776,12 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
778776
}
779777
}
780778

781-
fnsuggest_adding_copy_bounds(&self,err:&mutDiagnostic,ty:Ty<'tcx>,span:Span){
779+
fnsuggest_adding_copy_bounds(
780+
&self,
781+
err:&mutDiagnosticBuilder<'_>,
782+
ty:Ty<'tcx>,
783+
span:Span,
784+
){
782785
let tcx = self.infcx.tcx;
783786
let generics = tcx.generics_of(self.mir_def_id());
784787

@@ -1225,7 +1228,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
12251228
#[instrument(level = "debug", skip(self, err))]
12261229
fnsuggest_using_local_if_applicable(
12271230
&self,
1228-
err:&mutDiagnostic,
1231+
err:&mutDiagnosticBuilder<'_>,
12291232
location:Location,
12301233
issued_borrow:&BorrowData<'tcx>,
12311234
explanation:BorrowExplanation<'tcx>,
@@ -1321,7 +1324,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
13211324

13221325
fnsuggest_slice_method_if_applicable(
13231326
&self,
1324-
err:&mutDiagnostic,
1327+
err:&mutDiagnosticBuilder<'_>,
13251328
place:Place<'tcx>,
13261329
borrowed_place:Place<'tcx>,
13271330
){
@@ -1430,7 +1433,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
14301433
/// ```
14311434
pub(crate)fnexplain_iterator_advancement_in_for_loop_if_applicable(
14321435
&self,
1433-
err:&mutDiagnostic,
1436+
err:&mutDiagnosticBuilder<'_>,
14341437
span:Span,
14351438
issued_spans:&UseSpans<'tcx>,
14361439
){
@@ -1617,7 +1620,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
16171620
/// ```
16181621
fnsuggest_using_closure_argument_instead_of_capture(
16191622
&self,
1620-
err:&mutDiagnostic,
1623+
err:&mutDiagnosticBuilder<'_>,
16211624
borrowed_place:Place<'tcx>,
16221625
issued_spans:&UseSpans<'tcx>,
16231626
){
@@ -1751,7 +1754,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
17511754

17521755
fnsuggest_binding_for_closure_capture_self(
17531756
&self,
1754-
err:&mutDiagnostic,
1757+
err:&mutDiagnosticBuilder<'_>,
17551758
issued_spans:&UseSpans<'tcx>,
17561759
){
17571760
letUseSpans::ClosureUse{ capture_kind_span, .. } = issued_spans else{return};
@@ -2997,7 +3000,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
29973000
self.buffer_error(err);
29983001
}
29993002

3000-
fnexplain_deref_coercion(&mutself,loan:&BorrowData<'tcx>,err:&mutDiagnostic){
3003+
fnexplain_deref_coercion(&mutself,loan:&BorrowData<'tcx>,err:&mutDiagnosticBuilder<'_>){
30013004
let tcx = self.infcx.tcx;
30023005
iflet(
30033006
Some(Terminator{
@@ -3532,7 +3535,11 @@ enum AnnotatedBorrowFnSignature<'tcx> {
35323535
impl<'tcx>AnnotatedBorrowFnSignature<'tcx>{
35333536
/// Annotate the provided diagnostic with information about borrow from the fn signature that
35343537
/// helps explain.
3535-
pub(crate)fnemit(&self,cx:&mutMirBorrowckCtxt<'_,'tcx>,diag:&mutDiagnostic) -> String{
3538+
pub(crate)fnemit(
3539+
&self,
3540+
cx:&mutMirBorrowckCtxt<'_,'tcx>,
3541+
diag:&mutDiagnosticBuilder<'_>,
3542+
) -> String{
35363543
matchself{
35373544
&AnnotatedBorrowFnSignature::Closure{ argument_ty, argument_span } => {
35383545
diag.span_label(

‎compiler/rustc_borrowck/src/diagnostics/explain_borrow.rs‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#![allow(rustc::diagnostic_outside_of_impl)]
44
#![allow(rustc::untranslatable_diagnostic)]
55

6-
use rustc_errors::{Applicability,Diagnostic};
6+
use rustc_errors::{Applicability,DiagnosticBuilder};
77
use rustc_hir as hir;
88
use rustc_hir::intravisit::Visitor;
99
use rustc_index::IndexSlice;
@@ -65,7 +65,7 @@ impl<'tcx> BorrowExplanation<'tcx> {
6565
tcx:TyCtxt<'tcx>,
6666
body:&Body<'tcx>,
6767
local_names:&IndexSlice<Local,Option<Symbol>>,
68-
err:&mutDiagnostic,
68+
err:&mutDiagnosticBuilder<'_>,
6969
borrow_desc:&str,
7070
borrow_span:Option<Span>,
7171
multiple_borrow_span:Option<(Span,Span)>,
@@ -306,7 +306,7 @@ impl<'tcx> BorrowExplanation<'tcx> {
306306
fnadd_object_lifetime_default_note(
307307
&self,
308308
tcx:TyCtxt<'tcx>,
309-
err:&mutDiagnostic,
309+
err:&mutDiagnosticBuilder<'_>,
310310
unsize_ty:Ty<'tcx>,
311311
){
312312
iflet ty::Adt(def, args) = unsize_ty.kind(){
@@ -359,7 +359,7 @@ impl<'tcx> BorrowExplanation<'tcx> {
359359

360360
fnadd_lifetime_bound_suggestion_to_diagnostic(
361361
&self,
362-
err:&mutDiagnostic,
362+
err:&mutDiagnosticBuilder<'_>,
363363
category:&ConstraintCategory<'tcx>,
364364
span:Span,
365365
region_name:&RegionName,

0 commit comments

Comments
 (0)