Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 1a60b67

Browse files
committedJan 22, 2025
Auto merge of rust-lang#135891 - matthiaskrgr:rollup-vqfwp83, r=matthiaskrgr
Rollup of 10 pull requests Successful merges: - rust-lang#132983 (Edit dangling pointers ) - rust-lang#133154 (Reword resolve errors caused by likely missing crate in dep tree) - rust-lang#135409 (Fix ICE-133117: multiple never-pattern arm doesn't have false_edge_start_block) - rust-lang#135557 (Point at invalid utf-8 span on user's source code) - rust-lang#135596 (Properly note when query stack is being cut off) - rust-lang#135794 (Detect missing fields with default values and suggest `..`) - rust-lang#135814 (ci: use ghcr buildkit image) - rust-lang#135826 (Misc. `rustc_resolve` cleanups) - rust-lang#135837 (Remove test panic from File::open) - rust-lang#135856 (Library: Finalize dyn compatibility renaming) r? `@ghost` `@rustbot` modify labels: rollup
2 parents dee7d0e + 578f0d7 commit 1a60b67

File tree

160 files changed

+1487
-973
lines changed

Some content is hidden

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

160 files changed

+1487
-973
lines changed
 

‎compiler/rustc_query_system/src/query/job.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,7 @@ pub fn print_query_stack<Qcx: QueryContext>(
567567
qcx: Qcx,
568568
mut current_query: Option<QueryJobId>,
569569
dcx: DiagCtxtHandle<'_>,
570-
num_frames: Option<usize>,
570+
limit_frames: Option<usize>,
571571
mut file: Option<std::fs::File>,
572572
) -> usize {
573573
// Be careful relying on global state here: this code is called from
@@ -584,7 +584,7 @@ pub fn print_query_stack<Qcx: QueryContext>(
584584
let Some(query_info) = query_map.get(&query) else {
585585
break;
586586
};
587-
if Some(count_printed) < num_frames || num_frames.is_none() {
587+
if Some(count_printed) < limit_frames || limit_frames.is_none() {
588588
// Only print to stderr as many stack frames as `num_frames` when present.
589589
// FIXME: needs translation
590590
#[allow(rustc::diagnostic_outside_of_impl)]
@@ -615,5 +615,5 @@ pub fn print_query_stack<Qcx: QueryContext>(
615615
if let Some(ref mut file) = file {
616616
let _ = writeln!(file, "end of query stack");
617617
}
618-
count_printed
618+
count_total
619619
}

‎compiler/rustc_resolve/src/build_reduced_graph.rs

+26-28
Original file line numberDiff line numberDiff line change
@@ -645,10 +645,10 @@ impl<'a, 'ra, 'tcx> BuildReducedGraphVisitor<'a, 'ra, 'tcx> {
645645
let self_spans = items
646646
.iter()
647647
.filter_map(|(use_tree, _)| {
648-
if let ast::UseTreeKind::Simple(..) = use_tree.kind {
649-
if use_tree.ident().name == kw::SelfLower {
650-
return Some(use_tree.span);
651-
}
648+
if let ast::UseTreeKind::Simple(..) = use_tree.kind
649+
&& use_tree.ident().name == kw::SelfLower
650+
{
651+
return Some(use_tree.span);
652652
}
653653

654654
None
@@ -947,19 +947,19 @@ impl<'a, 'ra, 'tcx> BuildReducedGraphVisitor<'a, 'ra, 'tcx> {
947947
let imported_binding = self.r.import(binding, import);
948948
if parent == self.r.graph_root {
949949
let ident = ident.normalize_to_macros_2_0();
950-
if let Some(entry) = self.r.extern_prelude.get(&ident) {
951-
if expansion != LocalExpnId::ROOT && orig_name.is_some() && !entry.is_import() {
952-
self.r.dcx().emit_err(
953-
errors::MacroExpandedExternCrateCannotShadowExternArguments {
954-
span: item.span,
955-
},
956-
);
957-
// `return` is intended to discard this binding because it's an
958-
// unregistered ambiguity error which would result in a panic
959-
// caused by inconsistency `path_res`
960-
// more details: https://github.com/rust-lang/rust/pull/111761
961-
return;
962-
}
950+
if let Some(entry) = self.r.extern_prelude.get(&ident)
951+
&& expansion != LocalExpnId::ROOT
952+
&& orig_name.is_some()
953+
&& !entry.is_import()
954+
{
955+
self.r.dcx().emit_err(
956+
errors::MacroExpandedExternCrateCannotShadowExternArguments { span: item.span },
957+
);
958+
// `return` is intended to discard this binding because it's an
959+
// unregistered ambiguity error which would result in a panic
960+
// caused by inconsistency `path_res`
961+
// more details: https://github.com/rust-lang/rust/pull/111761
962+
return;
963963
}
964964
let entry = self
965965
.r
@@ -1040,10 +1040,10 @@ impl<'a, 'ra, 'tcx> BuildReducedGraphVisitor<'a, 'ra, 'tcx> {
10401040
span: item.span,
10411041
});
10421042
}
1043-
if let ItemKind::ExternCrate(Some(orig_name)) = item.kind {
1044-
if orig_name == kw::SelfLower {
1045-
self.r.dcx().emit_err(errors::MacroUseExternCrateSelf { span: attr.span });
1046-
}
1043+
if let ItemKind::ExternCrate(Some(orig_name)) = item.kind
1044+
&& orig_name == kw::SelfLower
1045+
{
1046+
self.r.dcx().emit_err(errors::MacroUseExternCrateSelf { span: attr.span });
10471047
}
10481048
let ill_formed = |span| {
10491049
self.r.dcx().emit_err(errors::BadMacroImport { span });
@@ -1179,14 +1179,12 @@ impl<'a, 'ra, 'tcx> BuildReducedGraphVisitor<'a, 'ra, 'tcx> {
11791179
return Some((MacroKind::Bang, item.ident, item.span));
11801180
} else if ast::attr::contains_name(&item.attrs, sym::proc_macro_attribute) {
11811181
return Some((MacroKind::Attr, item.ident, item.span));
1182-
} else if let Some(attr) = ast::attr::find_by_name(&item.attrs, sym::proc_macro_derive) {
1183-
if let Some(meta_item_inner) =
1182+
} else if let Some(attr) = ast::attr::find_by_name(&item.attrs, sym::proc_macro_derive)
1183+
&& let Some(meta_item_inner) =
11841184
attr.meta_item_list().and_then(|list| list.get(0).cloned())
1185-
{
1186-
if let Some(ident) = meta_item_inner.ident() {
1187-
return Some((MacroKind::Derive, ident, ident.span));
1188-
}
1189-
}
1185+
&& let Some(ident) = meta_item_inner.ident()
1186+
{
1187+
return Some((MacroKind::Derive, ident, ident.span));
11901188
}
11911189
None
11921190
}
There was a problem loading the remainder of the diff.

0 commit comments

Comments
 (0)
Failed to load comments.