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

libstd uses core::panic::Location where possible. #67137

Merged
merged 5 commits into from
Jan 4, 2020

Conversation

anp
Copy link
Member

@anp anp commented Dec 8, 2019

cc @eddyb

@rust-highfive
Copy link
Collaborator

r? @alexcrichton

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

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 8, 2019
src/libstd/macros.rs Outdated Show resolved Hide resolved
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-7 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-12-08T02:13:14.4499523Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-12-08T02:13:15.2563406Z ##[command]git config gc.auto 0
2019-12-08T02:13:15.2567499Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-12-08T02:13:15.2569566Z ##[command]git config --get-all http.proxy
2019-12-08T02:13:15.2571924Z ##[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/67137/merge:refs/remotes/pull/67137/merge
---
2019-12-08T02:46:54.0207027Z    Compiling rustc_data_structures v0.0.0 (/checkout/src/librustc_data_structures)
2019-12-08T02:46:58.1350458Z    Compiling arena v0.0.0 (/checkout/src/libarena)
2019-12-08T02:47:00.2988165Z    Compiling rustc_macros v0.1.0 (/checkout/src/librustc_macros)
2019-12-08T02:47:14.1850313Z    Compiling syntax_pos v0.0.0 (/checkout/src/libsyntax_pos)
2019-12-08T02:47:14.7177917Z error[E0658]: use of unstable library feature 'track_caller': uses #[track_caller] which is not yet stable
2019-12-08T02:47:14.7178275Z   --> src/libsyntax_pos/lib.rs:75:10
2019-12-08T02:47:14.7178866Z 75 |          RustcDecodable, RustcEncodable, HashStable_Generic)]
2019-12-08T02:47:14.7179395Z    |          ^^^^^^^^^^^^^^ in this macro invocation
2019-12-08T02:47:14.7180044Z    | 
2019-12-08T02:47:14.7180324Z   ::: <::core::macros::builtin::RustcDecodable macros>:1:1
2019-12-08T02:47:14.7180324Z   ::: <::core::macros::builtin::RustcDecodable macros>:1:1
2019-12-08T02:47:14.7180542Z    |
2019-12-08T02:47:14.7180831Z 1  | ($ item : item) => { }
2019-12-08T02:47:14.7181175Z    | ---------------------- in this expansion of `#[derive(RustcDecodable)]`
2019-12-08T02:47:14.7181396Z    |
2019-12-08T02:47:14.7181864Z    = note: for more information, see ***/issues/47809
2019-12-08T02:47:14.7182202Z    = help: add `#![feature(track_caller)]` to the crate attributes to enable
2019-12-08T02:47:14.7182273Z 
2019-12-08T02:47:14.8137192Z error[E0658]: use of unstable library feature 'track_caller': uses #[track_caller] which is not yet stable
2019-12-08T02:47:14.8137554Z    --> src/libsyntax_pos/lib.rs:802:39
2019-12-08T02:47:14.8137811Z     |
2019-12-08T02:47:14.8138143Z 802 | #[derive(Copy, Clone, RustcEncodable, RustcDecodable, Eq, PartialEq, Debug)]
2019-12-08T02:47:14.8138768Z     | 
2019-12-08T02:47:14.8139521Z    ::: <::core::macros::builtin::RustcDecodable macros>:1:1
2019-12-08T02:47:14.8139812Z     |
2019-12-08T02:47:14.8139812Z     |
2019-12-08T02:47:14.8140342Z 1   | ($ item : item) => { }
2019-12-08T02:47:14.8140668Z     | ---------------------- in this expansion of `#[derive(RustcDecodable)]`
2019-12-08T02:47:14.8140893Z     |
2019-12-08T02:47:14.8141281Z     = note: for more information, see ***/issues/47809
2019-12-08T02:47:14.8141590Z     = help: add `#![feature(track_caller)]` to the crate attributes to enable
2019-12-08T02:47:14.8141649Z 
2019-12-08T02:47:15.0416165Z error[E0658]: use of unstable library feature 'track_caller': uses #[track_caller] which is not yet stable
2019-12-08T02:47:15.0416550Z  --> src/libsyntax_pos/edition.rs:9:26
2019-12-08T02:47:15.0416837Z   |
2019-12-08T02:47:15.0417170Z 9 |          RustcEncodable, RustcDecodable, Eq, HashStable_Generic)]
2019-12-08T02:47:15.0417923Z   | 
2019-12-08T02:47:15.0418190Z  ::: <::core::macros::builtin::RustcDecodable macros>:1:1
2019-12-08T02:47:15.0418420Z   |
2019-12-08T02:47:15.0418420Z   |
2019-12-08T02:47:15.0418682Z 1 | ($ item : item) => { }
2019-12-08T02:47:15.0419014Z   | ---------------------- in this expansion of `#[derive(RustcDecodable)]`
2019-12-08T02:47:15.0419252Z   |
2019-12-08T02:47:15.0419652Z   = note: for more information, see ***/issues/47809
2019-12-08T02:47:15.0420342Z   = help: add `#![feature(track_caller)]` to the crate attributes to enable
2019-12-08T02:47:15.0420403Z 
2019-12-08T02:47:15.0554060Z error[E0658]: use of unstable library feature 'track_caller': uses #[track_caller] which is not yet stable
2019-12-08T02:47:15.0554648Z    |
2019-12-08T02:47:15.0554957Z 63 |          RustcEncodable, RustcDecodable, HashStable_Generic)]
2019-12-08T02:47:15.0555319Z    |                          ^^^^^^^^^^^^^^ in this macro invocation
2019-12-08T02:47:15.0555571Z    | 
2019-12-08T02:47:15.0555571Z    | 
2019-12-08T02:47:15.0555849Z   ::: <::core::macros::builtin::RustcDecodable macros>:1:1
2019-12-08T02:47:15.0556082Z    |
2019-12-08T02:47:15.0556371Z 1  | ($ item : item) => { }
2019-12-08T02:47:15.0557035Z    | ---------------------- in this expansion of `#[derive(RustcDecodable)]`
2019-12-08T02:47:15.0557255Z    |
2019-12-08T02:47:15.0557596Z    = note: for more information, see ***/issues/47809
2019-12-08T02:47:15.0557892Z    = help: add `#![feature(track_caller)]` to the crate attributes to enable
2019-12-08T02:47:15.0557948Z 
2019-12-08T02:47:15.1185194Z error[E0658]: use of unstable library feature 'track_caller': uses #[track_caller] which is not yet stable
2019-12-08T02:47:15.1186363Z     |
2019-12-08T02:47:15.1186689Z 689 | #[derive(Clone, Debug, RustcEncodable, RustcDecodable, HashStable_Generic)]
2019-12-08T02:47:15.1187400Z     |                                        ^^^^^^^^^^^^^^ in this macro invocation
2019-12-08T02:47:15.1187818Z     | 
2019-12-08T02:47:15.1187818Z     | 
2019-12-08T02:47:15.1188303Z    ::: <::core::macros::builtin::RustcDecodable macros>:1:1
2019-12-08T02:47:15.1188524Z     |
2019-12-08T02:47:15.1188983Z 1   | ($ item : item) => { }
2019-12-08T02:47:15.1189326Z     | ---------------------- in this expansion of `#[derive(RustcDecodable)]`
2019-12-08T02:47:15.1189571Z     |
2019-12-08T02:47:15.1189943Z     = note: for more information, see ***/issues/47809
2019-12-08T02:47:15.1190260Z     = help: add `#![feature(track_caller)]` to the crate attributes to enable
2019-12-08T02:47:15.1190320Z 
2019-12-08T02:47:15.1252488Z error[E0658]: use of unstable library feature 'track_caller': uses #[track_caller] which is not yet stable
2019-12-08T02:47:15.1253503Z     |
2019-12-08T02:47:15.1253817Z 713 | #[derive(Clone, Copy, PartialEq, Eq, RustcEncodable, RustcDecodable,
2019-12-08T02:47:15.1254177Z     |                                                      ^^^^^^^^^^^^^^ in this macro invocation
2019-12-08T02:47:15.1254623Z     | 
2019-12-08T02:47:15.1254623Z     | 
2019-12-08T02:47:15.1254887Z    ::: <::core::macros::builtin::RustcDecodable macros>:1:1
2019-12-08T02:47:15.1255121Z     |
2019-12-08T02:47:15.1255379Z 1   | ($ item : item) => { }
2019-12-08T02:47:15.1255885Z     | ---------------------- in this expansion of `#[derive(RustcDecodable)]`
2019-12-08T02:47:15.1256360Z     |
2019-12-08T02:47:15.1257081Z     = note: for more information, see ***/issues/47809
2019-12-08T02:47:15.1257437Z     = help: add `#![feature(track_caller)]` to the crate attributes to enable
2019-12-08T02:47:15.1257489Z 
2019-12-08T02:47:15.1325477Z error[E0658]: use of unstable library feature 'track_caller': uses #[track_caller] which is not yet stable
2019-12-08T02:47:15.1326104Z     |
2019-12-08T02:47:15.1326104Z     |
2019-12-08T02:47:15.1326448Z 749 | #[derive(Clone, Copy, PartialEq, Debug, RustcEncodable, RustcDecodable, HashStable_Generic)]
2019-12-08T02:47:15.1327083Z     | 
2019-12-08T02:47:15.1327525Z    ::: <::core::macros::builtin::RustcDecodable macros>:1:1
2019-12-08T02:47:15.1327998Z     |
2019-12-08T02:47:15.1327998Z     |
2019-12-08T02:47:15.1328263Z 1   | ($ item : item) => { }
2019-12-08T02:47:15.1328598Z     | ---------------------- in this expansion of `#[derive(RustcDecodable)]`
2019-12-08T02:47:15.1328834Z     |
2019-12-08T02:47:15.1329202Z     = note: for more information, see ***/issues/47809
2019-12-08T02:47:15.1329537Z     = help: add `#![feature(track_caller)]` to the crate attributes to enable
2019-12-08T02:47:15.1329578Z 
2019-12-08T02:47:15.1426870Z error[E0658]: use of unstable library feature 'track_caller': uses #[track_caller] which is not yet stable
2019-12-08T02:47:15.1427775Z     |
2019-12-08T02:47:15.1427775Z     |
2019-12-08T02:47:15.1428392Z 767 | #[derive(Clone, Copy, PartialEq, Debug, RustcEncodable, RustcDecodable, HashStable_Generic)]
2019-12-08T02:47:15.1429266Z     | 
2019-12-08T02:47:15.1429563Z    ::: <::core::macros::builtin::RustcDecodable macros>:1:1
2019-12-08T02:47:15.1429785Z     |
2019-12-08T02:47:15.1429785Z     |
2019-12-08T02:47:15.1430054Z 1   | ($ item : item) => { }
2019-12-08T02:47:15.1430430Z     | ---------------------- in this expansion of `#[derive(RustcDecodable)]`
2019-12-08T02:47:15.1430862Z     |
2019-12-08T02:47:15.1431401Z     = note: for more information, see ***/issues/47809
2019-12-08T02:47:15.1431736Z     = help: add `#![feature(track_caller)]` to the crate attributes to enable
2019-12-08T02:47:15.2293657Z error: aborting due to 8 previous errors
2019-12-08T02:47:15.2294387Z 
2019-12-08T02:47:15.2295033Z For more information about this error, try `rustc --explain E0658`.
2019-12-08T02:47:15.2466237Z error: could not compile `syntax_pos`.
---
2019-12-08T02:47:15.2575749Z   local time: Sun Dec  8 02:47:15 UTC 2019
2019-12-08T02:47:15.8017937Z   network time: Sun, 08 Dec 2019 02:47:15 GMT
2019-12-08T02:47:15.8028081Z == end clock drift check ==
2019-12-08T02:47:17.2491181Z 
2019-12-08T02:47:17.2606427Z ##[error]Bash exited with code '1'.
2019-12-08T02:47:17.2649012Z ##[section]Starting: Checkout
2019-12-08T02:47:17.2650717Z ==============================================================================
2019-12-08T02:47:17.2650867Z Task         : Get sources
2019-12-08T02:47:17.2650928Z 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)

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-7 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-12-08T12:54:45.1197227Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-12-08T12:54:45.1397693Z ##[command]git config gc.auto 0
2019-12-08T12:54:45.1470363Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-12-08T12:54:45.1517047Z ##[command]git config --get-all http.proxy
2019-12-08T12:54:45.1661943Z ##[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/67137/merge:refs/remotes/pull/67137/merge
---
2019-12-08T13:26:33.3003912Z    Compiling rustc_data_structures v0.0.0 (/checkout/src/librustc_data_structures)
2019-12-08T13:26:37.4274249Z    Compiling arena v0.0.0 (/checkout/src/libarena)
2019-12-08T13:26:38.5226750Z    Compiling rustc_macros v0.1.0 (/checkout/src/librustc_macros)
2019-12-08T13:26:51.3416924Z    Compiling syntax_pos v0.0.0 (/checkout/src/libsyntax_pos)
2019-12-08T13:26:51.8083715Z error[E0658]: use of unstable library feature 'track_caller': uses #[track_caller] which is not yet stable
2019-12-08T13:26:51.8084081Z   --> src/libsyntax_pos/lib.rs:75:10
2019-12-08T13:26:51.8084740Z 75 |          RustcDecodable, RustcEncodable, HashStable_Generic)]
2019-12-08T13:26:51.8086619Z    |          ^^^^^^^^^^^^^^ in this macro invocation
2019-12-08T13:26:51.8086938Z    | 
2019-12-08T13:26:51.8087368Z   ::: <::core::macros::builtin::RustcDecodable macros>:1:1
2019-12-08T13:26:51.8087368Z   ::: <::core::macros::builtin::RustcDecodable macros>:1:1
2019-12-08T13:26:51.8087776Z    |
2019-12-08T13:26:51.8088024Z 1  | ($ item : item) => { }
2019-12-08T13:26:51.8088491Z    | ---------------------- in this expansion of `#[derive(RustcDecodable)]`
2019-12-08T13:26:51.8088690Z    |
2019-12-08T13:26:51.8089107Z    = note: for more information, see ***/issues/47809
2019-12-08T13:26:51.8089392Z    = help: add `#![feature(track_caller)]` to the crate attributes to enable
2019-12-08T13:26:51.8089448Z 
2019-12-08T13:26:51.8866456Z error[E0658]: use of unstable library feature 'track_caller': uses #[track_caller] which is not yet stable
2019-12-08T13:26:51.8866783Z    --> src/libsyntax_pos/lib.rs:802:39
2019-12-08T13:26:51.8874982Z     |
2019-12-08T13:26:51.8875805Z 802 | #[derive(Copy, Clone, RustcEncodable, RustcDecodable, Eq, PartialEq, Debug)]
2019-12-08T13:26:51.8876449Z     | 
2019-12-08T13:26:51.8876710Z    ::: <::core::macros::builtin::RustcDecodable macros>:1:1
2019-12-08T13:26:51.8877205Z     |
2019-12-08T13:26:51.8877205Z     |
2019-12-08T13:26:51.8879913Z 1   | ($ item : item) => { }
2019-12-08T13:26:51.8880425Z     | ---------------------- in this expansion of `#[derive(RustcDecodable)]`
2019-12-08T13:26:51.8883690Z     |
2019-12-08T13:26:51.8885046Z     = note: for more information, see ***/issues/47809
2019-12-08T13:26:51.8885946Z     = help: add `#![feature(track_caller)]` to the crate attributes to enable
2019-12-08T13:26:51.8886022Z 
2019-12-08T13:26:52.0877576Z error[E0658]: use of unstable library feature 'track_caller': uses #[track_caller] which is not yet stable
2019-12-08T13:26:52.0878145Z  --> src/libsyntax_pos/edition.rs:9:26
2019-12-08T13:26:52.0878427Z   |
2019-12-08T13:26:52.0878709Z 9 |          RustcEncodable, RustcDecodable, Eq, HashStable_Generic)]
2019-12-08T13:26:52.0879276Z   | 
2019-12-08T13:26:52.0879526Z  ::: <::core::macros::builtin::RustcDecodable macros>:1:1
2019-12-08T13:26:52.0879747Z   |
2019-12-08T13:26:52.0879747Z   |
2019-12-08T13:26:52.0879991Z 1 | ($ item : item) => { }
2019-12-08T13:26:52.0880294Z   | ---------------------- in this expansion of `#[derive(RustcDecodable)]`
2019-12-08T13:26:52.0880537Z   |
2019-12-08T13:26:52.0880937Z   = note: for more information, see ***/issues/47809
2019-12-08T13:26:52.0881422Z   = help: add `#![feature(track_caller)]` to the crate attributes to enable
2019-12-08T13:26:52.0882297Z 
2019-12-08T13:26:52.1003231Z error[E0658]: use of unstable library feature 'track_caller': uses #[track_caller] which is not yet stable
2019-12-08T13:26:52.1003919Z    |
2019-12-08T13:26:52.1004273Z 63 |          RustcEncodable, RustcDecodable, HashStable_Generic)]
2019-12-08T13:26:52.1004691Z    |                          ^^^^^^^^^^^^^^ in this macro invocation
2019-12-08T13:26:52.1004991Z    | 
2019-12-08T13:26:52.1004991Z    | 
2019-12-08T13:26:52.1005312Z   ::: <::core::macros::builtin::RustcDecodable macros>:1:1
2019-12-08T13:26:52.1005581Z    |
2019-12-08T13:26:52.1031493Z 1  | ($ item : item) => { }
2019-12-08T13:26:52.1032392Z    | ---------------------- in this expansion of `#[derive(RustcDecodable)]`
2019-12-08T13:26:52.1032694Z    |
2019-12-08T13:26:52.1033137Z    = note: for more information, see ***/issues/47809
2019-12-08T13:26:52.1033515Z    = help: add `#![feature(track_caller)]` to the crate attributes to enable
2019-12-08T13:26:52.1033592Z 
2019-12-08T13:26:52.1557405Z error[E0658]: use of unstable library feature 'track_caller': uses #[track_caller] which is not yet stable
2019-12-08T13:26:52.1557947Z     |
2019-12-08T13:26:52.1558250Z 689 | #[derive(Clone, Debug, RustcEncodable, RustcDecodable, HashStable_Generic)]
2019-12-08T13:26:52.1558577Z     |                                        ^^^^^^^^^^^^^^ in this macro invocation
2019-12-08T13:26:52.1558815Z     | 
2019-12-08T13:26:52.1558815Z     | 
2019-12-08T13:26:52.1559065Z    ::: <::core::macros::builtin::RustcDecodable macros>:1:1
2019-12-08T13:26:52.1559456Z     |
2019-12-08T13:26:52.1559906Z 1   | ($ item : item) => { }
2019-12-08T13:26:52.1560387Z     | ---------------------- in this expansion of `#[derive(RustcDecodable)]`
2019-12-08T13:26:52.1560620Z     |
2019-12-08T13:26:52.1561450Z     = note: for more information, see ***/issues/47809
2019-12-08T13:26:52.1561771Z     = help: add `#![feature(track_caller)]` to the crate attributes to enable
2019-12-08T13:26:52.1561833Z 
2019-12-08T13:26:52.1618363Z error[E0658]: use of unstable library feature 'track_caller': uses #[track_caller] which is not yet stable
2019-12-08T13:26:52.1618898Z     |
2019-12-08T13:26:52.1619167Z 713 | #[derive(Clone, Copy, PartialEq, Eq, RustcEncodable, RustcDecodable,
2019-12-08T13:26:52.1619484Z     |                                                      ^^^^^^^^^^^^^^ in this macro invocation
2019-12-08T13:26:52.1620036Z     | 
2019-12-08T13:26:52.1620036Z     | 
2019-12-08T13:26:52.1620355Z    ::: <::core::macros::builtin::RustcDecodable macros>:1:1
2019-12-08T13:26:52.1620585Z     |
2019-12-08T13:26:52.1620834Z 1   | ($ item : item) => { }
2019-12-08T13:26:52.1621141Z     | ---------------------- in this expansion of `#[derive(RustcDecodable)]`
2019-12-08T13:26:52.1621390Z     |
2019-12-08T13:26:52.1621724Z     = note: for more information, see ***/issues/47809
2019-12-08T13:26:52.1622768Z     = help: add `#![feature(track_caller)]` to the crate attributes to enable
2019-12-08T13:26:52.1622826Z 
2019-12-08T13:26:52.1686844Z error[E0658]: use of unstable library feature 'track_caller': uses #[track_caller] which is not yet stable
2019-12-08T13:26:52.1687390Z     |
2019-12-08T13:26:52.1687390Z     |
2019-12-08T13:26:52.1687689Z 749 | #[derive(Clone, Copy, PartialEq, Debug, RustcEncodable, RustcDecodable, HashStable_Generic)]
2019-12-08T13:26:52.1688468Z     | 
2019-12-08T13:26:52.1688726Z    ::: <::core::macros::builtin::RustcDecodable macros>:1:1
2019-12-08T13:26:52.1688962Z     |
2019-12-08T13:26:52.1688962Z     |
2019-12-08T13:26:52.1689375Z 1   | ($ item : item) => { }
2019-12-08T13:26:52.1689691Z     | ---------------------- in this expansion of `#[derive(RustcDecodable)]`
2019-12-08T13:26:52.1689928Z     |
2019-12-08T13:26:52.1690262Z     = note: for more information, see ***/issues/47809
2019-12-08T13:26:52.1690583Z     = help: add `#![feature(track_caller)]` to the crate attributes to enable
2019-12-08T13:26:52.1690776Z 
2019-12-08T13:26:52.1765898Z error[E0658]: use of unstable library feature 'track_caller': uses #[track_caller] which is not yet stable
2019-12-08T13:26:52.1766618Z     |
2019-12-08T13:26:52.1766618Z     |
2019-12-08T13:26:52.1766935Z 767 | #[derive(Clone, Copy, PartialEq, Debug, RustcEncodable, RustcDecodable, HashStable_Generic)]
2019-12-08T13:26:52.1767524Z     | 
2019-12-08T13:26:52.1767788Z    ::: <::core::macros::builtin::RustcDecodable macros>:1:1
2019-12-08T13:26:52.1768005Z     |
2019-12-08T13:26:52.1768005Z     |
2019-12-08T13:26:52.1768262Z 1   | ($ item : item) => { }
2019-12-08T13:26:52.1768749Z     | ---------------------- in this expansion of `#[derive(RustcDecodable)]`
2019-12-08T13:26:52.1768957Z     |
2019-12-08T13:26:52.1769409Z     = note: for more information, see ***/issues/47809
2019-12-08T13:26:52.1769772Z     = help: add `#![feature(track_caller)]` to the crate attributes to enable
2019-12-08T13:26:52.2557761Z error: aborting due to 8 previous errors
2019-12-08T13:26:52.2590846Z 
2019-12-08T13:26:52.2608725Z For more information about this error, try `rustc --explain E0658`.
2019-12-08T13:26:52.2719615Z error: could not compile `syntax_pos`.
---
2019-12-08T13:26:52.2848730Z   local time: Sun Dec  8 13:26:52 UTC 2019
2019-12-08T13:26:52.4400470Z   network time: Sun, 08 Dec 2019 13:26:52 GMT
2019-12-08T13:26:52.4403593Z == end clock drift check ==
2019-12-08T13:26:53.8484346Z 
2019-12-08T13:26:53.8591550Z ##[error]Bash exited with code '1'.
2019-12-08T13:26:53.8625609Z ##[section]Starting: Checkout
2019-12-08T13:26:53.8627926Z ==============================================================================
2019-12-08T13:26:53.8627993Z Task         : Get sources
2019-12-08T13:26:53.8628034Z 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)

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-7 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-12-08T13:51:35.4830670Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-12-08T13:51:35.4849442Z ##[command]git config gc.auto 0
2019-12-08T13:51:35.4853028Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-12-08T13:51:35.4859177Z ##[command]git config --get-all http.proxy
2019-12-08T13:51:35.4864808Z ##[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/67137/merge:refs/remotes/pull/67137/merge
---
2019-12-08T14:19:42.5088934Z    Compiling rustc_data_structures v0.0.0 (/checkout/src/librustc_data_structures)
2019-12-08T14:19:45.8398616Z    Compiling arena v0.0.0 (/checkout/src/libarena)
2019-12-08T14:19:48.2744682Z    Compiling rustc_macros v0.1.0 (/checkout/src/librustc_macros)
2019-12-08T14:19:59.4200671Z    Compiling syntax_pos v0.0.0 (/checkout/src/libsyntax_pos)
2019-12-08T14:19:59.8412100Z error[E0658]: use of unstable library feature 'track_caller': uses #[track_caller] which is not yet stable
2019-12-08T14:19:59.8412458Z   --> src/libsyntax_pos/lib.rs:75:10
2019-12-08T14:19:59.8412958Z 75 |          RustcDecodable, RustcEncodable, HashStable_Generic)]
2019-12-08T14:19:59.8413267Z    |          ^^^^^^^^^^^^^^ in this macro invocation
2019-12-08T14:19:59.8413476Z    | 
2019-12-08T14:19:59.8413730Z   ::: <::core::macros::builtin::RustcDecodable macros>:1:1
2019-12-08T14:19:59.8413730Z   ::: <::core::macros::builtin::RustcDecodable macros>:1:1
2019-12-08T14:19:59.8413944Z    |
2019-12-08T14:19:59.8414180Z 1  | ($ item : item) => { }
2019-12-08T14:19:59.8414489Z    | ---------------------- in this expansion of `#[derive(RustcDecodable)]`
2019-12-08T14:19:59.8414715Z    |
2019-12-08T14:19:59.8415106Z    = note: for more information, see ***/issues/47809
2019-12-08T14:19:59.8415414Z    = help: add `#![feature(track_caller)]` to the crate attributes to enable
2019-12-08T14:19:59.8415452Z 
2019-12-08T14:19:59.9118629Z error[E0658]: use of unstable library feature 'track_caller': uses #[track_caller] which is not yet stable
2019-12-08T14:19:59.9118939Z    --> src/libsyntax_pos/lib.rs:802:39
2019-12-08T14:19:59.9119170Z     |
2019-12-08T14:19:59.9119464Z 802 | #[derive(Copy, Clone, RustcEncodable, RustcDecodable, Eq, PartialEq, Debug)]
2019-12-08T14:19:59.9120051Z     | 
2019-12-08T14:19:59.9120298Z    ::: <::core::macros::builtin::RustcDecodable macros>:1:1
2019-12-08T14:19:59.9120496Z     |
2019-12-08T14:19:59.9120496Z     |
2019-12-08T14:19:59.9120754Z 1   | ($ item : item) => { }
2019-12-08T14:19:59.9121058Z     | ---------------------- in this expansion of `#[derive(RustcDecodable)]`
2019-12-08T14:19:59.9121273Z     |
2019-12-08T14:19:59.9121612Z     = note: for more information, see ***/issues/47809
2019-12-08T14:19:59.9122079Z     = help: add `#![feature(track_caller)]` to the crate attributes to enable
2019-12-08T14:19:59.9122215Z 
2019-12-08T14:20:00.0806585Z error[E0658]: use of unstable library feature 'track_caller': uses #[track_caller] which is not yet stable
2019-12-08T14:20:00.0806890Z  --> src/libsyntax_pos/edition.rs:9:26
2019-12-08T14:20:00.0807124Z   |
2019-12-08T14:20:00.0807405Z 9 |          RustcEncodable, RustcDecodable, Eq, HashStable_Generic)]
2019-12-08T14:20:00.0807936Z   | 
2019-12-08T14:20:00.0808182Z  ::: <::core::macros::builtin::RustcDecodable macros>:1:1
2019-12-08T14:20:00.0808423Z   |
2019-12-08T14:20:00.0808423Z   |
2019-12-08T14:20:00.0808665Z 1 | ($ item : item) => { }
2019-12-08T14:20:00.0808967Z   | ---------------------- in this expansion of `#[derive(RustcDecodable)]`
2019-12-08T14:20:00.0809179Z   |
2019-12-08T14:20:00.0809517Z   = note: for more information, see ***/issues/47809
2019-12-08T14:20:00.0809813Z   = help: add `#![feature(track_caller)]` to the crate attributes to enable
2019-12-08T14:20:00.0809867Z 
2019-12-08T14:20:00.0918349Z error[E0658]: use of unstable library feature 'track_caller': uses #[track_caller] which is not yet stable
2019-12-08T14:20:00.0918954Z    |
2019-12-08T14:20:00.0919254Z 63 |          RustcEncodable, RustcDecodable, HashStable_Generic)]
2019-12-08T14:20:00.0919583Z    |                          ^^^^^^^^^^^^^^ in this macro invocation
2019-12-08T14:20:00.0919820Z    | 
2019-12-08T14:20:00.0919820Z    | 
2019-12-08T14:20:00.0920084Z   ::: <::core::macros::builtin::RustcDecodable macros>:1:1
2019-12-08T14:20:00.0920293Z    |
2019-12-08T14:20:00.0920576Z 1  | ($ item : item) => { }
2019-12-08T14:20:00.0920898Z    | ---------------------- in this expansion of `#[derive(RustcDecodable)]`
2019-12-08T14:20:00.0921164Z    |
2019-12-08T14:20:00.0921573Z    = note: for more information, see ***/issues/47809
2019-12-08T14:20:00.0921913Z    = help: add `#![feature(track_caller)]` to the crate attributes to enable
2019-12-08T14:20:00.0926122Z 
2019-12-08T14:20:00.1446918Z error[E0658]: use of unstable library feature 'track_caller': uses #[track_caller] which is not yet stable
2019-12-08T14:20:00.1447476Z     |
2019-12-08T14:20:00.1447769Z 689 | #[derive(Clone, Debug, RustcEncodable, RustcDecodable, HashStable_Generic)]
2019-12-08T14:20:00.1448111Z     |                                        ^^^^^^^^^^^^^^ in this macro invocation
2019-12-08T14:20:00.1448641Z     | 
2019-12-08T14:20:00.1448641Z     | 
2019-12-08T14:20:00.1448932Z    ::: <::core::macros::builtin::RustcDecodable macros>:1:1
2019-12-08T14:20:00.1449149Z     |
2019-12-08T14:20:00.1449392Z 1   | ($ item : item) => { }
2019-12-08T14:20:00.1449698Z     | ---------------------- in this expansion of `#[derive(RustcDecodable)]`
2019-12-08T14:20:00.1449913Z     |
2019-12-08T14:20:00.1450265Z     = note: for more information, see ***/issues/47809
2019-12-08T14:20:00.1450558Z     = help: add `#![feature(track_caller)]` to the crate attributes to enable
2019-12-08T14:20:00.1454204Z 
2019-12-08T14:20:00.1502663Z error[E0658]: use of unstable library feature 'track_caller': uses #[track_caller] which is not yet stable
2019-12-08T14:20:00.1503198Z     |
2019-12-08T14:20:00.1503479Z 713 | #[derive(Clone, Copy, PartialEq, Eq, RustcEncodable, RustcDecodable,
2019-12-08T14:20:00.1503828Z     |                                                      ^^^^^^^^^^^^^^ in this macro invocation
2019-12-08T14:20:00.1504042Z     | 
2019-12-08T14:20:00.1504042Z     | 
2019-12-08T14:20:00.1504292Z    ::: <::core::macros::builtin::RustcDecodable macros>:1:1
2019-12-08T14:20:00.1504517Z     |
2019-12-08T14:20:00.1504761Z 1   | ($ item : item) => { }
2019-12-08T14:20:00.1505079Z     | ---------------------- in this expansion of `#[derive(RustcDecodable)]`
2019-12-08T14:20:00.1505307Z     |
2019-12-08T14:20:00.1505635Z     = note: for more information, see ***/issues/47809
2019-12-08T14:20:00.1505950Z     = help: add `#![feature(track_caller)]` to the crate attributes to enable
2019-12-08T14:20:00.1509528Z 
2019-12-08T14:20:00.1567243Z error[E0658]: use of unstable library feature 'track_caller': uses #[track_caller] which is not yet stable
2019-12-08T14:20:00.1567770Z     |
2019-12-08T14:20:00.1567770Z     |
2019-12-08T14:20:00.1568104Z 749 | #[derive(Clone, Copy, PartialEq, Debug, RustcEncodable, RustcDecodable, HashStable_Generic)]
2019-12-08T14:20:00.1568661Z     | 
2019-12-08T14:20:00.1568924Z    ::: <::core::macros::builtin::RustcDecodable macros>:1:1
2019-12-08T14:20:00.1569124Z     |
2019-12-08T14:20:00.1569124Z     |
2019-12-08T14:20:00.1569361Z 1   | ($ item : item) => { }
2019-12-08T14:20:00.1569679Z     | ---------------------- in this expansion of `#[derive(RustcDecodable)]`
2019-12-08T14:20:00.1569880Z     |
2019-12-08T14:20:00.1570362Z     = note: for more information, see ***/issues/47809
2019-12-08T14:20:00.1570772Z     = help: add `#![feature(track_caller)]` to the crate attributes to enable
2019-12-08T14:20:00.1574044Z 
2019-12-08T14:20:00.1641719Z error[E0658]: use of unstable library feature 'track_caller': uses #[track_caller] which is not yet stable
2019-12-08T14:20:00.1642661Z     |
2019-12-08T14:20:00.1642661Z     |
2019-12-08T14:20:00.1643153Z 767 | #[derive(Clone, Copy, PartialEq, Debug, RustcEncodable, RustcDecodable, HashStable_Generic)]
2019-12-08T14:20:00.1644052Z     | 
2019-12-08T14:20:00.1644507Z    ::: <::core::macros::builtin::RustcDecodable macros>:1:1
2019-12-08T14:20:00.1644883Z     |
2019-12-08T14:20:00.1644883Z     |
2019-12-08T14:20:00.1645312Z 1   | ($ item : item) => { }
2019-12-08T14:20:00.1645772Z     | ---------------------- in this expansion of `#[derive(RustcDecodable)]`
2019-12-08T14:20:00.1646161Z     |
2019-12-08T14:20:00.1646653Z     = note: for more information, see ***/issues/47809
2019-12-08T14:20:00.1647140Z     = help: add `#![feature(track_caller)]` to the crate attributes to enable
2019-12-08T14:20:00.2346883Z error: aborting due to 8 previous errors
2019-12-08T14:20:00.2349659Z 
2019-12-08T14:20:00.2354507Z For more information about this error, try `rustc --explain E0658`.
2019-12-08T14:20:00.2491340Z error: could not compile `syntax_pos`.
---
2019-12-08T14:20:00.2624725Z   local time: Sun Dec  8 14:20:00 UTC 2019
2019-12-08T14:20:00.5333123Z   network time: Sun, 08 Dec 2019 14:20:00 GMT
2019-12-08T14:20:00.5335441Z == end clock drift check ==
2019-12-08T14:20:01.9617573Z 
2019-12-08T14:20:01.9685501Z ##[error]Bash exited with code '1'.
2019-12-08T14:20:01.9720241Z ##[section]Starting: Checkout
2019-12-08T14:20:01.9722100Z ==============================================================================
2019-12-08T14:20:01.9722151Z Task         : Get sources
2019-12-08T14:20:01.9722215Z 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)

