bors [Sun, 17 Jun 2018 09:48:10 +0000 (09:48 +0000)]
Auto merge of #51425 - QuietMisdreavus:thats-def-a-namespace-there, r=petrochenkov
refactor: create multiple HIR items for imports
When lowering `use` statements into HIR, they get a `Def` of the thing they're pointing at. This is great for things that need to know what was just pulled into scope. However, this is a bit misleading, because a `use` statement can pull things from multiple namespaces if their names collide. This is a problem for rustdoc, because if there are a module and a function with the same name (for example) then it will only document the module import, because that's that the lowered `use` statement points to.
The current version of this PR does the following:
* Whenever the resolver comes across a `use` statement, it loads the definitions into a new `import_map` instead of the existing `def_map`. This keeps the resolutions per-namespace so that all the target definitions are available.
* When lowering `use` statements, it looks up the resolutions in the `import_map` and creates multiple `Item`s if there is more than one resolution.
* To ensure the `NodeId`s are properly tracked in the lowered module, they need to be created in the AST, and pulled out as needed if multiple resolutions are available.
bors [Sun, 17 Jun 2018 07:49:25 +0000 (07:49 +0000)]
Auto merge of #51466 - joshlf:ref-split, r=dtolnay
Add Ref/RefMut map_split method
As proposed [here](https://internals.rust-lang.org/t/make-refcell-support-slice-splitting/7707).
TLDR: Add a `map_split` method that allows multiple `RefMut`s to exist simultaneously so long as they refer to non-overlapping regions of the original `RefCell`. This is useful for things like the slice `split_at_mut` method.
bors [Sun, 17 Jun 2018 02:57:40 +0000 (02:57 +0000)]
Auto merge of #51382 - GuillaumeGomez:intra-link-lint, r=QuietMisdreavus
Add lint for intra link resolution failure
This PR is almost done, just remains this note:
```
note: requested on the command line with `-W intra-link-resolution-failure`
```
I have no idea why my lint is considered as being passed through command line and wasn't able to find where it was set. If anyone has an idea, it'd be very helpful!
bors [Sat, 16 Jun 2018 17:43:24 +0000 (17:43 +0000)]
Auto merge of #51584 - QuietMisdreavus:globs-and-crosses, r=ollie27
rustdoc: process cross-crate glob re-exports
Turns out, we were deliberately ignoring glob re-exports when they were occurring across crates, even though we were fully processing them for local re-exports. This will at least bring the two into parity.
Mark Simulacrum [Sat, 16 Jun 2018 17:11:06 +0000 (11:11 -0600)]
Move bootstrap tests to the end of the default test run
Since they are unlikely to fail and are almost never going to fail
except with bootstrap changes (which would be tested locally anyway) it
makes sense to run these tests close to last.
bors [Sat, 16 Jun 2018 03:06:10 +0000 (03:06 +0000)]
Auto merge of #51411 - nnethercote:process_predicate, r=nikomatsakis
Speed up obligation forest code
Here are the rustc-perf benchmarks that get at least a 1% speedup on one or more of their runs with these patches applied:
```
inflate-check
avg: -8.7% min: -12.1% max: 0.0%
inflate
avg: -5.9% min: -8.6% max: 1.1%
inflate-opt
avg: -1.5% min: -2.0% max: -0.3%
clap-rs-check
avg: -0.6% min: -1.9% max: 0.5%
coercions
avg: -0.2%? min: -1.3%? max: 0.6%?
serde-opt
avg: -0.6% min: -1.0% max: 0.1%
coercions-check
avg: -0.4%? min: -1.0%? max: -0.0%?
```
bors [Wed, 13 Jun 2018 20:44:17 +0000 (20:44 +0000)]
Auto merge of #51532 - MajorBreakfast:task-future, r=cramertj
Improve core::task::TaskObj
- Rename `UnsafePoll` to `UnsafeTask` to avoid confusion with `Poll`
- Rename `TaskObj::from_poll_task()` to `TaskObj::new()`
- Rename `TaskObj`'s `poll` and `drop` fields to `poll_fn` and `drop_fn`
- Implement `Future` for `TaskObj`. Reason: It's a custom trait object for a future, so it should implement future
- Remove `unsafe impl Sync` for `TaskObj`. I don't think we need it. Was this safe? `UnsafeTask` only requires to implement `Send`
bors [Wed, 13 Jun 2018 10:03:05 +0000 (10:03 +0000)]
Auto merge of #51527 - kennytm:do-not-auto-hide-inherent-impl, r=GuillaumeGomez
Don't auto-hide inherent impls even if `rustdoc-collapse == true`.
This PR changes the auto-collapse behavior when a page is first loaded:
* Inherent impls will never be collapsed by default (new behavior).
* Trait impls will always be collapsed by default, same as before.
* Other items are collapsed according to localStorage, same as before.
This should be much more useful since there is no hint what the content of a collapsed inherent impl would be (try to collapse everything in https://doc.rust-lang.org/std/vec/struct.Vec.html and guess where a method like `try_reserve` or `splice` would be).
Manually clicking the global [-]/[+] will still collapse/expand everything.
Mark Rousskov [Tue, 12 Jun 2018 17:22:53 +0000 (11:22 -0600)]
Rollup merge of #51502 - jebrosen:pub_parse_methods, r=Mark-Simulacrum
Make parse_seq_to_end and parse_path public
(see SergioBenitez/Rocket#660, rust-lang/rust#51265)
Rocket currently uses `parse_seq_to_end` and `parse_path` in its codegen macros. Assuming I tested correctly, this is the minimal set of methods that are currently necessary to build Rocket again. I would be happy to add documentation of this and Rocket's other usages, if desired.
bors [Tue, 12 Jun 2018 15:23:28 +0000 (15:23 +0000)]
Auto merge of #51519 - ExpHP:issue-51331-b, r=petrochenkov
Fix for $crate var normalization in proc macro for externally defined macros
Fixes #51331, a bug that has existed in at least *some* form for a year and a half.
The PR includes the addition of a `fold_qpath` method to `syntax::fold::Folder`. Overriding this method is useful for folds that modify paths in a way that invalidates indices (insertion or removal of a component), as it provides the opportunity to update `qself.position` in `<A as B>::C` paths. I added it because the bugfix is messy without it.
(unfortunately, grepping around the codebase, I did not see anything else that could use it.)