Commit graph

97502 commits

Author SHA1 Message Date
Mazdak Farrokhzad
e9615f2487
Rollup merge of #63297 - RalfJung:ptr_offset, r=dtolnay
Improve pointer offset method docs

Cc @rkruppe @gnzlbg
2019-08-12 10:58:13 +02:00
Mazdak Farrokhzad
0b4823de23
Rollup merge of #62108 - Zoxc:sharded-queries, r=oli-obk
Use sharded maps for queries

Based on https://github.com/rust-lang/rust/pull/61779.

r? @Gankro
2019-08-12 10:58:12 +02:00
bors
72f8043d44 Auto merge of #63469 - Centril:refactor-parser, r=petrochenkov
libsyntax: Refactor `parser.rs` into reasonably sized logical units

Here we split `parser.rs` (~7.9 KLOC) into more reasonably sized files (all < 1.8 KLOC):

- `./src/libsyntax/parse/`
   - `parser.rs`
   - `parser/`
      - `pat.rs`
      - `expr.rs`
      - `stmt.rs`
      - `ty.rs`
      - `path.rs`
      - `generics.rs`
      - `item.rs`
      - `module.rs`

Closes https://github.com/rust-lang/rust/issues/60015.

r? @petrochenkov
2019-08-12 02:35:55 +00:00
bors
899efd5108 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.
2019-08-11 22:53:30 +00:00
bors
00ee1b47f4 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)

Failed merges:

r? @ghost
2019-08-11 19:19:33 +00:00
Mark Rousskov
4229dc3538
Rollup merge of #63464 - Mark-Simulacrum:deref-instance, r=eddyb
Copy ty::Instance instead of passing by reference

ty::Instance is small and Copy, we should not be adding additional
indirection.

Fixes #63409.

r? @eddyb
2019-08-11 15:18:49 -04:00
Mark Rousskov
86ceab47b1
Rollup merge of #63453 - Mark-Simulacrum:rustdoc-clean-2, r=GuillaumeGomez
rustdoc: general cleanup

Almost all commits stand alone; but all commits can be reviewed individually.
2019-08-11 15:18:47 -04:00
Mark Rousskov
e16b12fd49
Rollup merge of #63442 - lzutao:vec-bin-search-insert, r=Mark-Simulacrum
Add an example to show how to insert item to a sorted vec

Closes #61684
cc #61742
r? @Mark-Simulacrum, @jonas-schievink
2019-08-11 15:18:46 -04:00
Mark Rousskov
c805a38dff
Rollup merge of #63441 - bjorn3:patch-1, r=Mark-Simulacrum
Derive Debug for CrateInfo
2019-08-11 15:18:44 -04:00
Mark Rousskov
8122a01b27
Rollup merge of #63440 - RalfJung:ctfe-backtrace, r=oli-obk
rename RUST_CTFE_BACKTRACE to RUSTC_CTFE_BACKTRACE

This matches `RUSTC_LOG`. Both affect only rustc, not any Rust program.
2019-08-11 15:18:43 -04:00
Mark Rousskov
24a83374b6
Rollup merge of #63433 - RalfJung:miri-call, r=oli-obk
Miri shouldn't look at types

r? @oli-obk

Fixes https://github.com/rust-lang/rust/issues/62137
2019-08-11 15:18:41 -04:00
Mark Rousskov
061245e2b1
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.
2019-08-11 15:18:40 -04:00
Mark Rousskov
88629778e6
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).
2019-08-11 15:18:38 -04:00
Igor Matuszewski
c8a2855442 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.
2019-08-11 21:10:16 +02:00
Mazdak Farrokhzad
bcfcbfc923 parser: {check,expect}_lifetime into ty.rs 2019-08-11 20:46:34 +02:00
Mazdak Farrokhzad
385d07f359 parser: move into generics.rs 2019-08-11 20:44:09 +02:00
Mazdak Farrokhzad
d6d93b3d82 parser: move into stmt.rs 2019-08-11 20:32:29 +02:00
Mazdak Farrokhzad
28db7c5968 parser: move parse_fn_block_decl into expr.rs 2019-08-11 20:04:09 +02:00
Mazdak Farrokhzad
848ec4aa3c parser: move parse_ident_or_underscore into item.rs 2019-08-11 20:00:38 +02:00
Mazdak Farrokhzad
3dbfbafe3e parser: split into {ty, path}.rs 2019-08-11 19:59:27 +02:00
Mazdak Farrokhzad
e81347c368 parser: split into {item,module}.rs 2019-08-11 18:34:42 +02:00
Mark Rousskov
43de341f19 Copy ty::Instance instead of passing by reference
ty::Instance is small and Copy, we should not be adding additional
indirection.
2019-08-11 10:54:38 -04:00
bjorn3
b204232fd3
Derive Debug for NativeLibrary and NativeLibraryKind 2019-08-11 16:51:36 +02:00
Mark Rousskov
3b8a24d193 Reduce nesting in externalfiles implementation
Utilize `?` instead of and_then/map operators
2019-08-11 10:47:58 -04:00
Mark Rousskov
1aa0964b54 Drop RefCell from IdMap in markdown rendering 2019-08-11 10:47:58 -04:00
Mark Rousskov
c250b5fd03 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.
2019-08-11 10:36:46 -04:00
Mark Rousskov
dbad77ffdd Remove thread-local for playground config 2019-08-11 10:36:46 -04:00
Mark Rousskov
ade8b02828 Remove unnecessary channel 2019-08-11 10:36:46 -04:00
Mark Rousskov
eea2f879af Use a HashSet instead of Vec 2019-08-11 10:36:46 -04:00
Mark Rousskov
0347480151 Don't store all traits in DocContext
This is already a query so we're just needlessly copying the data
around.
2019-08-11 10:36:46 -04:00
Mark Rousskov
00319519bb Store typed Passes 2019-08-11 10:36:46 -04:00
Mark Rousskov
6be2857a6c Replace Arc with Rc around external_traits 2019-08-11 10:36:46 -04:00
Mark Rousskov
c57481001e 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).
2019-08-11 10:36:46 -04:00
Mark Rousskov
8f80a8d7d5 Use entry API in store_path 2019-08-11 10:36:46 -04:00
Mark Rousskov
00d7bc7688 Remove crate_name from DocContext
tcx.crate_name is the appropriate way to retrieve the crate name.
2019-08-11 10:36:46 -04:00
Mark Rousskov
19c85a8f8a Move def_id_to_path to use site in visit_ast 2019-08-11 10:36:46 -04:00
Mark Rousskov
65ea7b7947 rustdoc: Replace HirVec with slices in doctree 2019-08-11 10:36:46 -04:00
bors
8a068699a2 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 :)

r? @oli-obk
2019-08-11 13:37:37 +00:00
Mazdak Farrokhzad
e742de2569 parser: split into pat.rs 2019-08-11 15:24:37 +02:00
Mazdak Farrokhzad
81e6b5094e parser: split into expr.rs 2019-08-11 13:14:30 +02:00
Ralf Jung
09307474c2 update clippy 2019-08-11 12:06:12 +02:00
Ralf Jung
5c77a17d18 note down some more future plans 2019-08-11 12:04:49 +02:00
Ralf Jung
c5a63566d6 allow the lint if a few UB-demonstrating doc tests 2019-08-11 12:04:49 +02:00
Ralf Jung
3972d05fec proper doc comment for 'recovered' field of variant
Curtesy of petrochenkov
2019-08-11 12:04:49 +02:00
Ralf Jung
4b062a175f note a FIXME 2019-08-11 12:04:49 +02:00
Ralf Jung
8e6fbbec83 add tuple_fields convenience method and use it in a few places 2019-08-11 12:04:49 +02:00
Ralf Jung
fbd56131a9 fix a comment 2019-08-11 12:04:49 +02:00
Ralf Jung
ca1e94b131 warn for more cases 2019-08-11 12:04:49 +02:00
Ralf Jung
da6fbb1895 add basic lint testing for misuse of mem::zeroed and mem::uninitialized 2019-08-11 12:04:49 +02:00
bors
2b78e10ac1 Auto merge of #63343 - ishitatsuyuki:revert-62150, r=RalfJung
Back out #62150

Ref: #62825

cc @RalfJung
2019-08-11 09:58:01 +00:00