Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 10 pull requests #138912

Closed
wants to merge 29 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
5fe1e47
reintroduce remote-test support in run-make tests
pietroalbini Mar 18, 2025
39efa7c
Make default_codegen_backend serializable
tvladyslav Mar 17, 2025
c25e4bf
resolve: Avoid some unstable iteration 3
petrochenkov Mar 22, 2025
06d5888
ignore doctests only in specified targets
TaKO8Ki Mar 24, 2025
3dae3fb
add necessary lines
TaKO8Ki Mar 24, 2025
9dd5340
Remove `is_any_keyword` methods.
nnethercote Mar 12, 2025
a28d509
Improve keyword comments a little.
nnethercote Mar 12, 2025
3aaa12f
Fix some formatting.
nnethercote Mar 12, 2025
10236fb
Alphabetize the keywords list.
nnethercote Mar 12, 2025
a29e875
Move `is_used_keyword_conditional`.
nnethercote Mar 12, 2025
d9f250a
Remove duplicated loop when computing doc cfgs
GuillaumeGomez Mar 20, 2025
f5659f2
ignore tests broken while cross compiling
pietroalbini Mar 24, 2025
67e0b89
Add a helper for building an owner id in ast lowering
oli-obk Mar 24, 2025
251455b
Allow WellFormed goals to be returned from relating in new solver
compiler-errors Mar 23, 2025
aba23fd
Don't mark privacy test as needing GCE
compiler-errors Mar 21, 2025
c80d9b8
Don't ICE when encountering placeholders in layout computation
compiler-errors Mar 22, 2025
484362e
Mark a fixed test
compiler-errors Mar 21, 2025
ba4190c
resolve: Avoid some unstable iteration 2
petrochenkov Mar 16, 2025
7f2cb4c
Slightly reword triagebot ping message for `relnotes-interest-group`
jieyouxu Mar 22, 2025
92d3a00
Rollup merge of #138385 - nnethercote:keyword-tweaks, r=Noratrieb
TaKO8Ki Mar 24, 2025
41faf08
Rollup merge of #138580 - petrochenkov:resinstab, r=Nadrieril
TaKO8Ki Mar 24, 2025
f382a2d
Rollup merge of #138652 - ferrocene:pa-remote-test-rmake, r=jieyouxu
TaKO8Ki Mar 24, 2025
f92317e
Rollup merge of #138701 - tvladyslav:serializable_default_codegen_bac…
TaKO8Ki Mar 24, 2025
ee339f6
Rollup merge of #138755 - GuillaumeGomez:rm-duplicated-loop, r=camelid
TaKO8Ki Mar 24, 2025
bf18830
Rollup merge of #138829 - jieyouxu:adjust-relnotes-interest-group-des…
TaKO8Ki Mar 24, 2025
2fc02a6
Rollup merge of #138837 - petrochenkov:resinstab2, r=jieyouxu
TaKO8Ki Mar 24, 2025
609c393
Rollup merge of #138838 - compiler-errors:new-solver-crashes-tweaks, …
TaKO8Ki Mar 24, 2025
3c04362
Rollup merge of #138877 - TaKO8Ki:enable-per-target-ignores-for-docte…
TaKO8Ki Mar 24, 2025
ad8b2fa
Rollup merge of #138895 - oli-obk:dedup-owner-id-creation, r=compiler…
TaKO8Ki Mar 24, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
resolve: Avoid some unstable iteration 2
  • Loading branch information
