| Age | Commit message (Collapse) | Author | Lines |
|
|
|
|
|
|
|
It stop asserts and panics from libstd to automatically
include string output and formatting code.
Use case: developing static executables smaller than 50 kilobytes,
where usual formatting code is excessive while keeping debuggability
in debug mode.
May resolve #54981.
|
|
|
|
libcore: Add VaList and variadic arg handling intrinsics
## Summary
- Add intrinsics for `va_start`, `va_end`, `va_copy`, and `va_arg`.
- Add `core::va_list::VaList` to `libcore`.
Part 1 of (at least) 3 for #44930
Comments and critiques are very much welcomed 😄
|
|
r=steveklabnik
Add missing doc link
r? @steveklabnik
|
|
Remove unsafe `unsafe` inner function.
Within this `Iterator` implementation, a function `unsafe_get` is
defined which unsafely allows _unchecked_ indexing of any element in a
slice. This should be marked as _unsafe_, but it is not.
To address this issue, I removed that inner function.
|
|
atomic::Ordering: Get rid of misleading parts of intro
Remove the parts of atomic::Ordering's intro that wrongly claimed that
SeqCst prevents all reorderings around it.
Closes #55196
This is a (minimal) alternative to #55233.
I also wonder if it would be worth adding at least some warnings that atomics are often a footgun/hard to use correctly, similarly like `mem::transmute` or other functions have.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- Add the llvm intrinsics used to manipulate a va_list.
- Add the va_list lang item in order to allow implementing
VaList in libcore.
|
|
Use MaybeUninit in libcore
All code by @japaric. This re-submits the second half of https://github.com/rust-lang/rust/pull/53508 (the first half is at https://github.com/rust-lang/rust/pull/54667). This is likely the one containing the perf regression.
|
|
|
|
|
|
|
|
|
|
Within this `Iterator` implementation, a function `unsafe_get` is
defined which unsafely allows _unchecked_ indexing of any element in a
slice. This should be marked as _unsafe_, but it is not.
To address this issue, I removed that inner function.
|
|
Make `ParseIntError` and `IntErrorKind` fully public
Why would you write nice error types if I can't read them?
# Why
It can be useful to use `match` with errors produced when parsing strings to int. This would be useful for the `.err_match()` function in my [new crate](https://crates.io/crates/read_input).
---
I could also do this for `ParseFloatError` if people think it is a good idea.
I am new around hear so please tell me if I am getting anything wrong.
|
|
`TryFrom<&[T]> for &[T; $N]` (note *reference* to an array) already exists,
but not needing to dereference makes type inference easier
for example when using `u32::from_be_bytes`.
Also add doc examples doing just that.
|
|
|
|
|
|
- Original bug about documenting grammar
- https://github.com/rust-lang/rust/issues/32243
- Known bug with parsing
- https://github.com/rust-lang/rust/issues/31407
|
|
Stabilize the int_to_from_bytes feature
Fixes #52963
FCP to merge completed: https://github.com/rust-lang/rust/issues/52963#issuecomment-416548327
|
|
Incorporate `dyn` into more comments and docs.
r? @rust-lang/docs
|
|
Fixes #52963
|
|
|
|
Code by @japaric, I just split it into individual commits
|
|
Code by @japaric, I just split it into individual commits
|
|
Code by @japaric, I just split it into individual commits
|
|
Code by @japaric, I just split it into individual commits
|
|
Code by @japaric, I just split it into individual commits
|
|
Code by @japaric, I just split it into individual commits
|
|
|
|
std::str Adapt documentation to reality
|
|
Add std::iter::unfold
This adds an **unstable** ~`std::iter::iterate`~ `std::iter::unfold` function and ~`std::iter::Iterate`~ `std::iter::Unfold` type that trivially wrap a ~`FnMut() -> Option<T>`~ `FnMut(&mut State) -> Option<T>` closure to create an iterator. ~Iterator state can be kept in the closure’s environment or captures.~
This is intended to help reduce amount of boilerplate needed when defining an iterator that is only created in one place. Compare the existing example of the `std::iter` module: (explanatory comments elided)
```rust
struct Counter {
count: usize,
}
impl Counter {
fn new() -> Counter {
Counter { count: 0 }
}
}
impl Iterator for Counter {
type Item = usize;
fn next(&mut self) -> Option<usize> {
self.count += 1;
if self.count < 6 {
Some(self.count)
} else {
None
}
}
}
```
… with the same algorithm rewritten to use this new API:
```rust
fn counter() -> impl Iterator<Item=usize> {
std::iter::unfold(0, |count| {
*count += 1;
if *count < 6 {
Some(*count)
} else {
None
}
})
}
```
-----
This also add unstable `std::iter::successors` which takes an (optional) initial item and a closure that takes an item and computes the next one (its successor).
```rust
let powers_of_10 = successors(Some(1_u16), |n| n.checked_mul(10));
assert_eq!(powers_of_10.collect::<Vec<_>>(), &[1, 10, 100, 1_000, 10_000]);
```
|
|
Fix #[cfg] for step impl on ranges
```#[cfg(target_pointer_witdth = ...)]``` is misspelled
|
|
|
|
|
|
Rollup of 11 pull requests
Successful merges:
- #55367 (lint if a private item has doctests)
- #55485 (Return &T / &mut T in ManuallyDrop Deref(Mut) impl)
- #55784 (Clarifying documentation for collections::hash_map::Entry::or_insert)
- #55961 (Fix VecDeque pretty-printer)
- #55980 (Suggest on closure args count mismatching with pipe span)
- #56002 (fix #55972: Erroneous self arguments on bare functions emit subpar compilation error)
- #56063 (Update any.rs documentation using keyword dyn)
- #56067 (Add SGX target to rustc)
- #56078 (Fix error message for `-C panic=xxx`.)
- #56106 (Remove some incorrect doc comments)
- #56126 (core/benches/num: Add `from_str/from_str_radix()` benchmarks)
Failed merges:
r? @ghost
|
|
core/benches/num: Add `from_str/from_str_radix()` benchmarks
This was extracted from #55973
/cc @alexcrichton
|
|
Update any.rs documentation using keyword dyn
This will fix #56062.
|