| Age | Commit message (Collapse) | Author | Lines |
|
Optimizations removed in the previous commit required this function to behave incorrectly, but now those optimizations are gone so we can fix the bug.
Fixes https://github.com/rust-lang/rust/issues/104249
|
|
First, they require eagerly calculating private visibility (current normal module), which is somewhat expensive.
Private visibilities are also lost once calculated, instead of being cached in the table.
Second, I cannot prove that the optimizations are correct.
Maybe they can be partially reinstated in the future in cases when it's cheap and provably correct to do them.
They will also probably be merged into `fn update` in that case.
Partially fixes https://github.com/rust-lang/rust/issues/104249
Fixes https://github.com/rust-lang/rust/issues/104539
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Do not suggest `.clone()` as we already suggest borrowing the iterated
value.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
That issue was a dupe of 99852, but it's always better to
have multiple regression tests rather than one.
|
|
|
|
|
|
Fix an ICE parsing a malformed attribute.
Fixes #104620.
r? `@petrochenkov`
|
|
r=GuillaumeGomez
rustdoc: give struct fields CSS `display: block`
Fixes #104737
|
|
copy doc output files by format
This pr provides copying doc outputs by checking output format without removing output directory on each trigger.
Resolves #103785
|
|
Fix hang in where-clause suggestion with `predicate_can_apply`
Using `predicate_may_hold` during error reporting causes an evaluation overflow, which (because we use `evaluate_obligation_no_overflow`) then causes the predicate to need to be re-evaluated locally, which results in a hang.
... but since the "add a where clause" suggestion is best-effort, just throw any overflow errors. No need for 100% accuracy.
r? `@lcnr` who has been thinking about overflows... Let me know if you want more context about this issue, and as always, feel free to reassign.
Fixes #104225
|
|
optimize field ordering by grouping m*2^n-sized fields with equivalently aligned ones
```rust
use std::ptr::addr_of;
use std::mem;
struct Foo {
word: u32,
byte: u8,
ary: [u8; 4]
}
fn main() {
let foo: Foo = unsafe { mem::zeroed() };
println!("base: {:p}\nword: {:p}\nbyte: {:p}\nary: {:p}", &foo, addr_of!(foo.word), addr_of!(foo.byte), addr_of!(foo.ary));
}
```
prints
```
base: 0x7fffc1a8a668
word: 0x7fffc1a8a668
byte: 0x7fffc1a8a66c
ary: 0x7fffc1a8a66d
```
I.e. the `u8` in the middle causes the array to sit at an odd offset, which might prevent optimizations, especially on architectures where unaligned loads are costly.
Note that this will make field ordering niche-dependent, i.e. a `Bar<T>` with `T=char` and `T=u32` may result in different field order, this may break some code that makes invalid assumptions about `repr(Rust)` types.
|
|
order relations
|
|
|
|
|
|
This should improve performance and simplify the code.
|
|
Fix --extern library finding errors
- `crate_name` is not specified/passed to `metadata_crate_location_unknown_type`
https://github.com/rust-lang/rust/blob/c493bae0d8efd75723460ce5c371f726efa93f15/compiler/rustc_error_messages/locales/en-US/metadata.ftl#L274-L275
- `metadata_lib_filename_form` is missing `$`
- Add additional check to ensure that library is file
Testing
1. Create file `a.rs`
```rust
extern crate t;
fn main() {}
```
1. Create empty file `x`
1. Create empty directory `y`
1. Run
```sh
$ rustc -o a a.rs --extern t=x
$ rustc -o a a.rs --extern t=y
```
Both currently panic with stable.
|
|
Refactor must_use lint into two parts
Before, the lint did the checking for `must_use` and pretty printing the types in a special format in one pass, causing quite complex and untranslatable code.
Now the collection and printing is split in two. That should also make it easier to translate or extract the type pretty printing in the future.
Also fixes an integer overflow in the array length pluralization
calculation.
fixes #104352
|
|
Allow opaque types in trait impl headers and rely on coherence to reject unsound cases
r? ````@lcnr````
fixes #99840
|
|
|
|
Fixes #104620.
|
|
|
|
|
|
|
|
Fix `ClosureKind::to_def_id`
`Fn` and `FnOnce` were mixed up in https://github.com/rust-lang/rust/pull/99131.
|
|
Speed up mpsc_stress test
See https://rust-lang.zulipchat.com/#narrow/stream/122651-general/topic/mpsc_stress for context
r? windows
|
|
GuillaumeGomez:test-projection-used-as-const-generic, r=oli-obk
Add failing test for projections used as const generic
Based on the experiment done in https://github.com/rust-lang/rust/pull/104443, we realized it's currently not possible to support projections in const generics. More information about it in https://github.com/rust-lang/rust/pull/104443#discussion_r1029375633.
This PR adds the UI test in any case so we can gather data in order to work towards adding `TyAlias` into the ABI in the future.
r? ``@oli-obk``
|
|
Add powerpc64-ibm-aix as Tier-3 target
This is part of the effort mentioned in https://github.com/rust-lang/compiler-team/issues/553.
A reference to these options are definitions from [clang](https://github.com/llvm/llvm-project/blob/ad6fe32032a6229e0c40510e9bed419a01c695b3/clang/lib/Basic/Targets/PPC.h#L414-L448) and [llvm](https://github.com/llvm/llvm-project/blob/main/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp).
AIX has a system `ld` but [its options and behaviors](https://www.ibm.com/docs/en/aix/7.3?topic=l-ld-command) are different from GNU ld. Thanks to ``@bzEq`` for contributing the linking args.
|
|
|
|
|
|
|
|
Rollup of 6 pull requests
Successful merges:
- #104295 (Check generics parity before collecting return-position `impl Trait`s in trait)
- #104464 (Reduce exceptions overallocation on non Windows x86_64)
- #104615 (Create def_id for async fns during lowering)
- #104669 (Only declare bindings for if-let guards once per arm)
- #104701 (Remove a lifetime resolution hack from `compare_predicate_entailment`)
- #104710 (disable strict-provenance-violating doctests in Miri)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
r=cjgillot
Only declare bindings for if-let guards once per arm
Currently, each candidate for a match arm uses separate locals for the bindings in the if-let guard, causing problems (#88015) when those branches converge in the arm body.
Fixes #88015 (🤞)
|
|
Check generics parity before collecting return-position `impl Trait`s in trait
The only thing is that this duplicates the error message for number of generics mismatch, but we already deduplicate that error message in Cargo. I could add a flag to delay the error if the reviewer cares.
Fixes #104281
Also drive-by adds a few comments to the `collect_trait_impl_trait_tys` method, and removes an unused argument from `compare_number_of_generics`.
|
|
Unreserve braced enum variants in value namespace
With this PR braced enum variants (`enum E { V { /*...*/ } }`) no longer take a slot in value namespace, so the special case mentioned in the note in https://github.com/rust-lang/rfcs/blob/master/text/1506-adt-kinds.md#braced-structs is removed.
Report - https://github.com/rust-lang/rust/pull/103578#issuecomment-1292594900.
|
|
|
|
Fix #103826.
|