about summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-10-09 05:31:35 +0200
committerGitHub <noreply@github.com>2019-10-09 05:31:35 +0200
commitae5bb7e289b41a9266e6e560d6415caf905ecfeb (patch)
tree72b7859146805d664d0489a79907e7bb7a1ed465 /src/libsyntax
parent27240fe77b3e69e15a9095874f6b5e65a967e67f (diff)
parentcca58d1321b6de3098884d4af7bbff57f0f65101 (diff)
downloadrust-ae5bb7e289b41a9266e6e560d6415caf905ecfeb.tar.gz
rust-ae5bb7e289b41a9266e6e560d6415caf905ecfeb.zip
Rollup merge of #65037 - anp:track-caller, r=oli-obk
`#[track_caller]` feature gate (RFC 2091 1/N)

RFC text: https://github.com/rust-lang/rfcs/blob/master/text/2091-inline-semantic.md
Tracking issue: https://github.com/rust-lang/rust/issues/47809

I started with @ayosec's commit to add the feature gate with tests and rebased it onto current master. I fixed up some tidy lints and added a test.
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/feature_gate/active.rs4
-rw-r--r--src/libsyntax/feature_gate/builtin_attrs.rs1
2 files changed, 5 insertions, 0 deletions
diff --git a/src/libsyntax/feature_gate/active.rs b/src/libsyntax/feature_gate/active.rs
index 19ef430318d..94f0995566f 100644
--- a/src/libsyntax/feature_gate/active.rs
+++ b/src/libsyntax/feature_gate/active.rs
@@ -525,6 +525,9 @@ declare_features! (
     // Allows the use of raw-dylibs (RFC 2627).
     (active, raw_dylib, "1.40.0", Some(58713), None),
 
+    /// Enable accurate caller location reporting during panic (RFC 2091).
+    (active, track_caller, "1.40.0", Some(47809), None),
+
     // -------------------------------------------------------------------------
     // feature-group-end: actual feature gates
     // -------------------------------------------------------------------------
@@ -540,4 +543,5 @@ pub const INCOMPLETE_FEATURES: &[Symbol] = &[
     sym::or_patterns,
     sym::let_chains,
     sym::raw_dylib,
+    sym::track_caller,
 ];
diff --git a/src/libsyntax/feature_gate/builtin_attrs.rs b/src/libsyntax/feature_gate/builtin_attrs.rs
index c12d0ce06ff..ae23cc5cb93 100644
--- a/src/libsyntax/feature_gate/builtin_attrs.rs
+++ b/src/libsyntax/feature_gate/builtin_attrs.rs
@@ -324,6 +324,7 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
     ),
 
     gated!(ffi_returns_twice, Whitelisted, template!(Word), experimental!(ffi_returns_twice)),
+    gated!(track_caller, Whitelisted, template!(Word), experimental!(track_caller)),
 
     // ==========================================================================
     // Internal attributes: Stability, deprecation, and unsafe: