bors [Sun, 11 Aug 2019 22:53:30 +0000 (22:53 +0000)]
Auto merge of #63472 - Xanewok:update-rls, r=Mark-Simulacrum
Update RLS
This update includes the ability to warn on deprecated config keys.
It's important to be able to warn the user whenever they're using
an old configuration rather than giving them a cryptic "unknown
configuration error"
cc https://github.com/rust-lang/rls-vscode/issues/639
Since we removed a config value in the current nightly, it'd be
very good if this change can make also make it before cutting the
next release.
bors [Sun, 11 Aug 2019 19:19:33 +0000 (19:19 +0000)]
Auto merge of #63471 - Mark-Simulacrum:rollup-m756lnx, r=Mark-Simulacrum
Rollup of 8 pull requests
Successful merges:
- #61969 (Add #[repr(transparent)] for several types)
- #63346 (Lint on some incorrect uses of mem::zeroed / mem::uninitialized)
- #63433 (Miri shouldn't look at types)
- #63440 (rename RUST_CTFE_BACKTRACE to RUSTC_CTFE_BACKTRACE)
- #63441 (Derive Debug for CrateInfo)
- #63442 (Add an example to show how to insert item to a sorted vec)
- #63453 (rustdoc: general cleanup)
- #63464 (Copy ty::Instance instead of passing by reference)
Mark Rousskov [Sun, 11 Aug 2019 19:18:40 +0000 (15:18 -0400)]
Rollup merge of #63346 - RalfJung:zeroed-lint, r=eddyb
Lint on some incorrect uses of mem::zeroed / mem::uninitialized
Cc https://github.com/rust-lang/rust/issues/62825 and https://internals.rust-lang.org/t/make-mem-uninitialized-and-mem-zeroed-panic-for-some-types-where-0-is-a-niche/10605
This does not yet handle `NonNull`/`NonZero*`, but it is a start.
I also improved some doc issues I hit on the way, and added a useful helper to `TyS`.
EDIT: I added the relnotes label mostly as a proposal -- I think this is worth mentioning, but leave the decision up to the release team.
Mark Rousskov [Sun, 11 Aug 2019 19:18:38 +0000 (15:18 -0400)]
Rollup merge of #61969 - MikailBag:master, r=Centril
Add #[repr(transparent)] for several types
In some functions, types mentioned in this PR are transmuted into their inner value.
Example for `PathBuf`: https://github.com/rust-lang/rust/blob/master/src/libstd/path.rs#L1132.
This PR adds `#[repr(transparent)]` to those types, so their correct behavior doesn't depend on compiler details. (As far as I understand, currently that line, converting `PathBuf` to `Vec<u8>`, is UB).
Igor Matuszewski [Sun, 11 Aug 2019 19:10:16 +0000 (21:10 +0200)]
Update RLS
This update includes the ability to warn on deprecated config keys.
It's important to be able to warn the user whenever they're using
an old configuration rather than giving them a cryptic "unknown
configuration error"
cc https://github.com/rust-lang/rls-vscode/issues/639
Since we removed a config value in the current nightly, it'd be
very good if this change can make also make it before cutting the
next release.
Mark Rousskov [Sat, 10 Aug 2019 22:27:17 +0000 (18:27 -0400)]
Remove fmt::Display impls on Markdown structs
These impls prevent ergonomic use of the config (e.g., forcing us to use
RefCell) despite all usecases for these structs only using their Display
impls once.
Mark Rousskov [Sat, 10 Aug 2019 19:20:21 +0000 (15:20 -0400)]
Remove ReentrantMutex
This drops the parking_lot dependency; the ReentrantMutex type appeared
to be unused (at least, no compilation failures occurred).
This is technically a possible change in behavior of its users, as
lock() would wait on other threads releasing their guards, but since we
didn't actually remove any threading or such in this code, it appears
that we never used that behavior (the behavior change is only noticeable
if the type previously was used in two threads, in a single thread
ReentrantMutex is useless).
bors [Sun, 11 Aug 2019 13:37:37 +0000 (13:37 +0000)]
Auto merge of #63446 - Centril:refactor-lowering, r=oli-obk
Refactor and categorize lowering wrt. items / exprs
Split lowering into more files along the lines of "expression related" and "item related".
Also refactor huge methods into smaller ones.
A next step might be to introduce "type related" and merge patterns and statements combined with expressions into "value related". There's still more work to do but the PR was getting too big :)
bors [Sun, 11 Aug 2019 02:05:40 +0000 (02:05 +0000)]
Auto merge of #63413 - RalfJung:miri, r=oli-obk
update Miri
With https://github.com/rust-lang/rust/pull/63404 landed, we need https://github.com/rust-lang/miri/pull/898 to avoid failures in https://github.com/RalfJung/miri-test-libstd.
Rollup merge of #63432 - Centril:simplify-lowering, r=eddyb
Cleanup & Simplify stuff in lowering
Closes https://github.com/rust-lang/rust/issues/60253 as a byproduct.
It turns out that it is in fact necessary to have a `DropTemps(...)` around the `match_expr` and there is a test (https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-13304.rs) which fails without that.
Rollup merge of #63429 - rust-lang:gitignore-readd-tmp, r=Mark-Simulacrum
.gitignore: Readd `/tmp/`
Specifically, `/tmp/partitioning-tests/` it is generated by the incremental tests, https://github.com/rust-lang/rust/search?p=2&q=partitioning-tests&unscoped_q=partitioning-tests. These are cleaned up by compiletest but not if you kill testing prematurely (which I just did to test out a rollup, and it is annoying to `rm -rf tmp/`).
Rollup merge of #63400 - petrochenkov:resplit, r=eddyb
Try to break resolve into more isolated parts
Some small step towards resolve librarification.
"Late resolution" is the pass that resolves most of names in a crate beside imports and macros.
It runs when the crate is fully expanded and its module structure is fully built.
So we just walk through the crate and resolve all the expressions, types, etc.
This pass is pretty self-contained, but it was previously done by implementing `Visitor` on the whole `Resolver` (which is used for many other tasks), and fields specific to this pass were indiscernible from the global `Resolver` state.
This PR moves the late resolution pass into a separate visitor and a separate file, fields specific to this visitor are moved from `Resolver` as well.
I'm especially happy about `current_module` being removed from `Resolver`.
It was used even for operations not related to visiting and changing the `current_module` position in process.
It was also used as an implicit argument for some functions used in this style
```rust
let orig_current_module = mem::replace(&mut self.current_module, module);
self.resolve_ident_somewhere();
self.current_module = orig_current_module;
```
and having effects on e.g. privacy checking somewhere deeply inside `resolve_ident_somewhere`.
Now we explicitly pass a `ParentScope` to those functions instead, which includes the module and some other data describing our position in the crate relatively to which we resolve names.
Rustdoc was one of the users of `current_module`, it set it for resolving intra-doc links.
Now it passes it explicitly as an argument as well (I also supported resolving paths from rustdoc in unnamed blocks as a drive-by fix).
Visibility resolution is also changed to use early resolution (which is correct because it's used during the work of `BuildReducedGraphVisitor`, i.e. integration of a new AST fragment into the existing partially built module structures.) instead of untimely late resolution (which worked only due to restrictions on paths in visibilities like inability to refer to anything except ancestor modules).
This slightly regresses its diagnostics because late resolution has a more systematic error detection and recovery currently.
Due to changes in `current_module` and visibilities `BuildReducedGraphVisitor` ended up almost as heavily affected by this refactoring as late resolution.
Fixes https://github.com/rust-lang/rust/issues/63223 (due to visibility resolution changes).