Skip to content
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

Regression in that some imports are considered unused, but only when building docs #51689

Closed
retep998 opened this issue Jun 21, 2018 · 1 comment
Labels
regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@retep998
Copy link
Member

retep998 commented Jun 21, 2018

rustc 1.28.0-nightly (f28c7aef7 2018-06-19)
binary: rustc
commit-hash: f28c7aef7fbff1909c2d0257186cd7a5f0c6aa4b
commit-date: 2018-06-19
host: x86_64-pc-windows-msvc
release: 1.28.0-nightly
LLVM version: 6.0
Output of cargo doc
> cargo doc --all-features
   Compiling winapi v0.3.5 (file:///C:/Users/Peter/Code/winapi-rs)
 Documenting winapi v0.3.5 (file:///C:/Users/Peter/Code/winapi-rs)
error: unused import: `IsEqualGUID`
 --> src\shared\devpropdef.rs:8:29
  |
8 | use shared::guiddef::{GUID, IsEqualGUID};
  |                             ^^^^^^^^^^^
  |
note: lint level defined here
 --> src\lib.rs:8:9
  |
8 | #![deny(unused, unused_qualifications)]
  |         ^^^^^^
  = note: #[deny(unused_imports)] implied by #[deny(unused)]

error: unused import: `USB_ENDPOINT_DIRECTION_MASK`
  --> src\shared\usb.rs:10:59
   |
10 |     PUSB_CONFIGURATION_DESCRIPTOR, USB_DEVICE_DESCRIPTOR, USB_ENDPOINT_DIRECTION_MASK,
   |                                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: unused imports: `FILE_ANY_ACCESS`, `METHOD_BUFFERED`, `METHOD_NEITHER`
  --> src\shared\usbiodef.rs:13:20
   |
13 | use um::winioctl::{FILE_ANY_ACCESS, FILE_DEVICE_UNKNOWN, METHOD_BUFFERED, METHOD_NEITHER};
   |                    ^^^^^^^^^^^^^^^                       ^^^^^^^^^^^^^^^  ^^^^^^^^^^^^^^

error: unused import: `c_short`
 --> src\shared\windowsx.rs:8:21
  |
8 | use ctypes::{c_int, c_short};
  |                     ^^^^^^^

error: unused imports: `DWORD`, `HIWORD`, `LOWORD`
 --> src\shared\windowsx.rs:9:25
  |
9 | use shared::minwindef::{DWORD, HIWORD, LOWORD, LPARAM};
  |                         ^^^^^  ^^^^^^  ^^^^^^

error: unused import: `um::winbase::LocalFree`
 --> src\um\accctrl.rs:9:5
  |
9 | use um::winbase::LocalFree;
  |     ^^^^^^^^^^^^^^^^^^^^^^

error: unused import: `IMAGE_BITMAP`
  --> src\um\commctrl.rs:22:22
   |
22 |     CB_DELETESTRING, IMAGE_BITMAP, LPSCROLLINFO, LPTRACKMOUSEEVENT, NMHDR,
   |                      ^^^^^^^^^^^^

error: unused import: `shared::winerror::SEVERITY_ERROR`
  --> src\um\dwrite.rs:13:5
   |
13 | use shared::winerror::SEVERITY_ERROR;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: unused imports: `FLOAT`, `HIWORD`, `LOWORD`
  --> src\um\dxva2api.rs:12:38
   |
12 | use shared::minwindef::{BOOL, DWORD, FLOAT, HIWORD, LOWORD, UCHAR, UINT, USHORT};
   |                                      ^^^^^  ^^^^^^  ^^^^^^

error: unused import: `PUCHAR`
  --> src\um\evntcons.rs:11:25
   |
11 | use shared::minwindef::{PUCHAR, PULONG, PUSHORT, UCHAR, ULONG, USHORT};
   |                         ^^^^^^

error: unused import: `IsEqualIID`
 --> src\um\propkeydef.rs:7:23
  |
7 | use shared::guiddef::{IsEqualIID};
  |                       ^^^^^^^^^^

error: unused import: `SEVERITY_ERROR`
  --> src\um\wincodec.rs:21:5
   |
21 |     SEVERITY_ERROR
   |     ^^^^^^^^^^^^^^

error: unused import: `LOBYTE`
  --> src\um\wingdi.rs:11:71
   |
11 |     BOOL, BYTE, DWORD, FLOAT, HGLOBAL, HMETAFILE, HMODULE, HRGN, INT, LOBYTE, LPARAM, LPBYTE,
   |                                                                       ^^^^^^

error: unused imports: `FALSE`, `TRUE`
  --> src\um\wininet.rs:11:18
   |
11 |     BOOL, DWORD, FALSE, FILETIME, INT, LPBYTE,
   |                  ^^^^^
12 |     LPCVOID, LPDWORD, LPVOID, PBYTE, PDWORD, TRUE, WORD,
   |                                              ^^^^

error: unused imports: `HIWORD`, `LOWORD`, `MAKELONG`
  --> src\um\winsock2.rs:16:27
   |
16 |     BOOL, DWORD, FARPROC, HIWORD, INT, LOWORD, LPDWORD, LPHANDLE, LPINT, LPVOID, MAKELONG, UINT,
   |                           ^^^^^^       ^^^^^^                                    ^^^^^^^^

error: unused imports: `HIWORD`, `LOWORD`
  --> src\um\winuser.rs:16:41
   |
16 |     ATOM, BOOL, BYTE, DWORD, HINSTANCE, HIWORD, HKL, HMODULE, HRGN, HWINSTA, INT, LOWORD, LPARAM,
   |                                         ^^^^^^                                    ^^^^^^

error: Compilation failed, aborting rustdoc

error: Could not document `winapi`.

There is nothing in winapi which is conditional on whether the crate is being built as documentation, and these unused imports do not occur when building winapi normally, nor have they ever occurred when building documentation before. This is a very recent regression.

@retep998 retep998 added regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jun 21, 2018
@QuietMisdreavus
Copy link
Member

Duplicate of #51661

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

2 participants