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

Implement #[track_caller] attribute. (RFC 2091 4/N) #65881

Merged
merged 16 commits into from Dec 8, 2019

Conversation

@anp
Copy link
Member

anp commented Oct 27, 2019

Implements the #[track_caller] attribute in both const and codegen contexts.

The const implementation walks up the stack to find the nearest untracked callsite.

The codegen implementation adds an implicit argument to tracked function calls, and populates it with either a call to the previously-landed intrinsic or if the caller has #[track_caller] with a copy of the location passed to the current function.

Also includes a little cleanup and a few comments in the other caller location areas.

Depends on: 65664
RFC 2091 text
Tracking issue
Tracking doc

@rust-highfive

This comment has been minimized.

Copy link
Collaborator

rust-highfive commented Oct 27, 2019

r? @zackmdavis

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

@rust-highfive

This comment has been minimized.

Copy link
Collaborator

rust-highfive commented Oct 28, 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-28T00:32:18.3461312Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-10-28T00:32:18.3677633Z ##[command]git config gc.auto 0
2019-10-28T00:32:18.3729214Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-10-28T00:32:18.3774118Z ##[command]git config --get-all http.proxy
2019-10-28T00:32:18.3911061Z ##[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/65881/merge:refs/remotes/pull/65881/merge
---
2019-10-28T00:56:29.8569601Z    Compiling rustc_codegen_ssa v0.0.0 (/checkout/src/librustc_codegen_ssa)
2019-10-28T00:56:30.1990154Z error[E0425]: cannot find value `arg_count` in this scope
2019-10-28T00:56:30.1992137Z    --> src/librustc_codegen_ssa/mir/block.rs:571:45
2019-10-28T00:56:30.1992393Z     |
2019-10-28T00:56:30.1992668Z 571 |         let mut llargs = Vec::with_capacity(arg_count);
2019-10-28T00:56:30.1996382Z 
2019-10-28T00:56:32.4400514Z error: aborting due to previous error
2019-10-28T00:56:32.4405136Z 
2019-10-28T00:56:32.4434180Z For more information about this error, try `rustc --explain E0425`.
---
2019-10-28T00:56:43.1136232Z   local time: Mon Oct 28 00:56:43 UTC 2019
2019-10-28T00:56:43.2325625Z   network time: Mon, 28 Oct 2019 00:56:43 GMT
2019-10-28T00:56:43.2328032Z == end clock drift check ==
2019-10-28T00:56:44.0834481Z 
2019-10-28T00:56:44.0920383Z ##[error]Bash exited with code '1'.
2019-10-28T00:56:44.0986916Z ##[section]Starting: Checkout
2019-10-28T00:56:44.0989727Z ==============================================================================
2019-10-28T00:56:44.0989788Z Task         : Get sources
2019-10-28T00:56:44.0989836Z 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)

@anp anp force-pushed the anp:implicit-caller-location branch from d34f76a to 0d42c3b Oct 28, 2019
@rust-highfive

This comment has been minimized.

Copy link
Collaborator

rust-highfive commented Oct 28, 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-28T06:58:57.0639450Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-10-28T06:58:57.5835059Z ##[command]git config gc.auto 0
2019-10-28T06:58:57.5840920Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-10-28T06:58:57.5845012Z ##[command]git config --get-all http.proxy
2019-10-28T06:58:57.5849383Z ##[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/65881/merge:refs/remotes/pull/65881/merge
---
2019-10-28T07:24:40.1148347Z    Compiling rustc_codegen_ssa v0.0.0 (/checkout/src/librustc_codegen_ssa)
2019-10-28T07:24:40.4486299Z error[E0425]: cannot find value `arg_count` in this scope
2019-10-28T07:24:40.4486774Z    --> src/librustc_codegen_ssa/mir/block.rs:571:45
2019-10-28T07:24:40.4487015Z     |
2019-10-28T07:24:40.4487325Z 571 |         let mut llargs = Vec::with_capacity(arg_count);
2019-10-28T07:24:40.4494157Z 
2019-10-28T07:24:42.8999526Z error: aborting due to previous error
2019-10-28T07:24:42.9005313Z 
2019-10-28T07:24:42.9017256Z For more information about this error, try `rustc --explain E0425`.
---
2019-10-28T07:24:52.1903945Z   local time: Mon Oct 28 07:24:52 UTC 2019
2019-10-28T07:24:52.3410138Z   network time: Mon, 28 Oct 2019 07:24:52 GMT
2019-10-28T07:24:52.3412658Z == end clock drift check ==
2019-10-28T07:24:53.2236628Z 
2019-10-28T07:24:53.2365491Z ##[error]Bash exited with code '1'.
2019-10-28T07:24:53.2406338Z ##[section]Starting: Checkout
2019-10-28T07:24:53.2408155Z ==============================================================================
2019-10-28T07:24:53.2408233Z Task         : Get sources
2019-10-28T07:24:53.2408281Z 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)

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Oct 28, 2019