@alexcrichton
Copy link
Member

It looks like CI has an error which needs to be resolved I think? Additionally I haven't been following this unstable feature very closely, but this seems reasonable to me. @eddyb did you have something you wanted changed here though before this landed?

@eddyb
Copy link
Member

eddyb commented Dec 9, 2019

It's probably fine as-is (once it works properly, it's maybe missing an attribute like #[allow_internal_unstable(track_caller)] on std::panic!?)

But also, I think the libstd changes would be simpler with #67137 (comment) because then it would rely more on #[track_caller]'s automatic propagation.

@anp, do you want to do that now, or leave it for later?

@Dylan-DPC-zz Dylan-DPC-zz added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 12, 2019
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-7 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-12-22T22:46:41.9237524Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-12-22T22:46:42.8274171Z ##[command]git config gc.auto 0
2019-12-22T22:46:42.8282259Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-12-22T22:46:42.8285797Z ##[command]git config --get-all http.proxy
2019-12-22T22:46:42.8289557Z ##[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/67137/merge:refs/remotes/pull/67137/merge
---
2019-12-22T23:20:10.8219838Z    Compiling rustc_data_structures v0.0.0 (/checkout/src/librustc_data_structures)
2019-12-22T23:20:14.8566698Z    Compiling arena v0.0.0 (/checkout/src/libarena)
2019-12-22T23:20:16.4510074Z    Compiling rustc_macros v0.1.0 (/checkout/src/librustc_macros)
2019-12-22T23:20:30.1601222Z    Compiling syntax_pos v0.0.0 (/checkout/src/libsyntax_pos)
2019-12-22T23:20:30.6833711Z error[E0658]: use of unstable library feature 'track_caller': uses #[track_caller] which is not yet stable
2019-12-22T23:20:30.6834091Z   --> src/libsyntax_pos/lib.rs:75:10
2019-12-22T23:20:30.6834626Z 75 |          RustcDecodable, RustcEncodable, HashStable_Generic)]
2019-12-22T23:20:30.6834946Z    |          ^^^^^^^^^^^^^^ in this macro invocation
2019-12-22T23:20:30.6835156Z    | 
2019-12-22T23:20:30.6835408Z   ::: <::core::macros::builtin::RustcDecodable macros>:1:1
2019-12-22T23:20:30.6835408Z   ::: <::core::macros::builtin::RustcDecodable macros>:1:1
2019-12-22T23:20:30.6835622Z    |
2019-12-22T23:20:30.6835860Z 1  | ($ item : item) => { }
2019-12-22T23:20:30.6836174Z    | ---------------------- in this expansion of `#[derive(RustcDecodable)]`
2019-12-22T23:20:30.6837306Z    |
2019-12-22T23:20:30.6837771Z    = note: for more information, see ***/issues/47809
2019-12-22T23:20:30.6838097Z    = help: add `#![feature(track_caller)]` to the crate attributes to enable
2019-12-22T23:20:30.6838161Z 
2019-12-22T23:20:30.7680853Z error[E0658]: use of unstable library feature 'track_caller': uses #[track_caller] which is not yet stable
2019-12-22T23:20:30.7681199Z    --> src/libsyntax_pos/lib.rs:802:39
2019-12-22T23:20:30.7681472Z     |
2019-12-22T23:20:30.7681779Z 802 | #[derive(Copy, Clone, RustcEncodable, RustcDecodable, Eq, PartialEq, Debug)]
2019-12-22T23:20:30.7682452Z     | 
2019-12-22T23:20:30.7682713Z    ::: <::core::macros::builtin::RustcDecodable macros>:1:1
2019-12-22T23:20:30.7682934Z     |
2019-12-22T23:20:30.7682934Z     |
2019-12-22T23:20:30.7683183Z 1   | ($ item : item) => { }
2019-12-22T23:20:30.7683501Z     | ---------------------- in this expansion of `#[derive(RustcDecodable)]`
2019-12-22T23:20:30.7683724Z     |
2019-12-22T23:20:30.7684115Z     = note: for more information, see ***/issues/47809
2019-12-22T23:20:30.7684582Z     = help: add `#![feature(track_caller)]` to the crate attributes to enable
2019-12-22T23:20:30.7684928Z 
2019-12-22T23:20:31.3854940Z error[E0658]: use of unstable library feature 'track_caller': uses #[track_caller] which is not yet stable
2019-12-22T23:20:31.3858931Z  --> src/libsyntax_pos/edition.rs:9:26
2019-12-22T23:20:31.3859263Z   |
2019-12-22T23:20:31.3859613Z 9 |          RustcEncodable, RustcDecodable, Eq, HashStable_Generic)]
2019-12-22T23:20:31.3860375Z   | 
2019-12-22T23:20:31.3860640Z  ::: <::core::macros::builtin::RustcDecodable macros>:1:1
2019-12-22T23:20:31.3860866Z   |
2019-12-22T23:20:31.3860866Z   |
2019-12-22T23:20:31.3861136Z 1 | ($ item : item) => { }
2019-12-22T23:20:31.3861467Z   | ---------------------- in this expansion of `#[derive(RustcDecodable)]`
2019-12-22T23:20:31.3861689Z   |
2019-12-22T23:20:31.3862055Z   = note: for more information, see ***/issues/47809
2019-12-22T23:20:31.3862556Z   = help: add `#![feature(track_caller)]` to the crate attributes to enable
2019-12-22T23:20:31.3862596Z 
2019-12-22T23:20:31.3862906Z error[E0658]: use of unstable library feature 'track_caller': uses #[track_caller] which is not yet stable
2019-12-22T23:20:31.3863631Z    |
2019-12-22T23:20:31.3863938Z 63 |          RustcEncodable, RustcDecodable, HashStable_Generic)]
2019-12-22T23:20:31.3864308Z    |                          ^^^^^^^^^^^^^^ in this macro invocation
2019-12-22T23:20:31.3864531Z    | 
2019-12-22T23:20:31.3864531Z    | 
2019-12-22T23:20:31.3864802Z   ::: <::core::macros::builtin::RustcDecodable macros>:1:1
2019-12-22T23:20:31.3865033Z    |
2019-12-22T23:20:31.3865296Z 1  | ($ item : item) => { }
2019-12-22T23:20:31.3865638Z    | ---------------------- in this expansion of `#[derive(RustcDecodable)]`
2019-12-22T23:20:31.3865875Z    |
2019-12-22T23:20:31.3866211Z    = note: for more information, see ***/issues/47809
2019-12-22T23:20:31.3867161Z    = help: add `#![feature(track_caller)]` to the crate attributes to enable
2019-12-22T23:20:31.3867225Z 
2019-12-22T23:20:31.3867546Z error[E0658]: use of unstable library feature 'track_caller': uses #[track_caller] which is not yet stable
2019-12-22T23:20:31.3868047Z     |
2019-12-22T23:20:31.3868414Z 689 | #[derive(Clone, Debug, RustcEncodable, RustcDecodable, HashStable_Generic)]
2019-12-22T23:20:31.3868782Z     |                                        ^^^^^^^^^^^^^^ in this macro invocation
2019-12-22T23:20:31.3869028Z     | 
2019-12-22T23:20:31.3869028Z     | 
2019-12-22T23:20:31.3869597Z    ::: <::core::macros::builtin::RustcDecodable macros>:1:1
2019-12-22T23:20:31.3869955Z     |
2019-12-22T23:20:31.3870241Z 1   | ($ item : item) => { }
2019-12-22T23:20:31.3870582Z     | ---------------------- in this expansion of `#[derive(RustcDecodable)]`
2019-12-22T23:20:31.3870822Z     |
2019-12-22T23:20:31.3871179Z     = note: for more information, see ***/issues/47809
2019-12-22T23:20:31.3871499Z     = help: add `#![feature(track_caller)]` to the crate attributes to enable
2019-12-22T23:20:31.3871558Z 
2019-12-22T23:20:31.3872197Z error[E0658]: use of unstable library feature 'track_caller': uses #[track_caller] which is not yet stable
2019-12-22T23:20:31.3873183Z     |
2019-12-22T23:20:31.3873498Z 713 | #[derive(Clone, Copy, PartialEq, Eq, RustcEncodable, RustcDecodable,
2019-12-22T23:20:31.3873869Z     |                                                      ^^^^^^^^^^^^^^ in this macro invocation
2019-12-22T23:20:31.3874114Z     | 
2019-12-22T23:20:31.3874114Z     | 
2019-12-22T23:20:31.3874389Z    ::: <::core::macros::builtin::RustcDecodable macros>:1:1
2019-12-22T23:20:31.3874605Z     |
2019-12-22T23:20:31.3874889Z 1   | ($ item : item) => { }
2019-12-22T23:20:31.3875236Z     | ---------------------- in this expansion of `#[derive(RustcDecodable)]`
2019-12-22T23:20:31.3875468Z     |
2019-12-22T23:20:31.3875839Z     = note: for more information, see ***/issues/47809
2019-12-22T23:20:31.3876355Z     = help: add `#![feature(track_caller)]` to the crate attributes to enable
2019-12-22T23:20:31.3876552Z 
2019-12-22T23:20:31.3876915Z error[E0658]: use of unstable library feature 'track_caller': uses #[track_caller] which is not yet stable
2019-12-22T23:20:31.3877415Z     |
2019-12-22T23:20:31.3877415Z     |
2019-12-22T23:20:31.3877752Z 749 | #[derive(Clone, Copy, PartialEq, Debug, RustcEncodable, RustcDecodable, HashStable_Generic)]
2019-12-22T23:20:31.3878395Z     | 
2019-12-22T23:20:31.3878669Z    ::: <::core::macros::builtin::RustcDecodable macros>:1:1
2019-12-22T23:20:31.3878881Z     |
2019-12-22T23:20:31.3878881Z     |
2019-12-22T23:20:31.3879167Z 1   | ($ item : item) => { }
2019-12-22T23:20:31.3879508Z     | ---------------------- in this expansion of `#[derive(RustcDecodable)]`
2019-12-22T23:20:31.3879728Z     |
2019-12-22T23:20:31.3880093Z     = note: for more information, see ***/issues/47809
2019-12-22T23:20:31.3880557Z     = help: add `#![feature(track_caller)]` to the crate attributes to enable
2019-12-22T23:20:31.3880685Z 
2019-12-22T23:20:31.3881033Z error[E0658]: use of unstable library feature 'track_caller': uses #[track_caller] which is not yet stable
2019-12-22T23:20:31.3881885Z     |
2019-12-22T23:20:31.3881885Z     |
2019-12-22T23:20:31.3882235Z 767 | #[derive(Clone, Copy, PartialEq, Debug, RustcEncodable, RustcDecodable, HashStable_Generic)]
2019-12-22T23:20:31.3882856Z     | 
2019-12-22T23:20:31.3883143Z    ::: <::core::macros::builtin::RustcDecodable macros>:1:1
2019-12-22T23:20:31.3883370Z     |
2019-12-22T23:20:31.3883370Z     |
2019-12-22T23:20:31.3883651Z 1   | ($ item : item) => { }
2019-12-22T23:20:31.3883994Z     | ---------------------- in this expansion of `#[derive(RustcDecodable)]`
2019-12-22T23:20:31.3884213Z     |
2019-12-22T23:20:31.3884584Z     = note: for more information, see ***/issues/47809
2019-12-22T23:20:31.3884905Z     = help: add `#![feature(track_caller)]` to the crate attributes to enable
2019-12-22T23:20:31.3885207Z error: aborting due to 8 previous errors
2019-12-22T23:20:31.3885241Z 
2019-12-22T23:20:31.3885499Z For more information about this error, try `rustc --explain E0658`.
2019-12-22T23:20:31.3885771Z error: could not compile `syntax_pos`.
---
2019-12-22T23:20:31.3887259Z   local time: Sun Dec 22 23:20:31 UTC 2019
2019-12-22T23:20:31.4964665Z   network time: Sun, 22 Dec 2019 23:20:31 GMT
2019-12-22T23:20:31.4964779Z == end clock drift check ==
2019-12-22T23:20:32.8653616Z 
2019-12-22T23:20:32.8745517Z ##[error]Bash exited with code '1'.
2019-12-22T23:20:32.8784073Z ##[section]Starting: Checkout
2019-12-22T23:20:32.8786117Z ==============================================================================
2019-12-22T23:20:32.8786173Z Task         : Get sources
2019-12-22T23:20:32.8786218Z 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
Copy link
Contributor

