It seems that this place may cause a compilation error where the type cannot be inferred. Strangely, this only occurs when compiling simultaneously with the gpui library.
error log
error[E0282]: type annotations needed
--> \.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\roto-0.10.0\src\typechecker\types.rs:358:13
|
358 | Ok(s)
| ^^ cannot infer type of the type parameter `E` declared on the enum `Result`
|
help: consider specifying the generic arguments
|
358 | Ok::<std::string::String, E>(s)
| ++++++++++++++++++++++++++
error[E0283]: type annotations needed
--> \.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\roto-0.10.0\src\typechecker\types.rs:358:13
|
353 | write!(s, "{}", i.display(type_info))?;
| - type must be known at this point
...
358 | Ok(s)
| ^^ cannot infer type of the type parameter `E` declared on the enum `Result`
|
= note: multiple `impl`s satisfying `_: From<std::fmt::Error>` found in the following crates: `log`, `serde_fmt`, `value_bag`:
- impl From<std::fmt::Error> for log::kv::Error;
- impl From<std::fmt::Error> for serde_fmt::Error;
- impl From<std::fmt::Error> for value_bag::error::Error;
help: consider specifying the generic arguments
|
358 | Ok::<std::string::String, E>(s)
| ++++++++++++++++++++++++++
error[E0283]: type annotations needed
--> \.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\roto-0.10.0\src\typechecker\types.rs:358:13
|
356 | write!(s, ", {}", i.display(type_info))?;
| - type must be known at this point
357 | }
358 | Ok(s)
| ^^ cannot infer type of the type parameter `E` declared on the enum `Result`
|
= note: multiple `impl`s satisfying `_: From<std::fmt::Error>` found in the following crates: `log`, `serde_fmt`, `value_bag`:
- impl From<std::fmt::Error> for log::kv::Error;
- impl From<std::fmt::Error> for serde_fmt::Error;
- impl From<std::fmt::Error> for value_bag::error::Error;
help: consider specifying the generic arguments
|
358 | Ok::<std::string::String, E>(s)
| ++++++++++++++++++++++++++
error[E0283]: type annotations needed
--> \.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\roto-0.10.0\src\typechecker\types.rs:358:13
|
358 | Ok(s)
| ^^ cannot infer type of the type parameter `E` declared on the enum `Result`
...
389 | fmt_args(args)?,
| - type must be known at this point
|
= note: multiple `impl`s satisfying `std::fmt::Error: From<_>` found in the following crates: `core`, `serde_fmt`:
- impl From<serde_fmt::Error> for std::fmt::Error;
- impl<T> From<T> for T;
help: consider specifying the generic arguments
|
358 | Ok::<std::string::String, E>(s)
| ++++++++++++++++++++++++++
Some errors have detailed explanations: E0282, E0283.
For more information about an error, try `rustc --explain E0282`.
error: could not compile `roto` (lib) due to 4 previous errors
warning: build failed, waiting for other jobs to finish...
rustc version:
❯ rustc -Vv
rustc 1.94.1 (e408947bf 2026-03-25)
binary: rustc
commit-hash: e408947bfd200af42db322daf0fadfe7e26d3bd1
commit-date: 2026-03-25
host: x86_64-pc-windows-msvc
release: 1.94.1
LLVM version: 21.1.8
Cargo.toml:
[dependencies]
roto = "0.10.0"
gpui = "0.2.2"