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

Note when a mutable trait object is needed #65077

Merged
merged 6 commits into from Oct 10, 2019

Conversation

@estebank
Copy link
Contributor

estebank commented Oct 4, 2019

Fix #63619, fix #37914. CC #64068.

@rust-highfive

This comment has been minimized.

Copy link
Collaborator

rust-highfive commented Oct 4, 2019

r? @eddyb

(rust_highfive has picked a reviewer for you, use r? to override)

@eddyb

This comment has been minimized.

Copy link
Member

eddyb commented Oct 4, 2019

@rust-highfive rust-highfive assigned nikomatsakis and unassigned eddyb Oct 4, 2019
Copy link
Contributor

nikomatsakis left a comment

r=me, modulo oli's nit

@rust-highfive

This comment was marked as resolved.

Copy link
Collaborator

rust-highfive commented Oct 5, 2019

The job mingw-check of your PR failed (pretty log, raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
2019-10-05T18:38:09.8361100Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-10-05T18:38:09.8585169Z ##[command]git config gc.auto 0
2019-10-05T18:38:09.8642141Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-10-05T18:38:10.8151783Z ##[command]git config --get-all http.proxy
2019-10-05T18:38:10.8158672Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/65077/merge:refs/remotes/pull/65077/merge
---
2019-10-05T18:47:54.1634193Z     Checking rustc_lint v0.0.0 (/checkout/src/librustc_lint)
2019-10-05T18:47:55.2955341Z error[E0061]: this function takes 2 parameters but 3 parameters were supplied
2019-10-05T18:47:55.2955779Z    --> src/librustc_typeck/check/method/mod.rs:218:39
2019-10-05T18:47:55.2956090Z     |
2019-10-05T18:47:55.2956425Z 218 |             let trait_type = self.tcx.mk_ref(region, t_type, mutability.not());
2019-10-05T18:47:55.2956843Z 
2019-10-05T18:47:55.6525990Z error[E0061]: this function takes 2 parameters but 3 parameters were supplied
2019-10-05T18:47:55.6527078Z    --> src/librustc_typeck/check/method/suggest.rs:576:51
2019-10-05T18:47:55.6527608Z     |
2019-10-05T18:47:55.6527608Z     |
2019-10-05T18:47:55.6528149Z 576 |                         let trait_type = self.tcx.mk_ref(region, t_type, mutability.not());
2019-10-05T18:47:55.6528886Z 
2019-10-05T18:47:55.8171391Z     Checking rustc_mir v0.0.0 (/checkout/src/librustc_mir)
2019-10-05T18:47:56.8839801Z error: aborting due to 2 previous errors
2019-10-05T18:47:56.8841591Z 
---
2019-10-05T18:48:16.9928169Z == clock drift check ==
2019-10-05T18:48:16.9928236Z   local time: Sat Oct  5 18:48:15 UTC 2019
2019-10-05T18:48:16.9928289Z   network time: Sat, 05 Oct 2019 18:48:15 GMT
2019-10-05T18:48:16.9928340Z == end clock drift check ==
2019-10-05T18:48:16.9997818Z ##[error]Bash exited with code '1'.
2019-10-05T18:48:17.0034156Z ##[section]Starting: Checkout
2019-10-05T18:48:17.0036584Z ==============================================================================
2019-10-05T18:48:17.0036650Z Task         : Get sources
2019-10-05T18:48:17.0036723Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@estebank estebank force-pushed the estebank:mut-trait-expected branch from fdcf9ff to 8549dca Oct 5, 2019
@rust-highfive

This comment was marked as resolved.

Copy link
Collaborator

rust-highfive commented Oct 5, 2019

The job x86_64-gnu-llvm-6.0 of your PR failed (pretty log, raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
2019-10-05T19:28:32.4489755Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-10-05T19:28:32.4700260Z ##[command]git config gc.auto 0
2019-10-05T19:28:32.4787667Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-10-05T19:28:32.4851782Z ##[command]git config --get-all http.proxy
2019-10-05T19:28:32.4988437Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/65077/merge:refs/remotes/pull/65077/merge
---
2019-10-05T19:35:24.4577946Z    Compiling serde_json v1.0.40
2019-10-05T19:35:26.2733210Z    Compiling tidy v0.1.0 (/checkout/src/tools/tidy)
2019-10-05T19:35:37.2278617Z     Finished release [optimized] target(s) in 1m 27s
2019-10-05T19:35:37.2348193Z tidy check
2019-10-05T19:35:37.9840179Z tidy error: /checkout/src/librustc_typeck/check/method/suggest.rs:561: trailing whitespace
2019-10-05T19:35:40.0781901Z some tidy checks failed
2019-10-05T19:35:40.0784839Z 
2019-10-05T19:35:40.0784839Z 
2019-10-05T19:35:40.0785855Z command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/tidy" "/checkout/src" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "--no-vendor"
2019-10-05T19:35:40.0786356Z 
2019-10-05T19:35:40.0786958Z 
2019-10-05T19:35:40.0787277Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test src/tools/tidy
2019-10-05T19:35:40.0787402Z Build completed unsuccessfully in 0:01:30
2019-10-05T19:35:40.0787402Z Build completed unsuccessfully in 0:01:30
2019-10-05T19:35:40.0787710Z == clock drift check ==
2019-10-05T19:35:40.0787833Z   local time: Sat Oct  5 19:35:39 UTC 2019
2019-10-05T19:35:40.0787953Z   network time: Sat, 05 Oct 2019 19:35:39 GMT
2019-10-05T19:35:40.0788091Z == end clock drift check ==
2019-10-05T19:35:40.7288183Z ##[error]Bash exited with code '1'.
2019-10-05T19:35:40.7317260Z ##[section]Starting: Checkout
2019-10-05T19:35:40.7318651Z ==============================================================================
2019-10-05T19:35:40.7318695Z Task         : Get sources
2019-10-05T19:35:40.7319228Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@estebank estebank force-pushed the estebank:mut-trait-expected branch from 8549dca to 169b040 Oct 5, 2019
src/librustc/hir/mod.rs Outdated Show resolved Hide resolved
@estebank

This comment has been minimized.

Copy link
Contributor Author

estebank commented Oct 7, 2019

@bors r=nikomatsakis

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Oct 7, 2019

📌 Commit 6efcb02 has been approved by nikomatsakis

Centril added a commit to Centril/rust that referenced this pull request Oct 7, 2019
…matsakis

Note when a mutable trait object is needed

Fix rust-lang#63619, fix rust-lang#37914. CC rust-lang#64068.
@Centril Centril referenced this pull request Oct 7, 2019
bors added a commit that referenced this pull request Oct 7, 2019
Rollup of 6 pull requests

Successful merges:

 - #64739 (Remove as_str if the type is already &str)
 - #65077 (Note when a mutable trait object is needed)
 - #65120 (Correctly estimate the required space for string in `StyledBuffer::prepend`)
 - #65150 (Suggest dereferencing boolean reference when used in 'if' or 'while')
 - #65164 (Add long error explanation for E0566)
 - #65173 (Update reference)

Failed merges:

r? @ghost
@bors

This comment has been minimized.

Copy link
Contributor

bors commented Oct 9, 2019

⌛️ Testing commit 6efcb02 with merge c98595c...

bors added a commit that referenced this pull request Oct 9, 2019
Note when a mutable trait object is needed

Fix #63619, fix #37914. CC #64068.
@bors

This comment has been minimized.

Copy link
Contributor

bors commented Oct 9, 2019

💔 Test failed - checks-azure

@rust-highfive

This comment has been minimized.

Copy link
Collaborator

rust-highfive commented Oct 9, 2019

The job x86_64-gnu of your PR failed (pretty log, raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
2019-10-09T08:54:11.8362428Z failures:
2019-10-09T08:54:11.8370550Z 
2019-10-09T08:54:11.8372261Z ---- [ui] ui/where-clauses/where-for-self-2.rs stdout ----
2019-10-09T08:54:11.8372852Z 
2019-10-09T08:54:11.8373106Z error: Error: expected failure status (Some(1)) but received status Some(101).
2019-10-09T08:54:11.8373789Z status: exit code: 101
2019-10-09T08:54:11.8375439Z command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/where-clauses/where-for-self-2.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/where-clauses/where-for-self-2" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/where-clauses/where-for-self-2/auxiliary" "-A" "unused"
2019-10-09T08:54:11.8376644Z ------------------------------------------
2019-10-09T08:54:11.8376840Z 
2019-10-09T08:54:11.8377256Z ------------------------------------------
2019-10-09T08:54:11.8377641Z stderr:
2019-10-09T08:54:11.8377641Z stderr:
2019-10-09T08:54:11.8378175Z ------------------------------------------
2019-10-09T08:54:11.8378847Z thread 'rustc' panicked at 'assertion failed: !value.has_escaping_bound_vars()', src/librustc/ty/sty.rs:896:9
2019-10-09T08:54:11.8379276Z 
2019-10-09T08:54:11.8379465Z error: internal compiler error: unexpected panic
2019-10-09T08:54:11.8379606Z 
2019-10-09T08:54:11.8379772Z note: the compiler unexpectedly panicked. this is a bug.
2019-10-09T08:54:11.8379772Z note: the compiler unexpectedly panicked. this is a bug.
2019-10-09T08:54:11.8379932Z 
2019-10-09T08:54:11.8380372Z note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
2019-10-09T08:54:11.8380598Z 
2019-10-09T08:54:11.8381652Z note: rustc 1.40.0-dev running on x86_64-unknown-linux-gnu
2019-10-09T08:54:11.8382011Z 
2019-10-09T08:54:11.8382527Z note: compiler flags: -Z threads=1 -Z ui-testing -Z unstable-options -C prefer-dynamic -C rpath -C debuginfo=0
2019-10-09T08:54:11.8382925Z 
2019-10-09T08:54:11.8383338Z ------------------------------------------
2019-10-09T08:54:11.8383538Z 
2019-10-09T08:54:11.8383704Z 
---
2019-10-09T08:54:11.8390658Z thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:537:22
2019-10-09T08:54:11.8391688Z note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
2019-10-09T08:54:11.8405898Z 
2019-10-09T08:54:11.8406310Z 
2019-10-09T08:54:11.8408537Z command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "--compile-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" "--run-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--src-base" "/checkout/src/test/ui" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--mode" "ui" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/checkout/obj/build/x86_64-unknown-linux-gnu/llvm/build/bin/FileCheck" "--host-rustcflags" "-Crpath -O -Cdebuginfo=0 -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--target-rustcflags" "-Crpath -O -Cdebuginfo=0 -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--docck-python" "/usr/bin/python2.7" "--lldb-python" "/usr/bin/python2.7" "--gdb" "/usr/bin/gdb" "--llvm-version" "9.0.0-rust-1.40.0-dev\n" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--llvm-cxxflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
2019-10-09T08:54:11.8409462Z 
2019-10-09T08:54:11.8409618Z 
2019-10-09T08:54:11.8413758Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
2019-10-09T08:54:11.8414085Z Build completed unsuccessfully in 1:36:57
2019-10-09T08:54:11.8414085Z Build completed unsuccessfully in 1:36:57
2019-10-09T08:54:11.8474476Z == clock drift check ==
2019-10-09T08:54:11.8490521Z   local time: Wed Oct  9 08:54:11 UTC 2019
2019-10-09T08:54:11.9809710Z   network time: Wed, 09 Oct 2019 08:54:11 GMT
2019-10-09T08:54:11.9812071Z == end clock drift check ==
2019-10-09T08:54:12.8084696Z ##[error]Bash exited with code '1'.
2019-10-09T08:54:12.8118748Z ##[section]Starting: Upload CPU usage statistics
2019-10-09T08:54:12.8132635Z ==============================================================================
2019-10-09T08:54:12.8132740Z Task         : Bash
2019-10-09T08:54:12.8132837Z Description  : Run a Bash script on macOS, Linux, or Windows

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@estebank estebank force-pushed the estebank:mut-trait-expected branch from 6efcb02 to faf8a2a Oct 9, 2019
@estebank

This comment has been minimized.

Copy link
Contributor Author

estebank commented Oct 9, 2019

@bors r=nikomatsakis

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Oct 9, 2019

📌 Commit faf8a2a has been approved by nikomatsakis

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Oct 10, 2019

⌛️ Testing commit faf8a2a with merge 8ee24f6...

bors added a commit that referenced this pull request Oct 10, 2019
Note when a mutable trait object is needed

Fix #63619, fix #37914. CC #64068.
@bors

This comment has been minimized.

Copy link
Contributor

bors commented Oct 10, 2019

☀️ Test successful - checks-azure
Approved by: nikomatsakis
Pushing 8ee24f6 to master...

@bors bors added the merged-by-bors label Oct 10, 2019
@bors bors merged commit faf8a2a into rust-lang:master Oct 10, 2019
5 checks passed
5 checks passed
homu Test successful
Details
pr Build #20191009.44 succeeded
Details
pr (Linux mingw-check) Linux mingw-check succeeded
Details
pr (Linux x86_64-gnu-llvm-6.0) Linux x86_64-gnu-llvm-6.0 succeeded
Details
pr (LinuxTools) LinuxTools succeeded
Details
@nnethercote

This comment has been minimized.

Copy link
Contributor

nnethercote commented Oct 10, 2019

This caused a big perf regression, unfortunately. Quite a few benchmarks are affected, with the worst regression being 12%.

(#64939 is also in the commit range, but it's a very simple code clean-up and I just confirmed locally that it's not the cause.)

I suggest backing it out to allow time for investigation.

cc @rust-lang/wg-compiler-performance

@estebank

This comment has been minimized.

Copy link
Contributor Author

estebank commented Oct 11, 2019

I am surprised because I thought all the code that I touched here was outside of the "happy path", only triggering if an error is already being emitted, but feel free to rollback this PR (and reopen the original tickets).

@estebank

This comment has been minimized.

Copy link
Contributor Author

estebank commented Oct 11, 2019

Actually, I think I see it now. This code should be inside of the if result.illegal_sized_bound {}. I'm sure that the culprit.

bors added a commit that referenced this pull request Oct 11, 2019
Move diagnostics code out of the critical path

Follow up to #65077.

r? @nnethercote
Centril added a commit to Centril/rust that referenced this pull request Oct 13, 2019
Move diagnostics code out of the critical path

Follow up to rust-lang#65077.

r? @nnethercote
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
8 participants
You can’t perform that action at this time.