petrochenkov committed Mar 24, 2025
commit ba4190cf7e919d7cc31c366906ded41874ef0439
1 change: 0 additions & 1 deletion compiler/rustc_resolve/src/build_reduced_graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1115,7 +1115,6 @@ impl<'a, 'ra, 'tcx> BuildReducedGraphVisitor<'a, 'ra, 'tcx> {
}
});
} else {
#[allow(rustc::potential_query_instability)] // FIXME
for ident in single_imports.iter().cloned() {
let result = self.r.maybe_resolve_ident_in_module(
ModuleOrUniformRoot::Module(module),
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_resolve/src/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1468,7 +1468,6 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
return;
}

#[allow(rustc::potential_query_instability)] // FIXME
let unused_macro = self.unused_macros.iter().find_map(|(def_id, (_, unused_ident))| {
if unused_ident.name == ident.name { Some((def_id, unused_ident)) } else { None }
});
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_resolve/src/ident.rs
Original file line number Diff line number Diff line change
Expand Up @@ -946,7 +946,6 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {

// Check if one of single imports can still define the name,
// if it can then our result is not determined and can be invalidated.
#[allow(rustc::potential_query_instability)] // FIXME
for single_import in &resolution.single_imports {
if ignore_import == Some(*single_import) {
// This branch handles a cycle in single imports.
Expand Down
8 changes: 4 additions & 4 deletions compiler/rustc_resolve/src/imports.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::cell::Cell;
use std::mem;

use rustc_ast::NodeId;
use rustc_data_structures::fx::FxHashSet;
use rustc_data_structures::fx::{FxHashSet, FxIndexSet};
use rustc_data_structures::intern::Interned;
use rustc_errors::codes::*;
use rustc_errors::{Applicability, MultiSpan, pluralize, struct_span_code_err};
Expand Down Expand Up @@ -233,7 +233,7 @@ impl<'ra> ImportData<'ra> {
pub(crate) struct NameResolution<'ra> {
/// Single imports that may define the name in the namespace.
/// Imports are arena-allocated, so it's ok to use pointers as keys.
pub single_imports: FxHashSet<Import<'ra>>,
pub single_imports: FxIndexSet<Import<'ra>>,
/// The least shadowable known binding for this name, or None if there are no known bindings.
pub binding: Option<NameBinding<'ra>>,
pub shadowed_glob: Option<NameBinding<'ra>>,
Expand Down Expand Up @@ -494,7 +494,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
let key = BindingKey::new(target, ns);
let _ = this.try_define(import.parent_scope.module, key, dummy_binding, false);
this.update_resolution(import.parent_scope.module, key, false, |_, resolution| {
resolution.single_imports.remove(&import);
resolution.single_imports.swap_remove(&import);
})
});
self.record_use(target, dummy_binding, Used::Other);
Expand Down Expand Up @@ -862,7 +862,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
}
let key = BindingKey::new(target, ns);
this.update_resolution(parent, key, false, |_, resolution| {
resolution.single_imports.remove(&import);
resolution.single_imports.swap_remove(&import);
});
}
}
Expand Down
5 changes: 2 additions & 3 deletions compiler/rustc_resolve/src/late.rs
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,7 @@ struct DiagMetadata<'ast> {

/// A list of labels as of yet unused. Labels will be removed from this map when
/// they are used (in a `break` or `continue` statement)
unused_labels: FxHashMap<NodeId, Span>,
unused_labels: FxIndexMap<NodeId, Span>,

/// Only used for better errors on `let x = { foo: bar };`.
/// In the case of a parse error with `let x = { foo: bar, };`, this isn't needed, it's only
Expand Down Expand Up @@ -4779,7 +4779,7 @@ impl<'a, 'ast, 'ra: 'ast, 'tcx> LateResolutionVisitor<'a, 'ast, 'ra, 'tcx> {
Ok((node_id, _)) => {
// Since this res is a label, it is never read.
self.r.label_res_map.insert(expr.id, node_id);
self.diag_metadata.unused_labels.remove(&node_id);
self.diag_metadata.unused_labels.swap_remove(&node_id);
}
Err(error) => {
self.report_error(label.ident.span, error);
Expand Down Expand Up @@ -5201,7 +5201,6 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
let mut late_resolution_visitor = LateResolutionVisitor::new(self);
late_resolution_visitor.resolve_doc_links(&krate.attrs, MaybeExported::Ok(CRATE_NODE_ID));
visit::walk_crate(&mut late_resolution_visitor, krate);
#[allow(rustc::potential_query_instability)] // FIXME
for (id, span) in late_resolution_visitor.diag_metadata.unused_labels.iter() {
self.lint_buffer.buffer_lint(
lint::builtin::UNUSED_LABELS,
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_resolve/src/late/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1036,7 +1036,7 @@ impl<'ast, 'ra: 'ast, 'tcx> LateResolutionVisitor<'_, 'ast, 'ra, 'tcx> {
Applicability::MaybeIncorrect,
);
// Do not lint against unused label when we suggest them.
self.diag_metadata.unused_labels.remove(node_id);
self.diag_metadata.unused_labels.swap_remove(node_id);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_resolve/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1137,7 +1137,7 @@ pub struct Resolver<'ra, 'tcx> {
non_macro_attr: MacroData,
local_macro_def_scopes: FxHashMap<LocalDefId, Module<'ra>>,
ast_transform_scopes: FxHashMap<LocalExpnId, Module<'ra>>,
unused_macros: FxHashMap<LocalDefId, (NodeId, Ident)>,
unused_macros: FxIndexMap<LocalDefId, (NodeId, Ident)>,
/// A map from the macro to all its potentially unused arms.
unused_macro_rules: FxIndexMap<LocalDefId, UnordMap<usize, (Ident, Span)>>,
proc_macro_stubs: FxHashSet<LocalDefId>,
Expand Down
3 changes: 1 addition & 2 deletions compiler/rustc_resolve/src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,6 @@ impl<'ra, 'tcx> ResolverExpand for Resolver<'ra, 'tcx> {
}

fn check_unused_macros(&mut self) {
#[allow(rustc::potential_query_instability)] // FIXME
for (_, &(node_id, ident)) in self.unused_macros.iter() {
self.lint_buffer.buffer_lint(
UNUSED_MACROS,
Expand Down Expand Up @@ -576,7 +575,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
match res {
Res::Def(DefKind::Macro(_), def_id) => {
if let Some(def_id) = def_id.as_local() {
self.unused_macros.remove(&def_id);
self.unused_macros.swap_remove(&def_id);
if self.proc_macro_stubs.contains(&def_id) {
self.dcx().emit_err(errors::ProcMacroSameCrate {
span: path.span,
Expand Down
Loading