std:win: avoid WSA_FLAG_NO_INHERIT flag and don't use SetHandleInformation on UWP
This flag is not supported on Windows 7 before SP1, and on windows server 2008 SP2. This breaks Socket creation & duplication.
This was fixed in a previous PR. cc #26658
This PR: cc #60260 reuses this flag to support UWP, and makes an attempt to handle the potential error.
This version still fails to create a socket, as the error returned by WSA on this case is WSAEINVAL (invalid argument). and not WSAEPROTOTYPE.
MSDN page for WSASocketW (that states the platform support for WSA_FLAG_NO_HANDLE_INHERIT): https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-wsasocketw
CC #26543
CC #26518
rustc_codegen_ssa: Fix BodyAndCache reborrow to Body and change instances of body() call to derefence
rustc_mir: Fix BodyAndCache reborrow to Body and change intances of body() call to derefence
This commit updates the `wasi-libc` repository used to build the
wasm32-wasi target's libstd to ensure that both libstd and libc are
using the same wasi snapshot version.
Fixes an error introduced in #66750 where wasi executables always think
they have zero arguments because one of the vectors returned here
accidentally thought it was length 0.
Make const-qualification look at more `const fn`s
As explained in a lot more detail in #67053 this makes const-qualification not ignore the unstable const fns in libcore.
r? @oli-obk cc @ecstatic-morse
(Still a bit unsure about the `cfg`s here, for bootstrapping, does that seem correct ?)
Fixes#67053.
Include a span in more `expected...found` notes
In most places, we use a span when emitting `expected...found` errors.
However, there were a couple of places where we didn't use any span,
resulting in hard-to-interpret error messages.
This commit attaches the relevant span to these notes, and additionally
switches over to using `note_expected_found` instead of manually
formatting the message
weak-into-raw: Clarify some details in Safety
Clarify it is OK to pass a pointer that never owned a weak count (one
from Weak::new) back into it as it was created from it. Relates to
discussion in #60728.
@CAD97 Do you want to have a look at the new docs?
Less minification
The goal of this PR is to remove the minification process on the `search-index.js` file. It provides great result in term of space reduction but the computation time is far too long. I'll work on this issue and will put it back once it's fast enough.
cc @nox @lqd
r? @kinnison
Reorganize borrow check diagnostic code
Currently borrow checker diagnostics are split across many different modules in different places in the `librustc_mir` crate. This moves them all to a `diagnostics` module. This also reduces the nesting of the modules a bit (sooo much nesting).
I am also thinking of moving stuff out of the `nll` module since we only have one borrow checker now (🎉), and maybe it even makes sense to split out all of this stuff to a `librustc_borrow_check`, but those are for the future. Feel free to ping me here or on zulip and let me know what you think...
cc @nikomatsakis @matthewjasper @eddyb
Clarify it is OK to pass a pointer that never owned a weak count (one
from Weak::new) back into it as it was created from it. Relates to
discussion in #60728.
Use Module::print() instead of a PrintModulePass
llvm::Module has a print() method. It is unnecessary to create a pass just for the purpose of printing LLVM IR.
The deprecated `LLVM{Get,Set}ValueName` only work with NUL-terminated
strings, but the `2` variants use explicit lengths, which fits better
with Rust strings and slices. We now use these in new helper functions
`llvm::{get,set}_value_name` that convert to/from `&[u8]`.