☔️ The latest upstream changes (presumably #65885) made this pull request unmergeable. Please resolve the merge conflicts.

@anp anp force-pushed the anp:implicit-caller-location branch from 0d42c3b to ebbcd40 Oct 28, 2019
@rust-highfive

This comment has been minimized.

Copy link
Collaborator

rust-highfive commented Oct 28, 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-28T14:19:37.5979223Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-10-28T14:19:37.6159536Z ##[command]git config gc.auto 0
2019-10-28T14:19:37.6222193Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-10-28T14:19:38.4148309Z ##[command]git config --get-all http.proxy
2019-10-28T14:19:38.4156695Z ##[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/65881/merge:refs/remotes/pull/65881/merge
---
2019-10-28T14:43:22.0313782Z    Compiling rustc_codegen_ssa v0.0.0 (/checkout/src/librustc_codegen_ssa)
2019-10-28T14:43:22.3304016Z error[E0425]: cannot find value `arg_count` in this scope
2019-10-28T14:43:22.3304705Z    --> src/librustc_codegen_ssa/mir/block.rs:571:45
2019-10-28T14:43:22.3305488Z     |
2019-10-28T14:43:22.3306088Z 571 |         let mut llargs = Vec::with_capacity(arg_count);
2019-10-28T14:43:22.3307182Z 
2019-10-28T14:43:24.5891052Z error: aborting due to previous error
2019-10-28T14:43:24.5892658Z 
2019-10-28T14:43:24.5898206Z For more information about this error, try `rustc --explain E0425`.
---
2019-10-28T14:43:46.9364928Z   local time: Mon Oct 28 14:43:46 UTC 2019
2019-10-28T14:43:47.2087881Z   network time: Mon, 28 Oct 2019 14:43:47 GMT
2019-10-28T14:43:47.2090846Z == end clock drift check ==
2019-10-28T14:43:48.5026252Z 
2019-10-28T14:43:48.5120716Z ##[error]Bash exited with code '1'.
2019-10-28T14:43:48.5158021Z ##[section]Starting: Checkout
2019-10-28T14:43:48.5160099Z ==============================================================================
2019-10-28T14:43:48.5160161Z Task         : Get sources
2019-10-28T14:43:48.5160199Z 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)

@anp anp force-pushed the anp:implicit-caller-location branch from ebbcd40 to a308999 Oct 29, 2019
@rust-highfive

This comment has been minimized.

Copy link
Collaborator

