make MIR type checker handle a number of other cases
The existing type checker was primarily used to verify types, but was skipping over a number of details. For example, it was not checking that the predicates on functions were satisfied and so forth. This meant that the NLL region checker was not getting a lot of the constraints it needed. This PR closes those gaps. It also includes a bit of refactoring for the way that we store region values, encapsulating the bit matrix over into its own module and improving the data structures in use.
This is mostly work by @spastorino being ported over from nll-master.
r? @arielb1 or @pnkfelix
Fix visible_parent_map to choose globally minimal paths
Fix#46112: visible_parent_map construction needs a BFS over whole crate forest to get globally minimal paths.
(There are other latent bugs that were e.g. causing this test case to have weirdness like `<unnamed>` in the diagnostic output. Those bugs are not fixed here, since they are issues long-standing in the stable channel.)
Download crosstool-ng from GitHub
Workaround the current problem where http://crosstool-ng.org was done, causing all non-x86 jobs to fail spuriously (cc #40474).
If http://crosstool-ng.org becomes online before this PR is merged, this PR should be closed and the tree should be reopened.
Converting a `RegionElementIndex` to a `Location` is O(n) though could
trivially be O(log n), but we don't do it that much anyhow -- just on
error and debugging.
macros: hygienize use of `core`/`std` in builtin macros
Today, if a builtin macro wants to access an item from `core` or `std` (depending `#![no_std]`), it generates `::core::path::to::item` or `::std::path::to::item` respectively (c.f. `fn std_path()` in `libsyntax/ext/base.rs`).
This PR refactors the builtin macros to instead always emit `$crate::path::to::item` here. That is, the def site of builtin macros is taken to be in `extern crate core;` or `extern crate std;`. Since builtin macros are macros 1.0 (i.e. mostly unhygienic), changing the def site can only effect the resolution of `$crate`.
r? @nrc
Record all imports (`use`, `extern crate`) in the crate metadata
This PR adds non-`pub` `use` and `extern crate` imports in the crate metadata since hygienic macros invoked in other crates may use them. We already include all other non-`pub` items in the crate metadata. This improves import suggestions in some cases.
Fixes#42337.
r? @nrc
Implement impl Trait lifetime elision
Fixes#43396.
There's one weird ICE in the interaction with argument-position `impl Trait`. I'm still debugging it-- I've left a test for it commented out with a FIXME.
Also included a FIXME to ensure that `impl Trait` traits are caught under the lint in https://github.com/rust-lang/rust/issues/45992.
r? @nikomatsakis
Fix return value of `LLVMRustMetadataAsValue`
`LLVMRustMetadataAsValue` would previously return `void`, despite the
corresponding Rust function expecting to return a `ValueRef`.