Files
rust/tests/ui
bors 689511047a Auto merge of #112366 - lukas-code:test, r=Nilstrieb
`#[test]` function signature verification improvements

This PR contains two improvements to the expansion of the `#[test]` macro.

The first one fixes https://github.com/rust-lang/rust/issues/112360 by correctly recovering item statements if the signature verification fails.

The second one forbids non-lifetime generics on `#[test]` functions. These were previously allowed if the function returned `()`, but always caused an inference error:

before:
```text
error[E0282]: type annotations needed
 --> src/lib.rs:2:1
  |
1 | #[test]
  | ------- in this procedural macro expansion
2 | fn foo<T>() {}
  | ^^^^^^^^^^^^^^ cannot infer type
```

after:
```text
error: functions used as tests can not have any non-lifetime generic parameters
 --> src/lib.rs:2:1
  |
2 | fn foo<T>() {}
  | ^^^^^^^^^^^^^^
```

Also includes some basic tests for test function signature verification, because I couldn't find any (???) in the test suite.
2023-06-19 13:39:46 +00:00
..
2023-04-30 00:06:26 +08:00
2023-01-30 20:12:19 +00:00
2023-01-15 19:46:20 +00:00
2023-06-12 20:24:48 +08:00
2023-04-16 23:09:57 +00:00
2023-05-24 19:35:59 -03:00
2023-05-30 12:40:35 +02:00
2023-05-30 13:03:40 +02:00
2023-04-03 09:24:11 +02:00
2023-06-12 20:24:48 +08:00
2023-05-08 17:58:01 -03:00
2023-05-26 06:55:06 +10:00
2023-05-04 18:06:07 +00:00
2023-05-11 12:14:57 -07:00
2023-05-08 17:58:01 -03:00
2023-06-13 21:54:11 +00:00
2023-01-30 20:12:19 +00:00
2023-06-10 14:46:11 -04:00
2023-05-25 17:40:46 +00:00
2023-06-12 20:24:48 +08:00
2023-06-15 06:50:56 -04:00
2023-02-16 11:42:35 -03:00
2023-05-08 03:36:30 +00:00
2023-05-12 00:10:52 +00:00
2023-04-29 13:01:46 +01:00
2023-06-15 01:55:37 +00:00
2023-06-12 20:24:48 +08:00
2023-04-03 09:24:11 +02:00
2023-05-05 14:58:52 -07:00
2023-06-06 18:43:20 +00:00
2023-04-29 13:01:46 +01:00
2023-04-19 19:13:45 +00:00
2023-04-13 22:10:26 -05:00
2023-05-08 03:36:30 +00:00
2023-06-05 21:00:08 +00:00
2023-05-29 12:07:41 -03:00
2023-03-29 18:04:44 -04:00
2023-05-26 18:55:02 +01:00
2023-04-26 21:02:56 +02:00
2023-02-07 19:17:24 +00:00
2023-06-12 20:24:48 +08:00
2023-05-01 16:15:17 +08:00
2023-04-29 13:01:46 +01:00
2023-05-16 20:30:48 +00:00
2023-05-12 00:10:52 +00:00
2023-05-24 19:35:59 -03:00
2023-01-15 19:46:20 +00:00
2023-01-15 19:46:20 +00:00
2023-03-08 00:00:18 +00:00
2023-04-13 22:10:26 -05:00
2023-04-13 22:10:26 -05:00
2023-03-08 00:00:18 +00:00
2023-03-08 00:00:18 +00:00
2023-01-15 19:46:20 +00:00