| Age | Commit message (Collapse) | Author | Lines |
|
Rename
* Error::iter_chain() -> Error::chain()
* ErrorIter -> Chain
Removed
* Error::iter_sources()
according to
https://github.com/rust-lang/rust/issues/58520
Rationale:
1. Such iterators are helpful. They should better be stabilized sooner
than later.
2. self should be included. It is easy to .skip(1) it.
Not including self is harmful because it is harder to add self
to the iterator than to remove it.
3. The chosen name should be telling and reflect the fact that self is
included. `.chain()` was chosen because the iterator iterates over
the chain of errors that is somehow included in self.
4. The resulting iterator is named `Chain` because the `error::Chain`
is what we want to have.
|
|
|
|
Fix typo from #65214
|
|
Change untagged_unions to not allow union fields with drop
This is a rebase of #56440, massaged to solve merge conflicts and make the test suite pass.
Change untagged_unions to not allow union fields with drop
Union fields may now never have a type with attached destructor. This for example allows unions to use arbitrary field types only by wrapping them in `ManuallyDrop` (or similar).
The stable rule remains, that union fields must be `Copy`. We use the new rule for the `untagged_union` feature.
Tracking issue: https://github.com/rust-lang/rust/issues/55149
|
|
|
|
|
|
|
|
Added doc on keyword break
RE: #34601
|
|
Fix parameter name in documentation
|
|
Remove leading :: from paths in doc examples
Noted some pre-2018 path syntax in the doc examples, for example:
https://doc.rust-lang.org/std/process/fn.exit.html
```rust
fn main() {
::std::process::exit(match run_app() {
Ok(_) => 0,
...
```
Couldn't find an existing issue on this (then again, "::" makes for an annoying thing to search for) so if there is already something fixing this and/or there's a reason to not fix it, just close this PR.
(Also fixed indentation in the `process::exit()` docs)
|
|
|
|
|
|
Avoid realloc in `CString::new`
If `&[u8]` or `&str` is given, `CString::new` allocates a new `Vec` with the exact capacity, and then `CString::from_vec_unchecked` calls `.reserve_exact(1)` for nul byte. This PR avoids the reallocation by allocationg `len + 1` bytes beforehand. In microbenchmark this PR speeds up `CString::new(&[u8])` by 30%.
|
|
|
|
=> simplifies the maintenance of the interface
|
|
|
|
Update libc to 0.2.64
Passed local tests.
cc potentially interested people: @gnzlbg @tlively
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
doc: fix typo in OsStrExt and OsStringExt
|
|
Don't recommend ONCE_INIT in std::sync::Once
ONCE_INIT is deprecated, and so suggesting it as not only being on par with, but before `Once::new` is a bad idea.
|
|
make File::try_clone produce non-inheritable handles on Windows
~**NOT READY FOR REVIEW.** This PR is currently mainly to trigger CI so that I can see what happens. (Is there a better way to trigger CI?) I don't know whether this change makes sense yet.~ (Edit: @Mark-Simulacrum clarified that CI doesn't currently run on Windows.)
---
File handles shouldn't be inheritable in general.
`std::process::Command` takes care of making them inheritable when child
processes are spawned, and the `CREATE_PROCESS_LOCK` protects against
races in that section on Windows. But `File::try_clone` has been
creating inheritable file descriptors outside of that lock, which could
be leaking into other child processes unintentionally.
See also https://github.com/rust-lang/rust/pull/31069#discussion_r334117665.
|
|
|
|
|
|
- Compatible with Emscripten 1.38.46-upstream or later upstream.
- Refactors the Emscripten target spec to share code with other wasm
targets.
- Replaces the old incorrect wasm32 C call ABI with the correct one,
preserving the old one as wasm32_bindgen_compat for wasm-bindgen
compatibility.
- Updates the varargs ABI used by Emscripten and deletes the old one.
- Removes the obsolete wasm32-experimental-emscripten target.
- Uses EMCC_CFLAGS on CI to avoid the timeout problems with #63649.
|
|
|
|
ONCE_INIT is deprecated, and so suggesting it as not only being on par with, but before `Once::new` is a bad idea.
|
|
This provides a more fluent API to create files with options, and also avoids the need to import OpenOptions.
|
|
Implement Error::source on IntoStringError + Remove superfluous cause impls
IntoStringError only implemented `Error::cause`, which is deprecated. This implemements `Error::source` instead.
`Error::cause` will still work as before, thanks to the default implementation.
I think this was the only/last `Error` impl in the standard library to have a cause, but not a source.
|
|
Fix typo in task::Waker
fixes #65323
in `libstd/error.rs` there are a few mentions of `trait@Send` and `trait@Sync`. Are they wrong as well?
|
|
vxWorks: implement get_path() and get_mode() for File fmt::Debug
|
|
Split non-CAS atomic support off into target_has_atomic_load_store
This PR implements my proposed changes in https://github.com/rust-lang/rust/issues/32976#issuecomment-518542029 by removing `target_has_atomic = "cas"` and splitting `target_has_atomic` into two separate `cfg`s:
* `target_has_atomic = 8/16/32/64/128`: This indicates the largest width that the target can atomically CAS (which implies support for all atomic operations).
* ` target_has_atomic_load_store = 8/16/32/64/128`: This indicates the largest width that the target can support loading or storing atomically (but may not support CAS).
cc #32976
r? @alexcrichton
|
|
|
|
|
|
IntoStringError only implemented Error::cause, which is
deprecated. This implemements Error::source instead.
Error::cause will still work as before, thanks to the default
implementation.
|
|
Mark Path::join as must_use
I've accidentally did `mut_path_buf.jon(a_path);`, expecting this to be an in-place modification. Seems like we can easily warn in such cases?
|
|
Added doc about behavior of extend on HashMap
It was unclear what the implementation does when it encounters existing keys. This change makes it clear by documenting the trait impl.
|
|
libstd: Fix typos in doc
|
|
File handles shouldn't be inheritable in general.
`std::process::Command` takes care of making them inheritable when child
processes are spawned, and the `CREATE_PROCESS_LOCK` protects against
races in that section on Windows. But `File::try_clone` has been
creating inheritable file descriptors outside of that lock, which could
be leaking into other child processes unintentionally.
See also https://github.com/rust-lang/rust/pull/31069#discussion_r334117665.
|
|
Stabilize mem::take (mem_take)
Tracking issue: https://github.com/rust-lang/rust/issues/61129
r? @matklad
|
|
|
|
|
|
|
|
I've accidentally did `mut_path_buf.jon(a_path);`, expecting this to be an in-place modification. Seems like we can easily warn in such cases?
|
|
vxworks: add checking (r == 0)
|