| Age | Commit message (Collapse) | Author | Lines |
|
Or rather expose it, but always return an error
|
|
Attempt to create sockets with the WSA_FLAG_NO_HANDLE_INHERIT flag, and
handle the potential error gracefully (as the flag isn't support on
Windows 7 before SP1)
|
|
As Rtl* functions are not allowed there
|
|
|
|
|
|
Rename .cap() methods to .capacity()
As mentioned in #60316, there are a few `.cap()` methods, which seem out-of-place because such methods are called `.capacity()` in the rest of the code.
This PR renames them to `.capacity()` but leaves `RawVec::cap()` in there for backwards compatibility.
I didn't try to mark the old version as "deprecated", because I guess this would cause too much noise.
|
|
This commit moves `thread_local!` on WebAssembly targets to using the
`#[thread_local]` attribute in LLVM. This was recently implemented
upstream and is [in the process of being documented][dox]. This change
only takes affect if modules are compiled with `+atomics` which is
currently unstable and a pretty esoteric method of compiling wasm
artifacts.
This "new power" of the wasm toolchain means that the old
`wasm-bindgen-threads` feature of the standard library can be removed
since it should now be possible to create a fully functioning threaded
wasm module without intrusively dealing with libstd symbols or
intrinsics. Yay!
[dox]: https://github.com/WebAssembly/tool-conventions/pull/116
|
|
add support for hexagon-unknown-linux-musl
|
|
|
|
|
|
|
|
|
|
Co-Authored-By: gnzlbg <gnzlbg@users.noreply.github.com>
|
|
|
|
This makes them relative to the containing file instead of the crate
root
|
|
Remove uses of mem::uninitialized, which is now deprecated
|
|
Usages still appear in cloudabi tests and in the reentrant mutex implementation
|
|
|
|
|
|
read: fix doc comment
No idea how that happened...
|
|
Fix typo in src/libstd/net/udp.rs doc comment
Affect is usually used as a verb, effect as a verb.
|
|
do not use assume_init in std::io
Cc https://github.com/rust-lang/rust/issues/62397
|
|
Test that maplike FromIter satisfies uniqueness
This PR adds a simple assertion to the `HashMap` and `HashSet` tests to ensure that uniqueness is satisfied when `FromIter`ing. This is useful for people who want to test their custom type against the Map/Set interfaces since they'll copy the tests wholesale but possibly miss this bug (where _they_ = _me_).
|
|
|
|
|
|
|
|
|
|
dereferenced
|
|
non-NULL
|
|
|
|
|
|
|
|
|
|
Affect is usually used as a verb, effect as a verb.
|
|
Remove last use of mem::uninitialized from std::io::util
Addresses #62397 for std::io::util
|
|
|
|
|
|
|
|
port rust for vxWorks
The supporting for vxWorks has been enabled in this branch. Although there are still a lots of work to do, I would like to upstream the code and fix the problems later.
Please let me know if there is anything I have to do before upstream the code.
r? @alexcrichton
Thanks,
Baoshan
|
|
r? @alexcrichton
|
|
|
|
|
|
Fix miri error in into_inner() of CString
Fix #62553
I choice to not transmute because I think it's more unsafe and in case the structure change this code should always work.
r? @RalfJung
|
|
Add missing urls for osstr
r? @QuietMisdreavus
|
|
|
|
The std::io::Write::write method currensly suggests consumers guaranteed
that `0 <= n <= buf.len()`, for `Ok(n)`, however `n` is of type `usize`
causing the compiler to emit a warning:
```
warning: comparison is useless due to type limits
--> lib.rs:6:18
|
6 | Ok(n) => 0 <= n && n <= output.len(),
| ^^^^^^
|
= note: #[warn(unused_comparisons)] on by default
```
This PR removes the suggestion to check `0 <= n` since it is moot.
r? @steveklabnik
|
|
|
|
filedesc: don't use ioctl(FIOCLEX) on Linux
All `ioctl(2)`s will fail on `O_PATH` file descriptors on Linux (because
they use `&empty_fops` as a security measure against `O_PATH` descriptors
affecting the backing file).
As a result, `File::try_clone()` and various other methods would always
fail with `-EBADF` on `O_PATH` file descriptors. The solution is to simply
use `F_SETFD` (as is used on other unices) which works on `O_PATH`
descriptors because it operates through the `fnctl(2)` layer and not
through `ioctl(2)`s.
Since this code is usually only used in strange error paths (a broken or
ancient kernel), the extra overhead of one syscall shouldn't cause any
dramas. Most other systems programming languages also use the fnctl(2)
so this brings us in line with them.
Fixes: rust-lang/rust#62314
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
|
|
All ioctl(2)s will fail on O_PATH file descriptors on Linux (because
they use &empty_fops as a security measure against O_PATH descriptors
affecting the backing file).
As a result, File::try_clone() and various other methods would always
fail with -EBADF on O_PATH file descriptors. The solution is to simply
use F_SETFD (as is used on other unices) which works on O_PATH
descriptors because it operates through the fnctl(2) layer and not
through ioctl(2)s.
Since this code is usually only used in strange error paths (a broken or
ancient kernel), the extra overhead of one syscall shouldn't cause any
dramas. Most other systems programming languages also use the fnctl(2)
so this brings us in line with them.
Fixes: rust-lang/rust#62314
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
|
|
Replace SliceConcatExt trait with inherent methods and SliceConcat helper trait
Before this change `SliceConcatExt` was an unstable extension trait with stable methods. It was in the libstd prelude, so that its methods could be used on the stable channel.
This replaces it with inherent methods, which can be used without any addition to the prelude. Since the methods are stable and very generic (with for example a return type that depends on the types of parameters), an helper trait is still needed. But now that trait does not need to be in scope for the methods to be used.
Removing this depedency on the libstd prelude allows the methods to be used in `#![no_std]` crate that use liballoc, which does not have its own implicitly-imported prelude.
|