r? @nagisa
I'm going to need the `ConstVal` -> `ValueRef` translation to start removing trans/consts piece by piece. If you need anything implemented in the translation, feel free to assign an issue to me.
Running `/usr/bin/time -v make` to build rust (using local llvm) shows the maximum memory usage at 715 megabytes on 32-bit x86 (on arm linux it's even less @ 580M).
Reworded according to @brson's [input](https://github.com/rust-lang/rust/pull/30196#issuecomment-162088921).
This fixes a bug in which the visibility of a use declaration defining a name in one namespace (e.g. the value namespace) is overridden by a later use declaration defining the same name in the other namespace (e.g. the type namespace). For example,
```rust
fn f() {}
pub mod bar {}
mod foo {
use f; // This import should not be visible outside `foo`,
pub use bar as f; // but it visible outside of `foo` because of this import.
}
fn main() { foo::f(); }
```
As the example demonstrates, this is a [breaking-change], but it looks unlikely to cause breakage in practice, and any breakage can be fixed by correcting visibility modifiers.
This PR makes `Mir` `RustcEncodable` and `RustcDecodable` and stores it in crate metadata for inlinable items.
Some other things in here:
- `mir::visit::Visitor` is extended to also visit `Literals`, `Spans` and `DefIds`.
- It also adds `mir::visit::MutVisitor` which allows to mutate the visited `Mir` structure in place.
- Some numbers on how big MIR is in metadata (total metadata size in bytes):
| | w/ MIR | w/o MIR | Rel. Size |
|----------------|-----------:|------------:|:---------:|
| libcore | 17,695,473 | 14,263,377 | 124% |
| liblibc | 411,440 | 404,382 | 102% |
| libcollections | 4,537,975 | 3,526,933 | 129% |
| libserialize | 2,574,769 | 2,060,798 | 125% |
| libsyntax | 15,262,894 | 12,075,574 | 126% |
| librustc | 16,984,537 | 13,692,168 | 124% |
So, adding MIR to metadata makes it about 25% bigger. It could be worse, considering that it still uses the inefficient RBML encoding. Still, the question is whether we should put MIR emission behind a `-Z` flag.
This changes the error output and behaviour to:
* not emit python backtraces
* run all checks
* include a context line per error
* move the offending line-number to the start of the line
fixes#21455
This is a standard "clean out libstd" commit which removes all 1.5-and-before
deprecated functionality as it's now all been deprecated for at least one entire
cycle.
This is a standard "clean out libstd" commit which removes all 1.5-and-before
deprecated functionality as it's now all been deprecated for at least one entire
cycle.
I meant to double check the work in https://github.com/rust-lang/rust/issues/29429, but due to Mozlando, forgot. Here are two small fixes.
r? @brson I would like to get this backported to beta as well, sorry :( I don't generally want doc backports, but feel this is exceptional and worth it.