| Age | Commit message (Collapse) | Author | Lines |
|
Signed-off-by: onur-ozkan <work@onurozkan.dev>
|
|
Signed-off-by: onur-ozkan <work@onurozkan.dev>
|
|
Signed-off-by: onur-ozkan <work@onurozkan.dev>
|
|
|
|
|
|
Move `fd` into `std::sys`
Move platform definitions of `fd` into `std::sys`, as part of https://github.com/rust-lang/rust/issues/117276.
Unlike other modules directly under `std::sys`, this is only available on some platforms and I have not provided a fallback abstraction for unsupported platforms. That is similar to how `std::os::fd` is gated to only supported platforms.
Also, fix the `unsafe_op_in_unsafe_fn` lint, which was allowed for the Unix fd impl. Since macro expansions from `std::sys::pal::unix::weak` trigger this lint, fix it there too.
cc `@joboet,` `@ChrisDenton`
try-job: x86_64-gnu-aux
|
|
|
|
r=notriddle
Rustdoc: typecheck settings.js
This makes the file fully typechecked with no instances of ``````@ts-expect-error`````` and no type casts.
r? `````@notriddle`````
|
|
Allow optimizing out `panic_bounds_check` in Unicode checks.
Allow optimizing out `panic_bounds_check` in Unicode checks.
For context, see https://github.com/japaric/ufmt/issues/52#issuecomment-2699207241.
|
|
Expose algebraic floating point intrinsics
# Problem
A stable Rust implementation of a simple dot product is 8x slower than C++ on modern x86-64 CPUs. The root cause is an inability to let the compiler reorder floating point operations for better vectorization.
See https://github.com/calder/dot-bench for benchmarks. Measurements below were performed on a i7-10875H.
### C++: 10us ✅
With Clang 18.1.3 and `-O2 -march=haswell`:
<table>
<tr>
<th>C++</th>
<th>Assembly</th>
</tr>
<tr>
<td>
<pre lang="cc">
float dot(float *a, float *b, size_t len) {
#pragma clang fp reassociate(on)
float sum = 0.0;
for (size_t i = 0; i < len; ++i) {
sum += a[i] * b[i];
}
return sum;
}
</pre>
</td>
<td>
<img src="https://github.com/user-attachments/assets/739573c0-380a-4d84-9fd9-141343ce7e68" />
</td>
</tr>
</table>
### Nightly Rust: 10us ✅
With rustc 1.86.0-nightly (8239a37f9) and `-C opt-level=3 -C target-feature=+avx2,+fma`:
<table>
<tr>
<th>Rust</th>
<th>Assembly</th>
</tr>
<tr>
<td>
<pre lang="rust">
fn dot(a: &[f32], b: &[f32]) -> f32 {
let mut sum = 0.0;
for i in 0..a.len() {
sum = fadd_algebraic(sum, fmul_algebraic(a[i], b[i]));
}
sum
}
</pre>
</td>
<td>
<img src="https://github.com/user-attachments/assets/9dcf953a-2cd7-42f3-bc34-7117de4c5fb9" />
</td>
</tr>
</table>
### Stable Rust: 84us ❌
With rustc 1.84.1 (e71f9a9a9) and `-C opt-level=3 -C target-feature=+avx2,+fma`:
<table>
<tr>
<th>Rust</th>
<th>Assembly</th>
</tr>
<tr>
<td>
<pre lang="rust">
fn dot(a: &[f32], b: &[f32]) -> f32 {
let mut sum = 0.0;
for i in 0..a.len() {
sum += a[i] * b[i];
}
sum
}
</pre>
</td>
<td>
<img src="https://github.com/user-attachments/assets/936a1f7e-33e4-4ff8-a732-c3cdfe068dca" />
</td>
</tr>
</table>
# Proposed Change
Add `core::intrinsics::f*_algebraic` wrappers to `f16`, `f32`, `f64`, and `f128` gated on a new `float_algebraic` feature.
# Alternatives Considered
https://github.com/rust-lang/rust/issues/21690 has a lot of good discussion of various options for supporting fast math in Rust, but is still open a decade later because any choice that opts in more than individual operations is ultimately contrary to Rust's design principles.
In the mean time, processors have evolved and we're leaving major performance on the table by not supporting vectorization. We shouldn't make users choose between an unstable compiler and an 8x performance hit.
# References
* https://github.com/rust-lang/rust/issues/21690
* https://github.com/rust-lang/libs-team/issues/532
* https://github.com/rust-lang/rust/issues/136469
* https://github.com/calder/dot-bench
* https://www.felixcloutier.com/x86/vfmadd132ps:vfmadd213ps:vfmadd231ps
try-job: x86_64-gnu-nopt
try-job: x86_64-gnu-aux
|
|
|
|
|
|
|
|
|
|
Use target-agnostic LLD flags in bootstrap for `use-lld`
[Before](https://github.com/rust-lang/rust/pull/135001), I hardcoded LLD flags that pretty much only worked on GNU. The right way is to use `-Zlinker-features` instead though.
I *think* that this should also make this work on Windows mingw, and thus `@petrochenkov's` workaround is no longer necessary.
Fixes: https://github.com/rust-lang/rust/issues/139372
Closes: https://github.com/rust-lang/rust/pull/139375
r? `@lqd`
|
|
unstable book: document tait
Documents the type alias impl trait feature.
Rendered:



because you are deeply involved in this I'll r you but feel free to reroll
r? `@oli-obk`
|
|
Fix 2024 edition doctest panic output
Fixes #137970.
The problem was that the output was actually displayed by rustc itself because we're exiting with `Result<(), String>`, and the display is really not great. So instead, we get the output, we print it and then we return an `ExitCode`.
r? ````@aDotInTheVoid````
|
|
feat(project-model): provide flag for no deps
|
|
|
|
Cargo update
|
|
|
|
|
|
|
|
davidbarsky/davidbarsky/fix-panic-in-view-crate-graph
internal: fix panic in `view_crate_graph`
|
|
fix: don't drop references with more than one definition.
|
|
Noratrieb:Now_I_am_become_death,_the_destroyer_of_i686-pc-windows-gnu, r=workingjubilee
Demote i686-pc-windows-gnu to Tier 2
In accordance with [RFC 3771](https://github.com/rust-lang/rfcs/pull/3771). FCP has been completed.
tracking issue #138422
I also added a stub doc page for the target and renamed the windows-gnullvm page for consistency.
|
|
|
|
Implicit field references during struct initialization were
being dropped because get_definition was returning None because
there were multiple definitions.
This adds a new helper, `get_defintions`, that supports returning
more than one definition for a given token and hooks it up.
Fixes #19393
|
|
|
|
|
|
A Cargo project can now be built without any dependency metadata being fetched.
Signed-off-by: Prajwal S N <prajwalnadig21@gmail.com>
|
|
Add another Miri-detected bug to README.md
|
|
|
|
verb -> participle
Co-authored-by: Ralf Jung <post@ralfj.de>
|
|
|
|
Signed-off-by: Prajwal S N <prajwalnadig21@gmail.com>
|
|
|
|
|
|
Add helper function for checking LLD usage to `run-make-support`
Extracted out of https://github.com/rust-lang/rust/pull/138645, should be a simple refactoring.
r? ``@jieyouxu``
|
|
compiletest: Encapsulate all of the code that touches libtest
Compiletest currently relies on unstable libtest APIs in order to actually execute tests. That's unfortunate, but removing the dependency isn't trivial.
However, we can make a small step towards removing the libtest dependency by encapsulating the libtest interactions into a single dedicated module. That makes it easier to see what parts of libtest are actually used.
---
As a side-effect of moving the `test_opts` function into that dedicated module, this PR also ends up allowing `--fail-fast` to be passed on the command line, instead of requiring an environment variable.
---
There is still (at least) one other aspect of the libtest dependency that this PR does not address, namely the fact that we rely on libtest's output capture (via unstable std APIs) to capture the output that we print during individual tests. I hope to do something about that at some point.
r? jieyouxu
|
|
See https://rust-lang.github.io/mdBook/format/configuration/general.html#general-metadata
|
|
|
|
|
|
|
|
|
|
|
|
Included API:
impl<T: Copy> Cell<T> {
pub fn update(&self, f: impl FnOnce(T) -> T);
}
Closes: https://github.com/rust-lang/rust/issues/50186
|
|
Remove unused variables generated in merged doctests
The variable is unused so no need to keep it around.
cc `@notriddle`
r? `@camelid`
|
|
impl !PartialOrd for HirId
revive of https://github.com/rust-lang/rust/pull/92233
Another checkbox of https://github.com/rust-lang/rust/issues/90317, another small step in making incremental less likely to die in horrible ways
|
|
Tighten up assignment operator representations.
This is step 3 of [MCP 831](https://github.com/rust-lang/compiler-team/issues/831).
r? `@spastorino`
|