| Age | Commit message (Collapse) | Author | Lines |
|
|
|
|
|
Audit hidden/short code suggestions
Should fix #73641.
Audit uses of `span_suggestion_short` and `tool_only_span_suggestion` (`span_suggestion_hidden` is already tested with `run-rustfix`). Leave some FIXMEs for futher improvements/fixes.
r? @estebank
|
|
This commit modifies resolve to disallow `break`/`continue` to labels
through closures or async blocks. This doesn't make sense and should
have been prohibited anyway.
Signed-off-by: David Wood <david@davidtw.co>
|
|
|
|
|
|
|
|
propagation
|
|
A way forward for pointer equality in const eval
r? @varkor on the first commit and @RalfJung on the second commit
cc #53020
|
|
everything in the diagnostic
|
|
forbid mutable references in all constant contexts except for const-fns
PR to address #71212
cc: @ecstatic-morse
|
|
Specialization is unsound
As discussed in https://github.com/rust-lang/rust/issues/31844#issuecomment-617013949, it might be a good idea to warn users of specialization that the feature they are using is unsound.
I also expanded the "incomplete feature" warning to link the user to the tracking issue.
|
|
|
|
|
|
|
|
We can never supply a meaningful implementation of this.
Instead, the follow up commits will create two intrinsics
that approximate comparisons:
* `ptr_maybe_eq`
* `ptr_maybe_ne`
The fact that `ptr_maybe_eq(a, b)` is not necessarily the same
value as `!ptr_maybe_ne(a, b)` is a symptom of this entire
problem.
|
|
|
|
- Suggest borrowing expression if it would allow cast to work.
- Suggest using `<Type>::from(<expr>)` when appropriate.
- Minor tweak to `;` typo suggestion.
Partily address #47136.
|
|
|
|
r=varkor
mir: adjust conditional in recursion limit check
Fixes #67552.
This PR adjusts the condition used in the recursion limit check of
the monomorphization collector, from `>` to `>=`.
In #67552, the test case had infinite indirect recursion, repeating a
handful of functions (from the perspective of the monomorphization
collector): `rec` -> `identity` -> `Iterator::count` -> `Iterator::fold`
-> `Iterator::next` -> `rec`.
During this process, `resolve_associated_item` was invoked for
`Iterator::fold` (during the construction of an `Instance`), and
ICE'd due to substitutions needing inference. However, previous
iterations of this recursion would have called this function for
`Iterator::fold` - and did! - and succeeded in doing so (trivially
checkable from debug logging, `()` is present where `_` is in the substs
of the failing execution).
The expected outcome of this test case would be a recursion limit error
(which is present when the `identity` fn indirection is removed), and
the recursion depth of `rec` is increasing (other functions finish
collecting their neighbours and thus have their recursion depths reset).
When the ICE occurs, the recursion depth of `rec` is 256 (which matches
the recursion limit), which suggests perhaps that a different part of
the compiler is using a `>=` comparison and returning a different result
on this recursion rather than what it returned in every previous
recursion, thus stopping the monomorphization collector from reporting
an error on the next recursion, where `recursion_depth_of_rec > 256`
would have been true.
With grep and some educated guesses, we can determine that
the recursion limit check at line 818 in
`src/librustc_trait_selection/traits/project.rs` is the other check that
is using a different comparison. Modifying either comparison to be `>` or
`>=` respectively will fix the error, but changing the monomorphization
collector produces the nicer error.
|
|
Rollup of 9 pull requests
Successful merges:
- #67460 (Tweak impl signature mismatch errors involving `RegionKind::ReVar` lifetimes)
- #71095 (impl From<[T; N]> for Box<[T]>)
- #71500 (Make pointer offset methods/intrinsics const)
- #71804 (linker: Support `-static-pie` and `-static -shared`)
- #71862 (Implement RFC 2585: unsafe blocks in unsafe fn)
- #72103 (borrowck `DefId` -> `LocalDefId`)
- #72407 (Various minor improvements to Ipv6Addr::Display)
- #72413 (impl Step for char (make Range*<char> iterable))
- #72439 (NVPTX support for new asm!)
Failed merges:
r? @ghost
|
|
Suggest using std::mem::drop function instead of explicit destructor call
I would prefer to give a better suggestion that includes code example, but I'm currently stuck on getting the correct span for that.
Closes #72322.
|
|
This commit introduces a `Limit` type which is used to ensure that all
comparisons against limits within the compiler are consistent (which can
result in ICEs if they aren't).
Signed-off-by: David Wood <david@davidtw.co>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Moving more build-pass tests to check-pass
One or two tests became build-pass without the FIXME because they really
needed build-pass (were failing without it).
Helps with #62277
---
<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/rust-lang/rust/71340)
<!-- Reviewable:end -->
|
|
|
|
One or two tests became build-pass without the FIXME because they really
needed build-pass (were failing without it).
Helps with #62277
|
|
During development, a function could have a return type set that is a
bare trait object by accident. We already suggest using either a boxed
trait object or `impl Trait` if the return paths will allow it. We now
do so too when there are *no* return paths or they all resolve to `!`.
We still don't handle cases where the trait object is *not* the entirety
of the return type gracefully.
|
|
Add long error explanation for E0657
Added proper error explanation for issue E0657 in the Rust compiler.
Part of #61137
r? @GuillaumeGomez
|
|
Rename fn_has_self_argument to fn_has_self_parameter
Rename AssocItemKind::Method to AssocItemKind::Fn
Refine has_no_input_arg
Refine has_no_input_arg
Revert has_no_input_arg
Refine suggestion_descr
Move as_def_kind into AssocKind
Signed-off-by: Rustin-Liu <rustin.liu@gmail.com>
Fix tidy check issue
Signed-off-by: Rustin-Liu <rustin.liu@gmail.com>
|
|
|
|
|
|
Use `PredicateObligation`s instead of `Predicate`s
Keep more information about trait binding failures. Use more specific spans by pointing at bindings that introduce obligations.
Subset of #69709.
r? @eddyb
|
|
|
|
Keep more information about trait binding failures.
|
|
|
|
|
|
|
|
|
|
|
|
non-exhastive diagnostic: add note re. scrutinee type
This fixes https://github.com/rust-lang/rust/issues/67259 by adding a note:
```
= note: the matched value is of type &[i32]
```
to non-exhaustive pattern matching errors.
r? @varkor @estebank
|
|
|