Store references to the freevars instead of copies when constructing
the environment and insert an additional load when reading them from
the environment.
In particular, this causes mutation of an upvar to correctly mark
it as mutable during adjustment. This makes borrowck correctly
flag conflicting borrows, etc.
We still seem to generate incorrect code in trans which copies the upvar
by value into the closure. This remains to be fixed.
This rewrites them to the current `ItemStatic` production of the compiler, but I
want to get this into a snapshot. It will be illegal to use a `static` in a
pattern of a `match` statement, so all those current uses will need to be
rewritten to `const` once it's implemented. This requires that the stage0
snapshot is able to parse `const`.
cc #17718
This PR reverts https://github.com/rust-lang/rust/pull/17620, which caused a significant regression for slices.
As discussed with @alexcrichton, all of the public-facing changes of the earlier PR need to be rolled back, and it's not clear that we should move the libraries over to this new notation yet anyway (especially given its feature-gated status).
Closes#17710
Instead, only run `make tidy`. The tidy script can run quite quickly, and it's
super annoying to run tests for 50 minutes only to have bors fail with a
"trailing whitespace" error.
Instead, only run `make tidy`. The tidy script can run quite quickly, and it's
super annoying to run tests for 50 minutes only to have bors fail with a
"trailing whitespace" error.
This test has recently been failing on the bots, and I'm not entirely sure why.
I haven't been able to reproduce locally or on the bots, so I'm adding some
messages to help diagnose the problem hopefully.
The bitshifts were wrong in that they invoked undefined behavior and
only passed the lower byte of the presumed-to-be-32bit errno value.
Apparently all actually possible values for errno happen to be easily
under 256, so this didn't cause any actual problems.
This commit fixes the bitshifts, but doesn't generalize to errno types
that aren't 32bit.