bors
3c0f019b3c
Auto merge of #125852 - bvanjoi:improve-tip-for-invisible-trait, r=compiler-errors
...
improve tip for inaccessible traits
Improve the tips when the candidate method is from an inaccessible trait.
For example:
```rs
mod m {
trait Trait {
fn f() {}
}
impl<T> Trait for T {}
}
fn main() {
struct S;
S::f();
}
```
The difference between before and now is:
```diff
error[E0599]: no function or associated item named `f` found for struct `S` in the current scope
--> ./src/main.rs:88:6
|
LL | struct S;
| -------- function or associated item `f` not found for this struct
LL | S::f();
| ^ function or associated item not found in `S`
|
= help: items from traits can only be used if the trait is implemented and in scope
- help: trait `Trait` which provides `f` is implemented but not in scope; perhaps you want to import it
+ help: trait `crate::m::Trait` which provides `f` is implemented but not reachable
|
- LL + use crate::m::Trait;
|
```
2024-06-19 06:19:22 +00:00
..
2024-05-31 22:45:27 +02:00
2024-05-04 11:30:38 +02:00
2024-03-15 13:37:41 +00:00
2024-04-15 08:54:11 -04:00
2024-06-13 16:12:23 +01:00
2024-06-17 10:57:52 +00:00
2024-06-12 03:57:19 -07:00
2024-06-12 19:32:31 -04:00
2024-06-15 19:51:35 +02:00
2024-06-19 01:51:38 +01:00
2024-06-06 20:27:25 -05:00
2024-06-12 20:57:23 -04:00
2024-05-20 19:55:59 -07:00
2024-05-28 12:31:33 +02:00
2024-05-02 19:42:31 -04:00
2024-06-12 12:34:47 +00:00
2024-06-17 15:21:07 +10:00
2024-04-24 22:21:15 +00:00
2024-04-11 16:41:41 +00:00
2024-04-16 18:15:37 -04:00
2024-05-11 08:24:26 +05:30
2024-05-21 20:16:39 +00:00
2024-06-12 14:26:24 -04:00
2024-06-10 16:28:05 +05:30
2024-05-24 21:53:39 -04:00
2024-04-27 10:54:31 +03:00
2024-06-17 10:57:52 +00:00
2024-06-12 19:03:37 -04:00
2024-04-07 17:06:15 +00:00
2024-05-10 09:16:27 +02:00
2024-05-28 11:55:20 +00:00
2024-06-17 10:57:52 +00:00
2024-05-13 07:59:16 +02:00
2024-06-17 04:53:54 +01:00
2024-06-19 01:51:38 +01:00
2024-06-18 21:07:37 +10:00
2024-03-18 16:08:58 +00:00
2024-06-04 22:50:35 +02:00
2024-06-05 09:39:14 -07:00
2024-06-19 01:51:36 +01:00
2024-05-28 12:31:33 +02:00
2024-05-10 09:16:27 +02:00
2024-04-21 15:43:43 -03:00
2024-06-07 20:14:28 +02:00
2024-04-23 20:56:52 +02:00
2024-06-12 19:03:37 -04:00
2024-04-25 10:48:11 +03:00
2024-06-16 03:41:57 -04:00
2024-06-18 04:14:43 +08:00
2024-04-11 16:41:41 +00:00
2024-04-22 11:51:50 -04:00
2024-05-09 14:47:09 +10:00
2024-06-13 21:47:43 -04:00
2024-04-21 15:43:43 -03:00
2024-03-17 21:59:40 +00:00
2024-05-30 22:52:33 +02:00
2024-04-27 10:54:31 +03:00
2024-05-29 11:38:47 -04:00
2024-05-29 22:26:54 +00:00
2024-05-29 22:26:54 +00:00
2024-06-11 09:14:34 +01:00
2024-06-19 01:51:38 +01:00
2024-05-20 19:55:59 -07:00
2024-04-14 21:34:14 +05:30
2024-06-03 08:14:03 +00:00
2024-05-20 19:55:59 -07:00
2024-05-16 21:08:42 -04:00
2024-04-30 12:46:59 +05:30
2024-05-20 19:55:59 -07:00
2024-05-20 19:55:59 -07:00
2024-04-12 20:57:07 +00:00
2024-06-14 08:35:48 +02:00
2024-05-24 00:42:32 +02:00
2024-06-05 20:08:00 -04:00
2024-05-02 19:42:31 -04:00
2024-06-12 19:10:02 -04:00
2024-06-13 20:22:21 +00:00
2024-05-24 11:20:33 -04:00
2024-06-17 22:35:25 -04:00
2024-04-03 22:32:46 +01:00
2024-06-17 11:29:43 +08:00
2024-03-29 18:22:44 -07:00
2024-06-01 09:40:46 +08:00
2024-06-17 10:57:52 +00:00
2024-06-07 08:33:58 +00:00
2024-06-17 21:16:15 +10:00
2024-04-15 08:54:11 -04:00
2024-06-03 08:14:03 +00:00
2024-04-25 07:58:31 +02:00
2024-06-07 15:55:36 +10:00
2024-06-17 22:35:25 -04:00
2024-06-12 12:34:47 +00:00
2024-06-12 20:57:23 -04:00
2024-04-17 13:00:43 +02:00
2024-05-28 11:55:20 +00:00
2024-06-12 12:34:47 +00:00
2024-04-12 17:45:15 +01:00
2024-04-18 21:38:55 -07:00
2024-06-18 04:14:43 +08:00
2024-06-03 10:45:16 +00:00
2024-06-18 20:30:25 +10:00
2024-04-24 08:05:29 +00:00
2024-05-22 19:47:32 +08:00
2024-04-29 14:53:38 +02:00
2024-04-25 10:47:24 +08:00
2024-06-13 22:12:26 -03:00
2024-05-25 01:17:55 +00:00
2024-05-28 12:31:33 +02:00
2024-03-31 20:44:30 -04:00
2024-06-06 04:17:26 +02:00
2024-05-20 11:13:10 -04:00
2024-06-13 10:41:53 +00:00
2024-06-12 11:10:50 +00:00
2024-06-12 12:34:47 +00:00
2024-04-21 20:10:12 -04:00
2024-04-07 17:38:07 -03:00
2024-04-24 22:21:15 +00:00
2024-04-25 04:54:25 +08:00
2024-06-13 20:22:21 +00:00
2024-06-16 03:41:57 -04:00
2024-06-18 04:14:43 +08:00
2024-06-16 03:41:57 -04:00
2024-03-20 17:29:58 +00:00
2024-06-03 09:49:04 -04:00
2024-06-08 18:17:55 +02:00
2024-06-12 12:34:47 +00:00
2024-04-24 08:05:29 +00:00
2024-06-11 15:47:00 +02:00
2024-05-28 12:31:12 +02:00
2024-04-09 13:58:52 +00:00
2024-06-17 22:35:25 -04:00
2024-06-13 06:16:12 +00:00
2024-06-03 13:16:56 +00:00
2024-04-11 17:53:27 -04:00
2024-04-24 08:05:29 +00:00
2024-06-17 10:09:27 +00:00
2024-06-13 09:49:15 -07:00
2024-05-20 19:55:59 -07:00
2024-06-11 09:14:34 +01:00
2024-05-20 19:55:59 -07:00
2024-05-03 15:56:59 +02:00
2024-03-20 22:28:56 -04:00
2024-04-21 15:43:43 -03:00
2024-06-05 23:20:09 +08:00
2024-05-20 19:55:59 -07:00
2024-06-13 20:22:21 +00:00
2024-06-18 21:06:53 +00:00
2024-06-13 20:22:21 +00:00
2024-05-28 12:31:12 +02:00
2024-06-13 20:22:21 +00:00
2024-05-23 09:07:59 +08:00
2024-06-12 17:51:18 +02:00
2024-05-19 20:09:03 -07:00
2024-05-20 11:13:33 -04:00
2024-06-12 08:53:59 +00:00
2024-05-04 11:30:38 +02:00
2024-06-02 05:06:47 -07:00
2024-05-20 20:30:44 +02:00
2024-06-12 12:34:47 +00:00
2024-06-07 15:58:50 -04:00
2024-03-31 15:38:22 +02:00
2024-03-25 14:19:07 +00:00
2024-06-05 21:54:22 +02:00
2024-06-17 10:55:42 +00:00
2024-05-04 00:32:27 +00:00
2024-04-28 16:10:12 -04:00
2024-04-28 16:10:12 -04:00
2024-04-27 10:54:31 +03:00
2024-05-01 09:29:33 +05:30
2024-06-05 23:20:09 +08:00
2024-06-18 21:06:53 +00:00
2024-05-14 06:16:48 -04:00
2024-05-24 17:44:37 -07:00
2024-05-09 14:47:09 +10:00
2024-04-17 09:34:39 -04:00
2024-05-23 13:44:56 +02:00
2024-05-20 19:55:59 -07:00
2024-04-09 13:58:52 +00:00
2024-03-22 20:31:28 +01:00
2024-06-19 06:19:22 +00:00
2024-06-14 21:11:08 +00:00
2024-04-25 10:51:54 -04:00
2024-04-11 16:41:41 +00:00
2024-04-11 16:41:41 +00:00
2024-06-16 03:41:57 -04:00
2024-03-15 13:37:41 +00:00
2024-06-12 12:34:47 +00:00
2024-03-20 09:49:57 +00:00
2024-06-16 03:41:57 -04:00
2024-04-10 00:41:27 +00:00
2024-06-16 03:41:57 -04:00
2024-06-12 12:34:47 +00:00
2024-05-29 22:26:54 +00:00
2024-03-20 17:29:58 +00:00
2024-04-10 20:36:14 +00:00
2024-04-24 22:21:15 +00:00
2024-05-20 19:55:59 -07:00
2024-06-07 08:33:58 +00:00
2024-05-29 22:26:54 +00:00
2024-05-29 09:34:16 -07:00
2024-03-24 09:34:11 +01:00
2024-06-03 07:25:32 +02:00
2024-05-21 20:16:39 +00:00
2024-04-27 10:54:31 +03:00
2024-05-09 14:47:09 +10:00
2024-03-22 11:27:34 -04:00
2024-06-05 22:25:42 +01:00
2024-06-03 09:49:04 -04:00
2024-05-29 13:04:28 +00:00
2024-06-13 12:55:55 +02:00
2024-03-27 14:02:16 +00:00
2024-04-17 13:00:43 +02:00
2024-04-11 16:41:41 +00:00
2024-04-11 16:41:41 +00:00
2024-06-11 15:47:00 +02:00
2024-06-11 15:47:00 +02:00
2024-04-07 01:16:45 +02:00
2024-04-07 01:16:45 +02:00
2024-05-28 12:31:33 +02:00
2024-04-07 01:16:45 +02:00
2024-04-15 08:54:11 -04:00
2024-04-15 08:54:11 -04:00
2024-04-11 16:41:42 +00:00
2024-05-04 11:30:38 +02:00
2024-04-17 13:00:43 +02:00
2024-04-17 13:00:43 +02:00
2024-05-20 11:13:10 -04:00
2024-04-24 08:05:29 +00:00
2024-05-11 15:13:18 +02:00