Files
rust/tests/ui/consts
Trevor Gross d47f8ade58 Rollup merge of #144649 - estebank:issue-144602, r=lcnr
Account for bare tuples and `Pin` methods in field searching logic

When looking for the field names and types of a given type, account for tuples. This allows suggestions for incorrectly nested field accesses and field name typos to trigger as intended. Previously these suggestions only worked on `ty::Adt`, including tuple structs which are no different to tuples, so they should behave the same in suggestions.

When suggesting field access which would encounter a method not found, do not suggest pinning when those methods are on `impl Pin` itself.

```
error[E0599]: no method named `get_ref` found for tuple `(BufReader<File>,)` in the current scope
  --> $DIR/missing-field-access.rs:11:15
   |
LL |     let x = f.get_ref();
   |               ^^^^^^^ method not found in `(BufReader<File>,)`
   |
help: one of the expressions' fields has a method of the same name
   |
LL |     let x = f.0.get_ref();
   |               ++
```
instead of
```
error[E0599]: no method named `get_ref` found for tuple `(BufReader<File>,)` in the current scope
  --> $DIR/missing-field-access.rs:11:15
   |
LL |     let x = f.get_ref();
   |               ^^^^^^^ method not found in `(BufReader<File>,)`
   |
help: consider pinning the expression
   |
LL ~     let mut pinned = std::pin::pin!(f);
LL ~     let x = pinned.as_ref().get_ref();
   |
```

Fix rust-lang/rust#144602.
2025-08-08 14:22:46 -05:00
..
2025-07-21 12:49:45 +03:00
2024-09-15 10:20:47 +02:00
2024-01-13 12:46:58 -05:00
2024-09-15 09:51:32 +02:00
2024-08-18 19:46:53 +02:00
2023-01-11 09:32:08 +00:00
2024-02-07 10:42:01 +08:00
2024-11-22 02:32:26 +00:00
2025-02-27 20:02:25 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2024-11-22 02:32:26 +00:00
2024-11-22 02:32:26 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2025-07-21 12:49:45 +03:00
2023-01-11 09:32:08 +00:00
2023-11-12 04:33:19 +00:00
2025-07-08 14:36:43 +00:00
2024-02-25 12:03:48 +01:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2024-04-21 15:43:43 -03:00
2024-04-21 15:43:43 -03:00
2023-04-16 11:38:52 +00:00
2023-07-27 15:51:02 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2025-07-13 13:50:01 +00:00
2023-07-27 15:51:02 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2024-12-25 10:36:32 +01:00
2025-07-21 09:11:21 +00:00
2025-07-21 09:11:21 +00:00
2023-01-11 09:32:08 +00:00
2024-10-07 16:29:52 +00:00
2025-08-05 19:34:46 +05:00
2024-09-15 09:51:32 +02:00
2025-02-23 23:11:00 +07:00
2023-01-11 09:32:08 +00:00
2023-01-15 19:46:20 +00:00
2025-06-13 09:20:48 +02:00
2025-06-13 09:20:48 +02:00
2024-11-16 22:50:22 +01:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2025-01-06 17:54:59 +01:00
2025-01-06 17:54:59 +01:00
2024-09-14 18:07:06 +02:00