-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Handle rustc_resolve
cases of rustc::potential_query_instability
lint
#131213
base: master
Are you sure you want to change the base?
Handle rustc_resolve
cases of rustc::potential_query_instability
lint
#131213
Conversation
r? petrochenkov may have more opinions about this given the crate in question |
|
error: using `iter` can result in unstable query results
--> compiler/rustc_resolve/src/diagnostics.rs:1090:63
|
1090 | suggestions.extend(this.macro_use_prelude.iter().filter_map(
| ^^^^
|
= note: if you believe this case to be fine, allow this lint and add a comment explaining your rationale
= note: `-D rustc::potential-query-instability` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(rustc::potential_query_instability)]`
error: using `iter` can result in unstable query results
--> compiler/rustc_resolve/src/diagnostics.rs:1108:60
|
1108 | suggestions.extend(this.extern_prelude.iter().filter_map(|(ident, _)| {
| ^^^^
|
= note: if you believe this case to be fine, allow this lint and add a comment explaining your rationale
error: using `into_keys` can result in unstable query results
--> compiler/rustc_resolve/src/diagnostics.rs:1366:54
|
1366 | for ident in self.extern_prelude.clone().into_keys() {
| ^^^^^^^^^
|
= note: if you believe this case to be fine, allow this lint and add a comment explaining your rationale
error: using `iter` can result in unstable query results
--> compiler/rustc_resolve/src/diagnostics.rs:1471:47
|
1471 | let unused_macro = self.unused_macros.iter().find_map(|(def_id, (_, unused_ident))| {
| ^^^^
|
= note: if you believe this case to be fine, allow this lint and add a comment explaining your rationale
error: using `keys` can result in unstable query results
--> compiler/rustc_resolve/src/diagnostics.rs:1960:14
|
1960 | .keys()
| ^^^^
|
= note: if you believe this case to be fine, allow this lint and add a comment explaining your rationale
error: using `iter` can result in unstable query results
--> compiler/rustc_resolve/src/diagnostics.rs:1964:22
|
1964 | .iter()
| ^^^^
|
= note: if you believe this case to be fine, allow this lint and add a comment explaining your rationale
error: using `keys` can result in unstable query results
--> compiler/rustc_resolve/src/diagnostics.rs:2347:33
|
2347 | self.extern_prelude.keys().map(|ident| ident.name).collect::<Vec<_>>();
| ^^^^
|
= note: if you believe this case to be fine, allow this lint and add a comment explaining your rationale
error: using `into_iter` can result in unstable query results
--> compiler/rustc_resolve/src/diagnostics.rs:2847:22
|
2847 | .into_iter();
| ^^^^^^^^^
|
= note: if you believe this case to be fine, allow this lint and add a comment explaining your rationale
error: using `into_iter` can result in unstable query results
--> compiler/rustc_resolve/src/ident.rs:989:30
|
989 | for single_import in &resolution.single_imports {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: if you believe this case to be fine, allow this lint and add a comment explaining your rationale
error: using `into_iter` can result in unstable query results
--> compiler/rustc_resolve/src/late.rs:2263:50
|
2263 | let mut distinct_iter = distinct.into_iter();
| ^^^^^^^^^
|
= note: if you believe this case to be fine, allow this lint and add a comment explaining your rationale
error: using `keys` can result in unstable query results
--> compiler/rustc_resolve/src/late.rs:2799:53
|
2799 | .extend(parent_rib.bindings.keys().map(|ident| (*ident, ident.span)));
| ^^^^
|
= note: if you believe this case to be fine, allow this lint and add a comment explaining your rationale
error: using `iter` can result in unstable query results
--> compiler/rustc_resolve/src/late.rs:5048:79
|
5048 | for (id, span) in late_resolution_visitor.diag_metadata.unused_labels.iter() {
| ^^^^
|
= note: if you believe this case to be fine, allow this lint and add a comment explaining your rationale
error: using `into_iter` can result in unstable query results
--> compiler/rustc_resolve/src/late/diagnostics.rs:763:34
|
763 | for (ident, &res) in &rib.bindings {
| ^^^^^^^^^^^^^
|
= note: if you believe this case to be fine, allow this lint and add a comment explaining your rationale
error: using `into_iter` can result in unstable query results
--> compiler/rustc_resolve/src/late/diagnostics.rs:945:51
|
945 | for (label_ident, node_id) in &label_rib.bindings {
| ^^^^^^^^^^^^^^^^^^^
|
= note: if you believe this case to be fine, allow this lint and add a comment explaining your rationale
error: using `iter` can result in unstable query results
--> compiler/rustc_resolve/src/late/diagnostics.rs:1918:14
|
1918 | .iter()
| ^^^^
|
= note: if you believe this case to be fine, allow this lint and add a comment explaining your rationale
error: using `into_iter` can result in unstable query results
--> compiler/rustc_resolve/src/late/diagnostics.rs:2127:38
|
2127 | for (ident, &res) in &rib.bindings {
| ^^^^^^^^^^^^^
|
= note: if you believe this case to be fine, allow this lint and add a comment explaining your rationale
error: using `iter` can result in unstable query results
--> compiler/rustc_resolve/src/late/diagnostics.rs:2153:57
|
2153 | ... names.extend(extern_prelude.iter().flat_map(|(ident, _)| {
| ^^^^
|
= note: if you believe this case to be fine, allow this lint and add a comment explaining your rationale
error: using `iter` can result in unstable query results
--> compiler/rustc_resolve/src/late/diagnostics.rs:2590:14
|
2590 | .iter()
| ^^^^
|
= note: if you believe this case to be fine, allow this lint and add a comment explaining your rationale
error: using `iter` can result in unstable query results
--> compiler/rustc_resolve/src/late/diagnostics.rs:2599:43
|
2599 | let (ident, _) = rib.bindings.iter().find(|(ident, _)| ident.name == symbol).unwrap();
| ^^^^
|
= note: if you believe this case to be fine, allow this lint and add a comment explaining your rationale
error: using `iter` can result in unstable query results
--> compiler/rustc_resolve/src/macros.rs:347:58
|
347 | for (_, &(node_id, ident)) in self.unused_macros.iter() {
| ^^^^
|
= note: if you believe this case to be fine, allow this lint and add a comment explaining your rationale
error: using `iter` can result in unstable query results
--> compiler/rustc_resolve/src/macros.rs:355:80
|
355 | for (&(def_id, arm_i), &(ident, rule_span)) in self.unused_macro_rules.iter() {
| ^^^^
|
= note: if you believe this case to be fine, allow this lint and add a comment explaining your rationale
error: using `into_values` can result in unstable query results
--> compiler/rustc_resolve/src/rustdoc.rs:413:62
|
413 | let doc = prepare_to_doc_link_resolution(&doc_fragments).into_values().next().unwrap();
| ^^^^^^^^^^^
|
= note: if you believe this case to be fine, allow this lint and add a comment explaining your rationale |
Yeah, it means O(1) instead of O(n) but doesn't preserve the relative order. |
This comment was marked as resolved.
This comment was marked as resolved.
There are many places in which these maps are iterated, I'll try to go through all of them.
|
|
@ismailarilik |
37b12b1
to
fb9cc98
Compare
@rustbot review |
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
…instability-lint-for-rustc-resolve, r=<try> Handle `rustc_resolve` cases of `rustc::potential_query_instability` lint This PR removes `#![allow(rustc::potential_query_instability)]` line from [`compiler/rustc_resolve/src/lib.rs`](https://github.com/rust-lang/rust/blob/master/compiler/rustc_resolve/src/lib.rs#L12) and converts `FxHash{Map,Set}` types into `FxIndex{Map,Set}` to suppress lint errors. A somewhat tracking issue: rust-lang#84447 r? `@compiler-errors`
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (d65eab5): comparison URL. Overall result: ❌ regressions - please read the text belowBenchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf. Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @bors rollup=never Instruction countThis is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.
Max RSS (memory usage)Results (primary 0.4%, secondary 0.2%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResults (primary 2.0%, secondary 2.3%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 779.097s -> 779.212s (0.01%) |
cargo install rustup-toolchain-install-master , then cargo build --release
./target/release/collector profile_local cachegrind \
+66701c42263042f7120385725606edeb987ad4f1 \
--rustc2 +4a889a956e4c0269e73e3876ecb652fc844b5bb6 \
--include unused-warnings \
--profiles Check \
--scenarios Full in a clone of https://github.com/rust-lang/rustc-perf should work, assuming a typical linux distro like Ubuntu. (But I already did that, see the comments above.) |
The `FxIndexSet` solution seems costly.
The `FxIndexMap` solution seems costly.
818ee0a
to
0ecb033
Compare
That's likely going to be even slower, and we probably shouldn't do something like span sorting in non-diagnostic code. |
`shift_remove` is very expensive
…order As requested by @petrochenkov
Done: 2ff01e8 |
@rustbot review |
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
…instability-lint-for-rustc-resolve, r=<try> Handle `rustc_resolve` cases of `rustc::potential_query_instability` lint This PR removes `#![allow(rustc::potential_query_instability)]` line from [`compiler/rustc_resolve/src/lib.rs`](https://github.com/rust-lang/rust/blob/master/compiler/rustc_resolve/src/lib.rs#L12) and converts `FxHash{Map,Set}` types into `FxIndex{Map,Set}` to suppress lint errors. A somewhat tracking issue: rust-lang#84447 r? `@compiler-errors`
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (9e5ef87): comparison URL. Overall result: ❌✅ regressions and improvements - please read the text belowBenchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf. Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @bors rollup=never Instruction countThis is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.
Max RSS (memory usage)Results (primary 1.6%, secondary 1.9%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResults (secondary 2.3%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 780.559s -> 781.555s (0.13%) |
Could you submit the part of this PR that just adds (Oh, and |
I think working from this PR is better since there is a somewhat history here. Feel free to close it and work on it later. Sorry for being unqualified for things to do in this PR. BTW, I already removed the type @rustbot review |
This PR removes
#![allow(rustc::potential_query_instability)]
line fromcompiler/rustc_resolve/src/lib.rs
and convertsFxHash{Map,Set}
types intoFxIndex{Map,Set}
to suppress lint errors.A somewhat tracking issue: #84447
r? @compiler-errors