Instead of maybe storing its own sysroot and maybe deferring to the one
in `Session::opts`, just clone the latter when necessary so one is
always directly available. This removes the need for the getter.
Test with gdb8.2 and add debuginfo printing function call test
As far as I can see, `print function()` is not tested. It is important feature for debugging.
libtest: Use deterministic HashMap, avoid spawning thread if there is no concurrency
It seems desirable to make a test and bench runner deterministic, which this achieves by using a deterministic hasher. Also, we we only have 1 thread, we don't bother spawning one and just use the main thread.
The motivation for this is to be able to run the test harness in miri, where we can neither access the OS RNG, nor spawn threads.
This builder is not really the correct place to put this, but it
definitely has the time budget and checking this tool builds on just one
platform is more than sufficient.
Update Cargo submodule and its dependencies
Hopefully just another routine update!
So far this starts to enable the `std::arch` in stage0 builds of rustc.
This means that we may need stage0/not(stage0) in stdsimd itself, but
more and more code is starting to use `std::arch` so I think it's time
to start shifting the balance of work here.
Hopefully just another routine update!
So far this starts to enable the `std::arch` in stage0 builds of rustc.
This means that we may need stage0/not(stage0) in stdsimd itself, but
more and more code is starting to use `std::arch` so I think it's time
to start shifting the balance of work here.
Rollup of 5 pull requests
Successful merges:
- #56491 (emit error with span for empty asserts)
- #56633 (Fix right arrow size for crate filter)
- #56641 (fix span for invalid number of parameters in trait method)
- #56656 (Fix typo)
- #56661 (Add regression test for ICE)
Failed merges:
r? @ghost
Add regression test for ICE
Fixes#55846 with a minimal (or as best as I can manage) test case. I tested this against 1.30.0 manually to confirm it crashes.
The issue seemed to have something to do with associated types. It's possible someone with more knowledge can shrink the test case down further, or make it clearer.
Remove `tokenstream::Delimited`.
Because it's an extra type layer that doesn't really help; in a couple
of places it actively gets in the way, and overall removing it makes the
code nicer. It does, however, move `tokenstream::TokenTree` further away
from the `TokenTree` in `quote.rs`.
More importantly, this change reduces the size of `TokenStream` from 48
bytes to 40 bytes on x86-64, which is enough to slightly reduce
instruction counts on numerous benchmarks, the best by 1.5%.
Note that `open_tt` and `close_tt` have gone from being methods on
`Delimited` to associated methods of `TokenTree`.
Because it's an extra type layer that doesn't really help; in a couple
of places it actively gets in the way, and overall removing it makes the
code nicer. It does, however, move `tokenstream::TokenTree` further away
from the `TokenTree` in `quote.rs`.
More importantly, this change reduces the size of `TokenStream` from 48
bytes to 40 bytes on x86-64, which is enough to slightly reduce
instruction counts on numerous benchmarks, the best by 1.5%.
Note that `open_tt` and `close_tt` have gone from being methods on
`Delimited` to associated methods of `TokenTree`.
This commit also fixes up lifetimes a bit:
- Renames `'a` as `'p` when used with `Matrix` and `Pattern`, for
consistency.
- Removes some unnecessary `'p` lifetimes on some function arguments.
- Adds some missing lifetime parameters.
slice: tweak concat & join
- use `sum` instead of `fold` (readability)
- adjust the capacity for `join` - the number of separators is `n - 1`, not `n`; proof:
```
fn main() {
let a = [[1, 2], [4, 5]];
let v = a.join(&3);
assert_ne!(v.len(), v.capacity()); // len is 5, capacity is 6
}
```
Update the book to fix some edition-related bugs
I'd love to have this included in a point release if one happens, but the changes aren't worth doing a point release on their own IMO. I'd definitely like to see this backported to beta.
The most urgent changes included here are:
- Chapter 19.6, on macros (including the macro changes that just stabilized), [is cut off](https://github.com/rust-lang/book/issues/1668) because of an ill-placed newline in a comment that [pulldown-cmark interprets incorrectly](https://github.com/raphlinus/pulldown-cmark/issues/124).
- [The `Cargo.toml` shown in the Guessing Game example in Chapter 2 (and one in Chapter 14) doesn't have `edition="2018"`](https://github.com/rust-lang/book/pull/1671), which can be confusing depending on whether the readers have it in theirs or not, think they should remove it if they have it, and the rest of the chapter assumes it's there and the code doesn't compile if you don't have it.
- The redirects implemented as part of only shipping the 2018 edition of the book sometimes lead to [having to click through 2 redirect pages](https://github.com/rust-lang/book/pull/1667) when it could be just one.
There are other small corrections included that were made since the last time the book was updated, but those aren't urgent.
cc @steveklabnik