| Age | Commit message (Collapse) | Author | Lines |
|
Fix incorrect suggestion for extra `&` in pattern
Closes #106182
|
|
Fix ui constant tests for big-endian platforms
A number of tests under ui/const-ptr and ui/consts are currently failing on big-endian platforms as the binary encoding of some constants is hard-coded in the stderr test files.
Fix this by a combination of two types of changes:
- Where possible (i.e. where the particular value of a constant does not affect the purpose of the test), choose constant values that have the same encoding on big- and little-endian platforms.
- Where this is not possible, provide a normalize-stderr-test rule that transforms the printed big-endian encoding of such constants into the corresponding little-endian form.
Fixes part of https://github.com/rust-lang/rust/issues/105383.
|
|
Remove invalid case for mutable borrow suggestion
If we have a call such as `foo(&mut buf)` and after reference
collapsing the type is inferred as `&T` where-as the required type is
`&mut T`, don't suggest `foo(&mut mut buf)`. This is wrong syntactically
and the issue lies elsewhere, not in the borrow.
Fixes #105645
|
|
Change a commit_if_ok call to probe
Removes an over-eager `commit_if_ok` which makes inference worse.
I'm not entirely sure whether it's ok to remove the check that types are the same, because casting seems to cause equality checks with incorrect types?
Fixes #105037
r? ```@BoxyUwU```
|
|
|
|
Don't normalize in AstConv
See individual commits.
Fixes #101350
Fixes #54940
|
|
Rustup
Pulls in https://github.com/rust-lang/rust/pull/104658
|
|
|
|
|
|
make env::current_exe work on Windows
|
|
|
|
Always permit ConstProp to exploit arithmetic identities
Fixes https://github.com/rust-lang/rust/issues/72751
Initially, I thought I would need to enable operand propagation then do something else, but actually https://github.com/rust-lang/rust/pull/74491 already has the fix for the issue in question! It looks like this optimization was put under MIR opt level 3 due to possible soundness/stability implications, then demoted further to MIR opt level 4 when MIR opt level 2 became associated with `--release`.
Perhaps in the past we were doing CTFE on optimized MIR? We aren't anymore, so this optimization has no stability implications.
r? `@oli-obk`
|
|
Simplify match statement
Add multiple tests
- 1 test for checking `N + 1 + 1` does not unify with `N+1`
- 2 tests for checking that a function that uses two parameters only returns the parameter that
is actually used.
- Check exact repeat predicates
|
|
This prevents an ICE due to a value not actually being evaluatable later.
|
|
Instead of just switching to a probe, check for different matches, and see how many there are.
If one, unify it, otherwise return true and let it be unified later.
|
|
|
|
Improve spans of non-WF implied bound types
Fixes #60980
|
|
|
|
Do not emit structured suggestion for turbofish with wrong span
Fix #79161.
|
|
Add goml scripts to tidy checks
r? ``@notriddle``
|
|
Suppress type errors that come from private fields
Fixes #57320
There was some discussion here (https://github.com/rust-lang/rust/issues/57320#issuecomment-451308420), but I honestly think the second error is worth suppressing regardless.
I would be open to feedback though -- perhaps we can suppress the `.len()` suggestion if there's type error (since we have access to [`Expectation`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir_typeck/enum.Expectation.html), we can determine that).
r? ``@estebank``
|
|
Suggest using clone when we have &T and T implemented Clone
Fixes #106443
|
|
Structured suggestion for `&mut dyn Iterator` when possible
Fix #37914.
|
|
Mention "signature" rather than "fn pointer" when impl/trait methods are incompatible
Fixes #80929
Fixes #67296
|
|
|
|
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
|
|
|
|
Fix #79161.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
r=Mark-Simulacrum
Add retry mechanism for rustdoc GUI tests to reduce flakyness
Part of #93784.
I added 3 retries for failing GUI tests. An important note: if more than half of total tests fail, I don't retry because it's very likely not flakyness anymore at this point but a missing update after changes.
|
|
|
|
Do not emit wrong E0308 suggestion for closure mismatch
Found in #76353.
|
|
remove unreachable error code `E0313`
Fixes #103742
Makes #103433 redundant
Implements removal of `E0313`. I agree with the linked issue that this error code is unreachable but if someone could confirm that would be great, are crater runs done for this sort of thing?
Also removed a redundant `// ignore-tidy-filelength` that I found while reading code.
cc ``@GuillaumeGomez`` #61137
|
|
Add some UI tests and reword error-code docs
Added UI tests for `E0013` and `E0015`. Error code docs for `E0015` were a bit unclear (they referred to all non-const errors in const context, when only non-const functions applied), so I touched them up a bit.
I also fixed up some issues in the new `error_codes.rs` tidy check (linked #106341), that I overlooked previously.
r? ``@GuillaumeGomez``
|
|
jsondoclint: Check local items in `paths` are also in `index`.
Would have caught #104064 (if core.json was linted in CI).
Closes #106433.
r? rustdoc
|
|
Adjust comments about pre-push.sh hook
Follow-up to #101175.
|
|
r=compiler-errors
Suggest `mut self: &mut Self` for `?Sized` impls
Closes #106325
Closes #93078
The suggestion is _probably_ not what the user wants (hence `MaybeIncorrect`) but at least makes the problem in the above issues clearer. It might be better to add a note explaining why this is the case, but I'm not sure how best to word that so this is a start.
``@rustbot`` label +A-diagnostics
|
|
|
|
|
|
|
|
|
|
Update `rand` in the stdlib tests, and remove the `getrandom` feature from it.
The main goal is actually removing `getrandom`, so that eventually we can allow running the stdlib test suite on tier3 targets which don't have `getrandom` support. Currently those targets can only run the subset of stdlib tests that exist in uitests, and (generally speaking), we prefer not to test libstd functionality in uitests, which came up recently in https://github.com/rust-lang/rust/pull/104095 and https://github.com/rust-lang/rust/pull/104185. Additionally, the fact that we can't update `rand`/`getrandom` means we're stuck with the old set of tier3 targets, so can't test new ones.
~~Anyway, I haven't checked that this actually does allow use on tier3 targets (I think it does not, as some work is needed in stdlib submodules) but it moves us slightly closer to this, and seems to allow at least finally updating our `rand` dep, which definitely improves the status quo.~~ Checked and works now.
For the most part, our tests and benchmarks are fine using hard-coded seeds. A couple tests seem to fail with this (stuff manipulating the environment expecting no collisions, for example), or become pointless (all inputs to a function become equivalent). In these cases I've done a (gross) dance (ab)using `RandomState` and `Location::caller()` for some extra "entropy".
Trying to share that code seems *way* more painful than it's worth given that the duplication is a 7-line function, even if the lines are quite gross. (Keeping in mind that sharing it would require adding `rand` as a non-dev dep to std, and exposing a type from it publicly, all of which sounds truly awful, even if done behind a perma-unstable feature).
See also some previous attempts:
- https://github.com/rust-lang/rust/pull/86963 (in particular https://github.com/rust-lang/rust/pull/86963#issuecomment-885438936 which explains why this is non-trivial)
- https://github.com/rust-lang/rust/pull/89131
- https://github.com/rust-lang/rust/pull/96626#issuecomment-1114562857 (I tried in that PR at the same time, but settled for just removing the usage of `thread_rng()` from the benchmarks, since that was the main goal).
- https://github.com/rust-lang/rust/pull/104185
- Probably more. It's very tempting of a thing to "just update".
r? `@Mark-Simulacrum`
|
|
|
|
Rollup of 10 pull requests
Successful merges:
- #101936 (Migrating rustc_infer to session diagnostics (part 3))
- #104081 (PhantomData layout guarantees)
- #104543 (Migrate `codegen_ssa` to diagnostics structs - [Part 3])
- #105128 (Add O(1) `Vec -> VecDeque` conversion guarantee)
- #105517 (Fix process-panic-after-fork.rs to pass on newer versions of Android.)
- #105859 (Point out span where we could introduce higher-ranked lifetime)
- #106509 (Detect closures assigned to binding in block)
- #106553 (docs: make `HashSet::retain` doctest more clear)
- #106556 (rustdoc: remove no-op mobile CSS `.content { margin-left: 0 }`)
- #106564 (Change to immutable borrow when cloning element of RepeatN)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
|