Commit Graph

141790 Commits

Author SHA1 Message Date
bors
8b53ec677e Auto merge of #83828 - camelid:rustdoc-vec-perf, r=jyn514
rustdoc: Use `ThinVec` in a few places

Almost every crate has no primitives and no keywords defined in it, so
using `ThinVec` should make some types smaller.
2021-04-06 23:57:06 +00:00
Joshua Nelson
ffd7094f1d Fix handling of --output-format json flag
- Don't treat it as deprecated on stable and beta channels. Before, it
  would give confusing and incorrect output:

  ```
  warning: the 'output-format' flag is considered deprecated
    |
    = warning: see issue #44136 <https://github.com/rust-lang/rust/issues/44136> for more information

  error: json output format isn't supported for doc generation
  ```
  Both of those are wrong: output-format isn't deprecated, and json
  output is supported.

- Require -Z unstable-options for `--output-format json`

  Previously, it was allowed by default on nightly, which made it hard
  to realize the flag wouldn't be accepted on beta or stable.
  Note that this still allows `--output-format html`, which has been
  stable since 1.0.

- Remove unnecessary double-checking of the feature gate when parsing
  the output format
- Add custom run-make test since compiletest passes -Zunstable-options
    by default
2021-04-06 18:41:17 -04:00
Giacomo Stevanato
a775984348 Add regression test 2021-04-06 21:41:54 +02:00
Giacomo Stevanato
7f823e5bbd Add reborrow suggestion when mutable reference is moved in a for loop 2021-04-06 21:39:44 +02:00
Joshua Nelson
9e11902eff Store links in Cache instead of on items directly
Items are first built after rustdoc creates the TyCtxt. To allow
resolving the links before the TyCtxt is built, the links can't be
stored on `clean::Item` directly.
2021-04-06 14:26:57 -04:00
Cameron Steffen
47f0c15f67 Symbol optimizations 2021-04-06 13:00:36 -05:00
bors
c051c5ddda Auto merge of #83934 - Dylan-DPC:rollup-nw5dadn, r=Dylan-DPC
Rollup of 7 pull requests

Successful merges:

 - #82963 (Move `SharedContext` to `context.rs`)
 - #83829 (rustc_target: Rely on defaults more in target specs)
 - #83895 (Add listing of lints (eg via `-W help`) to rustdoc)
 - #83902 (Update LLVM to support more wasm simd ops)
 - #83903 (Fix typo in TokenStream documentation)
 - #83910 (Update cargo)
 - #83920 (Fix HashMap/HashSet LLDB pretty-printer after hashbrown 0.11.0)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2021-04-06 17:55:55 +00:00
bors
624e8aad32 Auto merge of #7044 - camsteffen:match-path, r=Manishearth
Soft deprecate match_path and match_qpath

changelog: none

From zulip [disucssion](https://rust-lang.zulipchat.com/#narrow/stream/257328-clippy/topic/match_.5Bq.5Dpath.20is.20bad.3F).
2021-04-06 17:41:34 +00:00
Camelid
3ea8ebcc2d rustdoc: Use ThinVec in a few places
Almost every crate has no primitives and no keywords defined in it, so
using `ThinVec` should make some types smaller.
2021-04-06 10:18:34 -07:00
bors
bbe1567bc9 Auto merge of #7043 - camsteffen:dead-utils, r=flip1995
Remove some dead utils

changelog: none
2021-04-06 16:49:42 +00:00
Cameron Steffen
a342de3bcb Soft deprecate match_path and match_qpath 2021-04-06 11:46:27 -05:00
Cameron Steffen
79d3082cd7 Remove paths::PATH_BUF 2021-04-06 11:33:59 -05:00
Cameron Steffen
1efb551369 Remove get_node_span 2021-04-06 11:33:59 -05:00
lukaslueg
72796a7c36
Merge branch 'master' into stab_peek_mut 2021-04-06 18:23:21 +02:00
lukaslueg
7f32fda78c
Update library/core/src/iter/adapters/peekable.rs
Co-authored-by: Alexander Ronald Altman <alexanderaltman@me.com>
2021-04-06 18:16:02 +02:00
Dylan DPC
3d33818a79
Rollup merge of #83920 - ortem:fix-hashmap-lldb-pretty-printer-1.52, r=pnkfelix
Fix HashMap/HashSet LLDB pretty-printer after hashbrown 0.11.0

The pretty-printer was broken in https://github.com/rust-lang/rust/pull/77566 after updating hashbrown to 0.11.0.
Note that the corresponding GDB pretty-printer was updated properly.

Fixes #83891
2021-04-06 17:42:35 +02:00
Dylan DPC
2f57dc8575
Rollup merge of #83910 - ehuss:update-cargo, r=ehuss
Update cargo

3 commits in 3c44c3c4b7900b8b13c85ead25ccaa8abb7d8989..65d57e6f384c2317f76626eac116f683e2b63665
2021-03-31 21:21:15 +0000 to 2021-04-04 15:07:52 +0000
- Fix typo in contrib docs. (rust-lang/cargo#9328)
- fix clippy warnings (rust-lang/cargo#9323)
- Add -Zallow-features to match rustc's -Z (rust-lang/cargo#9283)
2021-04-06 17:42:34 +02:00
Dylan DPC
38a8fa8421
Rollup merge of #83903 - rust-lang:GuillaumeGomez-patch-1, r=lcnr
Fix typo in TokenStream documentation
2021-04-06 17:42:33 +02:00
Dylan DPC
8cee7b7947
Rollup merge of #83902 - alexcrichton:update-llvm, r=nikic
Update LLVM to support more wasm simd ops

Adds a commit with support for i64 simd comparisons for the wasm target
2021-04-06 17:42:32 +02:00
Dylan DPC
e00893b715
Rollup merge of #83895 - eggyal:issue-83883, r=jyn514
Add listing of lints (eg via `-W help`) to rustdoc

Fixes #83883

r? `@jyn514`
2021-04-06 17:42:31 +02:00
Dylan DPC
93b506c6fa
Rollup merge of #83829 - petrochenkov:minclean, r=nagisa
rustc_target: Rely on defaults more in target specs
2021-04-06 17:42:29 +02:00
Dylan DPC
c92ac875bf
Rollup merge of #82963 - camelid:move-sharedcontext, r=GuillaumeGomez
Move `SharedContext` to `context.rs`

It is tightly connected to `Context` and is primarily used as a field in
`Context`. Thus, it should be next to `Context`.
2021-04-06 17:42:28 +02:00
bors
16143d1067 Auto merge of #83875 - jyn514:diag_info, r=bugadani
rustdoc: Use DiagnosticInfo in more parts of intra-doc links

This makes the code a lot less verbose.

This is separated into lots of tiny commits because it was easier for me that way, but the overall diff isn't that big if you want to read it at once.

r? `@bugadani`
2021-04-06 15:37:29 +00:00
bors
6ae0835df0 Auto merge of #6931 - Jarcho:needless_borrow, r=phansch,flip1995
Fix all occurences `needless_borrow` internally

The bug that got 'needless_borrow' moved into the nursery was fixed two years ago in d4370f8b.

This did trigger over a thousand times internally, so that's all the other changes. I vetted most of them, but there's a lot The only interesting change is to the lint list. `declare_tool_lint` already makes a reference, so there's no need to take a reference to the lints.

changelog: None
2021-04-06 15:30:48 +00:00
SNCPlay42
ee79f83129 forbid impl Trait in generic param defaults 2021-04-06 16:21:08 +01:00
lcnr
b729815fc7 use a SmallVec in impl_or_trait_item 2021-04-06 17:06:44 +02:00
Jason Newcomb
12fce55766
Fix all occurences of needless_borrow internally 2021-04-06 10:43:47 -04:00
bors
d2ba777159 Auto merge of #7036 - horacimacias:master, r=giraffate
consider mutability on useless_vec suggestions

fixes #7035

changelog: Now the suggested by `useless_vec` considers mutability to suggest either `&[]`, as before, or `&mut []` if the used reference is mutable.
2021-04-06 13:38:08 +00:00
bors
5c897d430d Auto merge of #83922 - RalfJung:miri, r=RalfJung
update Miri

Also updates the lockfile, since Miri updated some dependencies.
Cc `@rust-lang/miri` r? `@ghost`
2021-04-06 12:20:48 +00:00
Amanieu d'Antras
879bfeca54 Use AnonConst for asm! constants 2021-04-06 12:35:41 +01:00
Amanieu d'Antras
32be124e30 Use AnonConst for asm! constants 2021-04-06 12:35:41 +01:00
Ralf Jung
bf11b12e39 update Miri 2021-04-06 13:20:48 +02:00
bors
e1d49aaad4 Auto merge of #83821 - camelid:improve-thinvec, r=petrochenkov
Add `FromIterator` and `IntoIterator` impls for `ThinVec`

These should make using `ThinVec` feel much more like using `Vec`.
They will allow users of `Vec` to switch to `ThinVec` while continuing
to use `collect()`, `for` loops, and other parts of the iterator API.

I don't know if there were use cases before for using the iterator API
with `ThinVec`, but I would like to start using `ThinVec` in rustdoc,
and having it conform to the iterator API would make the transition
*a lot* easier.

I added a `FromIterator` impl, an `IntoIterator` impl that yields owned
elements, and `IntoIterator` impls that yield immutable or mutable
references to elements. I also added some unit tests for `ThinVec`.
2021-04-06 09:57:12 +00:00
ortem
3d3a5ca79f Fix HashMap/HashSet LLDB pretty-printer after hashbrown 0.11.0
The pretty-printer was broken in https://github.com/rust-lang/rust/pull/77566
after updating hashbrown to 0.11.0.
Note that the corresponding GDB pretty-printer was updated properly.
2021-04-06 12:44:17 +03:00
Horaci Macias
8a50923da4 consider mutability on useless_vec suggestions
https://github.com/rust-lang/rust-clippy/issues/7035
2021-04-06 11:09:52 +02:00
Alan Egerton
4d23c8e9a1
Add listing of lints (eg via -W help) to rustdoc 2021-04-06 09:54:56 +01:00
bors
354cc751b7 Auto merge of #81641 - bjorn3:find_codegen_backend, r=davidtwco
Find codegen backends in more locations

* Search in the sysroot passed using `--sysroot` in addition to the default sysroot.
* Search for `librustc_codegen_$name.so` in addition to `librustc_codegen_$name-$release.so`.

This combined would allow putting `librustc_codegen_cranelift.so` in the right location of a sysroot passed using `--sysroot`.
2021-04-06 07:16:19 +00:00
bors
a6e7a5aa5d Auto merge of #81234 - repnop:fn-alignment, r=lcnr
Allow specifying alignment for functions

Fixes #75072

This allows the user to specify alignment for functions, which can be useful for low level work where functions need to necessarily be aligned to a specific value.

I believe the error cases not covered in the match are caught earlier based on my testing so I had them just return `None`.
2021-04-06 04:35:26 +00:00
Camelid
525646a380 Move SharedContext to context.rs
It is tightly connected to `Context` and is primarily used as a field in
`Context`. Thus, it should be next to `Context`.
2021-04-05 19:27:48 -07:00
Camelid
09ff88b600 Add FromIterator and IntoIterator impls for ThinVec
These should make using `ThinVec` feel much more like using `Vec`.
They will allow users of `Vec` to switch to `ThinVec` while continuing
to use `collect()`, `for` loops, and other parts of the iterator API.

I don't know if there were use cases before for using the iterator API
with `ThinVec`, but I would like to start using `ThinVec` in rustdoc,
and having it conform to the iterator API would make the transition
*a lot* easier.

I added a `FromIterator` impl, an `IntoIterator` impl that yields owned
elements, and `IntoIterator` impls that yield immutable or mutable
references to elements. I also added some unit tests for `ThinVec`.
2021-04-05 19:09:51 -07:00
bors
0c7d4effd7 Auto merge of #83592 - nagisa:nagisa/dso_local, r=davidtwco
Set dso_local for hidden, private and local items

This should probably have no real effect in most cases, as e.g. `hidden`
visibility already implies `dso_local` (or at least LLVM IR does not
preserve the `dso_local` setting if the item is already `hidden`), but
it should fix `-Crelocation-model=static` and improve codegen in
executables.

Note that this PR does not exhaustively port the logic in [clang], only the
portion that is necessary to fix a regression from LLVM 12 that relates to
`-Crelocation_model=static`.

Fixes #83335

[clang]: 3001d080c8/clang/lib/CodeGen/CodeGenModule.cpp (L945-L1039)
2021-04-06 02:09:01 +00:00
Eric Huss
48c2cde39e Update cargo 2021-04-05 17:10:04 -07:00
bors
8e6b478a5a Auto merge of #83905 - JohnTitor:rollup-pa1la80, r=JohnTitor
Rollup of 8 pull requests

Successful merges:

 - #83370 (Add `x.py setup tools` which enables `download-rustc` by default)
 - #83489 (Properly suggest deref in else block)
 - #83734 (Catch a bad placeholder type error for statics in `extern`s)
 - #83814 (expand: Do not ICE when a legacy AST-based macro attribute produces and empty expression)
 - #83835 (rustdoc: sort search index items for compression)
 - #83849 (rustdoc: Cleanup handling of associated items for intra-doc links)
 - #83881 (⬆️ rust-analyzer)
 - #83885 (Document compiler/ with -Aprivate-intra-doc-links)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2021-04-05 23:40:18 +00:00
bors
57406c93df Auto merge of #7018 - Y-Nak:same_item_push, r=Manishearth
Don't trigger `same_item_push` if the vec is used in the loop body

fixes #6987
changelog: `same_item_push`: Don't trigger if the `vec` is used in the loop body
2021-04-05 22:57:33 +00:00
Wesley Norris
448d07683a Allow specifying alignment for functions 2021-04-05 17:36:51 -04:00
Yuki Okushi
d8c04b13a2
Rollup merge of #83885 - jyn514:private-links, r=Mark-Simulacrum
Document compiler/ with -Aprivate-intra-doc-links

Since compiler/ always passes --document-private-items, it's ok to link to items that are private.
2021-04-06 06:24:17 +09:00
Yuki Okushi
fb6eb4ad93
Rollup merge of #83881 - lnicola:rust-analyzer-2021-04-05, r=jonas-schievink
⬆️ rust-analyzer
2021-04-06 06:24:16 +09:00
Yuki Okushi
f93412fb53
Rollup merge of #83849 - jyn514:intra-doc-cleanup, r=bugadani
rustdoc: Cleanup handling of associated items for intra-doc links

Helps with https://github.com/rust-lang/rust/issues/83761 (right now the uses of the resolver are all intermingled with uses of the tyctxt). Best reviewed one commit at a time.

r? ```@bugadani``` maybe? Feel free to reassign :)
2021-04-06 06:24:15 +09:00
Yuki Okushi
12d007da0f
Rollup merge of #83835 - notriddle:sort-index, r=ollie27
rustdoc: sort search index items for compression

This should not affect the appearance of the docs pages themselves.

This makes the pre-compressed search index smaller, thanks to the
empty-string path duplication format, and also the gzipped version,
by giving the algorithm more structure to work with.

    rust$ wc -c search-index-old.js search-index-new.js
    2628334 search-index-old.js
    2586181 search-index-new.js
    5214515 total
    rust$ gzip search-index-*
    rust$ wc -c search-index-old.js.gz search-index-new.js.gz
    239486 search-index-old.js.gz
    237386 search-index-new.js.gz
    476872 total
2021-04-06 06:24:13 +09:00
Yuki Okushi
67ffbedada
Rollup merge of #83814 - petrochenkov:emptyexpr, r=davidtwco
expand: Do not ICE when a legacy AST-based macro attribute produces and empty expression

Fixes https://github.com/rust-lang/rust/issues/80251

The reported error is the same as for `let _ = #[cfg(FALSE)] EXPR;`
2021-04-06 06:24:12 +09:00