File: impl-trait.stderr

package info (click to toggle)
rust-ref-cast 1.0.23-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 256 kB
  • sloc: makefile: 2
file content (31 lines) | stat: -rw-r--r-- 1,344 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
error[E0106]: missing lifetime specifier
 --> tests/ui/impl-trait.rs:9:44
  |
9 |     pub fn ref_cast(s: impl AsRef<str>) -> &Self;
  |                                            ^ expected named lifetime parameter
  |
  = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from
help: consider using the `'static` lifetime, but this is uncommon unless you're returning a borrowed value from a `const` or a `static`
  |
9 |     pub fn ref_cast(s: impl AsRef<str>) -> &'static Self;
  |                                             +++++++
help: consider introducing a named lifetime parameter
  |
9 |     pub fn ref_cast<'a>(s: impl AsRef<str>) -> &'a Self;
  |                    ++++                        ~~~

error[E0562]: `impl Trait` is not allowed in paths
 --> tests/ui/impl-trait.rs:9:24
  |
9 |     pub fn ref_cast(s: impl AsRef<str>) -> &Self;
  |                        ^^^^^^^^^^^^^^^
  |
  = note: `impl Trait` is only allowed in arguments and return types of functions and methods

error[E0562]: `impl Trait` is not allowed in paths
  --> tests/ui/impl-trait.rs:12:26
   |
12 |     pub fn ref_cast2(s: &impl AsRef<str>) -> &Self;
   |                          ^^^^^^^^^^^^^^^
   |
   = note: `impl Trait` is only allowed in arguments and return types of functions and methods