rustdoc: Fix default logo filename
This was a typo made in #64443. It's the reason the logo is missing on the [nightly docs](https://doc.rust-lang.org/nightly/std/).
r? @Mark-Simulacrum
This iterator can be hot, and chained iterators are slow. The second
half of the chain is almost always empty, so this commit changes the
code to avoid the chained iteration.
This change reduces instruction counts for the `wg-grammar` benchmark by
up to 1.5%.
Optimize try_eval_bits to avoid layout queries
This specifically targets match checking, but is possibly more widely
useful as well. In code with large, single-value match statements, we
were previously spending a lot of time running layout_of for the
primitive types (integers, chars) -- which is essentially useless. This
optimizes the code to avoid those query calls by directly obtaining the
size for these types, when possible.
It may be worth considering adding a `size_of` query in the future which
might be far faster, especially if specialized for "const" cases --
match arms being the most obvious example. It's possibly such a function
would benefit from *not* being a query as well, since it's trivially
evaluatable from the sty for many cases whereas a query needs to hash
the input and such.
This specifically targets match checking, but is possibly more widely
useful as well. In code with large, single-value match statements, we
were previously spending a lot of time running layout_of for the
primitive types (integers, chars) -- which is essentially useless. This
optimizes the code to avoid those query calls by directly obtaining the
size for these types, when possible.
It may be worth considering adding a `size_of` query in the future which
might be far faster, especially if specialized for "const" cases --
match arms being the most obvious example. It's possibly such a function
would benefit from *not* being a query as well, since it's trivially
evaluatable from the sty for many cases whereas a query needs to hash
the input and such.
By collecting the done obligations (when necessary) in the main loop.
This makes the code cleaner.
The commit also changes the order in which successful obligations are
returned -- they are now returned in the registered order, rather than
reversed. Because this order doesn't actually matter, being only used by
tests, the commit uses `sort()` to make the test agnostic w.r.t. the
order.
It's not necessary; cycles (which are rare) can be detected by looking
at the node stack.
This change speeds things up slightly, as well as simplifying the code a
little.
Rollup of 6 pull requests
Successful merges:
- #64691 (Point at definition when misusing ADT)
- #64735 (Add long error explanation for E0533)
- #64825 (Point at enclosing match when expecting `()` in arm)
- #64858 (Add support for relating slices in `super_relate_consts`)
- #64894 (syntax: fix dropping of attribute on first param of non-method assocated fn)
- #64898 (fixed typo)
Failed merges:
r? @ghost
syntax: fix dropping of attribute on first param of non-method assocated fn
Fixes#64682.
The general idea is that we bake parsing of `self` into `parse_param_general` and then we just use standard list parsing. Overall, this simplifies the parsing and makes it more consistent.
r? @petrochenkov cc @c410-f3r
Point at enclosing match when expecting `()` in arm
When encountering code like the following:
```rust
fn main() {
match 3 {
4 => 1,
3 => {
println!("Yep it maches.");
2
}
_ => 2
}
println!("Bye!")
}
```
point at the enclosing `match` expression and suggest ignoring the
returned value:
```
error[E0308]: mismatched types
--> $DIR/match-needing-semi.rs:8:13
|
LL | / match 3 {
LL | | 4 => 1,
LL | | 3 => {
LL | | 2
| | ^ expected (), found integer
LL | | }
LL | | _ => 2
LL | | }
| | -- help: consider using a semicolon here
| |_____|
| expected this to be `()`
|
= note: expected type `()`
found type `{integer}
```
Fix#40799.