Skip to content

Commit

Permalink
track_caller tests account for incomplete feature warning.
Browse files Browse the repository at this point in the history
  • Loading branch information
anp committed Oct 3, 2019
1 parent 8ac9104 commit 9e301d1
Show file tree
Hide file tree
Showing 12 changed files with 54 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/test/ui/rfc-2091-track-caller/error-odd-syntax.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![feature(track_caller)]
#![feature(track_caller)] //~ WARN the feature `track_caller` is incomplete

#[track_caller(1)]
fn f() {}
Expand Down
8 changes: 8 additions & 0 deletions src/test/ui/rfc-2091-track-caller/error-odd-syntax.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,13 @@ error: malformed `track_caller` attribute input
LL | #[track_caller(1)]
| ^^^^^^^^^^^^^^^^^^ help: must be of the form: `#[track_caller]`

warning: the feature `track_caller` is incomplete and may cause the compiler to crash
--> $DIR/error-odd-syntax.rs:1:12
|
LL | #![feature(track_caller)]
| ^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default

error: aborting due to previous error

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![feature(track_caller)]
#![feature(track_caller)] //~ WARN the feature `track_caller` is incomplete

#[track_caller]
extern "C" fn f() {}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
warning: the feature `track_caller` is incomplete and may cause the compiler to crash
--> $DIR/error-with-invalid-abi.rs:1:12
|
LL | #![feature(track_caller)]
| ^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default

error[E0737]: rust ABI is required to use `#[track_caller]`
--> $DIR/error-with-invalid-abi.rs:3:1
|
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/rfc-2091-track-caller/error-with-naked.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![feature(naked_functions, track_caller)]
#![feature(naked_functions, track_caller)] //~ WARN the feature `track_caller` is incomplete

#[track_caller]
#[naked]
Expand Down
8 changes: 8 additions & 0 deletions src/test/ui/rfc-2091-track-caller/error-with-naked.stderr
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
warning: the feature `track_caller` is incomplete and may cause the compiler to crash
--> $DIR/error-with-naked.rs:1:29
|
LL | #![feature(naked_functions, track_caller)]
| ^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default

error[E0736]: cannot use `#[track_caller]` with `#[naked]`
--> $DIR/error-with-naked.rs:3:1
|
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/rfc-2091-track-caller/error-with-trait-fns.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![feature(track_caller)]
#![feature(track_caller)] //~ WARN the feature `track_caller` is incomplete

trait Trait {
#[track_caller]
Expand Down
8 changes: 8 additions & 0 deletions src/test/ui/rfc-2091-track-caller/error-with-trait-fns.stderr
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
warning: the feature `track_caller` is incomplete and may cause the compiler to crash
--> $DIR/error-with-trait-fns.rs:1:12
|
LL | #![feature(track_caller)]
| ^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default

error[E0738]: `#[track_caller]` is not supported for trait items yet.
--> $DIR/error-with-trait-fns.rs:4:5
|
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/rfc-2091-track-caller/only-for-fns.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![feature(track_caller)]
#![feature(track_caller)] //~ WARN the feature `track_caller` is incomplete

#[track_caller]
struct S;
Expand Down
9 changes: 8 additions & 1 deletion src/test/ui/rfc-2091-track-caller/only-for-fns.stderr
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
warning: the feature `track_caller` is incomplete and may cause the compiler to crash
--> $DIR/only-for-fns.rs:1:12
|
LL | #![feature(track_caller)]
| ^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default

error[E0735]: attribute should be applied to function
--> $DIR/only-for-fns.rs:3:1
|
Expand All @@ -8,4 +16,3 @@ LL | struct S;

error: aborting due to previous error

For more information about this error, try `rustc --explain E0735`.
2 changes: 1 addition & 1 deletion src/test/ui/rfc-2091-track-caller/pass.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// run-pass
#![feature(track_caller)]
#![feature(track_caller)] //~ WARN the feature `track_caller` is incomplete

#[track_caller]
fn f() {}
Expand Down
8 changes: 8 additions & 0 deletions src/test/ui/rfc-2091-track-caller/pass.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
warning: the feature `track_caller` is incomplete and may cause the compiler to crash
--> $DIR/pass.rs:2:12
|
LL | #![feature(track_caller)]
| ^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default

0 comments on commit 9e301d1

Please sign in to comment.