bors commented Dec 23, 2019

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

@anp
Copy link
Member Author

anp commented Dec 24, 2019

Rebased and pushed. I'll get the intrinsics fix in place and I can try using #[track_caller] on the panicking.rs functions after that.

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-7 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-12-24T01:06:23.0782803Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-12-24T01:06:23.0797645Z ##[command]git config gc.auto 0
2019-12-24T01:06:23.0801245Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-12-24T01:06:23.0804165Z ##[command]git config --get-all http.proxy
2019-12-24T01:06:23.0807132Z ##[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/67137/merge:refs/remotes/pull/67137/merge
---
2019-12-24T01:38:59.1360427Z    Compiling rustc_data_structures v0.0.0 (/checkout/src/librustc_data_structures)
2019-12-24T01:39:02.6962640Z    Compiling arena v0.0.0 (/checkout/src/libarena)
2019-12-24T01:39:05.1967506Z    Compiling rustc_macros v0.1.0 (/checkout/src/librustc_macros)
2019-12-24T01:39:17.5548285Z    Compiling syntax_pos v0.0.0 (/checkout/src/libsyntax_pos)
2019-12-24T01:39:18.0718975Z error[E0658]: use of unstable library feature 'track_caller': uses #[track_caller] which is not yet stable
2019-12-24T01:39:18.0719454Z   --> src/libsyntax_pos/lib.rs:81:5
2019-12-24T01:39:18.0720213Z 81 |     RustcDecodable,
2019-12-24T01:39:18.0721249Z    |     ^^^^^^^^^^^^^^ in this macro invocation
2019-12-24T01:39:18.0721518Z    | 
2019-12-24T01:39:18.0721808Z   ::: <::core::macros::builtin::RustcDecodable macros>:1:1
2019-12-24T01:39:18.0721808Z   ::: <::core::macros::builtin::RustcDecodable macros>:1:1
2019-12-24T01:39:18.0722086Z    |
2019-12-24T01:39:18.0722375Z 1  | ($ item : item) => { }
2019-12-24T01:39:18.0722734Z    | ---------------------- in this expansion of `#[derive(RustcDecodable)]`
2019-12-24T01:39:18.0722983Z    |
2019-12-24T01:39:18.0723448Z    = note: for more information, see ***/issues/47809
2019-12-24T01:39:18.0723781Z    = help: add `#![feature(track_caller)]` to the crate attributes to enable
2019-12-24T01:39:18.0723844Z 
2019-12-24T01:39:18.6234220Z error[E0658]: use of unstable library feature 'track_caller': uses #[track_caller] which is not yet stable
2019-12-24T01:39:18.6234800Z    --> src/libsyntax_pos/lib.rs:796:39
2019-12-24T01:39:18.6235235Z     |
2019-12-24T01:39:18.6235678Z 796 | #[derive(Copy, Clone, RustcEncodable, RustcDecodable, Eq, PartialEq, Debug)]
2019-12-24T01:39:18.6236878Z     | 
2019-12-24T01:39:18.6237282Z    ::: <::core::macros::builtin::RustcDecodable macros>:1:1
2019-12-24T01:39:18.6237647Z     |
2019-12-24T01:39:18.6237647Z     |
2019-12-24T01:39:18.6238470Z 1   | ($ item : item) => { }
2019-12-24T01:39:18.6239433Z     | ---------------------- in this expansion of `#[derive(RustcDecodable)]`
2019-12-24T01:39:18.6240641Z     |
2019-12-24T01:39:18.6241324Z     = note: for more information, see ***/issues/47809
2019-12-24T01:39:18.6241866Z     = help: add `#![feature(track_caller)]` to the crate attributes to enable
2019-12-24T01:39:18.6242047Z 
2019-12-24T01:39:18.6244834Z error[E0658]: use of unstable library feature 'track_caller': uses #[track_caller] which is not yet stable
2019-12-24T01:39:18.6245250Z   --> src/libsyntax_pos/edition.rs:16:5
2019-12-24T01:39:18.6246007Z 16 |     RustcDecodable,
2019-12-24T01:39:18.6246442Z    |     ^^^^^^^^^^^^^^ in this macro invocation
2019-12-24T01:39:18.6247048Z    | 
2019-12-24T01:39:18.6247611Z   ::: <::core::macros::builtin::RustcDecodable macros>:1:1
2019-12-24T01:39:18.6247611Z   ::: <::core::macros::builtin::RustcDecodable macros>:1:1
2019-12-24T01:39:18.6248083Z    |
2019-12-24T01:39:18.6248503Z 1  | ($ item : item) => { }
2019-12-24T01:39:18.6248932Z    | ---------------------- in this expansion of `#[derive(RustcDecodable)]`
2019-12-24T01:39:18.6249288Z    |
2019-12-24T01:39:18.6249730Z    = note: for more information, see ***/issues/47809
2019-12-24T01:39:18.6250951Z    = help: add `#![feature(track_caller)]` to the crate attributes to enable
2019-12-24T01:39:18.6251158Z 
2019-12-24T01:39:18.6251742Z error[E0658]: use of unstable library feature 'track_caller': uses #[track_caller] which is not yet stable
2019-12-24T01:39:18.6252673Z    |
2019-12-24T01:39:18.6253141Z 71 |     RustcDecodable,
2019-12-24T01:39:18.6253649Z    |     ^^^^^^^^^^^^^^ in this macro invocation
2019-12-24T01:39:18.6254221Z    | 
2019-12-24T01:39:18.6254221Z    | 
2019-12-24T01:39:18.6254803Z   ::: <::core::macros::builtin::RustcDecodable macros>:1:1
2019-12-24T01:39:18.6255129Z    |
2019-12-24T01:39:18.6255512Z 1  | ($ item : item) => { }
2019-12-24T01:39:18.6255937Z    | ---------------------- in this expansion of `#[derive(RustcDecodable)]`
2019-12-24T01:39:18.6256277Z    |
2019-12-24T01:39:18.6256740Z    = note: for more information, see ***/issues/47809
2019-12-24T01:39:18.6257156Z    = help: add `#![feature(track_caller)]` to the crate attributes to enable
2019-12-24T01:39:18.6257326Z 
2019-12-24T01:39:18.6257945Z error[E0658]: use of unstable library feature 'track_caller': uses #[track_caller] which is not yet stable
2019-12-24T01:39:18.6258707Z     |
2019-12-24T01:39:18.6259116Z 720 | #[derive(Clone, Debug, RustcEncodable, RustcDecodable, HashStable_Generic)]
2019-12-24T01:39:18.6259586Z     |                                        ^^^^^^^^^^^^^^ in this macro invocation
2019-12-24T01:39:18.6260121Z     | 
2019-12-24T01:39:18.6260121Z     | 
2019-12-24T01:39:18.6261030Z    ::: <::core::macros::builtin::RustcDecodable macros>:1:1
2019-12-24T01:39:18.6261476Z     |
2019-12-24T01:39:18.6261929Z 1   | ($ item : item) => { }
2019-12-24T01:39:18.6262487Z     | ---------------------- in this expansion of `#[derive(RustcDecodable)]`
2019-12-24T01:39:18.6262897Z     |
2019-12-24T01:39:18.6263458Z     = note: for more information, see ***/issues/47809
2019-12-24T01:39:18.6264126Z     = help: add `#![feature(track_caller)]` to the crate attributes to enable
2019-12-24T01:39:18.6264425Z 
2019-12-24T01:39:18.6265165Z error[E0658]: use of unstable library feature 'track_caller': uses #[track_caller] which is not yet stable
2019-12-24T01:39:18.6265942Z     |
2019-12-24T01:39:18.6266309Z 750 |     RustcDecodable,
2019-12-24T01:39:18.6266735Z     |     ^^^^^^^^^^^^^^ in this macro invocation
2019-12-24T01:39:18.6267083Z     | 
2019-12-24T01:39:18.6267083Z     | 
2019-12-24T01:39:18.6267458Z    ::: <::core::macros::builtin::RustcDecodable macros>:1:1
2019-12-24T01:39:18.6267805Z     |
2019-12-24T01:39:18.6268172Z 1   | ($ item : item) => { }
2019-12-24T01:39:18.6268614Z     | ---------------------- in this expansion of `#[derive(RustcDecodable)]`
2019-12-24T01:39:18.6268965Z     |
2019-12-24T01:39:18.6269401Z     = note: for more information, see ***/issues/47809
2019-12-24T01:39:18.6269839Z     = help: add `#![feature(track_caller)]` to the crate attributes to enable
2019-12-24T01:39:18.6270240Z 
2019-12-24T01:39:18.6271244Z error[E0658]: use of unstable library feature 'track_caller': uses #[track_caller] which is not yet stable
2019-12-24T01:39:18.6271762Z     |
2019-12-24T01:39:18.6271762Z     |
2019-12-24T01:39:18.6272339Z 789 | #[derive(Clone, Copy, PartialEq, Debug, RustcEncodable, RustcDecodable, HashStable_Generic)]
2019-12-24T01:39:18.6273376Z     | 
2019-12-24T01:39:18.6273843Z    ::: <::core::macros::builtin::RustcDecodable macros>:1:1
2019-12-24T01:39:18.6274610Z     |
2019-12-24T01:39:18.6274610Z     |
2019-12-24T01:39:18.6274912Z 1   | ($ item : item) => { }
2019-12-24T01:39:18.6275204Z     | ---------------------- in this expansion of `#[derive(RustcDecodable)]`
2019-12-24T01:39:18.6275619Z     |
2019-12-24T01:39:18.6276568Z     = note: for more information, see ***/issues/47809
2019-12-24T01:39:18.6276928Z     = help: add `#![feature(track_caller)]` to the crate attributes to enable
2019-12-24T01:39:18.6276966Z 
2019-12-24T01:39:18.6277382Z error[E0658]: use of unstable library feature 'track_caller': uses #[track_caller] which is not yet stable
2019-12-24T01:39:18.6278346Z     |
2019-12-24T01:39:18.6278346Z     |
2019-12-24T01:39:18.6280612Z 807 | #[derive(Clone, Copy, PartialEq, Debug, RustcEncodable, RustcDecodable, HashStable_Generic)]
2019-12-24T01:39:18.6281526Z     | 
2019-12-24T01:39:18.6281837Z    ::: <::core::macros::builtin::RustcDecodable macros>:1:1
2019-12-24T01:39:18.6282146Z     |
2019-12-24T01:39:18.6282146Z     |
2019-12-24T01:39:18.6283427Z 1   | ($ item : item) => { }
2019-12-24T01:39:18.6284320Z     | ---------------------- in this expansion of `#[derive(RustcDecodable)]`
2019-12-24T01:39:18.6284669Z     |
2019-12-24T01:39:18.6286741Z     = note: for more information, see ***/issues/47809
2019-12-24T01:39:18.6287677Z     = help: add `#![feature(track_caller)]` to the crate attributes to enable
2019-12-24T01:39:18.6288210Z error: aborting due to 8 previous errors
2019-12-24T01:39:18.6288375Z 
2019-12-24T01:39:18.6288751Z For more information about this error, try `rustc --explain E0658`.
2019-12-24T01:39:18.6288993Z error: could not compile `syntax_pos`.
---
2019-12-24T01:39:18.6291681Z   local time: Tue Dec 24 01:39:18 UTC 2019
2019-12-24T01:39:18.7357939Z   network time: Tue, 24 Dec 2019 01:39:18 GMT
2019-12-24T01:39:18.7358640Z == end clock drift check ==
2019-12-24T01:39:19.8735416Z 
2019-12-24T01:39:19.8835741Z ##[error]Bash exited with code '1'.
2019-12-24T01:39:19.8869241Z ##[section]Starting: Checkout
2019-12-24T01:39:19.8871599Z ==============================================================================
2019-12-24T01:39:19.8871660Z Task         : Get sources
2019-12-24T01:39:19.8871708Z 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
Copy link
Member Author

