Skip to content

Commit ff6f9d7

Browse files
committed
Bug 1738133 - Undo workaround for rust-lang/rust#88576. r=firefox-build-system-reviewers,nalexander
Differential Revision: https://phabricator.services.mozilla.com/D133015
1 parent aaa57dd commit ff6f9d7

File tree

4 files changed

+20
-16
lines changed

4 files changed

+20
-16
lines changed

Cargo.lock

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

-4
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,3 @@ path = "third_party/rust/mio-0.6.23"
109109

110110
[patch.crates-io.prost-derive]
111111
path = "third_party/rust/prost-derive"
112-
113-
# Patched to work around https://github.com/rust-lang/rust/issues/88576
114-
[patch.crates-io.winapi-util]
115-
path = "third_party/rust/winapi-util"

build/moz.configure/rust.configure

+15-2
Original file line numberDiff line numberDiff line change
@@ -153,10 +153,10 @@ def cargo_info(cargo):
153153
)
154154

155155

156-
@depends(rustc_info, cargo_info)
156+
@depends(rustc_info, cargo_info, target)
157157
@imports(_from="mozboot.util", _import="MINIMUM_RUST_VERSION")
158158
@imports(_from="textwrap", _import="dedent")
159-
def rust_compiler(rustc_info, cargo_info):
159+
def rust_compiler(rustc_info, cargo_info, target):
160160
if not rustc_info:
161161
die(
162162
dedent(
@@ -203,6 +203,19 @@ def rust_compiler(rustc_info, cargo_info):
203203
)
204204
)
205205

206+
if target.kernel == "WINNT" and (version.major, version.minor) == (1, 56):
207+
die(
208+
dedent(
209+
"""\
210+
Rust compiler 1.56.* is not supported for Windows builds.
211+
212+
Use a newer or an older version.
213+
214+
See https://github.com/rust-lang/rust/issues/88576.
215+
"""
216+
)
217+
)
218+
206219
if not cargo_info:
207220
die(
208221
dedent(

third_party/rust/winapi-util/src/win.rs

+3-10
Original file line numberDiff line numberDiff line change
@@ -101,16 +101,13 @@ struct HandleRefInner(Option<File>);
101101

102102
impl Drop for HandleRefInner {
103103
fn drop(&mut self) {
104-
self.0.take().map(|f| f.into_raw_handle());
104+
self.0.take().unwrap().into_raw_handle();
105105
}
106106
}
107107

108108
impl AsRawHandle for HandleRef {
109109
fn as_raw_handle(&self) -> RawHandle {
110-
match (self.0).0.as_ref() {
111-
Some(f) => f.as_raw_handle(),
112-
None => std::ptr::null_mut(),
113-
}
110+
self.as_file().as_raw_handle()
114111
}
115112
}
116113

@@ -162,11 +159,7 @@ impl HandleRef {
162159
/// is a valid handle. The caller must ensure this is true before invoking
163160
/// this constructor.
164161
pub unsafe fn from_raw_handle(handle: RawHandle) -> HandleRef {
165-
HandleRef(HandleRefInner(if handle.is_null() {
166-
None
167-
} else {
168-
Some(File::from_raw_handle(handle))
169-
}))
162+
HandleRef(HandleRefInner(Some(File::from_raw_handle(handle))))
170163
}
171164

172165
/// Return this handle as a standard `File` reference.

0 commit comments

Comments
 (0)