diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2020-03-17 13:27:56 +0100 |
|---|---|---|
| committer | Mazdak Farrokhzad <twingoow@gmail.com> | 2020-03-24 06:28:56 +0100 |
| commit | 397996420040fb7245f1f5e09a8ec441522183c0 (patch) | |
| tree | 38f8f3ac384706e13c5a6ad0b371a3971f8054d0 /src/test/ui/test-attrs | |
| parent | 0e0f9311dacad865c43953a1015ac00a010e19df (diff) | |
| download | rust-397996420040fb7245f1f5e09a8ec441522183c0.tar.gz rust-397996420040fb7245f1f5e09a8ec441522183c0.zip | |
defatalize expand_test_or_bench
Diffstat (limited to 'src/test/ui/test-attrs')
| -rw-r--r-- | src/test/ui/test-attrs/test-attr-non-associated-functions.rs | 8 | ||||
| -rw-r--r-- | src/test/ui/test-attrs/test-attr-non-associated-functions.stderr | 12 |
2 files changed, 18 insertions, 2 deletions
diff --git a/src/test/ui/test-attrs/test-attr-non-associated-functions.rs b/src/test/ui/test-attrs/test-attr-non-associated-functions.rs index e475f5b4a75..31e567c3960 100644 --- a/src/test/ui/test-attrs/test-attr-non-associated-functions.rs +++ b/src/test/ui/test-attrs/test-attr-non-associated-functions.rs @@ -6,7 +6,13 @@ struct A {} impl A { #[test] - fn new() -> A { //~ ERROR `#[test]` attribute is only allowed on non associated functions + fn new() -> A { + //~^ ERROR `#[test]` attribute is only allowed on non associated functions + A {} + } + #[test] + fn recovery_witness() -> A { + //~^ ERROR `#[test]` attribute is only allowed on non associated functions A {} } } diff --git a/src/test/ui/test-attrs/test-attr-non-associated-functions.stderr b/src/test/ui/test-attrs/test-attr-non-associated-functions.stderr index cb3ae51823e..a81b8f3980c 100644 --- a/src/test/ui/test-attrs/test-attr-non-associated-functions.stderr +++ b/src/test/ui/test-attrs/test-attr-non-associated-functions.stderr @@ -2,9 +2,19 @@ error: `#[test]` attribute is only allowed on non associated functions --> $DIR/test-attr-non-associated-functions.rs:9:5 | LL | / fn new() -> A { +LL | | LL | | A {} LL | | } | |_____^ -error: aborting due to previous error +error: `#[test]` attribute is only allowed on non associated functions + --> $DIR/test-attr-non-associated-functions.rs:14:5 + | +LL | / fn recovery_witness() -> A { +LL | | +LL | | A {} +LL | | } + | |_____^ + +error: aborting due to 2 previous errors |
