| Age | Commit message (Collapse) | Author | Lines |
|
tests encoding current behavior for various cases of "binding" to _.
The `_` binding form is special, in that it encodes a "no-op": nothing is actually bound, and thus nothing is moved or borrowed in this scenario. Usually we do the "right" thing in all such cases. The exceptions are explicitly pointed out in this test case, so that we keep track of whether they are eventually fixed.
Cc #53114.
(This does not close the aforementioned issue; it just adds the tests encoding the current behavior, which we hope to eventually fix.)
|
|
|
|
Add ThreadSanitizer test case
|
|
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
|
|
|
|
Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
|
|
Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
|
|
The `_` binding form is special, in that it encodes a "no-op": nothing is
actually bound, and thus nothing is moved or borrowed in this scenario. Usually
we do the "right" thing in all such cases. The exceptions are explicitly pointed
out in this test case, so that we keep track of whether they are eventually
fixed.
|
|
|
|
Replace "rc"/"arc" lang items with Rc/Arc diagnostic items.
`Rc`/`Arc` should have no special semantics, so it seems appropriate for them to not be lang items.
r? @matthewjasper
|
|
r=matthewjasper
Consider methods on fundamental `impl` when method is not found on numeric type
Fix #47759.
|
|
Fix #47759.
|
|
Add two const generics regression tests
Closes https://github.com/rust-lang/rust/issues/66596.
Closes https://github.com/rust-lang/rust/issues/61522.
|
|
|
|
|
|
Support `#[track_caller]` on functions in `extern "Rust" { ... }`
Fixes https://github.com/rust-lang/rust/issues/70830 which is the follow-up to @eddyb's suggestion in https://github.com/rust-lang/rust/pull/69251#discussion_r380791634 to allow `#[track_caller]` on `fn`s in FFI imports, that is, on functions in `extern "Rust" { ... }` blocks.
This requires that the other side, the FFI export, also have the `#[track_caller]` attribute. Otherwise, undefined behavior is triggered and the blame lies, as usual, with the `unsafe { ... }` block which called the FFI imported function.
After this PR, all forms of `fn` items with the right ABI (`"Rust"`) support `#[track_caller]`.
As a drive-by, the PR also hardens the check rejecting `#[naked] #[track_caller]` such that methods and other forms of `fn` items are also considered.
r? @eddyb
cc @rust-lang/lang
|
|
r=ecstatic-morse
Don't lint for self-recursion when the function can diverge
Fixes https://github.com/rust-lang/rust/issues/54444
|
|
save/restore `pessimistic_yield` when entering bodies
This flag is used to make the execution order around `+=` operators
pessimistic. Failure to save/restore the flag was causing independent
async blocks to effect one another, leading to strange ICEs and failed
assumptions.
Fixes #69307
r? @Zoxc
|
|
|
|
|
|
Keep more information about trait binding failures.
|
|
Do not suggest adding type param when `use` is already suggested
Fix #70365, cc #70572.
|
|
Suggest move for closures and async blocks in more cases.
Fixes #66107, also improves #67577
Related PR https://github.com/rust-lang/rust/pull/65166
|
|
remove false positives of unused_braces
fixes #70717
We could potentially be more aggressive when linting let bindings by checking if there are any explicit `ref`s.
I have been unable to create a snippet which compiles when using braces but has a borrowck error
without them. The closes I've gotten is [the following (playground)](https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=4a1552ebe9648cb13fcb8dd969189a6c).
r? @eddyb
|
|
|
|
|
|
|
|
Fix #70365, cc #70572.
|
|
|
|
Don't import integer and float modules, use assoc consts 2
Follow up to #70777. I missed quite a lot of places. Partially because I wanted to keep the size of the last PR down, and partially because my regexes were not good enough :)
r? @dtolnay
|
|
ty/walk: iterate `GenericArg`s instead of `Ty`s.
Before this PR, `Ty::walk` only iterated over `Ty`s, but that's becoming an increasing problem with `const` generics, as `ty::Const`s in `Substs` are missed by it.
By working with `GenericArg` instead, we can handle both `Ty`s and `ty::Const`s, but also `ty::Region`s, which used to require ad-hoc mechanisms such as `push_regions`.
I've also removed `TraitRef::input_types`, as it's both long obsolete, and easy to misuse.
|
|
|
|
|
|
|
|
Miri terminator handling: only do progress sanity check for 'Call' terminator
This will still catch mistakes in bad intrinsic/foreign-item shims, which is the main source of errors here.
Fixes https://github.com/rust-lang/rust/issues/70723
r? @oli-obk
|
|
|
|
Use smaller span for suggestion restricting lifetime
|
|
def_collector, visit_fn: account for no body
Fixes #70736
r? @petrochenkov
|
|
Tweak output of type params and constraints in the wrong order
r? @Centril @varkor
|
|
Using a single label for constraints and generic arguments.
|
|
|
|
|
|
"cannot resolve" → "cannot satisfy"
CC #66523
r? @Centril
|
|
|
|
|
|
|
|
Enable layout debugging for `impl Trait` type aliases
I also made it print the actual type name that the alias picks under the hood.
|
|
|
|
|
|
fix Miri assignment sanity check
Thanks @eddyb for pointing me to the right APIs!
r? @eddyb
Fixes https://github.com/rust-lang/rust/issues/70804
|