Matthias Krüger
2128efd87f
Rollup merge of #115313 - gurry:issue-114918-cycle-detected, r=compiler-errors
...
Make `get_return_block()` return `Some` only for HIR nodes in body
Fixes #114918
The issue occurred while compiling the following input:
```rust
fn uwu() -> [(); { () }] {
loop {}
}
```
It was caused by the code below trying to suggest a missing return type which resulted in a const eval cycle: 1bd043098e/compiler/rustc_hir_typeck/src/fn_ctxt/suggestions.rs (L68-L75)
The root cause was `get_return_block()` returning an `Fn` node for a node in the return type (i.e. the second `()` in the return type `[(); { () }]` of the input) although it is supposed to do so only for nodes that lie in the body of the function and return `None` otherwise (at least as per my understanding).
The PR fixes the issue by fixing this behaviour of `get_return_block()`.
2023-08-30 07:18:11 +02:00
..
2023-08-24 20:44:08 +03:00
2023-08-30 07:40:08 +05:30
2023-07-22 15:27:21 +00:00
2023-07-22 15:27:21 +00:00
2023-01-30 20:12:19 +00:00
2023-01-12 22:04:30 +00:00
2023-04-18 19:25:57 +00:00
2023-05-08 03:36:30 +00:00
2023-04-22 19:30:47 +00:00
2023-04-22 19:30:47 +00:00
2023-03-02 18:27:06 +00:00
2023-05-08 03:36:30 +00:00
2023-01-23 17:02:50 +00:00
2023-04-12 23:05:55 +00:00
2023-01-30 20:12:19 +00:00
2023-01-30 20:12:19 +00:00
2023-05-12 20:34:51 +00:00
2023-05-12 20:34:51 +00:00
2023-06-12 00:35:30 +00:00
2023-06-12 00:35:30 +00:00
2023-07-25 10:09:26 +01:00
2023-07-25 10:09:26 +01:00
2023-05-24 19:35:59 -03:00
2023-05-24 19:35:59 -03:00
2023-05-24 19:35:59 -03:00
2023-05-24 19:35:59 -03:00
2023-02-16 11:42:35 -03:00
2023-02-16 11:42:35 -03:00
2023-05-08 03:36:30 +00:00
2023-08-24 20:44:08 +03:00
2023-08-24 20:44:08 +03:00
2023-03-01 16:57:11 +00:00
2023-04-12 22:50:10 +00:00
2023-01-30 20:12:19 +00:00
2023-01-30 20:12:19 +00:00
2023-02-16 11:42:35 -03:00
2023-02-16 11:42:35 -03:00
2023-01-11 21:38:54 +00:00
2023-01-30 20:12:19 +00:00
2023-01-30 20:12:19 +00:00
2023-02-23 10:27:06 -07:00
2023-02-23 10:27:06 -07:00
2023-06-27 23:31:06 +00:00
2023-01-30 20:12:19 +00:00
2023-02-22 08:40:47 -07:00
2023-06-26 08:56:32 +00:00
2023-02-03 11:44:23 +00:00
2023-02-03 11:44:23 +00:00
2023-06-08 16:30:05 +00:00
2023-02-06 13:02:04 +08:00
2023-02-13 16:23:23 +01:00
2023-06-27 23:31:06 +00:00
2023-04-12 18:03:11 -04:00
2023-08-26 01:07:05 +00:00
2023-02-28 07:55:19 +00:00
2023-02-28 07:57:17 +00:00
2023-01-30 20:12:19 +00:00
2023-02-28 07:55:19 +00:00
2023-02-28 07:55:19 +00:00
2023-01-30 20:12:19 +00:00
2023-01-30 20:12:19 +00:00
2023-02-22 21:52:26 +00:00
2023-03-12 13:19:46 +00:00
2023-03-12 13:19:46 +00:00
2023-05-30 17:57:37 +08:00
2023-05-30 17:57:37 +08:00
2023-01-23 16:53:23 +00:00
2023-01-23 16:53:23 +00:00
2023-02-07 23:08:25 +00:00
2023-04-12 23:20:11 +00:00
2023-06-28 17:54:20 +08:00
2023-06-28 17:54:20 +08:00
2023-06-28 17:54:20 +08:00
2023-04-11 17:17:32 +00:00
2023-04-11 17:17:32 +00:00
2023-06-28 17:54:20 +08:00
2023-06-28 17:54:20 +08:00
2023-06-28 17:54:20 +08:00
2023-06-09 10:01:16 +08:00
2023-06-09 10:01:16 +08:00
2023-08-04 13:17:39 +02:00
2023-06-08 02:38:12 +08:00
2023-06-08 02:38:12 +08:00
2023-08-05 09:04:47 +08:00
2023-08-05 09:04:47 +08:00
2023-06-28 17:51:01 +00:00
2023-06-28 17:51:01 +00:00
2023-04-02 19:42:30 -04:00
2023-04-02 19:42:30 -04:00
2023-04-22 00:51:49 -04:00
2023-06-09 20:05:46 +08:00
2023-06-09 20:05:46 +08:00
2023-06-09 20:05:46 +08:00
2023-02-14 20:22:10 +00:00
2023-05-04 11:22:40 +01:00
2023-05-04 11:22:40 +01:00
2023-01-30 20:12:19 +00:00
2023-01-30 20:12:19 +00:00
2023-06-02 16:38:08 +00:00
2023-06-02 16:38:08 +00:00
2023-06-02 16:38:08 +00:00
2023-06-02 16:38:08 +00:00
2023-02-14 20:22:10 +00:00
2023-04-02 19:42:30 -04:00
2023-04-02 19:42:30 -04:00
2023-04-02 19:42:30 -04:00
2023-04-02 19:42:30 -04:00
2023-04-02 19:42:30 -04:00
2023-04-02 19:42:30 -04:00
2023-04-02 19:42:30 -04:00
2023-04-02 19:42:30 -04:00
2023-06-11 00:27:03 +00:00
2023-06-11 00:27:03 +00:00
2023-06-11 00:27:03 +00:00
2023-06-11 00:27:03 +00:00
2023-06-11 00:27:03 +00:00
2023-06-11 00:27:03 +00:00
2023-02-23 10:27:06 -07:00
2023-02-23 10:27:06 -07:00
2023-02-23 10:27:06 -07:00
2023-02-23 10:27:06 -07:00
2023-01-30 20:12:19 +00:00
2023-01-30 20:12:19 +00:00
2023-05-01 15:45:28 +00:00
2023-05-01 15:45:28 +00:00
2023-08-28 03:16:48 -07:00
2023-08-28 03:16:48 -07:00
2023-08-28 03:16:48 -07:00
2023-08-28 03:16:48 -07:00
2023-08-28 03:16:48 -07:00
2023-04-02 19:42:30 -04:00
2023-04-02 19:42:30 -04:00
2023-04-02 19:42:30 -04:00
2023-04-02 19:42:30 -04:00