rust-highfive commented Oct 29, 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-29T03:08:25.6984255Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-10-29T03:08:25.7171175Z ##[command]git config gc.auto 0
2019-10-29T03:08:25.7273816Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-10-29T03:08:25.7364214Z ##[command]git config --get-all http.proxy
2019-10-29T03:08:25.7513188Z ##[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/65881/merge:refs/remotes/pull/65881/merge
---
2019-10-29T04:16:05.3453863Z .................................................................................................... 1600/9260
2019-10-29T04:16:11.9843937Z .................................................................................................... 1700/9260
2019-10-29T04:16:26.6486710Z .........................................................i...............i.......................... 1800/9260
2019-10-29T04:16:35.4839679Z .................................................................................................... 1900/9260
2019-10-29T04:16:52.6449464Z ...............................................iiiii................................................ 2000/9260
2019-10-29T04:17:05.3783772Z .................................................................................................... 2200/9260
2019-10-29T04:17:08.4664994Z .................................................................................................... 2300/9260
2019-10-29T04:17:13.0753265Z .................................................................................................... 2400/9260
2019-10-29T04:17:40.1539574Z .................................................................................................... 2500/9260
---
2019-10-29T04:21:01.1704986Z .................................................i..............i................................... 4800/9260
2019-10-29T04:21:11.4806773Z .................................................................................................... 4900/9260
2019-10-29T04:21:21.3279990Z .................................................................................................... 5000/9260
2019-10-29T04:21:28.8976268Z .................................................................................................... 5100/9260
2019-10-29T04:21:40.5381036Z .................................................ii.ii...........i.................................. 5200/9260
2019-10-29T04:21:51.8502367Z .................................................................................................... 5400/9260
2019-10-29T04:22:02.7191184Z .................................................................................................... 5500/9260
2019-10-29T04:22:11.8690310Z ...................i................................................................................ 5600/9260
2019-10-29T04:22:18.8976758Z .................................................................................................... 5700/9260
2019-10-29T04:22:18.8976758Z .................................................................................................... 5700/9260
2019-10-29T04:22:32.4366653Z .................................................................................................... 5800/9260
2019-10-29T04:22:46.6324039Z ....ii...i..ii...........i.......................................................................... 5900/9260
2019-10-29T04:23:11.8534094Z .................................................................................................... 6100/9260
2019-10-29T04:23:21.2676702Z .................................................................................................... 6200/9260
2019-10-29T04:23:21.2676702Z .................................................................................................... 6200/9260
2019-10-29T04:23:37.7300751Z .......................i..ii........................................................................ 6300/9260
2019-10-29T04:24:00.9572098Z .........................................................................................i.......... 6500/9260
2019-10-29T04:24:03.6045778Z .................................................................................................... 6600/9260
2019-10-29T04:24:06.3246767Z ................................................................i................................... 6700/9260
2019-10-29T04:24:09.7797013Z .................................................................................................... 6800/9260
---
2019-10-29T04:28:54.5153612Z thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:537:22
2019-10-29T04:28:54.5154112Z note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
2019-10-29T04:28:54.5200067Z 
2019-10-29T04:28:54.5200913Z 
2019-10-29T04:28:54.5202992Z 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" "/usr/lib/llvm-6.0/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" "--quiet" "--llvm-version" "6.0.0\n" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--llvm-cxxflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
2019-10-29T04:28:54.5206531Z 
2019-10-29T04:28:54.5207369Z 
2019-10-29T04:28:54.5247507Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
2019-10-29T04:28:54.5248543Z Build completed unsuccessfully in 1:13:13
2019-10-29T04:28:54.5248543Z Build completed unsuccessfully in 1:13:13
2019-10-29T04:28:54.5324378Z == clock drift check ==
2019-10-29T04:28:54.5343396Z   local time: Tue Oct 29 04:28:54 UTC 2019
2019-10-29T04:28:54.6208878Z   network time: Tue, 29 Oct 2019 04:28:54 GMT
2019-10-29T04:28:54.6214969Z == end clock drift check ==
2019-10-29T04:28:55.5942224Z 
2019-10-29T04:28:55.6081972Z ##[error]Bash exited with code '1'.
2019-10-29T04:28:55.6141016Z ##[section]Starting: Checkout
2019-10-29T04:28:55.6142945Z ==============================================================================
2019-10-29T04:28:55.6143001Z Task         : Get sources
2019-10-29T04:28:55.6143231Z 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)

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Oct 29, 2019

☔️ The latest upstream changes (presumably #65919) made this pull request unmergeable. Please resolve the merge conflicts.

bors added a commit that referenced this pull request Oct 30, 2019
rustc: split FnAbi's into definitions/direct calls ("of_instance") and indirect calls ("of_fn_ptr").

*Based on #65938 (it's nicer with the rename IMO, but not necessary).*

After this PR:
* `InstanceDef::Virtual` is only used for "direct" virtual calls, and shims around those calls use `InstanceDef::ReifyShim` (i.e. for `<dyn Trait as Trait>::f as fn(_)`)
  * this could easily be done for intrinsics as well, to allow their reification, but I didn't do it
* `FnAbi::of_instance` is **always** used for declaring/defining an `fn`, and for direct calls to an `fn`
  * this is great for e.g. #65881 (`#[track_caller]`), which can introduce the "caller location" argument into "codegen signatures" by only changing `FnAbi::of_instance`, after this PR
* `FnAbi::of_fn_ptr` is used primarily for indirect calls, i.e. to `fn` pointers
  * *not* virtual calls (which use `FnAbi::of_instance` with `InstanceDef::Virtual`)
  * there's also a couple uses where the `rustc_codegen_llvm` needs to declare (i.e. FFI-import) an LLVM function that has no Rust declaration available at all
    * at least one of them could probably be a "weak lang item" instead

As there are many steps, this PR is best reviewed commit by commit - some of which arguably should be in their own PRs, I may have gotten carried away a bit.

cc @nagisa @rkruppe @oli-obk @anp
@JohnCSimon

This comment has been minimized.

Copy link
Member

JohnCSimon commented Nov 2, 2019

Ping from triage:
@anp is this still a WIP? Can you please address the build failures?
cc: @zackmdavis

@anp

This comment has been minimized.

Copy link
Member Author

anp commented Nov 2, 2019

This is pending #65947 right now.

(is it problematic to have a WIP/draft PR open for a while?)

@eddyb eddyb added S-blocked and removed S-waiting-on-author labels Nov 2, 2019
@eddyb

This comment has been minimized.

Copy link
Member

eddyb commented Nov 2, 2019

Marking as blocked on #65947.

@anp anp force-pushed the anp:implicit-caller-location branch from a308999 to b621eb7 Nov 2, 2019
@rust-highfive

This comment has been minimized.

Copy link
Collaborator

rust-highfive commented Nov 2, 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-11-02T15:51:28.1304029Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-11-02T15:51:28.1494488Z ##[command]git config gc.auto 0
2019-11-02T15:51:28.1579459Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-11-02T15:51:28.1639457Z ##[command]git config --get-all http.proxy
2019-11-02T15:51:28.1842256Z ##[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/65881/merge:refs/remotes/pull/65881/merge
---
2019-11-02T16:54:51.2532692Z .................................................................................................... 1600/9266
2019-11-02T16:54:57.4530956Z .................................................................................................... 1700/9266
2019-11-02T16:55:11.0838686Z ...........................................................i...............i........................ 1800/9266
2019-11-02T16:55:19.7052138Z .................................................................................................... 1900/9266
2019-11-02T16:55:35.5438535Z .................................................iiiii.............................................. 2000/9266
2019-11-02T16:55:47.1466454Z .................................................................................................... 2200/9266
2019-11-02T16:55:49.8481114Z .................................................................................................... 2300/9266
2019-11-02T16:55:53.8768261Z .................................................................................................... 2400/9266
2019-11-02T16:56:19.0646183Z .................................................................................................... 2500/9266
---
2019-11-02T16:59:22.6494414Z .................................................i...............i.................................. 4800/9266
2019-11-02T16:59:32.2101865Z .................................................................................................... 4900/9266
2019-11-02T16:59:41.2937031Z .................................................................................................... 5000/9266
2019-11-02T16:59:47.9799072Z .................................................................................................... 5100/9266
2019-11-02T16:59:59.0704334Z ..................................................ii.ii...........i................................. 5200/9266
2019-11-02T17:00:09.9855222Z .................................................................................................... 5400/9266
2019-11-02T17:00:20.9186163Z .................................................................................................... 5500/9266
2019-11-02T17:00:29.1145498Z .......................i............................................................................ 5600/9266
2019-11-02T17:00:36.0795170Z .................................................................................................... 5700/9266
2019-11-02T17:00:36.0795170Z .................................................................................................... 5700/9266
2019-11-02T17:00:48.7287764Z .................................................................................................... 5800/9266
2019-11-02T17:01:01.6958323Z ........ii...i..ii...........i...................................................................... 5900/9266
2019-11-02T17:01:25.3994617Z .................................................................................................... 6100/9266
2019-11-02T17:01:30.2617518Z .................................................................................................... 6200/9266
2019-11-02T17:01:30.2617518Z .................................................................................................... 6200/9266
2019-11-02T17:01:45.3813064Z ...........................i..ii.................................................................... 6300/9266
2019-11-02T17:02:07.1629934Z .............................................................................................i...... 6500/9266
2019-11-02T17:02:09.6156942Z .................................................................................................... 6600/9266
2019-11-02T17:02:12.0887864Z ....................................................................i............................... 6700/9266
2019-11-02T17:02:15.2632599Z .................................................................................................... 6800/9266
---
2019-11-02T17:04:02.8555327Z .................................................................................................... 7400/9266
2019-11-02T17:04:09.0341347Z ........................................................................F........................... 7500/9266
2019-11-02T17:04:18.9004758Z .................................................................................................... 7600/9266
2019-11-02T17:04:30.7382189Z .................................................................................................... 7700/9266
2019-11-02T17:04:41.4495497Z .........................................................................................ii......i.. 7800/9266
2019-11-02T17:04:52.8312612Z .................................................................................................... 8000/9266
2019-11-02T17:05:10.6486695Z .................................................................................................... 8100/9266
2019-11-02T17:05:19.7510858Z .................................................................................................... 8200/9266
2019-11-02T17:05:30.4369138Z .................................................................................................... 8300/9266
---
2019-11-02T17:07:27.4984293Z thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:537:22
2019-11-02T17:07:27.4985720Z note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
2019-11-02T17:07:27.5000767Z 
2019-11-02T17:07:27.5000990Z 
2019-11-02T17:07:27.5007731Z 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" "/usr/lib/llvm-6.0/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" "--quiet" "--llvm-version" "6.0.0\n" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--llvm-cxxflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
2019-11-02T17:07:27.5008578Z 
2019-11-02T17:07:27.5008712Z 
2019-11-02T17:07:27.5016779Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
2019-11-02T17:07:27.5016916Z Build completed unsuccessfully in 1:08:54
2019-11-02T17:07:27.5016916Z Build completed unsuccessfully in 1:08:54
2019-11-02T17:07:27.5077148Z == clock drift check ==
2019-11-02T17:07:27.5092290Z   local time: Sat Nov  2 17:07:27 UTC 2019
2019-11-02T17:07:33.0522745Z   network time: Sat, 02 Nov 2019 17:07:33 GMT
2019-11-02T17:07:33.0524257Z == end clock drift check ==
2019-11-02T17:07:34.0266072Z 
2019-11-02T17:07:34.0375577Z ##[error]Bash exited with code '1'.
2019-11-02T17:07:34.0450859Z ##[section]Starting: Checkout
2019-11-02T17:07:34.0452639Z ==============================================================================
2019-11-02T17:07:34.0452720Z Task         : Get sources
2019-11-02T17:07:34.0452788Z 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)

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Nov 6, 2019

