about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorAyush Kumar Mishra <ayush.k.mishra@xcelenergy.com>2020-03-10 08:33:14 +0530
committerAyush Kumar Mishra <ayush.k.mishra@xcelenergy.com>2020-03-10 08:33:14 +0530
commit6f2c01bcfbdcaa9686ceb37cce29564a2d662828 (patch)
tree2c737c2d4c8abb3fed2411cde0c1eb1b3d48f3c9 /src
parent3dbade652ed8ebac70f903e01f51cd92c4e4302c (diff)
downloadrust-6f2c01bcfbdcaa9686ceb37cce29564a2d662828.tar.gz
rust-6f2c01bcfbdcaa9686ceb37cce29564a2d662828.zip
Add long error explanation for E0739
Diffstat (limited to 'src')
-rw-r--r--src/librustc_error_codes/error_codes.rs2
-rw-r--r--src/librustc_error_codes/error_codes/E0739.md13
-rw-r--r--src/test/ui/rfc-2091-track-caller/only-for-fns.stderr1
3 files changed, 15 insertions, 1 deletions
diff --git a/src/librustc_error_codes/error_codes.rs b/src/librustc_error_codes/error_codes.rs
index 11d1209923f..0e14e2196ca 100644
--- a/src/librustc_error_codes/error_codes.rs
+++ b/src/librustc_error_codes/error_codes.rs
@@ -411,6 +411,7 @@ E0735: include_str!("./error_codes/E0735.md"),
 E0736: include_str!("./error_codes/E0736.md"),
 E0737: include_str!("./error_codes/E0737.md"),
 E0738: include_str!("./error_codes/E0738.md"),
+E0739: include_str!("./error_codes/E0739.md"),
 E0740: include_str!("./error_codes/E0740.md"),
 E0741: include_str!("./error_codes/E0741.md"),
 E0742: include_str!("./error_codes/E0742.md"),
@@ -610,5 +611,4 @@ E0748: include_str!("./error_codes/E0748.md"),
     E0722, // Malformed `#[optimize]` attribute
     E0724, // `#[ffi_returns_twice]` is only allowed in foreign functions
     E0726, // non-explicit (not `'_`) elided lifetime in unsupported position
-    E0739, // invalid track_caller application/syntax
 }
diff --git a/src/librustc_error_codes/error_codes/E0739.md b/src/librustc_error_codes/error_codes/E0739.md
new file mode 100644
index 00000000000..d3016f53a94
--- /dev/null
+++ b/src/librustc_error_codes/error_codes/E0739.md
@@ -0,0 +1,13 @@
+`#[track_caller]` can not be applied on struct. 
+
+Erroneous code example:
+
+```compile_fail,E0739
+#![feature(track_caller)]
+#[track_caller]
+struct Bar {
+    a: u8,
+}
+```
+
+[RFC 2091]: https://github.com/rust-lang/rfcs/blob/master/text/2091-inline-semantic.md
diff --git a/src/test/ui/rfc-2091-track-caller/only-for-fns.stderr b/src/test/ui/rfc-2091-track-caller/only-for-fns.stderr
index 7becb9c5b60..c2fb8fa1eb6 100644
--- a/src/test/ui/rfc-2091-track-caller/only-for-fns.stderr
+++ b/src/test/ui/rfc-2091-track-caller/only-for-fns.stderr
@@ -8,3 +8,4 @@ LL | struct S;
 
 error: aborting due to previous error
 
+For more information about this error, try `rustc --explain E0739`.