Skip to content

unresolved import: there is no as_utf16_p in std::os::win32 #9053

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
klutzy opened this issue Sep 8, 2013 · 3 comments
Closed

unresolved import: there is no as_utf16_p in std::os::win32 #9053

klutzy opened this issue Sep 8, 2013 · 3 comments
Labels
A-metadata Area: Crate metadata A-resolve Area: Name/path resolution done by `rustc_resolve` specifically

Comments

@klutzy
Copy link
Contributor

klutzy commented Sep 8, 2013

On win32,

use std::os::win32::as_utf16_p;
fn main() {}

gives "error: unresolved import: there is no as_utf16_p in std::os::win32".

With RUST_LOG=rustc, rustc gives some info:

~"(resolving single import) resolving `as_utf16_p` = `std::os::win32::as_utf16_p` from `???`"
~"(populating external module) attempting to populate std::os::win32"
~"(populating external module) ... found ident: SYSNAME"
~"(building reduced graph for external crate) building value (fn/static) SYSNAME"
~"(populating external module) ... found ident: DLL_PREFIX"
~"(building reduced graph for external crate) building value (fn/static) DLL_PREFIX"
~"(populating external module) ... found ident: DLL_SUFFIX"
~"(building reduced graph for external crate) building value (fn/static) DLL_SUFFIX"
~"(populating external module) ... found ident: EXE_SUFFIX"
~"(building reduced graph for external crate) building value (fn/static) EXE_SUFFIX"
tmp.rs:1:4: 1:30 error: unresolved import: there is no `as_utf16_p` in `std::os::win32`
tmp.rs:1 use std::os::win32::as_utf16_p;
             ^~~~~~~~~~~~~~~~~~~~~~~~~~
tmp.rs:1:4: 1:30 error: failed to resolve import `std::os::win32::as_utf16_p`
tmp.rs:1 use std::os::win32::as_utf16_p;
             ^~~~~~~~~~~~~~~~~~~~~~~~~~

Seems like resolver cannot find any function inside std::os::win32.

@klutzy
Copy link
Contributor Author

klutzy commented Sep 8, 2013

os has pub use os::consts::*; and os::consts has os::consts::win32 which has four static values e.g. SYSNAME or DLL_PREFIX. The original os::win32 module is covered with os::consts::win32.
However I don't know why it my code worked on 0.7 version.

@huonw
Copy link
Member

huonw commented Sep 8, 2013

There have been some changes to how metadata is loaded from other crates have possibly affected this.

(cc @pcwalton)

@klutzy
Copy link
Contributor Author

klutzy commented Sep 27, 2013

So this is really a mixture of two issues: export order change (pub use consts::win32; is higher than mod win32 {}) and impossibility to use mod win32.
I'm ok with the first change, but then we should move mod win32 somewhere. Actually it contains only two fns: pub fn fill_utf16_buf_and_decode and pub fn as_utf16_p. They are not win32-dependent, but just win32-convenient. How about moving them to str and export them for all os?

flip1995 pushed a commit to flip1995/rust that referenced this issue Aug 11, 2022
Fix suggestions for `async` closures in redundant_closure_call

Fixes rust-lang#9052

changelog: Fix suggestions given by [`redundant_closure_call`] for async closures
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-metadata Area: Crate metadata A-resolve Area: Name/path resolution done by `rustc_resolve` specifically
Projects
None yet
Development

No branches or pull requests

2 participants