File: issue-90101.stderr

package info (click to toggle)
rustc 1.85.0%2Bdfsg3-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental, forky, sid, trixie
  • size: 893,396 kB
  • sloc: xml: 158,127; python: 35,830; javascript: 19,497; cpp: 19,002; sh: 17,245; ansic: 13,127; asm: 4,376; makefile: 1,051; perl: 29; lisp: 29; ruby: 19; sql: 11
file content (24 lines) | stat: -rw-r--r-- 1,091 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
error[E0277]: the trait bound `PathBuf: From<Cow<'_, str>>` is not satisfied
  --> $DIR/issue-90101.rs:6:10
   |
LL |     func(Path::new("hello").to_path_buf().to_string_lossy(), "world")
   |     ---- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `From<Cow<'_, str>>` is not implemented for `PathBuf`
   |     |
   |     required by a bound introduced by this call
   |
   = help: the following other types implement trait `From<T>`:
             `PathBuf` implements `From<&T>`
             `PathBuf` implements `From<Box<Path>>`
             `PathBuf` implements `From<Cow<'_, Path>>`
             `PathBuf` implements `From<OsString>`
             `PathBuf` implements `From<String>`
   = note: required for `Cow<'_, str>` to implement `Into<PathBuf>`
note: required by a bound in `func`
  --> $DIR/issue-90101.rs:3:20
   |
LL | fn func(path: impl Into<PathBuf>, code: impl Into<String>) {}
   |                    ^^^^^^^^^^^^^ required by this bound in `func`

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0277`.