| Age | Commit message (Collapse) | Author | Lines |
|
|
|
|
|
Rollup of 5 pull requests
Successful merges:
- rust-lang/rust#144342 (add exact bitshifts)
- rust-lang/rust#145709 (Fix LoongArch C function ABI when passing/returning structs containing floats)
- rust-lang/rust#146152 (Unify and deduplicate algebraic float tests)
- rust-lang/rust#146207 (std: Implement WASIp2-specific stdio routines)
- rust-lang/rust#146217 (fix ICE when suggesting `::new`)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
avoid inline external links
|
|
|
|
split overlong physical lines
|
|
|
|
|
|
- RawVecInner::grow_exact causes UB if called with len and additional
arguments such that len + additional is less than the current
capacity. Indeed, in that case it calls Allocator::grow with a
new_layout that is smaller than old_layout, which violates a safety
precondition.
- All RawVecInner methods for resizing the buffer cause UB
if called with an elem_layout different from the one used to initially
allocate the buffer, because in that case Allocator::grow/shrink is called with
an old_layout that does not fit the allocated block, which violates a
safety precondition.
- RawVecInner::current_memory might cause UB if called with an elem_layout
different from the one used to initially allocate the buffer, because
the unchecked_mul might overflow.
- Furthermore, these methods cause UB if called with an elem_layout
where the size is not a multiple of the alignment. This is because
Layout::repeat is used (in layout_array) to compute the allocation's
layout when allocating, which includes padding to ensure alignment of
array elements, but simple multiplication is used (in current_memory) to
compute the old allocation's layout when resizing or deallocating, which
would cause the layout used to resize or deallocate to not fit the
allocated block, which violates a safety precondition.
|
|
Examples
---
```rust
mod indent {
struct Foo {}
fn foo() {
let foo = Foo{};
foo.bar$0;
}
}
```
**Before this PR**:
```rust
mod indent {
struct Foo { bar: ()
}
fn foo() {
let foo = Foo{};
foo.bar;
}
}
```
**After this PR**:
```rust
mod indent {
struct Foo {
bar: ()
}
fn foo() {
let foo = Foo{};
foo.bar;
}
}
```
---
New field list add newline
```rust
mod indent {
struct Foo;
fn foo() {
Foo.bar$0;
}
}
```
**Before this PR**:
```rust
mod indent {
struct Foo{ bar: () }
fn foo() {
Foo.bar;
}
}
```
**After this PR**:
```rust
mod indent {
struct Foo {
bar: (),
}
fn foo() {
Foo.bar;
}
}
```
|
|
make use of Duration::from_nanos_u128
|
|
|
|
Automatic Rustup
|
|
`(float_ty::MAX / 2) - (float_ty::MIN_POSITIVE * 2)` equals
`(float_ty::MAX / 2) + (float_ty::MIN_POSITIVE * 2)` equals
`(float_ty::MAX / 2)`. So these branches are pointless
|
|
fix ICE when suggesting `::new`
fixes https://github.com/rust-lang/rust/issues/146174
This code suggests to write `Foo::new(...)` when the user writes `Foo(...)` or `Foo { ... }` and the constructor is private, where `new` is some associated function that returns `Self`.
When checking that the return type of `new` is `Self`, we need to instantiate the parameters of `new` with infer vars, so we don't end up with a type like `Box<$param(0)>` in a context that doesn't have any parameters. But then we can't use `normalize_erasing_late_bound_regions` anymore because that goes though a query that can't deal with infer vars.
Since this is diagnostic-only code that is supposed to check for exactly `-> Self`, I think it's fine to just skip normalizing here, especially since The Correct Way<sup>TM</sup> would involve a probe and make this code even more complicated.
Also, the code here does almost the same thing, and these suggestions can probably be unified in the future: https://github.com/rust-lang/rust/blob/4ca8078d37c53ee4ff8fb32b4453b915116f25b8/compiler/rustc_hir_typeck/src/method/suggest.rs#L2123-L2129
r? ````@compiler-errors````
cc ````@Qelxiros```` -- this should unblock https://github.com/rust-lang/rust/pull/144420
|
|
std: Implement WASIp2-specific stdio routines
This commit is an extension of rust-lang/rust#145944 but applied to stdio specifically. The stdio routines are updated away from WASIp1 APIs to using WASIp2 APIs natively. The end goal is to eventually drop the dependency on WASIp1 APIs in the standard library entirely in favor of exclusively depending on WASIp2.
|
|
r=tgross35
Unify and deduplicate algebraic float tests
cc rust-lang/rust#141726
This is a proposal to unify and deduplicate the algebraic tests for f16, f32, f64 and f128
|
|
Fix LoongArch C function ABI when passing/returning structs containing floats
Similar to RISC-V, LoongArch passes structs containing only one or two floats (or a float–integer pair) in registers, as long as each element fits into a single corresponding register. Before this PR, Rust did not check the actual offset of the second float or integer; instead, it assumed the standard offset based on the default alignment. However, since the offset can be affected by `#[repr(align(N))]` and `#[repr(packed)]`, this led to miscompilations (see rust-lang/rust#145692). This PR fixes the issue by explicitly specifying the offset for the remainder of the cast.
|
|
add exact bitshifts
Tracking issue: rust-lang/rust#144336
cc ```@lolbinarycat```
|
|
resolve: Avoid finalizing extern prelude entries more than once
|
|
Pull recent changes from https://github.com/rust-lang/rust via Josh.
Upstream ref: b3cfb8faf84c5f3b7909479a9f9b6a3290d5f4d7
Filtered ref: 8995aa7743caf019203bc853f27af6006705ae30
Upstream diff: https://github.com/rust-lang/rust/compare/9385c64c95d971329e62917adc4349c8ccdbafe0...b3cfb8faf84c5f3b7909479a9f9b6a3290d5f4d7
This merge was created using https://github.com/rust-lang/josh-sync.
|
|
This updates the rust-version file to b3cfb8faf84c5f3b7909479a9f9b6a3290d5f4d7.
|
|
internal: Upgrade rustc crates
|
|
Clippy subtree update
r? `@Manishearth`
|
|
|
|
|
|
|
|
|
|
|
|
r=rcvalle
Sanitizers target modificators
Depends on bool flag fix: https://github.com/rust-lang/rust/pull/138483.
Some sanitizers need to be target modifiers, and some do not. For now, we should mark all sanitizers as target modifiers except for these: AddressSanitizer, LeakSanitizer
For kCFI, the helper flag -Zsanitizer-cfi-normalize-integers should also be a target modifier.
Many test errors was with sanizer flags inconsistent with std deps. Tests are fixed with `-C unsafe-allow-abi-mismatch`.
|
|
Example
---
```rust
fn main() {
let x = 1*x $0+ 2;
}
```
**Before this PR**:
```rust
fn main() {
let x = 1*x.wrapping_add(2);
}
```
**After this PR**:
```rust
fn main() {
let x = (1*x).wrapping_add(2);
}
```
|
|
clippy-subtree-update
|
|
clippy-subtree-update
|
|
r? @ghost
changelog: integer-to-pointer-transmutes are now handled by the upstream
`integer_to_ptr_transmutes` Rust lint and no longer by the
[`useless_transmute`] Clippy lint
|
|
|
|
|
|
Forgot to do this at the start of the week. Will be back on the 15th.
(That's also the reason why I forgot about the meeting. Sorry for that!)
r? @ghost
changelog: none
|
|
|
|
|
|
rustdoc-search: yet another stringdex optimization attempt
This one's uses a different tactic. It shouldn't significantly increase the amount of downloaded index data, but still reduces the amount of disk usage.
This one works by changing the suffix-only node representation to omit some data that's needed for checking. Since those nodes make up the bulk of the tree, it reduces the data they store, but also requires validating the match by fetching the name itself (but the names list is pretty small, and when I tried it with wordnet "indexing" it was about the same).
r? `@GuillaumeGomez`
|
|
The main changes are (there are some other small changes):
- Using a specific type for trait IDs in the new solver, allowing us to simplify a lot of code.
- Add `BoundConst` similar to `BoundTy` and `BoundRegion` (previously consts used `BoundVar` directly), due to a new trait requirement.
|
|
|
|
Co-authored-by: Travis Cross <tc@traviscross.com>
|
|
|
|
Rollup of 4 pull requests
Successful merges:
- rust-lang/rust#145976 (Add bootstrap.toml option to control debug breaking on ICEs on windows)
- rust-lang/rust#146151 (fixes auto-run js checks in tidy)
- rust-lang/rust#146194 (fix path str eq)
- rust-lang/rust#146197 (triagebot: fix rustc_allow_const_fn_unstable matcher)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
This commit is an extension of previous libstd support but applied to stdio
specifically. The stdio routines are updated away from WASIp1 APIs to using
WASIp2 APIs natively. The end goal is to eventually drop the dependency on
WASIp1 APIs in the standard library entirely in favor of exclusively depending
on WASIp2.
|
|
r=Urgau
triagebot: fix rustc_allow_const_fn_unstable matcher
The attribute is used like `#[rustc_allow_const_fn_unstable(const_precise_live_drops)]` so we can't have the final `]` here...
r? `@Urgau`
|
|
fix path str eq
fixes rust-lang/rust#146183
where the impl for partialeq<str> for pathbuf resulted in infinite recursion
|
|
fixes auto-run js checks in tidy
Modified is_non_auto_or_matches function in src/tools/tidy/src/extra_checks/mod.rs so that .ts extension is considered.
Tested locally with
`./x.py test tidy --extra-checks=auto:js`
|
|
Add bootstrap.toml option to control debug breaking on ICEs on windows
When rustc ICEs during bootstrap on Windows, it will call `DebugBreak`. This is intended to trigger a Windows Error Reporting dialog that can launch a debugger. However on some setups (mine for one) this will just abort the process, hiding any ICEs on other threads as well. I also would not want to see this dialog even if it did work for me.
This PR adds a new option to bootstrap.toml `rust.break-on-ice` to configure this behavior. By default, it is enabled, matching the existing behavior.
|