| Age | Commit message (Collapse) | Author | Lines |
|
We now require that projection candidates are applicable with the
idenitity substs of the trait, rather than allowing predicates that are
only applicable for certain substs.
|
|
|
|
`librustc_trait_selection`.
|
|
|
|
|
|
Unify region variables when projecting associated types
This is required to avoid cycles when evaluating auto trait predicates.
Notably, this is required to be able add Chalk types to `CtxtInterners` for `cfg(parallel_compiler)`.
r? @nikomatsakis
|
|
shim.rs: avoid creating `Call` terminators calling `Self`
Also contains some cleanup and doc comment additions so I could make sense of the code.
Fixes https://github.com/rust-lang/rust/issues/73109
Closes https://github.com/rust-lang/rust/pull/73175
r? @matthewjasper
|
|
|
|
Suggest `?Sized` when applicable for ADTs
Address #71790, fix #27964.
|
|
Expand "recursive opaque type" diagnostic
Fix #70968, partially address #66523.
|
|
Make all uses of ty::Error delay a span bug
r? @eddyb
A second attempt at https://github.com/rust-lang/rust/pull/70245
resolves https://github.com/rust-lang/rust/issues/70866
|
|
|
|
This is required to avoid cycles when evaluating auto trait
predicates.
|
|
|
|
store `ObligationCause` on the heap
Stores `ObligationCause` on the heap using an `Rc`.
This PR trades off some transient memory allocations to reduce the size of–and thus the number of instructions required to memcpy–a few widely used data structures in trait solving.
|
|
Fix #27964.
|
|
Fix #71790.
|
|
|
|
Fix #70968, partially address #66523.
|
|
Rollup of 10 pull requests
Successful merges:
- #72707 (Use min_specialization in the remaining rustc crates)
- #72740 (On recursive ADT, provide indirection structured suggestion)
- #72879 (Miri: avoid tracking current location three times)
- #72938 (Stabilize Option::zip)
- #73086 (Rename "cyclone" to "apple-a7" per changes in upstream LLVM)
- #73104 (Example about explicit mutex dropping)
- #73139 (Add methods to go from a nul-terminated Vec<u8> to a CString)
- #73296 (Remove vestigial CI job msvc-aux.)
- #73304 (Revert heterogeneous SocketAddr PartialEq impls)
- #73331 (extend network support for HermitCore)
Failed merges:
r? @ghost
|
|
Stabilize Option::zip
This PR stabilizes the following API:
```rust
impl<T> Option<T> {
pub fn zip<U>(self, other: Option<U>) -> Option<(T, U)>;
}
```
This API has real world usage as seen in <https://grep.app/search?q=-%3E%20Option%3C%5C%28T%2C%5Cs%3FU%5C%29%3E®exp=true&filter[lang][0]=Rust>.
The `zip_with` method is left unstably as this API is kinda niche
and it hasn't received much usage in Rust repositories on GitHub.
cc #70086
|
|
On recursive ADT, provide indirection structured suggestion
|
|
Use min_specialization in the remaining rustc crates
This adds a lot of `transmute` calls to replace the unsound uses of specialization.
It's ugly, but at least it's honest about what's going on.
cc #71420, @RalfJung
|
|
Rollup of 10 pull requests
Successful merges:
- #71824 (Check for live drops in constants after drop elaboration)
- #72389 (Explain move errors that occur due to method calls involving `self`)
- #72556 (Fix trait alias inherent impl resolution)
- #72584 (Stabilize vec::Drain::as_slice)
- #72598 (Display information about captured variable in `FnMut` error)
- #73336 (Group `Pattern::strip_*` method together)
- #73341 (_match.rs: fix module doc comment)
- #73342 (Fix iterator copied() documentation example code)
- #73351 (Update E0446.md)
- #73353 (structural_match: non-structural-match ty closures)
Failed merges:
r? @ghost
|
|
Clean up type alias impl trait implementation
- Removes special case for top-level impl trait
- Removes associated opaque types
- Forbid lifetime elision in let position impl trait. This is consistent with the behavior for inferred types.
- Handle lifetimes in type alias impl trait more uniformly with other parameters
cc #69323
cc #63063
Closes #57188
Closes #62988
Closes #69136
Closes #73061
|
|
|
|
This commit adds a `Closure` variant to `NonStructuralMatchTy` in
`structural_match`, fixing an ICE which can occur when
`impl_trait_in_bindings` is used with constants.
Signed-off-by: David Wood <david@davidtw.co>
|
|
|
|
|
|
|
|
|
|
This helper method works for all types, falling back to a query for
`TyKind::Adt`s to determine whether the implement the
`{Partial,}StructuralEq` traits.
|
|
|
|
This is consistent with types.
|
|
They're unused now.
|
|
|
|
|
|
|
|
Don't create impl candidates when obligation contains errors
Fixes #72839
In PR #72621, trait selection was modified to no longer bail out early
when an error type was encountered. This allowed us treat `ty::Error` as
`Sized`, causing us to avoid emitting a spurious "not sized" error after
a type error had already occured.
However, this means that we may now try to match an impl candidate
against the error type. Since the error type will unify with almost
anything, this can cause us to infinitely recurse (eventually triggering
an overflow) when trying to verify certain `where` clauses.
This commit causes us to skip generating any impl candidates when an
error type is involved.
|
|
normalize adt fields during structural match checking
fixes #72896
currently only fixes the issue itself and compiles stage 1 libs.
I believe we have to use something else to normalize the adt fields here,
as I expect some partially resolved adts to cause problems :thinking:
stage 1 libs and the test itself pass, not sure about the rest...
Will spend some more time looking into it tomorrow.
r? @pnkfelix cc @eddyb
|
|
|
|
Rename traits::Vtable to ImplSource.
Originally suggested by @eddyb.
r? @nikomatsakis
|
|
|
|
Make `PolyTraitRef::self_ty` return `Binder<Ty>`
This came up during review of #71618. The current implementation is the same as a call to `skip_binder` but harder to audit. Make it preserve binding levels and add a call to `skip_binder` at all use sites so they can be audited as part of #72507.
|
|
Rename all remaining compiler crates to use the `rustc_foo` pattern
libarena -> librustc_arena
libfmt_macros -> librustc_parse_format
libgraphviz -> librustc_graphviz
libserialize -> librustc_serialize
Closes https://github.com/rust-lang/rust/issues/71177 in particular.
|
|
Co-authored-by: Randy Taylor <tehgecKozzz@gmail.com>
|
|
|
|
|
|
|
|
Fixes #72839
In PR #72621, trait selection was modified to no longer bail out early
when an error type was encountered. This allowed us treat `ty::Error` as
`Sized`, causing us to avoid emitting a spurious "not sized" error after
a type error had already occured.
However, this means that we may now try to match an impl candidate
against the error type. Since the error type will unify with almost
anything, this can cause us to infinitely recurse (eventually triggering
an overflow) when trying to verify certain `where` clauses.
This commit causes us to skip generating any impl candidates when an
error type is involved.
|