under openbsd, the library path of libstdc++ need to be explicit (due
to the fact the default linker `cc` is gcc-4.2, and not gcc-4.9).
but when a recent LLVM is installed, rustc compilation pikes the bad
LLVM version (which live in /usr/local/lib, which is same directory of
libestdc++.so for gcc-4.9).
this patch move the libstdc++ path from RUST_FLAGS_<target> to special
variable, and use it *after* LLVM_LIBDIR_RUSTFLAGS_<target> in
arguments.
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!
This commit adds issue numbers to the vast majority of active feature
gates. The few that are left without issues are rustc/runtime-internal
features that are essentially private APIs.
Closes#28244
r? @huonw
The comparison of IP addresses should happen not always in network endianness
but rather in the host endianness format, so be sure to convert to that before
comparing addresses.
There are still locations where the endianness will factor into visible
properties, such as the hash, but these are not important to be independent of
the endianness in play (as hash values are pretty undefined anyway.
Closes#29691
r? @steveklabnik
This completely abdicates any responsibility to explain what Rust is, instead linking to the website.
My main motivation is that I am still not happy with it, and every time I try to fix it I just write a slightly longer sales pitch than what's on the website.
One thing this paragraph could do is direct people to more information about what is in the repo, or more technical information about the implementation.
Since commit 46068c9da, call to `reserve()` on empty vec allocates
exactly requested capacity, so unroll of first iteration may help only
with branch prediction.
Quite a bit of cruft in the valgrind suppressions. I started from a clean slate and found a few unique failures; this commit also moves the tests "fixed" by these suppressions into run-pass-valgrind.
Hi Rustaceans!
This is the second take on running latest rustfmt on librustc_front!
This is the same in https://github.com/rust-lang/rust/pull/29075 but cleaned. All fixups have been applied.
//cc @nrc