rust icon indicating copy to clipboard operation
rust copied to clipboard

optimization of access level table construction

Open Bryanskiy opened this issue 3 years ago β€’ 10 comments

Refactoring which was mentioned in #87487

Bryanskiy avatar Aug 04 '22 16:08 Bryanskiy

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @fee1-dead (or someone else) soon.

Please see the contribution instructions for more information.

rust-highfive avatar Aug 04 '22 16:08 rust-highfive

The job mingw-check failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
configure: rust.debug-assertions := True
configure: rust.overflow-checks := True
configure: llvm.assertions      := True
configure: dist.missing-tools   := True
configure: build.configure-args := ['--enable-sccache', '--disable-manage-submodu ...
configure: writing `config.toml` in current directory
configure: 
configure: run `python /checkout/x.py --help`
Attempting with retry: make prepare
---
* highest error code: E0790
Found 506 error codes
Found 0 error(s) in error codes
Done!
tidy error: /checkout/compiler/rustc_resolve/src/lib.rs:2024: trailing whitespace
tidy error: /checkout/compiler/rustc_resolve/src/access_levels.rs:192: trailing whitespace
tidy error: /checkout/compiler/rustc_resolve/src/imports.rs:1103: trailing whitespace
some tidy checks failed
Build completed unsuccessfully in 0:00:16

rust-log-analyzer avatar Aug 04 '22 16:08 rust-log-analyzer

Thanks for the pull request! I am going to request this to be reviewed by someone else because I am not familiar enough with that part of the code.

r? rust-lang/compiler

fee1-dead avatar Aug 04 '22 17:08 fee1-dead

r? @petrochenkov @bors try @rust-timer queue

petrochenkov avatar Aug 05 '22 09:08 petrochenkov

Awaiting bors try build completion.

@rustbot label: +S-waiting-on-perf

rust-timer avatar Aug 05 '22 09:08 rust-timer

:hourglass: Trying commit 3f386ed12df293677e8820c6c79653ae56432d66 with merge 995e9cda10d57acb02b9bf15bd7d1e19294b267b...

bors avatar Aug 05 '22 09:08 bors

:sunny: Try build successful - checks-actions Build commit: 995e9cda10d57acb02b9bf15bd7d1e19294b267b (995e9cda10d57acb02b9bf15bd7d1e19294b267b)

bors avatar Aug 05 '22 10:08 bors

Queued 995e9cda10d57acb02b9bf15bd7d1e19294b267b with parent 6bcf01afdb1c21a30cdf1fd20f9cdef7c482e753, future comparison URL.

rust-timer avatar Aug 05 '22 10:08 rust-timer

Finished benchmarking commit (995e9cda10d57acb02b9bf15bd7d1e19294b267b): comparison url.

Instruction count

  • Primary benchmarks: no relevant changes found
  • Secondary benchmarks: 😿 relevant regressions found
mean[^1] max count[^2]
Regressions 😿
(primary)
N/A N/A 0
Regressions 😿
(secondary)
0.5% 0.6% 9
Improvements πŸŽ‰
(primary)
N/A N/A 0
Improvements πŸŽ‰
(secondary)
N/A N/A 0
All πŸ˜ΏπŸŽ‰ (primary) N/A N/A 0

Max RSS (memory usage)

Results
  • Primary benchmarks: πŸŽ‰ relevant improvements found
  • Secondary benchmarks: mixed results
mean[^1] max count[^2]
Regressions 😿
(primary)
N/A N/A 0
Regressions 😿
(secondary)
3.8% 3.8% 1
Improvements πŸŽ‰
(primary)
-2.6% -2.6% 2
Improvements πŸŽ‰
(secondary)
-2.1% -2.2% 3
All πŸ˜ΏπŸŽ‰ (primary) -2.6% -2.6% 2

Cycles

This benchmark run did not return any relevant results for this metric.

[^1]: the arithmetic mean of the percent change [^2]: number of relevant changes

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

Benchmarking 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 @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please fix the regressions and do another perf run. If the next run shows neutral or positive results, the label will be automatically removed.

@bors rollup=never @rustbot label: +S-waiting-on-review -S-waiting-on-perf +perf-regression

rust-timer avatar Aug 05 '22 12:08 rust-timer

@bors rollup=maybe

petrochenkov avatar Aug 05 '22 12:08 petrochenkov

The job x86_64-gnu-llvm-12 failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
i..............................................................i........................ 88/546
........................................................................................ 176/546
........................................................................................ 264/546
........................................................................................ 352/546
................i..................F.................................................... 440/546
....i.F................................................................................. 528/546
Some tests failed in compiletest suite=rustdoc mode=rustdoc host=x86_64-unknown-linux-gnu target=x86_64-unknown-linux-gnu
failures:

---- [rustdoc] src/test/rustdoc/macro-indirect-use.rs stdout ----
---- [rustdoc] src/test/rustdoc/macro-indirect-use.rs stdout ----

error: htmldocck failed!
status: exit status: 1
command: "/usr/bin/python3" "/checkout/src/etc/htmldocck.py" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc/macro-indirect-use" "/checkout/src/test/rustdoc/macro-indirect-use.rs"
stdout: none
--- stderr -------------------------------
15: @has check failed
 File does not exist 'macro_indirect_use/inner/macro.some_macro.html'
 // @has macro_indirect_use/inner/macro.some_macro.html
Encountered 1 errors
------------------------------------------



---- [rustdoc] src/test/rustdoc/redirect-rename.rs stdout ----

error: htmldocck failed!
status: exit status: 1
command: "/usr/bin/python3" "/checkout/src/etc/htmldocck.py" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc/redirect-rename" "/checkout/src/test/rustdoc/redirect-rename.rs"
stdout: none
--- stderr -------------------------------
15: @has check failed
 File does not exist 'foo/hidden/bar/struct.Thing.html'
         // @has foo/hidden/bar/struct.Thing.html
16: @has check failed
 File does not exist 'foo/hidden/bar/struct.Thing.html'
         // @has - '//p/a' '../../foo/baz/struct.Thing.html'
33: @has check failed
 File does not exist 'foo/baz/struct.Thing.html'
 // @has foo/baz/struct.Thing.html
Encountered 3 errors
------------------------------------------


rust-log-analyzer avatar Aug 07 '22 20:08 rust-log-analyzer

The job x86_64-gnu-llvm-12 failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
   Compiling rustc_mir_transform v0.0.0 (/checkout/compiler/rustc_mir_transform)
   Compiling rustc_borrowck v0.0.0 (/checkout/compiler/rustc_borrowck)
   Compiling rustc_codegen_llvm v0.0.0 (/checkout/compiler/rustc_codegen_llvm)
   Compiling rustc_privacy v0.0.0 (/checkout/compiler/rustc_privacy)
error: diagnostics should only be created in `SessionDiagnostic`/`AddSubdiagnostic` impls
   --> compiler/rustc_privacy/src/lib.rs:405:31
    |
405 |                 self.tcx.sess.span_fatal(
    |
note: the lint level is defined here
   --> compiler/rustc_privacy/src/lib.rs:9:34
    |
    |
9   | #![cfg_attr(not(bootstrap), deny(rustc::diagnostic_outside_of_impl))]


error: diagnostics should be created using translatable messages
   --> compiler/rustc_privacy/src/lib.rs:405:31
    |
405 |                 self.tcx.sess.span_fatal(
    |
note: the lint level is defined here
   --> compiler/rustc_privacy/src/lib.rs:8:34
    |
    |
8   | #![cfg_attr(not(bootstrap), deny(rustc::untranslatable_diagnostic))]

error: could not compile `rustc_privacy` due to 2 previous errors
warning: build failed, waiting for other jobs to finish...
Build completed unsuccessfully in 0:09:24

rust-log-analyzer avatar Aug 09 '22 09:08 rust-log-analyzer

The job x86_64-gnu-llvm-12 failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
   Compiling rustc_borrowck v0.0.0 (/checkout/compiler/rustc_borrowck)
   Compiling rustc_mir_transform v0.0.0 (/checkout/compiler/rustc_mir_transform)
   Compiling rustc_codegen_llvm v0.0.0 (/checkout/compiler/rustc_codegen_llvm)
   Compiling rustc_privacy v0.0.0 (/checkout/compiler/rustc_privacy)
error: diagnostics should only be created in `SessionDiagnostic`/`AddSubdiagnostic` impls
   --> compiler/rustc_privacy/src/lib.rs:405:31
    |
405 |                 self.tcx.sess.span_fatal(
    |
note: the lint level is defined here
   --> compiler/rustc_privacy/src/lib.rs:9:34
    |
    |
9   | #![cfg_attr(not(bootstrap), deny(rustc::diagnostic_outside_of_impl))]


error: diagnostics should be created using translatable messages
   --> compiler/rustc_privacy/src/lib.rs:405:31
    |
405 |                 self.tcx.sess.span_fatal(
    |
note: the lint level is defined here
   --> compiler/rustc_privacy/src/lib.rs:8:34
    |
    |
8   | #![cfg_attr(not(bootstrap), deny(rustc::untranslatable_diagnostic))]

error: could not compile `rustc_privacy` due to 2 previous errors
warning: build failed, waiting for other jobs to finish...
Build completed unsuccessfully in 0:08:01

rust-log-analyzer avatar Aug 09 '22 14:08 rust-log-analyzer

The job x86_64-gnu-llvm-12 failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
   Compiling rustc_borrowck v0.0.0 (/checkout/compiler/rustc_borrowck)
   Compiling rustc_mir_transform v0.0.0 (/checkout/compiler/rustc_mir_transform)
   Compiling rustc_codegen_llvm v0.0.0 (/checkout/compiler/rustc_codegen_llvm)
   Compiling rustc_privacy v0.0.0 (/checkout/compiler/rustc_privacy)
error: diagnostics should only be created in `SessionDiagnostic`/`AddSubdiagnostic` impls
   --> compiler/rustc_privacy/src/lib.rs:405:31
    |
405 |                 self.tcx.sess.span_fatal(
    |
note: the lint level is defined here
   --> compiler/rustc_privacy/src/lib.rs:9:34
    |
    |
9   | #![cfg_attr(not(bootstrap), deny(rustc::diagnostic_outside_of_impl))]


error: diagnostics should be created using translatable messages
   --> compiler/rustc_privacy/src/lib.rs:405:31
    |
405 |                 self.tcx.sess.span_fatal(
    |
note: the lint level is defined here
   --> compiler/rustc_privacy/src/lib.rs:8:34
    |
    |
8   | #![cfg_attr(not(bootstrap), deny(rustc::untranslatable_diagnostic))]

error: could not compile `rustc_privacy` due to 2 previous errors
warning: build failed, waiting for other jobs to finish...
Build completed unsuccessfully in 0:08:17

rust-log-analyzer avatar Aug 09 '22 18:08 rust-log-analyzer

The job mingw-check failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
configure: rust.debug-assertions := True
configure: rust.overflow-checks := True
configure: llvm.assertions      := True
configure: dist.missing-tools   := True
configure: build.configure-args := ['--enable-sccache', '--disable-manage-submodu ...
configure: writing `config.toml` in current directory
configure: 
configure: run `python /checkout/x.py --help`
Attempting with retry: make prepare
---
* highest error code: E0790
Found 506 error codes
Found 0 error(s) in error codes
Done!
tidy error: /checkout/src/test/ui/privacy/access_levels.rs: missing trailing newline
some tidy checks failed
Build completed unsuccessfully in 0:00:10

rust-log-analyzer avatar Aug 10 '22 19:08 rust-log-analyzer

@rustbot ready

Bryanskiy avatar Aug 10 '22 21:08 Bryanskiy

The job x86_64-gnu-llvm-12 failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
 ---> 2afb3e7bef8f
Step 3/8 : RUN apt-get update && apt-get install -y --no-install-recommends   g++   gcc-multilib   make   ninja-build   file   curl   ca-certificates   python2.7   python3.9   git   cmake   sudo   gdb   llvm-12-tools   llvm-12-dev   libedit-dev   libssl-dev   pkg-config   zlib1g-dev   xz-utils   nodejs
 ---> Using cache
 ---> 357fae1e02d2
Step 4/8 : RUN apt-get update &&     apt-get install -y apt-transport-https software-properties-common &&     curl -s "https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/packages-microsoft-prod.deb" > packages-microsoft-prod.deb &&     dpkg -i packages-microsoft-prod.deb &&     apt-get update &&     apt-get install -y powershell
 ---> 080d1843107f
Step 5/8 : COPY scripts/sccache.sh /scripts/
 ---> Using cache
 ---> 4a6c76c56ba3
---
   Compiling rustc_borrowck v0.0.0 (/checkout/compiler/rustc_borrowck)
   Compiling rustc_mir_transform v0.0.0 (/checkout/compiler/rustc_mir_transform)
   Compiling rustc_codegen_llvm v0.0.0 (/checkout/compiler/rustc_codegen_llvm)
   Compiling rustc_privacy v0.0.0 (/checkout/compiler/rustc_privacy)
error: diagnostics should only be created in `SessionDiagnostic`/`AddSubdiagnostic` impls
   --> compiler/rustc_privacy/src/lib.rs:927:27
    |
927 |             self.tcx.sess.span_err(span, access_level);
    |
note: the lint level is defined here
   --> compiler/rustc_privacy/src/lib.rs:9:34
    |
    |
9   | #![cfg_attr(not(bootstrap), deny(rustc::diagnostic_outside_of_impl))]

error: could not compile `rustc_privacy` due to previous error
warning: build failed, waiting for other jobs to finish...
Build completed unsuccessfully in 0:07:56

rust-log-analyzer avatar Aug 12 '22 12:08 rust-log-analyzer

@rustbot ready

Bryanskiy avatar Aug 12 '22 14:08 Bryanskiy

The job mingw-check failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
configure: rust.debug-assertions := True
configure: rust.overflow-checks := True
configure: llvm.assertions      := True
configure: dist.missing-tools   := True
configure: build.configure-args := ['--enable-sccache', '--disable-manage-submodu ...
configure: writing `config.toml` in current directory
configure: 
configure: run `python /checkout/x.py --help`
Attempting with retry: make prepare
---
* highest error code: E0790
Found 506 error codes
Found 0 error(s) in error codes
Done!
tidy error: /checkout/src/test/ui/privacy/access_levels.rs:42: trailing whitespace
some tidy checks failed
Build completed unsuccessfully in 0:00:11

rust-log-analyzer avatar Aug 13 '22 15:08 rust-log-analyzer

@rustbot ready

Bryanskiy avatar Aug 13 '22 16:08 Bryanskiy

@rustbot ready

Bryanskiy avatar Aug 14 '22 11:08 Bryanskiy

r=me after squashing commits (2 commits, probably, because #[rustc_access_level] and compiler/rustc_resolve/src/access_levels.rs refactoring are two distinct things). @rustbot author

petrochenkov avatar Aug 14 '22 12:08 petrochenkov

@rustbot ready

Bryanskiy avatar Aug 14 '22 14:08 Bryanskiy

Thanks! @bors r+

petrochenkov avatar Aug 14 '22 16:08 petrochenkov

:pushpin: Commit 09277eba6808a804b63710f951c1234ec6fa3106 has been approved by petrochenkov

It is now in the queue for this repository.

bors avatar Aug 14 '22 16:08 bors

:umbrella: The latest upstream changes (presumably #100595) made this pull request unmergeable. Please resolve the merge conflicts.

bors avatar Aug 15 '22 21:08 bors

@rustbot ready

Bryanskiy avatar Aug 16 '22 08:08 Bryanskiy

@bors r+

petrochenkov avatar Aug 16 '22 14:08 petrochenkov

:pushpin: Commit d0884c43f937aaeeda5d0f1c3da8b8ad0bb326aa has been approved by petrochenkov

It is now in the queue for this repository.

bors avatar Aug 16 '22 14:08 bors

@rustbot author

Bryanskiy avatar Aug 31 '22 09:08 Bryanskiy