Commit graph

126257 commits

Author SHA1 Message Date
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
Ivan Tham
9ea4593572
Use [xxx()] rather than the [xxx] function
Co-authored-by: Joshua Nelson <joshua@yottadb.com>
2020-08-26 23:21:44 +08:00
Ivan Tham
16d8d4b899
Error use explicit intra-doc link and fix text 2020-08-26 22:41:56 +08:00
Bastian
2d853148d7 Changed the location of the suggestion as well as the way the suggestion is assembled 2020-08-26 16:39:30 +02:00
jumbatm
8c0128bb02 Fix ICE on unwrap of unknown layout. 2020-08-27 00:15:24 +10:00
Elichai Turkel
0cca5978a4
Fix potential UB in align_offset docs 2020-08-26 17:02:24 +03:00
bors
6ead62235a Auto merge of #75893 - Dylan-DPC:fix/offset-to-u64, r=oli-obk
change offset from u32 to u64

References #71696

r? @oli-obk

(closed the earlier pr because the rebase got messed up)
2020-08-26 13:10:42 +00:00
Guillaume Gomez
c73d4cddcc
Clean up E0761 explanation 2020-08-26 14:51:02 +02:00
bors
894581b872 Auto merge of #5946 - mikerite:fix-5729, r=flip1995
Fix `let_and_return` bad suggestion

Add a cast to the suggestion when the return expression has adjustments.
These adjustments are lost when the suggestion is applied.

This is similar to the problem in issue #4437.

Closes #5729

changelog: Fix `let_and_return` bad suggestion
2020-08-26 12:01:32 +00:00
bors
9ef44799bf Auto merge of #5949 - rail-rain:fix_fp_borrow_interior_mutable_const, r=oli-obk
Fix fp in `borrow_interior_mutable_const`

fixes #5796

changelog: fix false positive in `borrow_interior_mutable_const` when referencing a field behind a pointer.
2020-08-26 11:06:37 +00:00
bors
ffd59bf9c6 Auto merge of #75687 - TimDiekmann:realloc-align, r=Amanieu
Allow reallocation to different alignment in `AllocRef`

The allocator-wg [has decided](https://github.com/rust-lang/wg-allocators/issues/5#issuecomment-672591112) to support reallocating to a different alignment in `AllocRef`. For more details please see the linked issue.

r? @Amanieu

closes https://github.com/rust-lang/wg-allocators/issues/5
2020-08-26 10:44:28 +00:00
Amanieu d'Antras
178c1bbb5b Fix a typo in #75781 2020-08-26 10:49:15 +01:00
csmoe
8ee206a80d suggest await on unexpected types 2020-08-26 17:40:08 +08:00
Pietro Albini
3e16d4af7f
apply bootstrap cfgs 2020-08-26 10:17:31 +02:00
Pietro Albini
e88d79ca41
bump version to 1.48 2020-08-26 10:16:59 +02:00
bors
23db5426e6 Auto merge of #5964 - matsujika:matsujika-patch-1, r=ebroto
Fix typo

changelog: none
2020-08-26 07:53:07 +00:00
Hirochika Matsumoto
9d18c24b56 Fix typo 2020-08-26 16:03:35 +09:00
Aaron Hill
b5b8b9329b
Point to a move-related span when pointing to closure upvars
Fixes #75904

When emitting move/borrow errors, we may point into a closure to
indicate why an upvar is used in the closure. However, we use the
'upvar span', which is just an arbitrary usage of the upvar. If the
upvar is used in multiple places (e.g. a borrow and a move), we may end
up pointing to the borrow. If the overall error is a move error, this
can be confusing.

This PR tracks the span that caused an upvar to become captured by-value
instead of by-ref (assuming that it's not a `move` closure). We use this
span instead of the 'upvar' span when we need to point to an upvar usage
during borrow checking.
2020-08-26 02:11:01 -04:00
bors
2fe9a33659 Auto merge of #75843 - hermitcore:devel, r=nagisa
HermitCore switchs to relocatable binaries

- switch to relocatbale binaries to realize ASLR
- remove all dependencies to gcc
2020-08-26 03:47:07 +00:00