Commit graph

126278 commits

Author SHA1 Message Date
Aleksey Kladov
df975cf9c2 Rename rustdoc/test -> rustdoc/doctest
This modules contains the implementation of doctests, and not the
tests of rustdoc itself. This name is confusing, so let's rename it to
doctest for clarity.
2020-08-27 18:21:25 +02:00
bors
3d0c847d33 Auto merge of #74941 - dylanmckay:replace-broken-avr-unknown-unknown-target, r=oli-obk
[AVR] Replace broken 'avr-unknown-unknown' target with 'avr-unknown-gnu-atmega328' target

The `avr-unknown-unknown` target has never worked correctly, always trying to invoke
the host linker and failing. It aimed to be a mirror of AVR-GCC's
default handling of the `avr-unknown-unknown' triple (assume bare
minimum chip features, silently skip linking runtime libraries, etc).
This behaviour is broken-by-default as it will cause a miscompiled executable
when flashed.

This patch improves the AVR builtin target specifications to instead
expose only a 'avr-unknown-gnu-atmega328' target. This target system is
`gnu`, as it uses the AVR-GCC frontend along with avr-binutils. The
target triple ABI is 'atmega328'.

In the future, it should be possible to replace the dependency on
AVR-GCC and binutils by using the in-progress AVR LLD and compiler-rt support.
Perhaps at that point it would make sense to add an
'avr-unknown-unknown-atmega328' target as a better default when
implemented.

There is no current intention to add in-tree AVR target specifications for other
AVR microcontrollers - this one can serve as a reference implementation
for other devices via `rustc --print target-spec-json
avr-unknown-gnu-atmega328p`.

There should be no users of the existing 'avr-unknown-unknown' Rust
target as a custom target specification JSON has always been
recommended, and the avr-unknown-unknown target could never pass the
linking step anyway.
2020-08-27 15:48:56 +00:00
Aleksey Kladov
1f95a91c24 Remove dependency on StringReader from rustdoc highlighter
rustc_lexer is the lossless lexer, which is a better fit for
approximate syntax highlighting.

As a side-effect, we can now syntax-highlight even broken code.
2020-08-27 17:43:15 +02:00
Ivan Tham
3a814f3f57
Reduce duplicate doc link in error
Co-authored-by: Joshua Nelson <joshua@yottadb.com>
2020-08-27 23:30:15 +08:00
Takayuki Nakata
04bff17668 Fix FP in to_string_in_display
Don't emit a lint when `.to_string()` on anything that is not `self`
2020-08-27 23:37:47 +09:00
csmoe
b71c8b64b5 should not try to apply field accessing on enum 2020-08-27 22:01:52 +08:00
Guillaume Gomez
86e42c2742 Delay help popup creation to when it's needed 2020-08-27 14:22:54 +02:00
Guillaume Gomez
1727c7a194 Improve helper wording 2020-08-27 14:22:54 +02:00
bors
118860a7e7 Auto merge of #75947 - pietroalbini:bootstrap-update, r=Mark-Simulacrum
Bump version to 1.48 and update cfg(bootstrap)s

r? @Mark-Simulacrum
2020-08-27 09:24:51 +00:00
Pietro Albini
1b6590c9f4
forgot to remove a cfg(not(bootstrap)) 2020-08-27 10:58:34 +02:00
bors
f7cbb7a594 Auto merge of #72784 - csmoe:issue-61076, r=estebank
Await on mismatched future types

Closes #61076
This PR suggests to `await` on:
1. `async_fn().bar() => async_fn().await.bar()`
2. `async_fn().field => async_fn().await.field`
3. ` if let x = async() {} => if let x = async().await {}`

r? @tmandry @estebank
2020-08-27 07:26:32 +00:00
bors
4e701afd84 Auto merge of #75879 - pietroalbini:update-relnotes, r=Mark-Simulacrum
Include last-minute compatibility notes for 1.46.0

This cherry-picks the relnotes update of https://github.com/rust-lang/rust/pull/75878 on master.

r? @Mark-Simulacrum
2020-08-27 05:29:43 +00:00
csmoe
7cfcefd1fb add projection_ty_from_predicates query 2020-08-27 12:09:34 +08:00
kadmin
ed9df28655 Fix ICE due to carriage return w/ multibyte char
Based off of
972560b83f
2020-08-27 03:29:06 +00:00
Josh Triplett
f758c7b2a7 Debian 6 doesn't have ninja, so use make for the dist builds 2020-08-26 20:18:27 -07:00
bors
18b0585b52 Auto merge of #75842 - camelid:highlight-crate-links, r=jyn514
Highlight crate links like normal links

Fixes #75823.

Cc @jyn514
2020-08-27 02:51:01 +00:00
bors
09b06f9a09 Auto merge of #75966 - Dylan-DPC:rollup-srfpces, r=Dylan-DPC
Rollup of 10 pull requests

Successful merges:

 - #74730 (Hexagon libstd: update type defs)
 - #75758 (Fixes for VxWorks)
 - #75780 (Unconfuse Unpin docs a bit)
 - #75806 (Prevent automatic page change when using history)
 - #75818 (Update docs for SystemTime Windows implementation)
 - #75837 (Fix font color for help button in ayu and dark themes)
 - #75870 (Unify theme choices border color in ayu theme)
 - #75875 (Shorten liballoc vec resize intra-doc link)
 - #75953 (Fix swapped stability attributes for rustdoc lints)
 - #75958 (Avoid function-scoping global variables)

Failed merges:

r? @ghost
2020-08-27 00:25:52 +00:00
bors
dead45fd5b Auto merge of #5957 - xvschneider:AddUnwrapInsideResultLint, r=yaahc
Adding new lint to prevent usage of 'unwrap' inside functions that re…

### Change
Adding a new lint that will emit a warning when using "unwrap" or "expect" inside a function that returns result.
### Motivation
These functions promote recoverable errors to non-recoverable errors which may be undesirable in code bases which wish to avoid panics.
### Test plan
Running:
`TESTNAME=unwrap_in_result cargo uitest
`---

changelog: none
2020-08-26 23:38:34 +00:00
Jane Lusby
91024f1fde Add new lint to prevent usage of unwrap in fns that return result 2020-08-26 16:31:49 -07:00
aticu
39f5ebcd74 Fix typo in std::hint::black_box docs 2020-08-27 01:16:18 +02:00
Dylan DPC
8fd73aa45d
Rollup merge of #75958 - Mark-Simulacrum:fix-toolstate, r=kennytm
Avoid function-scoping global variables

In 2e6f2e8855, we added a main function to the publish_toolstate.py script.
Unfortunately, we missed that the Python program implicitly declares global
variables in that code, which means that adding a function changes variable
scoping and breaks other code.

This commit avoids introducing that function and adds a warning to future
editors of the code.
2020-08-27 01:14:20 +02:00
Dylan DPC
c2a0168ce5
Rollup merge of #75953 - jyn514:missing-lints, r=Manishearth
Fix swapped stability attributes for rustdoc lints

This fixes a regression introduced in https://github.com/rust-lang/rust/pull/74855. Previously, `missing_doc_code_examples` would be run on stable and `private_doc_tests` would only be run on nightly. Now, it correctly does the reverse.
Closes https://github.com/rust-lang/rust/issues/75951.
r? @ehuss
2020-08-27 01:14:18 +02:00
Dylan DPC
11e9769a97
Rollup merge of #75875 - pickfire:patch-4, r=jyn514
Shorten liballoc vec resize intra-doc link

r? @jyn514
2020-08-27 01:14:17 +02:00
Dylan DPC
c1cb46e906
Rollup merge of #75870 - GuillaumeGomez:unify-border-color-theme-ayu, r=pickfire
Unify theme choices border color in ayu theme

There was a slight color difference in the theme choice menu borders:

![Screenshot from 2020-08-24 10-37-05](https://user-images.githubusercontent.com/3050060/91022913-22654880-e5f6-11ea-8165-302b2d4e701e.png)
![Screenshot from 2020-08-24 10-37-58](https://user-images.githubusercontent.com/3050060/91022918-242f0c00-e5f6-11ea-989a-e26a28196d09.png)

r? @Cldfire
2020-08-27 01:14:15 +02:00
Dylan DPC
88c68cae4f
Rollup merge of #75837 - GuillaumeGomez:fix-font-color-help-button, r=Cldfire
Fix font color for help button in ayu and dark themes

A nice before/after:

![Screenshot from 2020-08-23 14-47-07](https://user-images.githubusercontent.com/3050060/90979230-0dd07400-e554-11ea-85f7-046dfca65e8e.png)

![Screenshot from 2020-08-23 14-47-03](https://user-images.githubusercontent.com/3050060/90979233-145eeb80-e554-11ea-8e63-1864c3f2699b.png)

For the ayu theme, the change is very "light", the font color was already close to white, so I unified the color with the pictures of the other buttons:

![Screenshot from 2020-08-23 15-20-45](https://user-images.githubusercontent.com/3050060/90979281-5e47d180-e554-11ea-9993-8595057481ab.png)
![Screenshot from 2020-08-23 15-20-50](https://user-images.githubusercontent.com/3050060/90979279-5daf3b00-e554-11ea-8d39-beb57091aba7.png)
2020-08-27 01:14:13 +02:00
Dylan DPC
a838f2fc79
Rollup merge of #75818 - ollie27:doc_systemtime_windows, r=retep998
Update docs for SystemTime Windows implementation

Windows now uses `GetSystemTimePreciseAsFileTime` (since #69858) on versions of Windows that support it.
2020-08-27 01:14:11 +02:00
Dylan DPC
463fdf3e04
Rollup merge of #75806 - GuillaumeGomez:prevent-automatic-page-change-history, r=pickfire
Prevent automatic page change when using history

Fixes #75774.
2020-08-27 01:14:08 +02:00
Dylan DPC
a79f9af290
Rollup merge of #75780 - matklad:unconfuseunpindocs, r=KodrAus
Unconfuse Unpin docs a bit

* Don't say that Unpin is used to prevent moves, because it is used
  to *allow* moves
* Be more precise about kindedness of things, it is
  `Pin<Pointer<Data>>`, rather than just `Pin<Pointer>`.
2020-08-27 01:14:06 +02:00
Dylan DPC
730449d22a
Rollup merge of #75758 - bpangWR:master, r=Mark-Simulacrum
Fixes for VxWorks

r? @alexcrichton
2020-08-27 01:14:04 +02:00
Dylan DPC
2eec2ecbde
Rollup merge of #74730 - androm3da:fix_libstd_hexlinux_01, r=dtolnay
Hexagon libstd: update type defs
2020-08-27 01:14:02 +02:00
bors
e45c59e922 Auto merge of #5968 - rail-rain:fix_use_snippet_with_applicability, r=flip1995
Fix the wrong use of `snippet_with_applicability`

For the context, please see https://github.com/rust-lang/rust-clippy/issues/5822#issuecomment-680749728 and https://github.com/rust-lang/rust-clippy/issues/5822#issuecomment-680783381.

---

changelog: none
2020-08-26 22:52:47 +00:00
bors
45a83e97cc Auto merge of #75898 - lcnr:variant-def-recovered, r=petrochenkov
VariantDef: move `recovered` into `VariantFlags`
2020-08-26 22:28:48 +00:00
rail
edc05da57d Fix the wrong use of snippet_with_applicability
This includes a workaround of the issue #5822,
the cause of this little mistake.
2020-08-27 10:24:16 +12:00
Josh Triplett
bb39f3555c Provide a better diagnostic if ninja isn't installed
Let people know that they can set ninja=false if they don't want to
install ninja.
2020-08-26 14:57:11 -07:00
Josh Triplett
6149dffff9 Install ninja on CI builders
Windows CI builds already install ninja. Install it in all the
Docker-based builds as well.
2020-08-26 14:57:07 -07:00
Josh Triplett
181ce0e013 Disable ninja on macOS CI
Should be re-enabled when we have a recipe for installing ninja on
macOS.
2020-08-26 14:55:21 -07:00
Josh Triplett
30b7dac745 Set ninja=true by default
Ninja substantially improves LLVM build time. On a 96-way system, using
Make took 248s, and using Ninja took 161s, a 35% improvement.

We already require a variety of tools to build Rust. If someone wants to
build without Ninja (for instance, to minimize the set of packages
required to bootstrap a new target), they can easily set `ninja=false`
in `config.toml`.  Our defaults should help people build Rust (and LLVM)
faster, to speed up development.
2020-08-26 14:55:21 -07:00
Mark Rousskov
c8b240241a Avoid function-scoping global variables
In 2e6f2e8855, we added a main function to the publish_toolstate.py script.
Unfortunately, we missed that the Python program implicitly declares global
variables in that code, which means that adding a function changes variable
scoping and breaks other code.

This commit avoids introducing that function and adds a warning to future
editors of the code.
2020-08-26 17:24:52 -04:00
bors
2d8a3b9181 Auto merge of #75944 - jumbatm:issue-75924-clashing-extern-decl-ice, r=spastorino
Fix ICE on unwrap of unknown layout in ClashingExternDeclarations.

Fixes #75924.
2020-08-26 20:31:44 +00:00
Joshua Nelson
29399fad5f Fix swapped stability attributes
This fixes a regression introduced in
https://github.com/rust-lang/rust/pull/74855.
2020-08-26 15:31:08 -04:00
bors
48717b6f3c Auto merge of #75912 - scottmcm:manuallydrop-vs-forget, r=Mark-Simulacrum
Suggest `mem::forget` if `mem::ManuallyDrop::new` isn't used

I think this communicates the intent more idiomatically, and is shorter anyway.

Inspired because [it came up on URLO](https://users.rust-lang.org/t/validity-of-memory-area-after-std-forget/47730/7?u=scottmcm), and it turns out that std had done it too in one spot:
![image](https://user-images.githubusercontent.com/18526288/91203819-e19f2980-e6f2-11ea-9112-835f3b22ce05.png)
2020-08-26 18:40:51 +00:00
bors
64c4bb0d2b Auto merge of #5966 - 1c3t3a:1c3t3a-dev-5819-fix, r=Manishearth
Corrects the float_equality_without_abs lint

Fixes an issue in the `float_equality_without_abs` lint. The lint suggestion was configured in a way that it lints the whole error and not just the subtraction part. In the current configuration the lint would suggest to change the expression in a wrong way, e.g.
```rust
let _ = (a - b) < f32::EPSILON; // before
let _ = (a - b).abs(); // after
```
This was dicovered by @flip1995. (See discussion of PR #5952).

Also the suggestion is now formatted via `utils::sugg`.
changelog: none
2020-08-26 18:15:42 +00:00
bors
1f2dd3b56a Auto merge of #75903 - jyn514:lint-refactor, r=GuillaumeGomez
Warn about unknown or renamed lints in rustdoc

Fixes https://github.com/rust-lang/rust/issues/75884.
This is best reviewed one commit at a time.
r? @GuillaumeGomez

Originally I tried to do a much broader refactoring that got rid of `init_lints` altogether. My reasoning is that now the lints aren't being run anymore (after https://github.com/rust-lang/rust/pull/73566), there's no need to ignore them explicitly. But it seems there are still some lints that aren't affected by setting `lint_mod` to a no-op:

```
deny(pub_use_of_private_extern_crate)
deny(const_err)
warn(unused_imports)
```

(there are possibly more, these are just the ones that failed in the rustdoc test suite).

Some of these seem like we really should be warning about, but that's a much larger change and I don't propose to make it here. So for the time being, this just adds the `unknown_lints` and `renamed_or_removed_lints` passes to the list of lints rustdoc warns about.
2020-08-26 16:38:58 +00:00
Surya Midatala
7569cf98f9 Merge conflict fix: disambiguate f32 -> prim@f32 and u32 -> prim@u32 2020-08-26 21:55:42 +05:30
Joshua Nelson
25c034c52e Use allow(unused_imports) instead of cfg(doc) for imports used only for intra-doc links 2020-08-26 21:43:46 +05:30
Joshua Nelson
9b89d8a7a2 Fix link to f32
Co-authored-by: Oliver Middleton <olliemail27@gmail.com>
2020-08-26 21:43:46 +05:30
Surya Midatala
621cbaafff Use crate::mod to disambiguate links 2020-08-26 21:43:46 +05:30
Surya Midatala
f10ab91391 Add suggestions from code review 2020-08-26 21:43:46 +05:30
Surya Midatala
b3437f36e0 Add missed links in primitive_docs.rs 2020-08-26 21:43:46 +05:30
Surya Midatala
a712fbd50b Move to intra-doc links for wasi/ext/fs.rs, os_str_bytes.rs, primitive_docs.rs & poison.rs 2020-08-26 21:43:46 +05:30