retep998 / winapi-rs

Rust bindings to Windows API
https://crates.io/crates/winapi
Apache License 2.0
1.85k stars 392 forks source link

`cargo doc` fails on 2018-06-18 nightly #633

Closed ErichDonGubler closed 6 years ago

ErichDonGubler commented 6 years ago

The main reason this breaks seems to be that nightly is now emitting unused imports as warnings, which there are several of shown in my testing below. I've included a sample invocation, but if you need any further information please let me know! Builds for uploads-im-client-rs are going to break because I decided to include a cargo doc --verbose command. I would love to keep my CI more rigorous, but I can't because of this issue!

Log output ``` ~/…/bug-reports/winapi-rs 0.3$ cargo +nightly-2018-06-18 doc --all-features Compiling winapi v0.3.5 (file:///C:/Users/egubler/workspace/personal/bug-reports/winapi-rs) Documenting winapi v0.3.5 (file:///C:/Users/egubler/workspace/personal/bug-reports/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`. Caused by: process didn't exit successfully: `rustdoc --crate-name winapi src\lib.rs -o C:\Users\egubler\workspace\personal\bug-reports\winapi-rs\target\doc --cfg feature="accctrl" --cfg feature="aclapi" --cfg feature="activation" --cfg feature="appmgmt" --cfg feature="audioclient" --cfg feature="audiosessiontypes" --cfg feature="avrt" --cfg feature="basetsd" --cfg feature="bcrypt" --cfg feature="bits" --cfg feature="bits10_1" --cfg feature="bits1_5" --cfg feature="bits2_0" --cfg feature="bits2_5" --cfg feature="bits3_0" --cfg feature="bits4_0" --cfg feature="bits5_0" --cfg feature="bitscfg" --cfg feature="bitsmsg" --cfg feature="bugcodes" --cfg feature="cderr" --cfg feature="cfg" --cfg feature="cfgmgr32" --cfg feature="cguid" --cfg feature="combaseapi" --cfg feature="coml2api" --cfg feature="commapi" --cfg feature="commctrl" --cfg feature="commdlg" --cfg feature="commoncontrols" --cfg feature="consoleapi" --cfg feature="corsym" --cfg feature="d2d1" --cfg feature="d2d1_1" --cfg feature="d2d1_2" --cfg feature="d2d1_3" --cfg feature="d2d1effectauthor" --cfg feature="d2d1effects" --cfg feature="d2d1effects_1" --cfg feature="d2d1effects_2" --cfg feature="d2d1svg" --cfg feature="d2dbasetypes" --cfg feature="d3d" --cfg feature="d3d10" --cfg feature="d3d10_1" --cfg feature="d3d10_1shader" --cfg feature="d3d10effect" --cfg feature="d3d10misc" --cfg feature="d3d10sdklayers" --cfg feature="d3d10shader" --cfg feature="d3d11" --cfg feature="d3d11_1" --cfg feature="d3d11_2" --cfg feature="d3d11_3" --cfg feature="d3d11_4" --cfg feature="d3d11on12" --cfg feature="d3d11sdklayers" --cfg feature="d3d11shader" --cfg feature="d3d12" --cfg feature="d3d12sdklayers" --cfg feature="d3d12shader" --cfg feature="d3d9" --cfg feature="d3d9caps" --cfg feature="d3d9types" --cfg feature="d3dcommon" --cfg feature="d3dcompiler" --cfg feature="d3dcsx" --cfg feature="d3dx10core" --cfg feature="d3dx10math" --cfg feature="d3dx10mesh" --cfg feature="datetimeapi" --cfg feature="davclnt" --cfg feature="dbghelp" --cfg feature="dcommon" --cfg feature="dcomp" --cfg feature="dcompanimation" --cfg feature="dcomptypes" --cfg feature="dde" --cfg feature="ddraw" --cfg feature="ddrawi" --cfg feature="ddrawint" --cfg feature="debug" --cfg feature="debugapi" --cfg feature="devguid" --cfg feature="devpkey" --cfg feature="devpropdef" --cfg feature="dinput" --cfg feature="dinputd" --cfg feature="dmksctl" --cfg feature="dmusicc" --cfg feature="docobj" --cfg feature="documenttarget" --cfg feature="dpa_dsa" --cfg feature="dpapi" --cfg feature="dsgetdc" --cfg feature="dsound" --cfg feature="dsrole" --cfg feature="dvp" --cfg feature="dwmapi" --cfg feature="dwrite" --cfg feature="dwrite_1" --cfg feature="dwrite_2" --cfg feature="dwrite_3" --cfg feature="dxdiag" --cfg feature="dxfile" --cfg feature="dxgi" --cfg feature="dxgi1_2" --cfg feature="dxgi1_3" --cfg feature="dxgi1_4" --cfg feature="dxgi1_5" --cfg feature="dxgi1_6" --cfg feature="dxgidebug" --cfg feature="dxgiformat" --cfg feature="dxgitype" --cfg feature="dxva2api" --cfg feature="dxvahd" --cfg feature="endpointvolume" --cfg feature="errhandlingapi" --cfg feature="everything" --cfg feature="evntcons" --cfg feature="evntprov" --cfg feature="evntrace" --cfg feature="excpt" --cfg feature="fibersapi" --cfg feature="fileapi" --cfg feature="gl-gl" --cfg feature="guiddef" --cfg feature="handleapi" --cfg feature="heapapi" --cfg feature="hidclass" --cfg feature="hidpi" --cfg feature="hidsdi" --cfg feature="hidusage" --cfg feature="highlevelmonitorconfigurationapi" --cfg feature="hstring" --cfg feature="http" --cfg feature="imm" --cfg feature="impl-default" --cfg feature="in6addr" --cfg feature="inaddr" --cfg feature="inspectable" --cfg feature="interlockedapi" --cfg feature="intsafe" --cfg feature="ioapiset" --cfg feature="jobapi" --cfg feature="jobapi2" --cfg feature="knownfolders" --cfg feature="ksmedia" --cfg feature="ktmtypes" --cfg feature="ktmw32" --cfg feature="libloaderapi" --cfg feature="limits" --cfg feature="lmaccess" --cfg feature="lmalert" --cfg feature="lmapibuf" --cfg feature="lmat" --cfg feature="lmcons" --cfg feature="lmdfs" --cfg feature="lmerrlog" --cfg feature="lmjoin" --cfg feature="lmmsg" --cfg feature="lmremutl" --cfg feature="lmrepl" --cfg feature="lmserver" --cfg feature="lmshare" --cfg feature="lmstats" --cfg feature="lmsvc" --cfg feature="lmuse" --cfg feature="lmwksta" --cfg feature="lowlevelmonitorconfigurationapi" --cfg feature="lsalookup" --cfg feature="memoryapi" --cfg feature="minschannel" --cfg feature="minwinbase" --cfg feature="minwindef" --cfg feature="mmdeviceapi" --cfg feature="mmeapi" --cfg feature="mmreg" --cfg feature="mmsystem" --cfg feature="msaatext" --cfg feature="mscat" --cfg feature="mschapp" --cfg feature="mssip" --cfg feature="mstcpip" --cfg feature="namedpipeapi" --cfg feature="namespaceapi" --cfg feature="nb30" --cfg feature="ncrypt" --cfg feature="ntddscsi" --cfg feature="ntddser" --cfg feature="ntdef" --cfg feature="ntlsa" --cfg feature="ntsecapi" --cfg feature="ntstatus" --cfg feature="oaidl" --cfg feature="objbase" --cfg feature="objidl" --cfg feature="objidlbase" --cfg feature="ocidl" --cfg feature="oleauto" --cfg feature="olectl" --cfg feature="opmapi" --cfg feature="pdh" --cfg feature="perflib" --cfg feature="physicalmonitorenumerationapi" --cfg feature="playsoundapi" --cfg feature="powerbase" --cfg feature="powersetting" --cfg feature="powrprof" --cfg feature="processenv" --cfg feature="processsnapshot" --cfg feature="processthreadsapi" --cfg feature="processtopologyapi" --cfg feature="profileapi" --cfg feature="propidl" --cfg feature="propkeydef" --cfg feature="propsys" --cfg feature="prsht" --cfg feature="psapi" --cfg feature="qos" --cfg feature="realtimeapiset" --cfg feature="reason" --cfg feature="restartmanager" --cfg feature="restrictederrorinfo" --cfg feature="rmxfguid" --cfg feature="roapi" --cfg feature="robuffer" --cfg feature="roerrorapi" --cfg feature="rpc" --cfg feature="rpcdce" --cfg feature="rpcndr" --cfg feature="sapi" --cfg feature="sapi51" --cfg feature="sapi53" --cfg feature="sapiddk" --cfg feature="sapiddk51" --cfg feature="schannel" --cfg feature="sddl" --cfg feature="securityappcontainer" --cfg feature="securitybaseapi" --cfg feature="servprov" --cfg feature="setupapi" --cfg feature="shellapi" --cfg feature="shellscalingapi" --cfg feature="shlobj" --cfg feature="shobjidl" --cfg feature="shobjidl_core" --cfg feature="shtypes" --cfg feature="spapidef" --cfg feature="sporder" --cfg feature="sql" --cfg feature="sqlext" --cfg feature="sqltypes" --cfg feature="sqlucode" --cfg feature="sspi" --cfg feature="std" --cfg feature="stralign" --cfg feature="stringapiset" --cfg feature="strmif" --cfg feature="subauth" --cfg feature="synchapi" --cfg feature="sysinfoapi" --cfg feature="systemtopologyapi" --cfg feature="textstor" --cfg feature="threadpoolapiset" --cfg feature="threadpoollegacyapiset" --cfg feature="timeapi" --cfg feature="timezoneapi" --cfg feature="tlhelp32" --cfg feature="transportsettingcommon" --cfg feature="tvout" --cfg feature="unknwnbase" --cfg feature="urlhist" --cfg feature="urlmon" --cfg feature="usb" --cfg feature="usbiodef" --cfg feature="usbspec" --cfg feature="userenv" --cfg feature="usp10" --cfg feature="utilapiset" --cfg feature="vadefs" --cfg feature="vcruntime" --cfg feature="vsbackup" --cfg feature="vss" --cfg feature="vsserror" --cfg feature="vswriter" --cfg feature="wct" --cfg feature="werapi" --cfg feature="winbase" --cfg feature="wincodec" --cfg feature="wincodecsdk" --cfg feature="wincon" --cfg feature="wincred" --cfg feature="wincrypt" --cfg feature="windef" --cfg feature="windowsceip" --cfg feature="windowsx" --cfg feature="winefs" --cfg feature="winerror" --cfg feature="winevt" --cfg feature="wingdi" --cfg feature="winhttp" --cfg feature="wininet" --cfg feature="winineti" --cfg feature="winioctl" --cfg feature="winnetwk" --cfg feature="winnls" --cfg feature="winnt" --cfg feature="winreg" --cfg feature="winsafer" --cfg feature="winscard" --cfg feature="winsmcrd" --cfg feature="winsock2" --cfg feature="winspool" --cfg feature="winstring" --cfg feature="winsvc" --cfg feature="winusb" --cfg feature="winusbio" --cfg feature="winuser" --cfg feature="winver" --cfg feature="wmistr" --cfg feature="wnnc" --cfg feature="wow64apiset" --cfg feature="ws2def" --cfg feature="ws2ipdef" --cfg feature="ws2spi" --cfg feature="ws2tcpip" --cfg feature="wtypes" --cfg feature="wtypesbase" --cfg feature="xinput" -L dependency=C:\Users\egubler\workspace\personal\bug-reports\winapi-rs\target\debug\deps --cfg feature="gl-gl"` (exit code: 101) ```
retep998 commented 6 years ago

winapi itself actually does #![deny(unused)] but it should only ever affect building winapi directly, because cargo caps the lints on crates when they are merely a dependency.

However there is a very serious bug here in that some imports are being considered unused, but only when building documentation. I'll file an upstream bug to find out what the heck is going on.

Filed as https://github.com/rust-lang/rust/issues/51689

ErichDonGubler commented 6 years ago

FYI for readers: rustdoc upstream duped @retep998's issue filed above to https://github.com/rust-lang/rust/issues/51661.

retep998 commented 6 years ago

winapi docs are currently building fine for me using rustc 1.30.0-nightly (cb6d2dfa8 2018-09-16)