Closed samvv closed 8 months ago
Hi, I'm getting the following error on this snippet:
Report::build(ReportKind::Error, "foobar", d.offset) .with_message(d.message()) .finish() .print(( "foobar", Source::from(d.file.text()) )) .unwrap()
error[E0283]: type annotations needed --> src/diagnostic.rs:363:9 | 363 | Report::build(ReportKind::Error, "fooba", d.offset) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot infer type for type parameter `U` | = note: multiple `impl`s satisfying `_: From<&str>` found in the `clap_builder` crate: - impl From<&'static str> for Id; - impl From<&'static str> for Str; - impl From<&'static str> for clap::builder::OsStr; - impl From<&'static str> for clap::builder::StyledStr; = note: required for `&str` to implement `Into<_>` note: required by a bound in `ariadne::Report::<'_, S>::build` --> /home/samvv/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ariadne-0.4.0/src/lib.rs:159:22 | 159 | pub fn build<Id: Into<<S::SourceId as ToOwned>::Owned>>(kind: ReportKind, src_id: Id, offset: usize) -> ReportBuilder<S> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Report::<'_, S>::build`
Does anyone know what's happening here? In particular, I have no idea what the impls from clap_builder are doing there. They are not imported.
impl
clap_builder
Never mind I think I found the problem ... I'm not creating a label, which makes the Rust type checker fail to infer S as indicated by a previous (unposted error).
S
Sorry for the noise!
Hi, I'm getting the following error on this snippet:
Does anyone know what's happening here? In particular, I have no idea what the
impl
s fromclap_builder
are doing there. They are not imported.