| Age | Commit message (Collapse) | Author | Lines |
|
Add new tier-3 target: armv7-unknown-linux-uclibceabihf
This change adds a new tier-3 target: armv7-unknown-linux-uclibceabihf
This target is primarily used in embedded linux devices where system resources are slim and glibc is deemed too heavyweight. Cross compilation C toolchains are available [here](https://toolchains.bootlin.com/) or via [buildroot](https://buildroot.org).
The change is based largely on a previous PR #79380 with a few minor modifications. The author of that PR was unable to push the PR forward, and graciously allowed me to take it over.
Per the [target tier 3 policy](https://github.com/rust-lang/rfcs/blob/master/text/2803-target-tier-policy.md), I volunteer to be the "target maintainer".
This is my first PR to Rust itself, so I apologize if I've missed things!
|
|
|
|
|
|
|
|
Move top part of print_item to Tera templates
Part of #84419.
This moves the first line of each item page (E.g. `Struct foo::Bar .... 1.0.0 [-][src]` into a Tera template.
I also moved template initialization into its own module and added a small macro to reduce duplication and opportunity for errors.
|
|
Also tidied up a few other nearby `#[must_use]`s.
|
|
CI: Use mirror for libisl downloads for more docker dist builds
http://isl.gforge.inria.fr fell from the net a couple of days ago. It hosts libisl source tarballs required by crosstool-ng, which we use for our docker dist cross-compilation builds. Some of the affected builds were already fixed in #89599.
This PR sets a mirror URL for the other builds requiring libisl-0.14. They use an older version of crosstool-ng (1.22.0), which has only one mirror setting for all downloads.
r? `@Mark-Simulacrum`
|
|
|
|
There's nothing insightful to say about these so I didn't write any
extra explanations.
|
|
Remove unused clippy bootstrap env vars
Continues rust-lang/rust-clippy#7646
|
|
|
|
|
|
|
|
|
|
|
|
rustdoc: Cleanup various `clean` types
Cleanup various `clean` types.
|
|
Co-authored-by: Amanieu d'Antras <amanieu@gmail.com>
|
|
|
|
|
|
Rollup of 6 pull requests
Successful merges:
- #75644 (Add 'core::array::from_fn' and 'core::array::try_from_fn')
- #87528 (stack overflow handler specific openbsd change.)
- #88436 (std: Stabilize command_access)
- #89614 (Update to Unicode 14.0)
- #89664 (Add documentation to boxed conversions)
- #89700 (Fix invalid HTML generation for higher bounds)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
|
|
because previous test does not cause the expected error message when
`-Z borrowck=mir`.
|
|
r=notriddle
Fix invalid HTML generation for higher bounds
Considering this is a bug, I cherry-picked the commit from #89676 so it's merged more quickly.
r? ``@notriddle``
|
|
Add documentation to boxed conversions
Among other changes, documents whether allocations are necessary
to complete the type conversion.
Part of #51430, supersedes #89199
|
|
Update to Unicode 14.0
The Unicode Standard [announced Version 14.0](https://home.unicode.org/announcing-the-unicode-standard-version-14-0/) on September 14, 2021, and this pull request updates the generated tables in `core` accordingly.
This did require a little prep-work in `unicode-table-generator`. First, #81358 had modified the generated file instead of the tool, so that change is now reflected in the tool as well. Next, I found that the "Alphabetic" property in version 14 was panicking when generating a bitset, "cannot pack 264 into 8 bits". We've been using the skiplist for that anyway, so I changed this to fail gracefully. Finally, I confirmed that the tool still created the exact same tables for 13 before moving to 14.
|
|
std: Stabilize command_access
Tracking issue: #44434 (not yet closed but the FCP is done so that should be soon).
|
|
stack overflow handler specific openbsd change.
|
|
Add 'core::array::from_fn' and 'core::array::try_from_fn'
These auxiliary methods fill uninitialized arrays in a safe way and are particularly useful for elements that don't implement `Default`.
```rust
// Foo doesn't implement Default
struct Foo(usize);
let _array = core::array::from_fn::<_, _, 2>(|idx| Foo(idx));
```
Different from `FromIterator`, it is guaranteed that the array will be fully filled and no error regarding uninitialized state will be throw. In certain scenarios, however, the creation of an **element** can fail and that is why the `try_from_fn` function is also provided.
```rust
#[derive(Debug, PartialEq)]
enum SomeError {
Foo,
}
let array = core::array::try_from_fn(|i| Ok::<_, SomeError>(i));
assert_eq!(array, Ok([0, 1, 2, 3, 4]));
let another_array = core::array::try_from_fn(|_| Err(SomeError::Foo));
assert_eq!(another_array, Err(SomeError::Foo));
```
|
|
Refactor fingerprint reconstruction
This PR replaces can_reconstruct_query_key with fingerprint_style, which returns the style of the fingerprint for that query. This allows us to avoid trying to extract a DefId (or equivalent) from keys which *are* reconstructible because they're () but not as DefIds.
This is done with the goal of fixing -Zdump-dep-graph, which seems to have broken a while ago (I didn't try to bisect). Currently even on a `fn main() {}` file it'll ICE (you need to also pass -Zquery-dep-graph for it to work at all), and this patch indirectly fixes the cause of that ICE. This also adds a test for it continuing to work.
|
|
|
|
|
|
Rollup of 10 pull requests
Successful merges:
- #88707 (String.split_terminator: Add an example when using a slice of chars)
- #89605 (Fix stabilization version for `bindings_after_at`)
- #89634 (rustc_driver: Enable the `WARN` log level by default)
- #89641 (make #[target_feature] work with `asm` register classes)
- #89678 (Fix minor std::thread documentation typo)
- #89684 (Fix asm docs typo)
- #89687 (Move `read2_abbreviated` function into read2.rs)
- #89693 (Add #[must_use] to stdin/stdout/stderr locks)
- #89694 (Add #[must_use] to string/char transformation methods)
- #89697 (Fix min LLVM version for bpf-types test)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
Fix min LLVM version for bpf-types test
The test requires https://reviews.llvm.org/D102118 which was released in LLVM 13.
Closes #89689
|
|
Add #[must_use] to string/char transformation methods
These methods could be misconstrued as modifying their arguments instead of returning new values.
Where possible I made the note recommend a method that does mutate in place.
Parent issue: #89692
|
|
r=joshtriplett
Add #[must_use] to stdin/stdout/stderr locks
Affected methods:
```rust
std::io fn stdin_locked() -> StdinLock<'static>;
std::io::Stdin fn lock(&self) -> StdinLock<'_>;
std::io fn stdout_locked() -> StdoutLock<'static>;
std::io::Stdout fn lock(&self) -> StdoutLock<'_>;
std::io fn stderr_locked() -> StderrLock<'static>;
std::io::Stderr fn lock(&self) -> StderrLock<'_>;
```
Parent issue: https://github.com/rust-lang/rust/issues/89692
|
|
r=Mark-Simulacrum
Move `read2_abbreviated` function into read2.rs
Work towards #89475.
|
|
Fix asm docs typo
Fixes a typo in target feature names in the `asm` documentation
|
|
Fix minor std::thread documentation typo
callers of spawn_unchecked() need to make sure that the thread
not outlive references in the passed closure, not the other way around.
|
|
make #[target_feature] work with `asm` register classes
Fixes #89289
|
|
rustc_driver: Enable the `WARN` log level by default
This commit changes the `tracing_subscriber` initialization in
`rustc_driver` so that the `WARN` verbosity level is enabled by default
when the `RUSTC_LOG` env variable is empty. If the `RUSTC_LOG` env
variable is set, the filter string in the environment variable is
honored, instead.
Fixes #76824
Closes #89623
cc ``@eddyb,`` ``@oli-obk``
|
|
Fix stabilization version for `bindings_after_at`
According to the release notes and its PR milestone, it was stabilized
in 1.56.0.
|
|
String.split_terminator: Add an example when using a slice of chars
|
|
Co-authored-by: Laurențiu Nicola <lnicola@users.noreply.github.com>
|
|
Closes #89689
|
|
Co-authored-by: Josh Triplett <josh@joshtriplett.org>
Co-authored-by: Laurențiu Nicola <lnicola@users.noreply.github.com>
|
|
|
|
Co-authored-by: Josh Triplett <josh@joshtriplett.org>
|
|
Add print_item.html and the code in print_item.rs to use it.
|
|
Optimize File::read_to_end and read_to_string
Reading a file into an empty vector or string buffer can incur unnecessary `read` syscalls and memory re-allocations as the buffer "warms up" and grows to its final size. This is perhaps a necessary evil with generic readers, but files can be read in smarter by checking the file size and reserving that much capacity.
`std::fs::read` and `std::fs::read_to_string` already perform this optimization: they open the file, reads its metadata, and call `with_capacity` with the file size. This ensures that the buffer does not need to be resized and an initial string of small `read` syscalls.
However, if a user opens the `File` themselves and calls `file.read_to_end` or `file.read_to_string` they do not get this optimization.
```rust
let mut buf = Vec::new();
file.read_to_end(&mut buf)?;
```
I searched through this project's codebase and even here are a *lot* of examples of this. They're found all over in unit tests, which isn't a big deal, but there are also several real instances in the compiler and in Cargo. I've documented the ones I found in a comment here:
https://github.com/rust-lang/rust/issues/89516#issuecomment-934423999
Most telling, the documentation for both the `Read` trait and the `Read::read_to_end` method both show this exact pattern as examples of how to use readers. What this says to me is that this shouldn't be solved by simply fixing the instances of it in this codebase. If it's here it's certain to be prevalent in the wider Rust ecosystem.
To that end, this commit adds specializations of `read_to_end` and `read_to_string` directly on `File`. This way it's no longer a minor footgun to start with an empty buffer when reading a file in.
A nice side effect of this change is that code that accesses a `File` as `impl Read` or `dyn Read` will benefit. For example, this code from `compiler/rustc_serialize/src/json.rs`:
```rust
pub fn from_reader(rdr: &mut dyn Read) -> Result<Json, BuilderError> {
let mut contents = Vec::new();
match rdr.read_to_end(&mut contents) {
```
Related changes:
- I also added specializations to `BufReader` to delegate to `self.inner`'s methods. That way it can call `File`'s optimized implementations if the inner reader is a file.
- The private `std::io::append_to_string` function is now marked `unsafe`.
- `File::read_to_string` being more efficient means that the performance note for `io::read_to_string` can be softened. I've added `@camelid's` suggested wording from https://github.com/rust-lang/rust/issues/80218#issuecomment-936806502.
r? `@joshtriplett`
|
|
These methods could be misconstrued as modifying their arguments instead
of returning new values.
Where possible I made the note recommend a method that does mutate in
place.
|