Unresolved import

I have an interesting problem with a very simple code:

error[E0432]: unresolved import trust_dns_resolver::Resolver
ā€“> src/dns.rs:4:5
4 | use trust_dns_resolver::Resolver;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no Resolver in the root

error: aborting due to previous error


use std::net::{IpAddr, Ipv4Addr, Ipv6Addr};
extern crate trust_dns_resolver;
use trust_dns_resolver::config::*;
use trust_dns_resolver::Resolver;

Has anybody seen this before?

Check you Cargo.lock file to see what version of trust_dns_resolver you are using. It may be pulling an older version.

Also, try run cargo doc --open on your project to see documentations of its dependencies of actually installed version.

1 Like

Thanks, I was playing with features when I imported the create and that was the problem here.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.