anp commented Dec 24, 2019

I think my last fixup resolves the issue with expansion of RustcDecodable.

Working on using #[track_caller] on the "plumbing" functions now.

@anp
Copy link
Member Author

anp commented Dec 24, 2019

This PR will now break miri, as it changes the signature of the Machine trait which is implemented there as well. I think I've covered everything in the CI feedback from previous runs and the review feedback so far. Going to wait for bors and highfive to tell me about next steps.

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-7 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-12-24T03:58:32.9789514Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-12-24T03:58:33.9544420Z ##[command]git config gc.auto 0
2019-12-24T03:58:33.9550072Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-12-24T03:58:33.9555154Z ##[command]git config --get-all http.proxy
2019-12-24T03:58:33.9560634Z ##[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/67137/merge:refs/remotes/pull/67137/merge
---
2019-12-24T04:59:43.3120242Z .................................................................................................... 1600/9445
2019-12-24T04:59:48.0708307Z .................................................................................................... 1700/9445
2019-12-24T04:59:58.6460231Z ......................................................................................i............. 1800/9445
2019-12-24T05:00:06.2969056Z .................................................................................................... 1900/9445
2019-12-24T05:00:12.9036293Z ........................................................................iiiii....................... 2000/9445
2019-12-24T05:00:34.2483344Z .................................................................................................... 2200/9445
2019-12-24T05:00:36.6488078Z .................................................................................................... 2300/9445
2019-12-24T05:00:39.3473733Z .................................................................................................... 2400/9445
2019-12-24T05:00:52.0873783Z .................................................................................................... 2500/9445
---
2019-12-24T05:03:48.2956358Z ..i...............i................................................................................. 4900/9445
2019-12-24T05:03:58.7656219Z .................................................................................................... 5000/9445
2019-12-24T05:04:03.7996736Z ..............................................i..................................................... 5100/9445
2019-12-24T05:04:14.0143068Z .................................................................................................... 5200/9445
2019-12-24T05:04:20.1487879Z .............ii.ii...........i...................................................................... 5300/9445
2019-12-24T05:04:29.7584365Z .................................................................................................... 5500/9445
2019-12-24T05:04:41.1636591Z ...............................................................................................i.... 5600/9445
2019-12-24T05:04:49.3785252Z .................................................................................................... 5700/9445
2019-12-24T05:04:54.7316003Z .................................................................................................... 5800/9445
2019-12-24T05:04:54.7316003Z .................................................................................................... 5800/9445
2019-12-24T05:05:04.6579244Z ...................................................................................ii...i..ii....... 5900/9445
2019-12-24T05:05:27.7403289Z .................................................................................................... 6100/9445
2019-12-24T05:05:35.5048672Z .................................................................................................... 6200/9445
2019-12-24T05:05:43.7783463Z .................................................................................................... 6300/9445
2019-12-24T05:05:43.7783463Z .................................................................................................... 6300/9445
2019-12-24T05:05:59.4877296Z ..........i..ii..................................................................................... 6400/9445
2019-12-24T05:06:18.7524011Z ......................................................................................i............. 6600/9445
2019-12-24T05:06:20.9284086Z .................................................................................................... 6700/9445
2019-12-24T05:06:23.3162963Z ......................................................................................i............. 6800/9445
2019-12-24T05:06:26.1555597Z .................................................................................................... 6900/9445
---
2019-12-24T05:08:07.5275803Z .................................................................................................... 7500/9445
2019-12-24T05:08:12.4722487Z .................................................................................................... 7600/9445
2019-12-24T05:08:19.7512268Z .................................................................................................... 7700/9445
2019-12-24T05:08:30.9245391Z .................................................................................................... 7800/9445
2019-12-24T05:08:37.2272543Z .................iiii............................................................................... 7900/9445
2019-12-24T05:08:51.6284401Z .................................................................................................... 8100/9445
2019-12-24T05:09:03.0734937Z .................................................................................................... 8200/9445
2019-12-24T05:09:16.1527742Z .................................................................................................... 8300/9445
2019-12-24T05:09:22.6135575Z .................................................................................................... 8400/9445
---
2019-12-24T05:11:46.1861256Z ---- [mir-opt] mir-opt/retain-never-const.rs stdout ----
2019-12-24T05:11:46.1861312Z 
2019-12-24T05:11:46.1861360Z error: compilation failed!
2019-12-24T05:11:46.1861423Z status: exit code: 1
2019-12-24T05:11:46.1863804Z command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/mir-opt/retain-never-const.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "-Zdump-mir=all" "-Zmir-opt-level=3" "-Zdump-mir-exclude-pass-number" "-Zdump-mir-dir=/checkout/obj/build/x86_64-unknown-linux-gnu/test/mir-opt/retain-never-const" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/mir-opt/retain-never-const/a" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--emit" "mir,link" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/mir-opt/retain-never-const/auxiliary"
2019-12-24T05:11:46.1866796Z ------------------------------------------
2019-12-24T05:11:46.1866896Z 
2019-12-24T05:11:46.1867225Z ------------------------------------------
2019-12-24T05:11:46.1867274Z stderr:
2019-12-24T05:11:46.1867274Z stderr:
2019-12-24T05:11:46.1867509Z ------------------------------------------
2019-12-24T05:11:46.1867581Z warning: due to multiple output types requested, the explicitly specified output file name will be adapted for each output type
2019-12-24T05:11:46.1867620Z 
2019-12-24T05:11:46.1868702Z warning: struct is never constructed: `PrintName`
2019-12-24T05:11:46.1870067Z   --> /checkout/src/test/mir-opt/retain-never-const.rs:10:8
2019-12-24T05:11:46.1870282Z    |
2019-12-24T05:11:46.1870324Z 10 | struct PrintName<T>(T);
2019-12-24T05:11:46.1870427Z    |
2019-12-24T05:11:46.1870469Z    = note: `#[warn(dead_code)]` on by default
2019-12-24T05:11:46.1870498Z 
2019-12-24T05:11:46.1870498Z 
2019-12-24T05:11:46.1870558Z warning: associated const is never used: `VOID`
2019-12-24T05:11:46.1871775Z    |
2019-12-24T05:11:46.1871775Z    |
2019-12-24T05:11:46.1871839Z 13 |     const VOID: ! = panic!();
2019-12-24T05:11:46.1872086Z 
2019-12-24T05:11:46.1872086Z 
2019-12-24T05:11:46.1872125Z warning: function is never used: `no_codegen`
2019-12-24T05:11:46.1872539Z    |
2019-12-24T05:11:46.1872579Z 16 | fn no_codegen<T>() {
2019-12-24T05:11:46.1872636Z    |    ^^^^^^^^^^
2019-12-24T05:11:46.1873418Z 
2019-12-24T05:11:46.1873418Z 
2019-12-24T05:11:46.1873496Z error: any use of this value will cause an error
2019-12-24T05:11:46.1874234Z   --> /checkout/src/test/mir-opt/retain-never-const.rs:13:21
2019-12-24T05:11:46.1874312Z    |
2019-12-24T05:11:46.1874353Z 13 |     const VOID: ! = panic!();
2019-12-24T05:11:46.1874622Z    |                     |
2019-12-24T05:11:46.1877003Z    |                     the evaluated program panicked at 'explicit panic', /checkout/src/test/mir-opt/retain-never-const.rs:13:21
2019-12-24T05:11:46.1877076Z    |
2019-12-24T05:11:46.1877943Z    = note: `#[deny(const_err)]` on by default
2019-12-24T05:11:46.1877943Z    = note: `#[deny(const_err)]` on by default
2019-12-24T05:11:46.1878940Z    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
2019-12-24T05:11:46.1879842Z 
2019-12-24T05:11:46.1879926Z error[E0080]: erroneous constant used
2019-12-24T05:11:46.1880268Z   --> /checkout/src/test/mir-opt/retain-never-const.rs:17:13
2019-12-24T05:11:46.1880314Z    |
2019-12-24T05:11:46.1880372Z 17 |     let _ = PrintName::<T>::VOID;
2019-12-24T05:11:46.1880419Z    |             ^^^^^^^^^^^^^^^^^^^^ referenced constant has errors
2019-12-24T05:11:46.1881092Z error: aborting due to 2 previous errors
2019-12-24T05:11:46.1881140Z 
2019-12-24T05:11:46.1881475Z For more information about this error, try `rustc --explain E0080`.
2019-12-24T05:11:46.1881635Z 
---
2019-12-24T05:11:46.1884026Z thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:385:22
2019-12-24T05:11:46.1884082Z note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
2019-12-24T05:11:46.1886146Z 
2019-12-24T05:11:46.1886208Z 
2019-12-24T05:11:46.1892938Z command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "/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/mir-opt" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/mir-opt" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--mode" "mir-opt" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/usr/lib/llvm-7/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" "7.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-12-24T05:11:46.1893193Z 
2019-12-24T05:11:46.1893238Z 
2019-12-24T05:11:46.1952355Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
2019-12-24T05:11:46.1952677Z Build completed unsuccessfully in 1:06:42
2019-12-24T05:11:46.1952677Z Build completed unsuccessfully in 1:06:42
2019-12-24T05:11:46.1957537Z == clock drift check ==
2019-12-24T05:11:46.1974281Z   local time: Tue Dec 24 05:11:46 UTC 2019
2019-12-24T05:11:46.7453268Z   network time: Tue, 24 Dec 2019 05:11:46 GMT
2019-12-24T05:11:46.7475419Z == end clock drift check ==
2019-12-24T05:11:52.4503166Z 
2019-12-24T05:11:52.4642887Z ##[error]Bash exited with code '1'.
2019-12-24T05:11:52.4682677Z ##[section]Starting: Checkout
2019-12-24T05:11:52.4684566Z ==============================================================================
2019-12-24T05:11:52.4684629Z Task         : Get sources
2019-12-24T05:11:52.4684670Z 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
Copy link
Contributor

bors commented Dec 26, 2019

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

@anp
Copy link
Member Author

anp commented Dec 26, 2019

Once #67631 lands the failing test will be fixed and I'll clean up the history here.

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-7 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-12-26T21:40:54.3678544Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-12-26T21:40:54.3983494Z ##[command]git config gc.auto 0
2019-12-26T21:40:54.4031977Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-12-26T21:40:54.4091064Z ##[command]git config --get-all http.proxy
2019-12-26T21:40:54.4248705Z ##[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/67137/merge:refs/remotes/pull/67137/merge
---
2019-12-26T22:43:06.3149827Z .................................................................................................... 1600/9456
2019-12-26T22:43:11.2712825Z .................................................................................................... 1700/9456
2019-12-26T22:43:20.9835961Z .............................................................................................i...... 1800/9456
2019-12-26T22:43:29.3482501Z .................................................................................................... 1900/9456
2019-12-26T22:43:36.2764343Z ...............................................................................iiiii................ 2000/9456
2019-12-26T22:43:59.2428314Z .................................................................................................... 2200/9456
2019-12-26T22:44:01.6811144Z .................................................................................................... 2300/9456
2019-12-26T22:44:04.3223155Z .................................................................................................... 2400/9456
2019-12-26T22:44:10.6844695Z .................................................................................................... 2500/9456
---
2019-12-26T22:47:13.5607928Z ..........i...............i......................................................................... 4900/9456
2019-12-26T22:47:23.7358243Z .................................................................................................... 5000/9456
2019-12-26T22:47:28.8598051Z ......................................................i............................................. 5100/9456
2019-12-26T22:47:38.5495563Z .................................................................................................... 5200/9456
2019-12-26T22:47:45.0867463Z .....................ii.ii...........i.............................................................. 5300/9456
2019-12-26T22:47:54.4709142Z .................................................................................................... 5500/9456
2019-12-26T22:48:05.7404262Z .................................................................................................... 5600/9456
2019-12-26T22:48:13.2082880Z ...i................................................................................................ 5700/9456
2019-12-26T22:48:19.0569858Z .................................................................................................... 5800/9456
2019-12-26T22:48:19.0569858Z .................................................................................................... 5800/9456
2019-12-26T22:48:29.2767471Z ...........................................................................................ii...i..i 5900/9456
2019-12-26T22:48:41.9694438Z i...........i....................................................................................... 6000/9456
2019-12-26T22:48:59.9985281Z .................................................................................................... 6200/9456
2019-12-26T22:49:07.2744468Z .................................................................................................... 6300/9456
2019-12-26T22:49:07.2744468Z .................................................................................................... 6300/9456
2019-12-26T22:49:20.7533092Z ..................i..ii............................................................................. 6400/9456
2019-12-26T22:49:40.3359224Z ...............................................................................................i.... 6600/9456
2019-12-26T22:49:42.4380916Z .................................................................................................... 6700/9456
2019-12-26T22:49:44.6822909Z ...............................................................................................i.... 6800/9456
2019-12-26T22:49:47.3241219Z .................................................................................................... 6900/9456
---
2019-12-26T22:51:26.8458421Z .................................................................................................... 7500/9456
2019-12-26T22:51:31.7231240Z .................................................................................................... 7600/9456
2019-12-26T22:51:38.5159954Z .................................................................................................... 7700/9456
2019-12-26T22:51:49.0063491Z .................................................................................................... 7800/9456
2019-12-26T22:51:55.7723079Z ...........................iiii..................................................................... 7900/9456
2019-12-26T22:52:10.2963530Z .................................................................................................... 8100/9456
2019-12-26T22:52:19.7905614Z .................................................................................................... 8200/9456
2019-12-26T22:52:33.7278152Z .................................................................................................... 8300/9456
2019-12-26T22:52:41.1158499Z .................................................................................................... 8400/9456
---
2019-12-26T22:55:02.6834117Z ---- [mir-opt] mir-opt/retain-never-const.rs stdout ----
2019-12-26T22:55:02.6834154Z 
2019-12-26T22:55:02.6834221Z error: compilation failed!
2019-12-26T22:55:02.6834266Z status: exit code: 1
2019-12-26T22:55:02.6835491Z command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/mir-opt/retain-never-const.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "-Zdump-mir=all" "-Zmir-opt-level=3" "-Zdump-mir-exclude-pass-number" "-Zdump-mir-dir=/checkout/obj/build/x86_64-unknown-linux-gnu/test/mir-opt/retain-never-const" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/mir-opt/retain-never-const/a" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--emit" "mir,link" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/mir-opt/retain-never-const/auxiliary"
2019-12-26T22:55:02.6835933Z ------------------------------------------
2019-12-26T22:55:02.6835971Z 
2019-12-26T22:55:02.6836203Z ------------------------------------------
2019-12-26T22:55:02.6836251Z stderr:
2019-12-26T22:55:02.6836251Z stderr:
2019-12-26T22:55:02.6836498Z ------------------------------------------
2019-12-26T22:55:02.6836571Z warning: due to multiple output types requested, the explicitly specified output file name will be adapted for each output type
2019-12-26T22:55:02.6836608Z 
2019-12-26T22:55:02.6836674Z warning: struct is never constructed: `PrintName`
2019-12-26T22:55:02.6836934Z   --> /checkout/src/test/mir-opt/retain-never-const.rs:10:8
2019-12-26T22:55:02.6836986Z    |
2019-12-26T22:55:02.6837028Z 10 | struct PrintName<T>(T);
2019-12-26T22:55:02.6837132Z    |
2019-12-26T22:55:02.6837176Z    = note: `#[warn(dead_code)]` on by default
2019-12-26T22:55:02.6837224Z 
2019-12-26T22:55:02.6837224Z 
2019-12-26T22:55:02.6837268Z warning: associated const is never used: `VOID`
2019-12-26T22:55:02.6837836Z    |
2019-12-26T22:55:02.6837836Z    |
2019-12-26T22:55:02.6837901Z 13 |     const VOID: ! = panic!();
2019-12-26T22:55:02.6837978Z 
2019-12-26T22:55:02.6837978Z 
2019-12-26T22:55:02.6838040Z warning: function is never used: `no_codegen`
2019-12-26T22:55:02.6838460Z    |
2019-12-26T22:55:02.6838514Z 16 | fn no_codegen<T>() {
2019-12-26T22:55:02.6838580Z    |    ^^^^^^^^^^
2019-12-26T22:55:02.6838608Z 
2019-12-26T22:55:02.6838608Z 
2019-12-26T22:55:02.6838650Z error: any use of this value will cause an error
2019-12-26T22:55:02.6838960Z   --> /checkout/src/test/mir-opt/retain-never-const.rs:13:21
2019-12-26T22:55:02.6839011Z    |
2019-12-26T22:55:02.6839053Z 13 |     const VOID: ! = panic!();
2019-12-26T22:55:02.6839922Z    |                     |
2019-12-26T22:55:02.6840342Z    |                     the evaluated program panicked at 'explicit panic', /checkout/src/test/mir-opt/retain-never-const.rs:13:21
2019-12-26T22:55:02.6840402Z    |
2019-12-26T22:55:02.6840471Z    = note: `#[deny(const_err)]` on by default
2019-12-26T22:55:02.6840471Z    = note: `#[deny(const_err)]` on by default
2019-12-26T22:55:02.6840829Z    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
2019-12-26T22:55:02.6840880Z 
2019-12-26T22:55:02.6840965Z error[E0080]: erroneous constant used
2019-12-26T22:55:02.6841245Z   --> /checkout/src/test/mir-opt/retain-never-const.rs:17:13
2019-12-26T22:55:02.6841297Z    |
2019-12-26T22:55:02.6841363Z 17 |     let _ = PrintName::<T>::VOID;
2019-12-26T22:55:02.6841417Z    |             ^^^^^^^^^^^^^^^^^^^^ referenced constant has errors
2019-12-26T22:55:02.6841495Z error: aborting due to 2 previous errors
2019-12-26T22:55:02.6841543Z 
2019-12-26T22:55:02.6841819Z For more information about this error, try `rustc --explain E0080`.
2019-12-26T22:55:02.6841869Z 
---
2019-12-26T22:55:02.6853157Z thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:385:22
2019-12-26T22:55:02.6853221Z note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
2019-12-26T22:55:02.6853254Z 
2019-12-26T22:55:02.6853280Z 
2019-12-26T22:55:02.6854979Z command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "/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/mir-opt" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/mir-opt" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--mode" "mir-opt" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/usr/lib/llvm-7/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" "7.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-12-26T22:55:02.6855377Z 
2019-12-26T22:55:02.6855426Z 
2019-12-26T22:55:02.6860388Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
2019-12-26T22:55:02.6860463Z Build completed unsuccessfully in 1:07:21
2019-12-26T22:55:02.6860463Z Build completed unsuccessfully in 1:07:21
2019-12-26T22:55:02.6916439Z == clock drift check ==
2019-12-26T22:55:02.6930151Z   local time: Thu Dec 26 22:55:02 UTC 2019
2019-12-26T22:55:02.9788050Z   network time: Thu, 26 Dec 2019 22:55:02 GMT
2019-12-26T22:55:02.9793474Z == end clock drift check ==
2019-12-26T22:55:08.7287285Z 
2019-12-26T22:55:08.7392571Z ##[error]Bash exited with code '1'.
2019-12-26T22:55:08.7482209Z ##[section]Starting: Checkout
2019-12-26T22:55:08.7484938Z ==============================================================================
2019-12-26T22:55:08.7485019Z Task         : Get sources
2019-12-26T22:55:08.7485060Z 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)

* Removes unnecessary feature flag from track_caller test.
* Tests of panic internals no longer need to explicitly construct Location.
* Add #![warn(const_err)] to retain-never-const per @oli-obk.
* Add track_caller test with diverging function.
@eddyb
Copy link
Member

eddyb commented Jan 4, 2020

@bors r+

@bors
Copy link
Contributor

bors commented Jan 4, 2020

📌 Commit 27b25eb has been approved by eddyb

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jan 4, 2020
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Jan 4, 2020
libstd uses `core::panic::Location` where possible.

cc @eddyb
bors added a commit that referenced this pull request Jan 4, 2020
Rollup of 4 pull requests

Successful merges:

 - #67137 (libstd uses `core::panic::Location` where possible.)
 - #67709 (Introduce an option for disabling deduplication of diagnostics)
 - #67775 (Make "use $crate" a hard error)
 - #67812 (Tweak and extend internal BTreeMap documentation, including debug asserts.)

Failed merges:

r? @ghost
@bors bors merged commit 27b25eb into rust-lang:master Jan 4, 2020
@anp anp deleted the tracked-panic-internals branch January 4, 2020 22:13
anp added a commit to anp/miri that referenced this pull request Jan 5, 2020
JohnTitor added a commit to JohnTitor/rust-clippy that referenced this pull request Jan 5, 2020
JohnTitor added a commit to JohnTitor/rust-clippy that referenced this pull request Jan 5, 2020
bors added a commit to rust-lang/rust-clippy that referenced this pull request Jan 5, 2020
bors added a commit to rust-lang/rust-clippy that referenced this pull request Jan 5, 2020
bors added a commit to rust-lang/miri that referenced this pull request Jan 6, 2020
Update panic machinery to match #[track_caller] changes.

This gets miri's tests passing again with rust-lang/rust#67137, I don't think it will pass CI until that has merged.
@anp anp mentioned this pull request May 21, 2020
Manishearth added a commit to Manishearth/rust that referenced this pull request Jun 30, 2020
Stabilize `#[track_caller]`.

# Stabilization Report

RFC: [2091]
Tracking issue: rust-lang#47809

## Summary

From the [rustc-dev-guide chapter][dev-guide]:

> Take this example program:

```rust
fn main() {
    let foo: Option<()> = None;
    foo.unwrap(); // this should produce a useful panic message!
}
```

> Prior to Rust 1.42, panics like this `unwrap()` printed a location in libcore:

```
$ rustc +1.41.0 example.rs; example.exe
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value',...core\macros\mod.rs:15:40
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
```

> As of 1.42, we get a much more helpful message:

```
$ rustc +1.42.0 example.rs; example.exe
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', example.rs:3:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
```

> These error messages are achieved through a combination of changes to `panic!` internals to make use of `core::panic::Location::caller` and a number of `#[track_caller]` annotations in the standard library which propagate caller information.

The attribute adds an implicit caller location argument to the ABI of annotated functions, but does not affect the type or MIR of the function. We implement the feature entirely in codegen and in the const evaluator.

## Bottom Line

This PR stabilizes the use of `#[track_caller]` everywhere, including traits and extern blocks. It also stabilizes `core::panic::Location::caller`, although the use of that function in a const context remains gated by `#![feature(const_caller_location)]`.

The implementation for the feature already changed the output of panic messages for a number of std functions, as described in the [1.42 release announcement]. The attribute's use in `Index` and `IndexMut` traits is visible to users since 1.44.

## Tests

All of the tests for this feature live under [src/test/ui/rfc-2091-track-caller][tests] in the repo.

Noteworthy cases:

* [use of attr in std]
  * validates user-facing benefit of the feature
* [trait attribute inheritance]
  * covers subtle behavior designed during implementation and not RFC'd
* [const/codegen equivalence]
  * this was the result of a suspected edge case and investigation
* [diverging function support]
  * covers an unresolved question from the RFC
* [fn pointers and shims]
  * covers important potential sources of unsoundness

## Documentation

The rustc-dev-guide now has a chapter on [Implicit Caller Location][dev-guide].

I have an [open PR to the reference][attr-reference-pr] documenting the attribute.

The intrinsic's [wrapper] includes some examples as well.

## Implementation History

* 2019-10-02: [`#[track_caller]` feature gate (RFC 2091 1/N) rust-lang#65037](rust-lang#65037)
  * Picked up the patch that @ayosec had started on the feature gate.
* 2019-10-13: [Add `Instance::resolve_for_fn_ptr` (RFC 2091 rust-lang#2/N) rust-lang#65182](rust-lang#65182)
* 2019-10-20: ~~[WIP Add MIR argument for #[track_caller] (RFC 2091 3/N) rust-lang#65258](rust-lang#65258
  * Abandoned approach to send location as a MIR argument.
* 2019-10-28: [`std::panic::Location` is a lang_item, add `core::intrinsics::caller_location` (RFC 2091 3/N) rust-lang#65664](rust-lang#65664)
* 2019-12-07: [Implement #[track_caller] attribute. (RFC 2091 4/N) rust-lang#65881](rust-lang#65881)
* 2020-01-04: [libstd uses `core::panic::Location` where possible. rust-lang#67137](rust-lang#67137)
* 2020-01-08: [`Option::{expect,unwrap}` and `Result::{expect, expect_err, unwrap, unwrap_err}` have `#[track_caller]` rust-lang#67887](rust-lang#67887)
* 2020-01-20: [Fix #[track_caller] and function pointers rust-lang#68302](rust-lang#68302) (fixed rust-lang#68178)
* 2020-03-23: [#[track_caller] in traits rust-lang#69251](rust-lang#69251)
* 2020-03-24: [#[track_caller] on core::ops::{Index, IndexMut}. rust-lang#70234](rust-lang#70234)
* 2020-04-08 [Support `#[track_caller]` on functions in `extern "Rust" { ... }` rust-lang#70916](rust-lang#70916)

## Unresolveds

### From the RFC

> Currently the RFC simply prohibit applying #[track_caller] to trait methods as a future-proofing
> measure.

**Resolved.** See the dev-guide documentation and the tests section above.

> Diverging functions should be supported.

**Resolved.** See the tests section above.

> The closure foo::{{closure}} should inherit most attributes applied to the function foo, ...

**Resolved.** This unknown was related to specifics of the implementation which were made irrelevant by the final implementation.

### Binary Size

I [instrumented track_caller to use custom sections][measure-size] in a local build and discovered relatively minor binary size usage for the feature overall. I'm leaving the issue open to discuss whether we want to upstream custom section support.

There's an [open issue to discuss mitigation strategies][mitigate-size]. Some decisions remain about the "right" strategies to reduce size without overly constraining the compiler implementation. I'd be excited to see someone carry that work forward but my opinion is that we shouldn't block stabilization on implementing compiler flags for redaction.

### Specialization

There's an [open issue][specialization] on the semantics of the attribute in specialization chains. I'm inclined to move forward with stabilization without an exact resolution here given that specialization is itself unstable, but I also think it should be an easy question to resolve.

### Location only points to the start of a call span

rust-lang#69977 was resolved by rust-lang#73182, and the next step should probably be to [extend `Location` with a notion of the end of a call](rust-lang#73554).

### Regression of std's panic messages

rust-lang#70963 should be resolved by serializing span hygeine to crate metadata: rust-lang#68686.

[2091]: https://github.com/rust-lang/rfcs/blob/master/text/2091-inline-semantic.md
[dev-guide]: https://rustc-dev-guide.rust-lang.org/codegen/implicit-caller-location.html
[specialization]: rust-lang#70293
[measure-size]: rust-lang#70579
[mitigate-size]: rust-lang#70580
[attr-reference-pr]: rust-lang/reference#742
[wrapper]: https://doc.rust-lang.org/nightly/core/panic/struct.Location.html#method.caller
[tests]: https://github.com/rust-lang/rust/tree/master/src/test/ui/rfc-2091-track-caller
[const/codegen equivalence]: https://github.com/rust-lang/rust/blob/master/src/test/ui/rfc-2091-track-caller/caller-location-fnptr-rt-ctfe-equiv.rs
[diverging function support]: https://github.com/rust-lang/rust/blob/master/src/test/ui/rfc-2091-track-caller/diverging-caller-location.rs
[use of attr in std]: https://github.com/rust-lang/rust/blob/master/src/test/ui/rfc-2091-track-caller/std-panic-locations.rs
[fn pointers and shims]: https://github.com/rust-lang/rust/blob/master/src/test/ui/rfc-2091-track-caller/tracked-fn-ptr-with-arg.rs
[trait attribute inheritance]: https://github.com/rust-lang/rust/blob/master/src/test/ui/rfc-2091-track-caller/tracked-trait-impls.rs
[1.42 release announcement]: https://blog.rust-lang.org/2020/03/12/Rust-1.42.html#useful-line-numbers-in-option-and-result-panic-messages
Manishearth added a commit to Manishearth/rust that referenced this pull request Jun 30, 2020
Stabilize `#[track_caller]`.

# Stabilization Report

RFC: [2091]
Tracking issue: rust-lang#47809

## Summary

From the [rustc-dev-guide chapter][dev-guide]:

> Take this example program:

```rust
fn main() {
    let foo: Option<()> = None;
    foo.unwrap(); // this should produce a useful panic message!
}
```

> Prior to Rust 1.42, panics like this `unwrap()` printed a location in libcore:

```
$ rustc +1.41.0 example.rs; example.exe
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value',...core\macros\mod.rs:15:40
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
```

> As of 1.42, we get a much more helpful message:

```
$ rustc +1.42.0 example.rs; example.exe
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', example.rs:3:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
```

> These error messages are achieved through a combination of changes to `panic!` internals to make use of `core::panic::Location::caller` and a number of `#[track_caller]` annotations in the standard library which propagate caller information.

The attribute adds an implicit caller location argument to the ABI of annotated functions, but does not affect the type or MIR of the function. We implement the feature entirely in codegen and in the const evaluator.

## Bottom Line

This PR stabilizes the use of `#[track_caller]` everywhere, including traits and extern blocks. It also stabilizes `core::panic::Location::caller`, although the use of that function in a const context remains gated by `#![feature(const_caller_location)]`.

The implementation for the feature already changed the output of panic messages for a number of std functions, as described in the [1.42 release announcement]. The attribute's use in `Index` and `IndexMut` traits is visible to users since 1.44.

## Tests

All of the tests for this feature live under [src/test/ui/rfc-2091-track-caller][tests] in the repo.

Noteworthy cases:

* [use of attr in std]
  * validates user-facing benefit of the feature
* [trait attribute inheritance]
  * covers subtle behavior designed during implementation and not RFC'd
* [const/codegen equivalence]
  * this was the result of a suspected edge case and investigation
* [diverging function support]
  * covers an unresolved question from the RFC
* [fn pointers and shims]
  * covers important potential sources of unsoundness

## Documentation

The rustc-dev-guide now has a chapter on [Implicit Caller Location][dev-guide].

I have an [open PR to the reference][attr-reference-pr] documenting the attribute.

The intrinsic's [wrapper] includes some examples as well.

## Implementation History

* 2019-10-02: [`#[track_caller]` feature gate (RFC 2091 1/N) rust-lang#65037](rust-lang#65037)
  * Picked up the patch that @ayosec had started on the feature gate.
* 2019-10-13: [Add `Instance::resolve_for_fn_ptr` (RFC 2091 rust-lang#2/N) rust-lang#65182](rust-lang#65182)
* 2019-10-20: ~~[WIP Add MIR argument for #[track_caller] (RFC 2091 3/N) rust-lang#65258](rust-lang#65258
  * Abandoned approach to send location as a MIR argument.
* 2019-10-28: [`std::panic::Location` is a lang_item, add `core::intrinsics::caller_location` (RFC 2091 3/N) rust-lang#65664](rust-lang#65664)
* 2019-12-07: [Implement #[track_caller] attribute. (RFC 2091 4/N) rust-lang#65881](rust-lang#65881)
* 2020-01-04: [libstd uses `core::panic::Location` where possible. rust-lang#67137](rust-lang#67137)
* 2020-01-08: [`Option::{expect,unwrap}` and `Result::{expect, expect_err, unwrap, unwrap_err}` have `#[track_caller]` rust-lang#67887](rust-lang#67887)
* 2020-01-20: [Fix #[track_caller] and function pointers rust-lang#68302](rust-lang#68302) (fixed rust-lang#68178)
* 2020-03-23: [#[track_caller] in traits rust-lang#69251](rust-lang#69251)
* 2020-03-24: [#[track_caller] on core::ops::{Index, IndexMut}. rust-lang#70234](rust-lang#70234)
* 2020-04-08 [Support `#[track_caller]` on functions in `extern "Rust" { ... }` rust-lang#70916](rust-lang#70916)

## Unresolveds

### From the RFC

> Currently the RFC simply prohibit applying #[track_caller] to trait methods as a future-proofing
> measure.

**Resolved.** See the dev-guide documentation and the tests section above.

> Diverging functions should be supported.

**Resolved.** See the tests section above.

> The closure foo::{{closure}} should inherit most attributes applied to the function foo, ...

**Resolved.** This unknown was related to specifics of the implementation which were made irrelevant by the final implementation.

### Binary Size

I [instrumented track_caller to use custom sections][measure-size] in a local build and discovered relatively minor binary size usage for the feature overall. I'm leaving the issue open to discuss whether we want to upstream custom section support.

There's an [open issue to discuss mitigation strategies][mitigate-size]. Some decisions remain about the "right" strategies to reduce size without overly constraining the compiler implementation. I'd be excited to see someone carry that work forward but my opinion is that we shouldn't block stabilization on implementing compiler flags for redaction.

### Specialization

There's an [open issue][specialization] on the semantics of the attribute in specialization chains. I'm inclined to move forward with stabilization without an exact resolution here given that specialization is itself unstable, but I also think it should be an easy question to resolve.

### Location only points to the start of a call span

rust-lang#69977 was resolved by rust-lang#73182, and the next step should probably be to [extend `Location` with a notion of the end of a call](rust-lang#73554).

### Regression of std's panic messages

rust-lang#70963 should be resolved by serializing span hygeine to crate metadata: rust-lang#68686.

[2091]: https://github.com/rust-lang/rfcs/blob/master/text/2091-inline-semantic.md
[dev-guide]: https://rustc-dev-guide.rust-lang.org/codegen/implicit-caller-location.html
[specialization]: rust-lang#70293
[measure-size]: rust-lang#70579
[mitigate-size]: rust-lang#70580
[attr-reference-pr]: rust-lang/reference#742
[wrapper]: https://doc.rust-lang.org/nightly/core/panic/struct.Location.html#method.caller
[tests]: https://github.com/rust-lang/rust/tree/master/src/test/ui/rfc-2091-track-caller
[const/codegen equivalence]: https://github.com/rust-lang/rust/blob/master/src/test/ui/rfc-2091-track-caller/caller-location-fnptr-rt-ctfe-equiv.rs
[diverging function support]: https://github.com/rust-lang/rust/blob/master/src/test/ui/rfc-2091-track-caller/diverging-caller-location.rs
[use of attr in std]: https://github.com/rust-lang/rust/blob/master/src/test/ui/rfc-2091-track-caller/std-panic-locations.rs
[fn pointers and shims]: https://github.com/rust-lang/rust/blob/master/src/test/ui/rfc-2091-track-caller/tracked-fn-ptr-with-arg.rs
[trait attribute inheritance]: https://github.com/rust-lang/rust/blob/master/src/test/ui/rfc-2091-track-caller/tracked-trait-impls.rs
[1.42 release announcement]: https://blog.rust-lang.org/2020/03/12/Rust-1.42.html#useful-line-numbers-in-option-and-result-panic-messages
Manishearth added a commit to Manishearth/rust that referenced this pull request Jul 1, 2020
Stabilize `#[track_caller]`.

# Stabilization Report

RFC: [2091]
Tracking issue: rust-lang#47809

## Summary

From the [rustc-dev-guide chapter][dev-guide]:

> Take this example program:

```rust
fn main() {
    let foo: Option<()> = None;
    foo.unwrap(); // this should produce a useful panic message!
}
```

> Prior to Rust 1.42, panics like this `unwrap()` printed a location in libcore:

```
$ rustc +1.41.0 example.rs; example.exe
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value',...core\macros\mod.rs:15:40
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
```

> As of 1.42, we get a much more helpful message:

```
$ rustc +1.42.0 example.rs; example.exe
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', example.rs:3:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
```

> These error messages are achieved through a combination of changes to `panic!` internals to make use of `core::panic::Location::caller` and a number of `#[track_caller]` annotations in the standard library which propagate caller information.

The attribute adds an implicit caller location argument to the ABI of annotated functions, but does not affect the type or MIR of the function. We implement the feature entirely in codegen and in the const evaluator.

## Bottom Line

This PR stabilizes the use of `#[track_caller]` everywhere, including traits and extern blocks. It also stabilizes `core::panic::Location::caller`, although the use of that function in a const context remains gated by `#![feature(const_caller_location)]`.

The implementation for the feature already changed the output of panic messages for a number of std functions, as described in the [1.42 release announcement]. The attribute's use in `Index` and `IndexMut` traits is visible to users since 1.44.

## Tests

All of the tests for this feature live under [src/test/ui/rfc-2091-track-caller][tests] in the repo.

Noteworthy cases:

* [use of attr in std]
  * validates user-facing benefit of the feature
* [trait attribute inheritance]
  * covers subtle behavior designed during implementation and not RFC'd
* [const/codegen equivalence]
  * this was the result of a suspected edge case and investigation
* [diverging function support]
  * covers an unresolved question from the RFC
* [fn pointers and shims]
  * covers important potential sources of unsoundness

## Documentation

The rustc-dev-guide now has a chapter on [Implicit Caller Location][dev-guide].

I have an [open PR to the reference][attr-reference-pr] documenting the attribute.

The intrinsic's [wrapper] includes some examples as well.

## Implementation History

* 2019-10-02: [`#[track_caller]` feature gate (RFC 2091 1/N) rust-lang#65037](rust-lang#65037)
  * Picked up the patch that @ayosec had started on the feature gate.
* 2019-10-13: [Add `Instance::resolve_for_fn_ptr` (RFC 2091 rust-lang#2/N) rust-lang#65182](rust-lang#65182)
* 2019-10-20: ~~[WIP Add MIR argument for #[track_caller] (RFC 2091 3/N) rust-lang#65258](rust-lang#65258
  * Abandoned approach to send location as a MIR argument.
* 2019-10-28: [`std::panic::Location` is a lang_item, add `core::intrinsics::caller_location` (RFC 2091 3/N) rust-lang#65664](rust-lang#65664)
* 2019-12-07: [Implement #[track_caller] attribute. (RFC 2091 4/N) rust-lang#65881](rust-lang#65881)
* 2020-01-04: [libstd uses `core::panic::Location` where possible. rust-lang#67137](rust-lang#67137)
* 2020-01-08: [`Option::{expect,unwrap}` and `Result::{expect, expect_err, unwrap, unwrap_err}` have `#[track_caller]` rust-lang#67887](rust-lang#67887)
* 2020-01-20: [Fix #[track_caller] and function pointers rust-lang#68302](rust-lang#68302) (fixed rust-lang#68178)
* 2020-03-23: [#[track_caller] in traits rust-lang#69251](rust-lang#69251)
* 2020-03-24: [#[track_caller] on core::ops::{Index, IndexMut}. rust-lang#70234](rust-lang#70234)
* 2020-04-08 [Support `#[track_caller]` on functions in `extern "Rust" { ... }` rust-lang#70916](rust-lang#70916)

## Unresolveds

### From the RFC

> Currently the RFC simply prohibit applying #[track_caller] to trait methods as a future-proofing
> measure.

**Resolved.** See the dev-guide documentation and the tests section above.

> Diverging functions should be supported.

**Resolved.** See the tests section above.

> The closure foo::{{closure}} should inherit most attributes applied to the function foo, ...

**Resolved.** This unknown was related to specifics of the implementation which were made irrelevant by the final implementation.

### Binary Size

I [instrumented track_caller to use custom sections][measure-size] in a local build and discovered relatively minor binary size usage for the feature overall. I'm leaving the issue open to discuss whether we want to upstream custom section support.

There's an [open issue to discuss mitigation strategies][mitigate-size]. Some decisions remain about the "right" strategies to reduce size without overly constraining the compiler implementation. I'd be excited to see someone carry that work forward but my opinion is that we shouldn't block stabilization on implementing compiler flags for redaction.

### Specialization

There's an [open issue][specialization] on the semantics of the attribute in specialization chains. I'm inclined to move forward with stabilization without an exact resolution here given that specialization is itself unstable, but I also think it should be an easy question to resolve.

### Location only points to the start of a call span

rust-lang#69977 was resolved by rust-lang#73182, and the next step should probably be to [extend `Location` with a notion of the end of a call](rust-lang#73554).

### Regression of std's panic messages

rust-lang#70963 should be resolved by serializing span hygeine to crate metadata: rust-lang#68686.

[2091]: https://github.com/rust-lang/rfcs/blob/master/text/2091-inline-semantic.md
[dev-guide]: https://rustc-dev-guide.rust-lang.org/codegen/implicit-caller-location.html
[specialization]: rust-lang#70293
[measure-size]: rust-lang#70579
[mitigate-size]: rust-lang#70580
[attr-reference-pr]: rust-lang/reference#742
[wrapper]: https://doc.rust-lang.org/nightly/core/panic/struct.Location.html#method.caller
[tests]: https://github.com/rust-lang/rust/tree/master/src/test/ui/rfc-2091-track-caller
[const/codegen equivalence]: https://github.com/rust-lang/rust/blob/master/src/test/ui/rfc-2091-track-caller/caller-location-fnptr-rt-ctfe-equiv.rs
[diverging function support]: https://github.com/rust-lang/rust/blob/master/src/test/ui/rfc-2091-track-caller/diverging-caller-location.rs
[use of attr in std]: https://github.com/rust-lang/rust/blob/master/src/test/ui/rfc-2091-track-caller/std-panic-locations.rs
[fn pointers and shims]: https://github.com/rust-lang/rust/blob/master/src/test/ui/rfc-2091-track-caller/tracked-fn-ptr-with-arg.rs
[trait attribute inheritance]: https://github.com/rust-lang/rust/blob/master/src/test/ui/rfc-2091-track-caller/tracked-trait-impls.rs
[1.42 release announcement]: https://blog.rust-lang.org/2020/03/12/Rust-1.42.html#useful-line-numbers-in-option-and-result-panic-messages
Manishearth added a commit to Manishearth/rust that referenced this pull request Jul 1, 2020
Stabilize `#[track_caller]`.

# Stabilization Report

RFC: [2091]
Tracking issue: rust-lang#47809

## Summary

From the [rustc-dev-guide chapter][dev-guide]:

> Take this example program:

```rust
fn main() {
    let foo: Option<()> = None;
    foo.unwrap(); // this should produce a useful panic message!
}
```

> Prior to Rust 1.42, panics like this `unwrap()` printed a location in libcore:

```
$ rustc +1.41.0 example.rs; example.exe
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value',...core\macros\mod.rs:15:40
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
```

> As of 1.42, we get a much more helpful message:

```
$ rustc +1.42.0 example.rs; example.exe
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', example.rs:3:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
```

> These error messages are achieved through a combination of changes to `panic!` internals to make use of `core::panic::Location::caller` and a number of `#[track_caller]` annotations in the standard library which propagate caller information.

The attribute adds an implicit caller location argument to the ABI of annotated functions, but does not affect the type or MIR of the function. We implement the feature entirely in codegen and in the const evaluator.

## Bottom Line

This PR stabilizes the use of `#[track_caller]` everywhere, including traits and extern blocks. It also stabilizes `core::panic::Location::caller`, although the use of that function in a const context remains gated by `#![feature(const_caller_location)]`.

The implementation for the feature already changed the output of panic messages for a number of std functions, as described in the [1.42 release announcement]. The attribute's use in `Index` and `IndexMut` traits is visible to users since 1.44.

## Tests

All of the tests for this feature live under [src/test/ui/rfc-2091-track-caller][tests] in the repo.

Noteworthy cases:

* [use of attr in std]
  * validates user-facing benefit of the feature
* [trait attribute inheritance]
  * covers subtle behavior designed during implementation and not RFC'd
* [const/codegen equivalence]
  * this was the result of a suspected edge case and investigation
* [diverging function support]
  * covers an unresolved question from the RFC
* [fn pointers and shims]
  * covers important potential sources of unsoundness

## Documentation

The rustc-dev-guide now has a chapter on [Implicit Caller Location][dev-guide].

I have an [open PR to the reference][attr-reference-pr] documenting the attribute.

The intrinsic's [wrapper] includes some examples as well.

## Implementation History

* 2019-10-02: [`#[track_caller]` feature gate (RFC 2091 1/N) rust-lang#65037](rust-lang#65037)
  * Picked up the patch that @ayosec had started on the feature gate.
* 2019-10-13: [Add `Instance::resolve_for_fn_ptr` (RFC 2091 rust-lang#2/N) rust-lang#65182](rust-lang#65182)
* 2019-10-20: ~~[WIP Add MIR argument for #[track_caller] (RFC 2091 3/N) rust-lang#65258](rust-lang#65258
  * Abandoned approach to send location as a MIR argument.
* 2019-10-28: [`std::panic::Location` is a lang_item, add `core::intrinsics::caller_location` (RFC 2091 3/N) rust-lang#65664](rust-lang#65664)
* 2019-12-07: [Implement #[track_caller] attribute. (RFC 2091 4/N) rust-lang#65881](rust-lang#65881)
* 2020-01-04: [libstd uses `core::panic::Location` where possible. rust-lang#67137](rust-lang#67137)
* 2020-01-08: [`Option::{expect,unwrap}` and `Result::{expect, expect_err, unwrap, unwrap_err}` have `#[track_caller]` rust-lang#67887](rust-lang#67887)
* 2020-01-20: [Fix #[track_caller] and function pointers rust-lang#68302](rust-lang#68302) (fixed rust-lang#68178)
* 2020-03-23: [#[track_caller] in traits rust-lang#69251](rust-lang#69251)
* 2020-03-24: [#[track_caller] on core::ops::{Index, IndexMut}. rust-lang#70234](rust-lang#70234)
* 2020-04-08 [Support `#[track_caller]` on functions in `extern "Rust" { ... }` rust-lang#70916](rust-lang#70916)

## Unresolveds

### From the RFC

> Currently the RFC simply prohibit applying #[track_caller] to trait methods as a future-proofing
> measure.

**Resolved.** See the dev-guide documentation and the tests section above.

> Diverging functions should be supported.

**Resolved.** See the tests section above.

> The closure foo::{{closure}} should inherit most attributes applied to the function foo, ...

**Resolved.** This unknown was related to specifics of the implementation which were made irrelevant by the final implementation.

### Binary Size

I [instrumented track_caller to use custom sections][measure-size] in a local build and discovered relatively minor binary size usage for the feature overall. I'm leaving the issue open to discuss whether we want to upstream custom section support.

There's an [open issue to discuss mitigation strategies][mitigate-size]. Some decisions remain about the "right" strategies to reduce size without overly constraining the compiler implementation. I'd be excited to see someone carry that work forward but my opinion is that we shouldn't block stabilization on implementing compiler flags for redaction.

### Specialization

There's an [open issue][specialization] on the semantics of the attribute in specialization chains. I'm inclined to move forward with stabilization without an exact resolution here given that specialization is itself unstable, but I also think it should be an easy question to resolve.

### Location only points to the start of a call span

rust-lang#69977 was resolved by rust-lang#73182, and the next step should probably be to [extend `Location` with a notion of the end of a call](rust-lang#73554).

### Regression of std's panic messages

rust-lang#70963 should be resolved by serializing span hygeine to crate metadata: rust-lang#68686.

[2091]: https://github.com/rust-lang/rfcs/blob/master/text/2091-inline-semantic.md
[dev-guide]: https://rustc-dev-guide.rust-lang.org/codegen/implicit-caller-location.html
[specialization]: rust-lang#70293
[measure-size]: rust-lang#70579
[mitigate-size]: rust-lang#70580
[attr-reference-pr]: rust-lang/reference#742
[wrapper]: https://doc.rust-lang.org/nightly/core/panic/struct.Location.html#method.caller
[tests]: https://github.com/rust-lang/rust/tree/master/src/test/ui/rfc-2091-track-caller
[const/codegen equivalence]: https://github.com/rust-lang/rust/blob/master/src/test/ui/rfc-2091-track-caller/caller-location-fnptr-rt-ctfe-equiv.rs
[diverging function support]: https://github.com/rust-lang/rust/blob/master/src/test/ui/rfc-2091-track-caller/diverging-caller-location.rs
[use of attr in std]: https://github.com/rust-lang/rust/blob/master/src/test/ui/rfc-2091-track-caller/std-panic-locations.rs
[fn pointers and shims]: https://github.com/rust-lang/rust/blob/master/src/test/ui/rfc-2091-track-caller/tracked-fn-ptr-with-arg.rs
[trait attribute inheritance]: https://github.com/rust-lang/rust/blob/master/src/test/ui/rfc-2091-track-caller/tracked-trait-impls.rs
[1.42 release announcement]: https://blog.rust-lang.org/2020/03/12/Rust-1.42.html#useful-line-numbers-in-option-and-result-panic-messages
Manishearth added a commit to Manishearth/rust that referenced this pull request Jul 1, 2020
Stabilize `#[track_caller]`.

# Stabilization Report

RFC: [2091]
Tracking issue: rust-lang#47809

## Summary

From the [rustc-dev-guide chapter][dev-guide]:

> Take this example program:

```rust
fn main() {
    let foo: Option<()> = None;
    foo.unwrap(); // this should produce a useful panic message!
}
```

> Prior to Rust 1.42, panics like this `unwrap()` printed a location in libcore:

```
$ rustc +1.41.0 example.rs; example.exe
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value',...core\macros\mod.rs:15:40
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
```

> As of 1.42, we get a much more helpful message:

```
$ rustc +1.42.0 example.rs; example.exe
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', example.rs:3:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
```

> These error messages are achieved through a combination of changes to `panic!` internals to make use of `core::panic::Location::caller` and a number of `#[track_caller]` annotations in the standard library which propagate caller information.

The attribute adds an implicit caller location argument to the ABI of annotated functions, but does not affect the type or MIR of the function. We implement the feature entirely in codegen and in the const evaluator.

## Bottom Line

This PR stabilizes the use of `#[track_caller]` everywhere, including traits and extern blocks. It also stabilizes `core::panic::Location::caller`, although the use of that function in a const context remains gated by `#![feature(const_caller_location)]`.

The implementation for the feature already changed the output of panic messages for a number of std functions, as described in the [1.42 release announcement]. The attribute's use in `Index` and `IndexMut` traits is visible to users since 1.44.

## Tests

All of the tests for this feature live under [src/test/ui/rfc-2091-track-caller][tests] in the repo.

Noteworthy cases:

* [use of attr in std]
  * validates user-facing benefit of the feature
* [trait attribute inheritance]
  * covers subtle behavior designed during implementation and not RFC'd
* [const/codegen equivalence]
  * this was the result of a suspected edge case and investigation
* [diverging function support]
  * covers an unresolved question from the RFC
* [fn pointers and shims]
  * covers important potential sources of unsoundness

## Documentation

The rustc-dev-guide now has a chapter on [Implicit Caller Location][dev-guide].

I have an [open PR to the reference][attr-reference-pr] documenting the attribute.

The intrinsic's [wrapper] includes some examples as well.

## Implementation History

* 2019-10-02: [`#[track_caller]` feature gate (RFC 2091 1/N) rust-lang#65037](rust-lang#65037)
  * Picked up the patch that @ayosec had started on the feature gate.
* 2019-10-13: [Add `Instance::resolve_for_fn_ptr` (RFC 2091 rust-lang#2/N) rust-lang#65182](rust-lang#65182)
* 2019-10-20: ~~[WIP Add MIR argument for #[track_caller] (RFC 2091 3/N) rust-lang#65258](rust-lang#65258
  * Abandoned approach to send location as a MIR argument.
* 2019-10-28: [`std::panic::Location` is a lang_item, add `core::intrinsics::caller_location` (RFC 2091 3/N) rust-lang#65664](rust-lang#65664)
* 2019-12-07: [Implement #[track_caller] attribute. (RFC 2091 4/N) rust-lang#65881](rust-lang#65881)
* 2020-01-04: [libstd uses `core::panic::Location` where possible. rust-lang#67137](rust-lang#67137)
* 2020-01-08: [`Option::{expect,unwrap}` and `Result::{expect, expect_err, unwrap, unwrap_err}` have `#[track_caller]` rust-lang#67887](rust-lang#67887)
* 2020-01-20: [Fix #[track_caller] and function pointers rust-lang#68302](rust-lang#68302) (fixed rust-lang#68178)
* 2020-03-23: [#[track_caller] in traits rust-lang#69251](rust-lang#69251)
* 2020-03-24: [#[track_caller] on core::ops::{Index, IndexMut}. rust-lang#70234](rust-lang#70234)
* 2020-04-08 [Support `#[track_caller]` on functions in `extern "Rust" { ... }` rust-lang#70916](rust-lang#70916)

## Unresolveds

### From the RFC

> Currently the RFC simply prohibit applying #[track_caller] to trait methods as a future-proofing
> measure.

**Resolved.** See the dev-guide documentation and the tests section above.

> Diverging functions should be supported.

**Resolved.** See the tests section above.

> The closure foo::{{closure}} should inherit most attributes applied to the function foo, ...

**Resolved.** This unknown was related to specifics of the implementation which were made irrelevant by the final implementation.

### Binary Size

I [instrumented track_caller to use custom sections][measure-size] in a local build and discovered relatively minor binary size usage for the feature overall. I'm leaving the issue open to discuss whether we want to upstream custom section support.

There's an [open issue to discuss mitigation strategies][mitigate-size]. Some decisions remain about the "right" strategies to reduce size without overly constraining the compiler implementation. I'd be excited to see someone carry that work forward but my opinion is that we shouldn't block stabilization on implementing compiler flags for redaction.

### Specialization

There's an [open issue][specialization] on the semantics of the attribute in specialization chains. I'm inclined to move forward with stabilization without an exact resolution here given that specialization is itself unstable, but I also think it should be an easy question to resolve.

### Location only points to the start of a call span

rust-lang#69977 was resolved by rust-lang#73182, and the next step should probably be to [extend `Location` with a notion of the end of a call](rust-lang#73554).

### Regression of std's panic messages

rust-lang#70963 should be resolved by serializing span hygeine to crate metadata: rust-lang#68686.

[2091]: https://github.com/rust-lang/rfcs/blob/master/text/2091-inline-semantic.md
[dev-guide]: https://rustc-dev-guide.rust-lang.org/codegen/implicit-caller-location.html
[specialization]: rust-lang#70293
[measure-size]: rust-lang#70579
[mitigate-size]: rust-lang#70580
[attr-reference-pr]: rust-lang/reference#742
[wrapper]: https://doc.rust-lang.org/nightly/core/panic/struct.Location.html#method.caller
[tests]: https://github.com/rust-lang/rust/tree/master/src/test/ui/rfc-2091-track-caller
[const/codegen equivalence]: https://github.com/rust-lang/rust/blob/master/src/test/ui/rfc-2091-track-caller/caller-location-fnptr-rt-ctfe-equiv.rs
[diverging function support]: https://github.com/rust-lang/rust/blob/master/src/test/ui/rfc-2091-track-caller/diverging-caller-location.rs
[use of attr in std]: https://github.com/rust-lang/rust/blob/master/src/test/ui/rfc-2091-track-caller/std-panic-locations.rs
[fn pointers and shims]: https://github.com/rust-lang/rust/blob/master/src/test/ui/rfc-2091-track-caller/tracked-fn-ptr-with-arg.rs
[trait attribute inheritance]: https://github.com/rust-lang/rust/blob/master/src/test/ui/rfc-2091-track-caller/tracked-trait-impls.rs
[1.42 release announcement]: https://blog.rust-lang.org/2020/03/12/Rust-1.42.html#useful-line-numbers-in-option-and-result-panic-messages
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants