Skip to content

Commit ffc41ab

Browse files
authored
Merge pull request #82 from crablang/current
manual sync with upstream
2 parents abc7f7c + 0b3ed2d commit ffc41ab

File tree

1,380 files changed

+61381
-18951
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,380 files changed

+61381
-18951
lines changed

.git-blame-ignore-revs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,5 @@ c34fbfaad38cf5829ef5cfe780dc9d58480adeaa
1414
cf2dff2b1e3fa55fa5415d524200070d0d7aacfe
1515
# Run rustfmt on bootstrap
1616
b39a1d6f1a30ba29f25d7141038b9a5bf0126e36
17+
# reorder fluent message files
18+
f97fddab91fbf290ea5b691fe355d6f915220b6e

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
[submodule "src/llvm-project"]
3434
path = src/llvm-project
3535
url = https://github.com/rust-lang/llvm-project.git
36-
branch = rustc/16.0-2023-04-05
36+
branch = rustc/16.0-2023-06-05
3737
[submodule "src/doc/embedded-book"]
3838
path = src/doc/embedded-book
3939
url = https://github.com/crablang/embedded-book.git

Cargo.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1902,9 +1902,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55"
19021902

19031903
[[package]]
19041904
name = "libc"
1905-
version = "0.2.143"
1905+
version = "0.2.146"
19061906
source = "registry+https://github.com/rust-lang/crates.io-index"
1907-
checksum = "edc207893e85c5d6be840e969b496b53d94cec8be2d501b214f50daa97fa8024"
1907+
checksum = "f92be4933c13fd498862a9e02a3055f8a8d9c039ce33db97306fd5a6caa7f29b"
19081908
dependencies = [
19091909
"rustc-std-workspace-core",
19101910
]

compiler/rustc_abi/src/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,9 @@ pub struct Size {
414414
// Safety: Ord is implement as just comparing numerical values and numerical values
415415
// are not changed by (de-)serialization.
416416
#[cfg(feature = "nightly")]
417-
unsafe impl StableOrd for Size {}
417+
unsafe impl StableOrd for Size {
418+
const CAN_USE_UNSTABLE_SORT: bool = true;
419+
}
418420

419421
// This is debug-printed a lot in larger structs, don't waste too much space there
420422
impl fmt::Debug for Size {

compiler/rustc_ast/src/expand/mod.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
11
//! Definitions shared by macros / syntax extensions and e.g. `rustc_middle`.
22
3+
use rustc_span::{def_id::DefId, symbol::Ident};
4+
5+
use crate::MetaItem;
6+
37
pub mod allocator;
8+
9+
#[derive(Debug, Clone, Encodable, Decodable, HashStable_Generic)]
10+
pub struct StrippedCfgItem<ModId = DefId> {
11+
pub parent_module: ModId,
12+
pub name: Ident,
13+
pub cfg: MetaItem,
14+
}
15+
16+
impl<ModId> StrippedCfgItem<ModId> {
17+
pub fn map_mod_id<New>(self, f: impl FnOnce(ModId) -> New) -> StrippedCfgItem<New> {
18+
StrippedCfgItem { parent_module: f(self.parent_module), name: self.name, cfg: self.cfg }
19+
}
20+
}

compiler/rustc_borrowck/src/constraint_generation.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ use rustc_infer::infer::InferCtxt;
44
use rustc_middle::mir::visit::TyContext;
55
use rustc_middle::mir::visit::Visitor;
66
use rustc_middle::mir::{
7-
BasicBlock, BasicBlockData, Body, Local, Location, Place, PlaceRef, ProjectionElem, Rvalue,
8-
SourceInfo, Statement, StatementKind, Terminator, TerminatorKind, UserTypeProjection,
7+
Body, Local, Location, Place, PlaceRef, ProjectionElem, Rvalue, SourceInfo, Statement,
8+
StatementKind, Terminator, TerminatorKind, UserTypeProjection,
99
};
1010
use rustc_middle::ty::subst::SubstsRef;
1111
use rustc_middle::ty::visit::TypeVisitable;
@@ -49,10 +49,6 @@ struct ConstraintGeneration<'cg, 'tcx> {
4949
}
5050

5151
impl<'cg, 'tcx> Visitor<'tcx> for ConstraintGeneration<'cg, 'tcx> {
52-
fn visit_basic_block_data(&mut self, bb: BasicBlock, data: &BasicBlockData<'tcx>) {
53-
self.super_basic_block_data(bb, data);
54-
}
55-
5652
/// We sometimes have `substs` within an rvalue, or within a
5753
/// call. Make them live at the location where they appear.
5854
fn visit_substs(&mut self, substs: &SubstsRef<'tcx>, location: Location) {

compiler/rustc_borrowck/src/diagnostics/mutability_errors.rs

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -416,12 +416,28 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
416416
_,
417417
) = pat.kind
418418
{
419-
err.span_suggestion(
420-
upvar_ident.span,
421-
"consider changing this to be mutable",
422-
format!("mut {}", upvar_ident.name),
423-
Applicability::MachineApplicable,
424-
);
419+
if upvar_ident.name == kw::SelfLower {
420+
for (_, node) in self.infcx.tcx.hir().parent_iter(upvar_hir_id) {
421+
if let Some(fn_decl) = node.fn_decl() {
422+
if !matches!(fn_decl.implicit_self, hir::ImplicitSelfKind::ImmRef | hir::ImplicitSelfKind::MutRef) {
423+
err.span_suggestion(
424+
upvar_ident.span,
425+
"consider changing this to be mutable",
426+
format!("mut {}", upvar_ident.name),
427+
Applicability::MachineApplicable,
428+
);
429+
break;
430+
}
431+
}
432+
}
433+
} else {
434+
err.span_suggestion(
435+
upvar_ident.span,
436+
"consider changing this to be mutable",
437+
format!("mut {}", upvar_ident.name),
438+
Applicability::MachineApplicable,
439+
);
440+
}
425441
}
426442

427443
let tcx = self.infcx.tcx;

compiler/rustc_borrowck/src/region_infer/opaque_types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ impl<'tcx> InferCtxtExt<'tcx> for InferCtxt<'tcx> {
285285
let infcx = self
286286
.tcx
287287
.infer_ctxt()
288-
.with_opaque_type_inference(if self.tcx.trait_solver_next() {
288+
.with_opaque_type_inference(if self.next_trait_solver() {
289289
DefiningAnchor::Bind(def_id)
290290
} else {
291291
DefiningAnchor::Bubble

compiler/rustc_borrowck/src/type_check/mod.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ pub(crate) fn type_check<'mir, 'tcx>(
188188

189189
// FIXME(-Ztrait-solver=next): A bit dubious that we're only registering
190190
// predefined opaques in the typeck root.
191-
if infcx.tcx.trait_solver_next() && !infcx.tcx.is_typeck_child(body.source.def_id()) {
191+
if infcx.next_trait_solver() && !infcx.tcx.is_typeck_child(body.source.def_id()) {
192192
checker.register_predefined_opaques_in_new_solver();
193193
}
194194

@@ -477,9 +477,7 @@ impl<'a, 'b, 'tcx> Visitor<'tcx> for TypeVerifier<'a, 'b, 'tcx> {
477477

478478
fn visit_body(&mut self, body: &Body<'tcx>) {
479479
self.sanitize_type(&"return type", body.return_ty());
480-
for local_decl in &body.local_decls {
481-
self.sanitize_type(local_decl, local_decl.ty);
482-
}
480+
// The types of local_decls are checked above which is called in super_body.
483481
self.super_body(body);
484482
}
485483
}

compiler/rustc_builtin_macros/src/format.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -554,9 +554,6 @@ fn report_missing_placeholders(
554554
fmt_span: Span,
555555
) {
556556
let mut diag = if let &[(span, named)] = &unused[..] {
557-
//let mut diag = ecx.struct_span_err(span, msg);
558-
//diag.span_label(span, msg);
559-
//diag
560557
ecx.create_err(errors::FormatUnusedArg { span, named })
561558
} else {
562559
let unused_labels =

0 commit comments

Comments
 (0)