| Age | Commit message (Collapse) | Author | Lines |
|
|
|
|
|
this is necessary for never-type stabilization
|
|
Fixes #63677
RFC #2071 (impl-trait-existential-types) does not explicitly state how
impl trait type alises should interact with coherence. However, there's
only one choice which makes sense - coherence should look at the
underlying type (i.e. the 'defining' type of the impl trait) of the type
alias, just like we do for non-impl-trait type aliases.
Specifically, impl trait type alises which resolve to a local type
should be treated like a local type with respect to coherence (e.g.
impl trait type aliases which resolve to a forieign type should be
treated as a foreign type, and those that resolve to a local type should
be treated as a local type).
Since neither inherent impls nor direct trait impl (i.e. `impl MyType`
or `impl MyTrait for MyType`) are allowd for type aliases, this
usually does not come up. Before we ever attempt to do coherence
checking, we will have errored out if an impl trait type alias was used
directly in an 'impl' clause.
However, during trait selection, we sometimes need to prove bounds like
'T: Sized' for some type 'T'. If 'T' is an impl trait type alias, this
requires to know the coherence behavior for impl trait type aliases when
we perform coherence checking.
Note: Since determining the underlying type of an impl trait type alias
requires us to perform body type checking, this commit causes us to type
check some bodies easlier than we otherwise would have. However, since
this is done through a query, this shouldn't cause any problems
For completeness, I've added an additional test of the coherence-related
behavior of impl trait type aliases.
|
|
|
|
|
|
Add explanation to type mismatch involving type params and assoc types
CC #63711
|
|
factor out pluralisation remains after #64280
there are two case that doesn't not match the original macro pattern at [here](https://github.com/rust-lang/rust/blob/master/src/librustc_lint/unused.rs#L146) and [here](https://github.com/rust-lang/rust/blob/master/src/libsyntax/parse/diagnostics.rs#L539) as the provided param is already a bool or the check condition is not `x != 1`, so I change the macro accept a boolean expr instead of number to fit all the cases.
@Centril please review
Fixes #64238.
|
|
Optimizing for the common numbers of entries in `stalled_on` wins about
4% on `keccak` and `inflate`.
|
|
|
|
|
|
|
|
More `ObligationForest` improvements
Following on from #64500, these commits alsomake the code both nicer and faster.
r? @nikomatsakis
|
|
|
|
|
|
The super-hot call site of `inlined_shallow_resolve()` basically does
`r.inlined_shallow_resolve(ty) != ty`. This commit introduces a
version of that function specialized for that particular call pattern,
`shallow_resolve_changed()`. Incredibly, this reduces the instruction
count for `keccak` by 5%.
The commit also renames `inlined_shallow_resolve()` as
`shallow_resolve()` and removes the `inline(always)` annotation, as it's
no longer nearly so hot.
|
|
Amazingly enough, this is a 3.5% instruction count win on `keccak`.
|
|
Fixes #64412
|
|
The reduction in `memcpy` calls outweighs the cost of the extra
allocations, for a net performance win.
|
|
The reduction in `memcpy` calls greatly outweighs the cost of the extra
allocations, for a net performance win.
|
|
These are types that get memcpy'd a lot.
|
|
Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
|
|
|
|
|
|
r=petrochenkov
Minimize uses of `LocalInternedString`
`LocalInternedString` is described as "An alternative to `Symbol` and `InternedString`, useful when the chars within the symbol need to be accessed. It is best used for temporary values."
This PR makes the code match that comment, by removing all non-local uses of `LocalInternedString`. This allows the removal of a number of operations on `LocalInternedString` and a couple of uses of `unsafe`.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Add Option<Span> to `require_lang_item`
Fixes #63954
I'm not sure where to take `Some(span)` or something so I use `None` in many places.
r? @estebank
|
|
Simplify eager normalization of constants
r? @nikomatsakis
|
|
|
|
|
|
|
|
|
|
|
|
Don't special case the `Self` parameter by name
This results in a couple of small diagnostic regressions. They could be avoided by keeping the special case just for diagnostics, but that seems worse.
closes #50125
cc #60869
|
|
Use this to simplify the object safety code a bit.
|
|
For naming consistency with everything else in this area
|
|
The expansion info is not optional and should always exist
|
|
`Ident` has had a full span rather than just a `SyntaxContext` for a long time now.
|
|
|
|
|
|
Revert "Rollup merge of #62696 - chocol4te:fix_#62194, r=estebank"
This reverts commit df21a6f040a7011d509769a61ac7af9502636b33 (#62696), reversing
changes made to cc16d0486933e02237190366de2eb43df2215c11.
That PR makes error messages worse than before, and we couldn't come up with a way of actually making them better, so revert it for now. Any idea for making this error message better is welcome!
Fixes #63145.
r? @estebank
|