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

use MaybeUninit instead of mem::uninitialized for Windows Mutex #56275

Merged
merged 10 commits into from Dec 2, 2018

Conversation

Projects
None yet
7 participants
@RalfJung
Member

RalfJung commented Nov 27, 2018

I hope this builds, I do not have a Windows machine to test...

@rust-highfive

This comment has been minimized.

Collaborator

rust-highfive commented Nov 27, 2018

r? @Mark-Simulacrum

(rust_highfive has picked a reviewer for you, use r? to override)

pub unsafe fn uninitialized() -> ReentrantMutex {
mem::uninitialized()
pub fn uninitialized() -> ReentrantMutex {
MaybeUninit::uninitialized()

This comment has been minimized.

@abonander

abonander Nov 27, 2018

Contributor

Looks like you forgot to wrap this in ReentrantMutex.

This comment has been minimized.

@RalfJung

RalfJung Nov 27, 2018

Member

I forgot indeed, thanks!

@rust-highfive

This comment was marked as resolved.

Collaborator

rust-highfive commented Nov 27, 2018

The job mingw-check of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
travis_time:end:12c15103:start=1543314315747488617,finish=1543314318036583390,duration=2289094773
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#Pull-Requests-and-Security-Restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
Setting environment variables from .travis.yml
$ export IMAGE=mingw-check
---
[00:06:49] configure: build.locked-deps    := True
[00:06:49] configure: llvm.ccache          := sccache
[00:06:49] configure: build.cargo-native-static := True
[00:06:49] configure: dist.missing-tools   := True
[00:06:49] configure: build.configure-args := ['--enable-sccache', '--disable-manage-submodu ...
[00:06:49] configure: writing `config.toml` in current directory
[00:06:49] configure: 
[00:06:49] configure: run `python /checkout/x.py --help`
[00:06:49] configure: 
---
[00:08:15]     Checking libc v0.0.0 (/checkout/src/rustc/libc_shim)
[00:08:15]     Checking alloc v0.0.0 (/checkout/src/liballoc)
[00:08:15]     Checking panic_abort v0.0.0 (/checkout/src/libpanic_abort)
[00:08:19]     Checking panic_unwind v0.0.0 (/checkout/src/libpanic_unwind)
[00:08:20] error[E0658]: use of unstable library feature 'maybe_uninit' (see issue #53491)
[00:08:20]    |
[00:08:20]    |
[00:08:20] 33 | use mem::{self, MaybeUninit};
[00:08:20]    |
[00:08:20]    = help: add #![feature(maybe_uninit)] to the crate attributes to enable
[00:08:20] 
[00:08:20] 
[00:08:20] error[E0658]: use of unstable library feature 'maybe_uninit' (see issue #53491)
[00:08:20]     |
[00:08:20]     |
[00:08:20] 160 | pub struct ReentrantMutex { inner: MaybeUninit<UnsafeCell<c::CRITICAL_SECTION>> }
[00:08:20]     |
[00:08:20]     = help: add #![feature(maybe_uninit)] to the crate attributes to enable
[00:08:20] 
[00:08:20] 
[00:08:20] error[E0658]: use of unstable library feature 'maybe_uninit' (see issue #53491)
[00:08:20]     |
[00:08:20] 167 |         MaybeUninit::uninitialized()
[00:08:20]     |         ^^^^^^^^^^^^^^^^^^^^^^^^^^
[00:08:20]     |
[00:08:20]     |
[00:08:20]     = help: add #![feature(maybe_uninit)] to the crate attributes to enable
[00:08:20] 
[00:08:22] error[E0308]: mismatched types
[00:08:22]    --> src/libstd/sys/windows/mutex.rs:167:9
[00:08:22]     |
[00:08:22] 166 |     pub fn uninitialized() -> ReentrantMutex {
[00:08:22]     |                               -------------- expected `sys::windows::mutex::ReentrantMutex` because of return type
[00:08:22] 167 |         MaybeUninit::uninitialized()
[00:08:22]     |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `sys::windows::mutex::ReentrantMutex`, found union `core::mem::MaybeUninit`
[00:08:22]     |
[00:08:22]     = note: expected type `sys::windows::mutex::ReentrantMutex`
[00:08:22]                found type `core::mem::MaybeUninit<_>`
[00:08:22] 
[00:08:22] error[E0658]: use of unstable library feature 'maybe_uninit' (see issue #53491)
[00:08:22]     |
[00:08:22]     |
[00:08:22] 171 |         c::InitializeCriticalSection(self.inner.get_ref().get());
[00:08:22]     |
[00:08:22]     = help: add #![feature(maybe_uninit)] to the crate attributes to enable
[00:08:22] 
[00:08:22] 
[00:08:22] error[E0658]: use of unstable library feature 'maybe_uninit' (see issue #53491)
[00:08:22]     |
[00:08:22]     |
[00:08:22] 175 |         c::EnterCriticalSection(self.inner.get_ref().get());
[00:08:22]     |
[00:08:22]     = help: add #![feature(maybe_uninit)] to the crate attributes to enable
[00:08:22] 
[00:08:22] 
[00:08:22] error[E0658]: use of unstable library feature 'maybe_uninit' (see issue #53491)
[00:08:22]     |
[00:08:22]     |
[00:08:22] 180 |         c::TryEnterCriticalSection(self.inner.get_ref().get()) != 0
[00:08:22]     |
[00:08:22]     = help: add #![feature(maybe_uninit)] to the crate attributes to enable
[00:08:22] 
[00:08:22] 
[00:08:22] error[E0658]: use of unstable library feature 'maybe_uninit' (see issue #53491)
[00:08:22]     |
[00:08:22]     |
[00:08:22] 184 |         c::LeaveCriticalSection(self.inner.get_ref().get());
[00:08:22]     |
[00:08:22]     = help: add #![feature(maybe_uninit)] to the crate attributes to enable
[00:08:22] 
[00:08:22] 
[00:08:22] error[E0658]: use of unstable library feature 'maybe_uninit' (see issue #53491)
[00:08:22]     |
[00:08:22]     |
[00:08:22] 188 |         c::DeleteCriticalSection(self.inner.get_ref().get());
[00:08:22]     |
[00:08:22]     = help: add #![feature(maybe_uninit)] to the crate attributes to enable
[00:08:22] 
[00:08:23] error: aborting due to 9 previous errors
[00:08:23] error: aborting due to 9 previous errors
[00:08:23] 
[00:08:23] Some errors occurred: E0308, E0658.
[00:08:23] For more information about an error, try `rustc --explain E0308`.
[00:08:23] error: Could not compile `std`.
[00:08:23] 
[00:08:23] To learn more, run the command again with --verbose.
[00:08:23] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "check" "--target" "i686-pc-windows-gnu" "-j" "4" "--release" "--locked" "--color" "always" "--features" "panic-unwind backtrace" "--manifest-path" "/checkout/src/libstd/Cargo.toml" "--message-format" "json"
[00:08:23] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap check --target=i686-pc-windows-gnu --host=i686-pc-windows-gnu
[00:08:23] Build completed unsuccessfully in 0:00:29
travis_time:end:2c00311c:start=1543314326974359037,finish=1543314830331025333,duration=503356666296
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 1.
---
travis_time:end:3330f676:start=1543314830767845251,finish=1543314830775483157,duration=7637906
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:092d0a8c
$ ln -s . checkout && for CORE in obj/cores/core.*; do EXE=$(echo $CORE | sed 's|obj/cores/core\.[0-9]*\.!checkout!\(.*\)|\1|;y|!|/|'); if [ -f "$EXE" ]; then printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" "$CORE"; gdb --batch -q -c "$CORE" "$EXE" -iex 'set auto-load off' -iex 'dir src/' -iex 'set sysroot .' -ex bt -ex q; echo travis_fold":"end:crashlog; fi; done || true
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:0dd3b668
travis_time:start:0dd3b668
$ cat ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
cat: ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers: No such file or directory
travis_fold:end:after_failure.5
travis_fold:start:after_failure.6
travis_time:start:05d49590
$ dmesg | grep -i kill

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@Mark-Simulacrum

This comment has been minimized.

Member

Mark-Simulacrum commented Nov 27, 2018

FWIW, you should be able to run the mingw-check builder locally (src/ci/docker/run.sh mingw-check I believe) if you have Docker.

Code-wise this seems fine but someone else should probably review as well as I'm not up to date on MaybeUninit myself -- not sure who to assign though personally.

@RalfJung RalfJung referenced this pull request Nov 27, 2018

Open

Enable validation everywhere #551

5 of 9 tasks complete
@rust-highfive

This comment was marked as resolved.

Collaborator

rust-highfive commented Nov 27, 2018

The job mingw-check of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
travis_time:end:014a04c4:start=1543323024867771650,finish=1543323025931789515,duration=1064017865
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#Pull-Requests-and-Security-Restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
Setting environment variables from .travis.yml
$ export IMAGE=mingw-check
---
[00:06:35] configure: build.locked-deps    := True
[00:06:35] configure: llvm.ccache          := sccache
[00:06:35] configure: build.cargo-native-static := True
[00:06:35] configure: dist.missing-tools   := True
[00:06:35] configure: build.configure-args := ['--enable-sccache', '--disable-manage-submodu ...
[00:06:35] configure: writing `config.toml` in current directory
[00:06:35] configure: 
[00:06:35] configure: run `python /checkout/x.py --help`
[00:06:35] configure: 
---
[00:08:02]     Checking libc v0.0.0 (/checkout/src/rustc/libc_shim)
[00:08:02]     Checking alloc v0.0.0 (/checkout/src/liballoc)
[00:08:02]     Checking panic_abort v0.0.0 (/checkout/src/libpanic_abort)
[00:08:06]     Checking panic_unwind v0.0.0 (/checkout/src/libpanic_unwind)
[00:08:08] error[E0658]: use of unstable library feature 'maybe_uninit' (see issue #53491)
[00:08:08]    |
[00:08:08]    |
[00:08:08] 33 | use mem::{self, MaybeUninit};
[00:08:08]    |
[00:08:08]    = help: add #![feature(maybe_uninit)] to the crate attributes to enable
[00:08:08] 
[00:08:08] 
[00:08:08] error[E0658]: use of unstable library feature 'maybe_uninit' (see issue #53491)
[00:08:08]     |
[00:08:08]     |
[00:08:08] 160 | pub struct ReentrantMutex { inner: MaybeUninit<UnsafeCell<c::CRITICAL_SECTION>> }
[00:08:08]     |
[00:08:08]     = help: add #![feature(maybe_uninit)] to the crate attributes to enable
[00:08:08] 
[00:08:08] 
[00:08:08] error[E0658]: use of unstable library feature 'maybe_uninit' (see issue #53491)
[00:08:08]     |
[00:08:08]     |
[00:08:08] 167 |         ReentrantMutex { inner: MaybeUninit::uninitialized() }
[00:08:08]     |
[00:08:08]     = help: add #![feature(maybe_uninit)] to the crate attributes to enable
[00:08:08] 
[00:08:08] 
[00:08:10] error[E0658]: use of unstable library feature 'maybe_uninit' (see issue #53491)
[00:08:10]     |
[00:08:10]     |
[00:08:10] 171 |         c::InitializeCriticalSection(self.inner.get_ref().get());
[00:08:10]     |
[00:08:10]     = help: add #![feature(maybe_uninit)] to the crate attributes to enable
[00:08:10] 
[00:08:10] 
[00:08:10] error[E0658]: use of unstable library feature 'maybe_uninit' (see issue #53491)
[00:08:10]     |
[00:08:10]     |
[00:08:10] 175 |         c::EnterCriticalSection(self.inner.get_ref().get());
[00:08:10]     |
[00:08:10]     = help: add #![feature(maybe_uninit)] to the crate attributes to enable
[00:08:10] 
[00:08:10] 
[00:08:10] error[E0658]: use of unstable library feature 'maybe_uninit' (see issue #53491)
[00:08:10]     |
[00:08:10]     |
[00:08:10] 180 |         c::TryEnterCriticalSection(self.inner.get_ref().get()) != 0
[00:08:10]     |
[00:08:10]     = help: add #![feature(maybe_uninit)] to the crate attributes to enable
[00:08:10] 
[00:08:10] 
[00:08:10] error[E0658]: use of unstable library feature 'maybe_uninit' (see issue #53491)
[00:08:10]     |
[00:08:10]     |
[00:08:10] 184 |         c::LeaveCriticalSection(self.inner.get_ref().get());
[00:08:10]     |
[00:08:10]     = help: add #![feature(maybe_uninit)] to the crate attributes to enable
[00:08:10] 
[00:08:10] 
[00:08:10] error[E0658]: use of unstable library feature 'maybe_uninit' (see issue #53491)
[00:08:10]     |
[00:08:10]     |
[00:08:10] 188 |         c::DeleteCriticalSection(self.inner.get_ref().get());
[00:08:10]     |
[00:08:10]     = help: add #![feature(maybe_uninit)] to the crate attributes to enable
[00:08:10] 
[00:08:10] error: aborting due to 8 previous errors
[00:08:10] error: aborting due to 8 previous errors
[00:08:10] 
[00:08:10] For more information about this error, try `rustc --explain E0658`.
[00:08:10] error: Could not compile `std`.
[00:08:10] 
[00:08:10] To learn more, run the command again with --verbose.
[00:08:10] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "check" "--target" "i686-pc-windows-gnu" "-j" "4" "--release" "--locked" "--color" "always" "--features" "panic-unwind backtrace" "--manifest-path" "/checkout/src/libstd/Cargo.toml" "--message-format" "json"
[00:08:10] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap check --target=i686-pc-windows-gnu --host=i686-pc-windows-gnu
[00:08:10] Build completed unsuccessfully in 0:00:30
travis_time:end:10036f8c:start=1543323034683017313,finish=1543323526383134731,duration=491700117418
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 1.
---
travis_time:end:0712dff0:start=1543323526818164247,finish=1543323526825760020,duration=7595773
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:1fc64d9c
$ ln -s . checkout && for CORE in obj/cores/core.*; do EXE=$(echo $CORE | sed 's|obj/cores/core\.[0-9]*\.!checkout!\(.*\)|\1|;y|!|/|'); if [ -f "$EXE" ]; then printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" "$CORE"; gdb --batch -q -c "$CORE" "$EXE" -iex 'set auto-load off' -iex 'dir src/' -iex 'set sysroot .' -ex bt -ex q; echo travis_fold":"end:crashlog; fi; done || true
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:00e32abe
travis_time:start:00e32abe
$ cat ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
cat: ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers: No such file or directory
travis_fold:end:after_failure.5
travis_fold:start:after_failure.6
travis_time:start:3f5f8e7c
$ dmesg | grep -i kill

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

Show resolved Hide resolved src/libstd/sys/windows/mutex.rs Outdated

RalfJung added some commits Nov 28, 2018

@rust-highfive

This comment was marked as resolved.

Collaborator

rust-highfive commented Nov 28, 2018

The job mingw-check of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
travis_time:end:3182576f:start=1543397853918340421,finish=1543397938976201507,duration=85057861086
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#Pull-Requests-and-Security-Restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
Setting environment variables from .travis.yml
$ export IMAGE=mingw-check
---
[00:06:57] configure: build.locked-deps    := True
[00:06:57] configure: llvm.ccache          := sccache
[00:06:57] configure: build.cargo-native-static := True
[00:06:57] configure: dist.missing-tools   := True
[00:06:57] configure: build.configure-args := ['--enable-sccache', '--disable-manage-submodu ...
[00:06:57] configure: writing `config.toml` in current directory
[00:06:57] configure: 
[00:06:57] configure: run `python /checkout/x.py --help`
[00:06:57] configure: 
---
[00:08:33]     Checking panic_unwind v0.0.0 (/checkout/src/libpanic_unwind)
[00:08:37] error[E0308]: mismatched types
[00:08:37]    --> src/libstd/sys/windows/mutex.rs:177:33
[00:08:37]     |
[00:08:37] 177 |         c::EnterCriticalSection((&mut *self.inner.get()).get_ref());
[00:08:37]     |                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ types differ in mutability
[00:08:37]     |
[00:08:37]     = note: expected type `*mut sys::windows::c::CRITICAL_SECTION`
[00:08:37]                found type `&sys::windows::c::CRITICAL_SECTION`
[00:08:37] error[E0308]: mismatched types
[00:08:37]    --> src/libstd/sys/windows/mutex.rs:184:36
[00:08:37]     |
[00:08:37]     |
[00:08:37] 184 |         c::TryEnterCriticalSection((&mut *self.inner.get()).get_ref()) != 0
[00:08:37]     |                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ types differ in mutability
[00:08:37]     |
[00:08:37]     = note: expected type `*mut sys::windows::c::CRITICAL_SECTION`
[00:08:37]                found type `&sys::windows::c::CRITICAL_SECTION`
[00:08:37] error[E0308]: mismatched types
[00:08:37]    --> src/libstd/sys/windows/mutex.rs:190:33
[00:08:37]     |
[00:08:37]     |
[00:08:37] 190 |         c::LeaveCriticalSection((&mut *self.inner.get()).get_ref());
[00:08:37]     |                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ types differ in mutability
[00:08:37]     |
[00:08:37]     = note: expected type `*mut sys::windows::c::CRITICAL_SECTION`
[00:08:37]                found type `&sys::windows::c::CRITICAL_SECTION`
[00:08:37] error[E0308]: mismatched types
[00:08:37]    --> src/libstd/sys/windows/mutex.rs:196:34
[00:08:37]     |
[00:08:37]     |
[00:08:37] 196 |         c::DeleteCriticalSection((&mut *self.inner.get()).get_ref());
[00:08:37]     |                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ types differ in mutability
[00:08:37]     |
[00:08:37]     = note: expected type `*mut sys::windows::c::CRITICAL_SECTION`
[00:08:37]                found type `&sys::windows::c::CRITICAL_SECTION`
[00:08:37] error: aborting due to 4 previous errors
[00:08:37] 
[00:08:37] For more information about this error, try `rustc --explain E0308`.
[00:08:37] error: Could not compile `std`.
[00:08:37] error: Could not compile `std`.
[00:08:37] 
[00:08:37] To learn more, run the command again with --verbose.
[00:08:37] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "check" "--target" "i686-pc-windows-gnu" "-j" "4" "--release" "--locked" "--color" "always" "--features" "panic-unwind backtrace" "--manifest-path" "/checkout/src/libstd/Cargo.toml" "--message-format" "json"
[00:08:37] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap check --target=i686-pc-windows-gnu --host=i686-pc-windows-gnu
[00:08:37] Build completed unsuccessfully in 0:00:31
travis_time:end:0537a536:start=1543397948085105501,finish=1543398465822822309,duration=517737716808
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 1.
---
travis_time:end:13fc6046:start=1543398466291998481,finish=1543398466300421667,duration=8423186
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:03b8a4c6
$ ln -s . checkout && for CORE in obj/cores/core.*; do EXE=$(echo $CORE | sed 's|obj/cores/core\.[0-9]*\.!checkout!\(.*\)|\1|;y|!|/|'); if [ -f "$EXE" ]; then printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" "$CORE"; gdb --batch -q -c "$CORE" "$EXE" -iex 'set auto-load off' -iex 'dir src/' -iex 'set sysroot .' -ex bt -ex q; echo travis_fold":"end:crashlog; fi; done || true
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:279687e4
travis_time:start:279687e4
$ cat ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
cat: ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers: No such file or directory
travis_fold:end:after_failure.5
travis_fold:start:after_failure.6
travis_time:start:1a5cb638
$ dmesg | grep -i kill

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@RalfJung

This comment has been minimized.

Member

RalfJung commented Dec 2, 2018

Code-wise this seems fine but someone else should probably review as well as I'm not up to date on MaybeUninit myself -- not sure who to assign though personally.

@SimonSapin could you have a look?

@@ -22,6 +22,9 @@ fn float_to_decimal_common_exact<T>(fmt: &mut Formatter, num: &T,
unsafe {
let mut buf = MaybeUninit::<[u8; 1024]>::uninitialized(); // enough for f32 and f64
let mut parts = MaybeUninit::<[flt2dec::Part; 4]>::uninitialized();
// FIXME: Technically, this is calling `get_mut` on an uninitialized

This comment has been minimized.

@SimonSapin

SimonSapin Dec 2, 2018

Contributor

Maybe file an issue about this specifically, and mention that issue number in code comments for all known occurences? That way when the question is resolved we can grep for the issue number to find places to fix (or to remove outdated FIXME comments).

This comment has been minimized.

@RalfJung

RalfJung Dec 2, 2018

Member

Wouldn't this usually be part of the discussion in the tracking issue?

This comment has been minimized.

@SimonSapin

SimonSapin Dec 2, 2018

Contributor

Ok, the tracking issue number could serve as well. My comment was more about having something to grep for to find known occurrences.

This comment has been minimized.

@RalfJung

RalfJung Dec 2, 2018

Member

I agree. Is like this okay? This covers all get_mut uses that got added as part of my PR series. I grepped the codebase for other uses of MaybeUninit and found none.

@SimonSapin

This comment has been minimized.

Contributor

SimonSapin commented Dec 2, 2018

Looks good, thanks!

@bors r+

@bors

This comment has been minimized.

Contributor

bors commented Dec 2, 2018

📌 Commit ebe69c0 has been approved by SimonSapin

@bors

This comment has been minimized.

Contributor

bors commented Dec 2, 2018

⌛️ Testing commit ebe69c0 with merge 8660eba...

bors added a commit that referenced this pull request Dec 2, 2018

Auto merge of #56275 - RalfJung:win-mutex, r=SimonSapin
use MaybeUninit instead of mem::uninitialized for Windows Mutex

I hope this builds, I do not have a Windows machine to test...
@bors

This comment has been minimized.

Contributor

bors commented Dec 2, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: SimonSapin
Pushing 8660eba to master...

@bors bors merged commit ebe69c0 into rust-lang:master Dec 2, 2018

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details

@bors bors referenced this pull request Dec 2, 2018

Open

Add todo!() macro #56348

@RalfJung RalfJung referenced this pull request Dec 2, 2018

Merged

We don't need no whitelist #561

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment