| Age | Commit message (Collapse) | Author | Lines | 
|---|
|  |  | 
|  | Fix scrolling for item declaration block
Fixes https://github.com/rust-lang/rust/issues/105580.
The `contain: layout` was the issue here and the bug was actually on both mobile and desktop.
r? `@notriddle` | 
|  | Fix help docs for -Zallow-features
The arguments for -Zallow-features are comma-separated (`parse_opt_comma_list`), not space separated (`parse_list`). | 
|  | [RFC 2397] Initial implementation
cc #51992
Because of previous experiences where ppl didn't have the time to review large PRs (or any at all), the implementation of this feature will be delivered in small chunks to hopefully make things faster.
In this initial PR, only the attribute is being declared and gated with ordinary tests. | 
|  | Add test for #106062
Add a regression test for #106062
Closes #106062 | 
|  | remove E0280
After looking at #61137 I tried my hand at E0280. I'm unable to find a reasonable example that emits the error. There are a couple of old examples that compile with the current compiler ([#26217](https://github.com/rust-lang/rust/issues/26217), [#42114](https://github.com/rust-lang/rust/issues/42114), [#27113](https://github.com/rust-lang/rust/issues/27113)) and there is a [bug with chalk](https://github.com/rust-lang/rust/blob/b7cdb635c4b973572307ad288466fba64533369c/src/test/ui/chalkify/bugs/async.rs) that makes it emit the error, with a couple more chalk bugs on zulip.
It seems like the error is supposed to be emitted from unfulfilled where bounds, of which two are related to borrow checking (error in where T: 'a or where 'a: 'b) and thus tend to emit errors like "lifetime may not live long enough" from borrow checking instead. The final case is with type equality constraints (where <T as Iterator>::Item == u32), which is unimplemented ([#20041](https://github.com/rust-lang/rust/issues/20041)). That such different problems are supposed to have the same error code also seems strange to me.
Since the error seems to only be emitted when using chalk I propose to remove it and replace it with an ICE instead. A crater run might be warranted.
Pinging `@jackh726` due to removal of chalk test that now ICEs. | 
|  |  | 
|  | compiler-errors:be-more-accurate-abt-method-suggestions, r=oli-obk
Consider return type when giving various method suggestions
1. Fix a bug in method probe where we weren't normalizing `xform_ret_ty` for non-`impl` method candidates. This shouldn't affect happy-path code, since we only use `xform_ret_ty` when probing methods for diagnostics (I think).
2. Pass the return type expectation down to `lookup_probe`/`probe_for_name` usages in diagnostics. Added a few UI tests to gate against bad suggestions.
3. Make a `FnCtxt::lookup_probe_for_diagnostic` which properly passes down `IsSuggestion(true)`. Should help suppress other weird notes in some corner cases. | 
|  | Rollup of 9 pull requests
Successful merges:
 - #105034 (Add example for iterator_flatten)
 - #105708 (Enable atomic cas for bpf targets)
 - #106175 (Fix bad import suggestion with nested `use` tree)
 - #106204 (No need to take opaques in `check_type_bounds`)
 - #106387 (Revert "bootstrap: Get rid of `tail_args` in `stream_cargo`")
 - #106636 (Accept old spelling of Fuchsia target triples)
 - #106639 (update Miri)
 - #106640 (update test for inductive canonical cycles)
 - #106647 (rustdoc: merge common CSS for `a`)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup | 
|  |  | 
|  | Add regression test for #100772
Closes #100772
r? `@compiler-errors`
Signed-off-by: Yuki Okushi <jtitor@2k36.org> | 
|  |  | 
|  | update test for inductive canonical cycles
the previous test always resulted in a cycle :sweat_smile: cc https://github.com/rust-lang/chalk/pull/787.
I checked with #102713 and this is the only test which fails with that PR.
r? ``@jackh726`` | 
|  | Fix bad import suggestion with nested `use` tree
Fixes #105566
Fixes #105373
Ideally, we'd find some way to turn these into structured suggestions -- perhaps on a separate line as a different `use` statement, but I have no idea how to access the span for the whole `use` from this point in the import resolution code. | 
|  |  | 
|  | Rollup of 10 pull requests
Successful merges:
 - #105292 (Change a commit_if_ok call to probe)
 - #105655 (Remove invalid case for mutable borrow suggestion)
 - #106047 (Fix ui constant tests for big-endian platforms)
 - #106061 (Enable Shadow Call Stack for Fuchsia on AArch64)
 - #106164 (Move `check_region_obligations_and_report_errors` to `TypeErrCtxt`)
 - #106291 (Fix incorrect suggestion for extra `&` in pattern)
 - #106389 (Simplify some canonical type alias names)
 - #106468 (Use FxIndexSet when updating obligation causes in `adjust_fulfillment_errors_for_expr_obligation`)
 - #106549 (Use fmt named parameters in rustc_borrowck)
 - #106614 (error-code docs improvements (No. 2))
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup | 
|  |  | 
|  |  | 
|  |  | 
|  |  | 
|  | error-code docs improvements (No. 2)
- Added empty error-code docs for `E0208`, `E0640` and `E0717` with the "internal" header as discussed on Discord.
- Wrote docs and UI test for `E0711`, again with the header.
- `tidy` changes are common-sense and make everything pass, `style.rs` hack is annoying though.
r? ```@GuillaumeGomez``` | 
|  | 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 | 
|  | 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. | 
|  |  | 
|  |  | 
|  |  | 
|  |  | 
|  |  | 
|  |  | 
|  | Do not emit wrong E0308 suggestion for closure mismatch
Found in #76353. | 
|  | 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`` |