This mostly brings them in line with existing linking convention, but
also has some minor re-wording.
The text at the top has been re-focused, by starting out with what the
prelude does, rather than starting from injecting std.
Also, it now mentions that other preludes exist.
Part of https://github.com/rust-lang/rust/issues/29369
large matches that fallback to Eq. When we encounter a case where the
test being performed does not inform the candidate at all, we just stop
testing the candidates at that point, rather than adding the candidate
to both outcomes. The former behavior was not WRONG, but it generated a
lot of code, whereas this new behavior degenerates to an if-else-if
tree.
Fixes#29740.
It's a bit strange to expect users of `libstd` to require the use of an external crates.io crate to work with standard types. This commit encourages the use `os::raw::c_char` instead, although users are certainly free to use `libc::c_char` if they wish; the test still exists to ensure the two types are identical (though the reported bug only exists on platforms that are not officially tested).
Fixes#29774
The older algorithm was pretty inefficient for big matches. Fixes#29227. (On my computer, MIR construction on this test case goes from 9.9s to 0.025s.) Whereas before we had a loop like:
- for all outcomes of the test we are performing
- for all candidates
- check whether candidate is relevant to outcome
We now do:
- for all candidates
- determine which outcomes the candidate is relevant to
Since the number of outcomes in this case is proportional to the number of candidates, the original algorithm turned out to be O(n^2), and the newer one is just O(n).
This PR also does some minor speedups by eagerly mirroring all patterns, so that we can just pass around `&Pattern<'tcx>`, which makes cloning cheaper. We could probably go a bit further in this direction.
r? @Aatch
format_args! doesn't support none Sized types so we should just pass it the references to left_val and right_val.
This fixes `assert_eq!([1, 2, 3][..], vec![1, 2, 3][..])` for example.
Hi Rustaceans!
This is the secong take on running latest rustfmt on librustc_driver!
All fixups made in https://github.com/rust-lang/rust/pull/29033 were done (also rustfmt got better).
//cc @nrc
before we iterated over the test and each outcome thereof, and then
checked processed every candidate against this outcome, we now organize
the walk differently. Instead, we visit each candidate and say "Here is
the test being performed. Figure out the resulting candidates for each
possible outcome and add yourself into the appropriate places."
- Check privacy sanity in all blocks, not only function bodies
- Check all fields, not only named
- Check all impl items, not only methods
- Check default impls
- Move the sanity check in the beginning of privacy checking, so others could rely on it
Technically it's a [breaking-change], but I expect no breakage because, well, it's *sane* privacy visitor, if code is broken it must be insane by definition!