☔️ The latest upstream changes (presumably #66143) made this pull request unmergeable. Please resolve the merge conflicts.

@anp anp force-pushed the anp:implicit-caller-location branch from b621eb7 to 78d8622 Nov 8, 2019
@anp

This comment has been minimized.

Copy link
Member Author

anp commented Nov 8, 2019

I implemented the remaining functionality on top of @eddyb's branch from #65947, pushing it here now to see how it behaves on tests.

If you're taking a look at this it would be great to get your review on #65947 first since this PR depends on it, and I'll need to remove the rebased commits once that lands to make this more easily reviewed.

@anp anp marked this pull request as ready for review Nov 8, 2019
@anp anp changed the title WIP Implement #[track_caller] attribute. (RFC 2091 4/N) Implement #[track_caller] attribute. (RFC 2091 4/N) Nov 8, 2019
@rust-highfive rust-highfive assigned oli-obk and unassigned zackmdavis Dec 7, 2019
@anp anp force-pushed the anp:implicit-caller-location branch from 1c37b55 to ef95b38 Dec 7, 2019
anp added 4 commits Dec 6, 2019
The caller location is passed as an implicit argument, so we must consider it when checking the sizedness of arguments.
@anp anp force-pushed the anp:implicit-caller-location branch from ef95b38 to 15d1f7c Dec 7, 2019
@oli-obk

This comment has been minimized.

Copy link
Contributor

oli-obk commented Dec 7, 2019

@bors r=eddyb,oli-obk

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Dec 7, 2019

📌 Commit 15d1f7c has been approved by eddyb,oli-obk

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Dec 7, 2019

⌛️ Testing commit 15d1f7c with merge 8d5f9ce...

bors added a commit that referenced this pull request Dec 7, 2019
Implement #[track_caller] attribute. (RFC 2091 4/N)

Implements the `#[track_caller]` attribute in both const and codegen contexts.

The const implementation walks up the stack to find the nearest untracked callsite.

The codegen implementation adds an implicit argument to tracked function calls, and populates it with either a call to the previously-landed intrinsic or if the caller has `#[track_caller]` with a copy of the location passed to the current function.

Also includes a little cleanup and a few comments in the other caller location areas.

[Depends on: 65664](#65664)
[RFC 2091 text](https://github.com/rust-lang/rfcs/blob/master/text/2091-inline-semantic.md)
[Tracking issue](#47809)
[Tracking doc](https://paper.dropbox.com/doc/track_rfc_2091_impl-notes--Anf1NwnIb0xcRv31YLIadyj0Ag-rwCdRc2fi2yvRZ7syGZ9q#:uid=863513134494965680023183&h2=TODO-actually-pass-location-to)
@bors

This comment has been minimized.

Copy link
Contributor

bors commented Dec 7, 2019

💔 Test failed - checks-azure

@anp

This comment has been minimized.

Copy link
Member Author

anp commented Dec 7, 2019

Azure says that the macOS i686 build was canceled? https://dev.azure.com/rust-lang/rust/_build/results?buildId=15399

EDIT: ah, there's more detail:

##[Error 1]
An error occurred while provisioning resources (Error Type: Disconnect). 

##[Warning 1]
Received request to deprovision: The request was cancelled by the remote provider. 
@anp anp mentioned this pull request Dec 7, 2019
@eddyb

This comment has been minimized.

Copy link
Member

eddyb commented Dec 7, 2019

@bors retry

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Dec 7, 2019

⌛️ Testing commit 15d1f7c with merge de17464...

bors added a commit that referenced this pull request Dec 7, 2019
Implement #[track_caller] attribute. (RFC 2091 4/N)

Implements the `#[track_caller]` attribute in both const and codegen contexts.

The const implementation walks up the stack to find the nearest untracked callsite.

The codegen implementation adds an implicit argument to tracked function calls, and populates it with either a call to the previously-landed intrinsic or if the caller has `#[track_caller]` with a copy of the location passed to the current function.

Also includes a little cleanup and a few comments in the other caller location areas.

[Depends on: 65664](#65664)
[RFC 2091 text](https://github.com/rust-lang/rfcs/blob/master/text/2091-inline-semantic.md)
[Tracking issue](#47809)
[Tracking doc](https://paper.dropbox.com/doc/track_rfc_2091_impl-notes--Anf1NwnIb0xcRv31YLIadyj0Ag-rwCdRc2fi2yvRZ7syGZ9q#:uid=863513134494965680023183&h2=TODO-actually-pass-location-to)
@bors

This comment has been minimized.

Copy link
Contributor

bors commented Dec 8, 2019

☀️ Test successful - checks-azure
Approved by: eddyb,oli-obk
Pushing de17464 to master...

@bors bors added the merged-by-bors label Dec 8, 2019
@bors bors merged commit 15d1f7c into rust-lang:master Dec 8, 2019
5 checks passed
5 checks passed
homu Test successful
Details
pr #20191207.9 succeeded
Details
pr (Linux mingw-check) Linux mingw-check succeeded
Details
pr (Linux x86_64-gnu-llvm-7) Linux x86_64-gnu-llvm-7 succeeded
Details
pr (Linux x86_64-gnu-tools) Linux x86_64-gnu-tools succeeded
Details
@anp anp deleted the anp:implicit-caller-location branch Dec 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
10 participants
You can’t perform that action at this time.