Commit graph

151619 commits

Author SHA1 Message Date
Yoshitomo Nakanishi
3bc5abef62 default_numeric_fallback: Fix FP with floating literal 2021-07-08 11:37:12 +09:00
Yuki Okushi
01474ad92c
Rollup merge of #86956 - cuviper:unalias-every, r=m-ou-se
Revert "Add "every" as a doc alias for "all"."

This reverts commit 35450365ac (#81697) for "every" and closes #86554 in kind for "some".

The new [doc alias policy](https://std-dev-guide.rust-lang.org/documentation/doc-alias-policy.html) is that we don't want language-specific aliases like these JavaScript names, and we especially don't want to conflict with real names. While "every" is okay in the latter regard, its natural pair "some" makes a doc-search collision with `Option::Some`.

r? ```@m-ou-se```
2021-07-08 10:44:37 +09:00
Yuki Okushi
0f37050b74
Rollup merge of #86955 - Swordelf2:patch-1, r=cuviper
Fix typo in `ops::Drop` docs
2021-07-08 10:44:36 +09:00
Yuki Okushi
59b4f88af1
Rollup merge of #86933 - GuillaumeGomez:cleanup-rustdoc-static-files, r=Manishearth
Clean up rustdoc static files

The `html/static` of rustdoc was starting to be quite a mess... So I moved files in sub-folders to make it easier to follow. Here what remains in `html/static` folder:

```
$ ls
COPYRIGHT.txt  css  fonts  images  js  LICENSE-APACHE.txt  LICENSE-MIT.txt
```

cc ```@jyn514```
r? ```@Manishearth```
2021-07-08 10:44:35 +09:00
Yuki Okushi
463301aa5a
Rollup merge of #86932 - rylev:fix-ice-86895, r=estebank
Fix ICE when misplaced visibility cannot be properly parsed

Fixes #86895

The issue was that a failure to parse the visibility was causing the original error to be dropped before being emitted.

The resulting error isn't quite as nice as when the visibility is parsed properly, but I'm not sure which error to prioritize here. Displaying both errors might be too confusing.

r? ```@estebank```
2021-07-08 10:44:34 +09:00
Yuki Okushi
89638a1ddc
Rollup merge of #86927 - bjorn3:sync_cg_clif-2021-07-07, r=bjorn3
Sync rustc_codegen_cranelift

The main hightlight this sync is basic support for AArch64. Most things should work on Linux, but there does seem to be an ABI incompatibility causing proc-macros to crash, see https://github.com/bjorn3/rustc_codegen_cranelift/issues/1184. Thanks to ```@afonso360``` for implementing all Cranelift features that were necessary to compile for AArch64 using cg_clif. Also thanks to ```@shamatar``` for implementing the `llvm.x86.addcarry.64` and `llvm.x86.subborrow.64` llvm intrinsics used by num-bigint (https://github.com/bjorn3/rustc_codegen_cranelift/pull/1178) and ```@eggyal``` for implementing multi-threading support for the lazy jit mode. (https://github.com/bjorn3/rustc_codegen_cranelift/pull/1166)

r? ```@ghost```

```@rustbot``` label +A-codegen +A-cranelift +T-compiler
2021-07-08 10:44:33 +09:00
Yuki Okushi
fccf0c2f8c
Rollup merge of #86925 - inquisitivecrystal:mailmap, r=Mark-Simulacrum
Add self to mailmap

For personal reasons, I would currently prefer to be known by this name.
2021-07-08 10:44:32 +09:00
Yuki Okushi
a57a2e991d
Rollup merge of #86917 - notriddle:notriddle/from-try-reserve-error, r=JohnTitor
Add doc comment for `impl From<LayoutError> for TryReserveError`
2021-07-08 10:44:31 +09:00
Yuki Okushi
165b520b89
Rollup merge of #86812 - FabianWolff:recover-dyn-mut, r=petrochenkov
Recover from `&dyn mut ...` parse errors

Consider this example:
```rust
fn main() {
    let r: &dyn mut Trait;
}
```
This currently leads to:
```
error: expected one of `!`, `(`, `;`, `=`, `?`, `for`, lifetime, or path, found keyword `mut`
 --> src/main.rs:2:17
  |
2 |     let r: &dyn mut Trait;
  |                 ^^^ expected one of 8 possible tokens

error: aborting due to previous error
```
However, especially for beginners, I think it is easy to get `&dyn mut` and `&mut dyn` confused. With my changes, I get a help message, and the parser even recovers:
```
error: `mut` must precede `dyn`
 --> test.rs:2:12
  |
2 |     let r: &dyn mut Trait;
  |            ^^^^^^^^ help: place `mut` before `dyn`: `&mut dyn`

error[E0405]: cannot find trait `Trait` in this scope
 --> test.rs:2:21
  |
2 |     let r: &dyn mut Trait;
  |                     ^^^^^ not found in this scope

error: aborting due to 2 previous errors
```
2021-07-08 10:44:30 +09:00
Yuki Okushi
c2d3f5f772
Rollup merge of #86639 - eholk:lint-tool, r=petrochenkov
Support lint tool names in rustc command line options

When rustc is running without a lint tool such as clippy enabled, options for lints such as `clippy::foo` are meant to be ignored. This was already working for those specified by attrs, such as `#![allow(clippy::foo)]`, but this did not work for command line arguments like `-A clippy::foo`. This PR fixes that issue.

Note that we discovered this issue while discussing https://github.com/rust-lang/cargo/issues/5034.

Fixes #86628.
2021-07-08 10:44:29 +09:00
Mara Bos
e3044432c7 Move [debug_]assert_matches to mod {core, std}::assert. 2021-07-08 02:33:36 +02:00
Jacob Pratt
bd674b1e0b
Update .mailmap file 2021-07-07 16:32:04 -04:00
Josh Stone
ace3989d55 Revert "Add "every" as a doc alias for "all"."
This reverts commit 35450365ac.
2021-07-07 13:13:26 -07:00
Swordelf2
7677f5fe31
Fix typo in ops::Drop docs 2021-07-07 22:26:32 +03:00
bors
d2b04f075c Auto merge of #86105 - bjorn3:link_info_refactor, r=petrochenkov
Refactor the generation of the metadata for linking
2021-07-07 18:28:53 +00:00
Eric Holk
4a83a93e9a Cleanup: unify lint name checking
This change merges `check_lint_and_tool_name` into `check_lint_name` in
order to avoid having two very similar functions.

Also adds the `.stderr` file back for the test case, since apparently
it is still needed.
2021-07-07 10:50:50 -07:00
Eric Holk
5413d2e529 Fix test case
Previously this was using a `.stderr` file, but that does not seem to
work for all cases. This change uses `// error-pattern:` instead.
2021-07-07 10:28:35 -07:00
cyberia
a853a49425 Clarify behaviour of f64 and f32::sqrt when argument is negative zero 2021-07-07 18:22:17 +01:00
EFanZh
1b0998ca52 Ignore Windows debugger pretty-printing tests 2021-07-08 01:04:59 +08:00
Ralf Jung
381a9e5714 update Miri 2021-07-07 18:44:07 +02:00
Josh Triplett
c3fbafddc0 Update targets to use target_abi
All eabi targets have target_abi = "eabi".
All eabihf targets have target_abi = "eabihf".
armv6_unknown_freebsd and armv7_unknown_freebsd have target_abi = "eabihf".
All abi64 targets have target_abi = "abi64".
All ilp32 targets have target_abi = "ilp32".
All softfloat targets have target_abi = "softfloat".
All *-uwp-windows-* targets have target_abi = "uwp".
All spe targets have target_abi = "spe".
All macabi targets have target_abi = "macabi".
aarch64-apple-ios-sim has target_abi = "sim".
x86_64-fortanix-unknown-sgx has target_abi = "fortanix".
x86_64-unknown-linux-gnux32 has target_abi = "x32".

Add FIXME entries for targets for which existing values need to change
once cfg_target_abi becomes stable. (All of them are tier 3 targets.)

Add a test for target_abi in `--print cfg`.
2021-07-07 08:52:35 -07:00
Josh Triplett
84d6e8aed3 Implement cfg(target_abi) (RFC 2992)
Add an `abi` field to `TargetOptions`, defaulting to "". Support using
`cfg(target_abi = "...")` for conditional compilation on that field.

Gated by `feature(cfg_target_abi)`.

Add a test for `target_abi`, and a test for the feature gate.

Add `target_abi` to tidy as a platform-specific cfg.

This does not add an abi to any existing target.
2021-07-07 08:52:35 -07:00
Guillaume Gomez
e5c24ba400 Clean up rustdoc static files 2021-07-07 17:52:18 +02:00
Justus K
27b55e636f
Document rustdoc with --document-private-items 2021-07-07 16:52:30 +02:00
bjorn3
2977dff116 Remove a sorting operation from used_crates 2021-07-07 15:32:51 +02:00
Mara Bos
10d6b34d32 Add generic types to prelude collision lint test. 2021-07-07 13:26:38 +00:00
Mara Bos
f77dd5ac93 Add test for trait check in prelude collision lint. 2021-07-07 13:26:38 +00:00
Mara Bos
60535441c8 Check FromIterator trait impl in prelude collision check. 2021-07-07 13:26:38 +00:00
Ryan Levick
04a9c10fc2 Fix ICE when misplaced visibility cannot be properly parsed 2021-07-07 15:02:20 +02:00
Ryan Levick
7515bcf01a Change linked tracking issue for more qualified paths 2021-07-07 14:56:51 +02:00
Trevor Spiteri
ed76c11202 special case for integer log10 2021-07-07 14:10:05 +02:00
Trevor Spiteri
b0f98c60a6 test integer log10 values close to all powers of 10 2021-07-07 14:07:32 +02:00
Guillaume Gomez
74d71c204f Only show restricted pub use 2021-07-07 13:47:28 +02:00
EFanZh
2b2bcf11ab Ignore Android debugger pretty-printing tests 2021-07-07 18:46:24 +08:00
bjorn3
00b2f56bc6 Add memchr to list of permitted cg_clif deps
Object started depending on it
2021-07-07 11:39:29 +02:00
Guillaume Gomez
e7bc2a012a Add tests for reexports (both public and private) 2021-07-07 11:30:08 +02:00
Guillaume Gomez
cc0932641a Fix inconsistency on visibility display for typedefs 2021-07-07 11:30:08 +02:00
Guillaume Gomez
e948e8de79 Fix reexports visibility 2021-07-07 11:30:08 +02:00
Guillaume Gomez
84f259e44c Unify macro source display 2021-07-07 11:30:08 +02:00
Guillaume Gomez
c70250dfbd Add test for reexported macros 2.0 rendering 2021-07-07 11:30:08 +02:00
Guillaume Gomez
d1ad40eac4 Fix rendering of reexported macros 2.0 2021-07-07 11:30:08 +02:00
bjorn3
d531f3d6ee Merge commit '3a31c6d8272c14388a34622193baf553636fe470' into sync_cg_clif-2021-07-07 2021-07-07 11:14:20 +02:00
bjorn3
3a31c6d827 Rustup to rustc 1.55.0-nightly (885399992 2021-07-06) 2021-07-07 11:08:52 +02:00
bjorn3
97c2fa1f9d Update regex crates
This removes two dependencies of rustbuild
2021-07-07 11:07:25 +02:00
inquisitivecrystal
0db66e568c Add self to mailmap 2021-07-07 01:33:25 -07:00
bors
c5e344f774 Auto merge of #86920 - JohnTitor:rollup-buvzpkr, r=JohnTitor
Rollup of 8 pull requests

Successful merges:

 - #80918 (Add Integer::log variants)
 - #86717 (Rename some Rust 2021 lints to better names )
 - #86819 (Clean up rustdoc IDs)
 - #86880 (Test ManuallyDrop::clone_from.)
 - #86906 (Replace deprecated compare_and_swap and fix typo in core::sync::atomic::{fence, compiler_fence} docs)
 - #86907 (Migrate `cpu-usage-over-time.py` to Python 3)
 - #86916 (rewrote documentation for thread::yield_now())
 - #86919 (Update books)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2021-07-07 03:31:23 +00:00
bors
7de1efa02e Auto merge of #86920 - JohnTitor:rollup-buvzpkr, r=JohnTitor
Rollup of 8 pull requests

Successful merges:

 - #80918 (Add Integer::log variants)
 - #86717 (Rename some Rust 2021 lints to better names )
 - #86819 (Clean up rustdoc IDs)
 - #86880 (Test ManuallyDrop::clone_from.)
 - #86906 (Replace deprecated compare_and_swap and fix typo in core::sync::atomic::{fence, compiler_fence} docs)
 - #86907 (Migrate `cpu-usage-over-time.py` to Python 3)
 - #86916 (rewrote documentation for thread::yield_now())
 - #86919 (Update books)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2021-07-07 03:31:23 +00:00
Yuki Okushi
51968854f4
Rollup merge of #86919 - ehuss:update-books, r=ehuss
Update books

## nomicon

8 commits in b9ca313e687c991223e23e5520529815dc281205..7a13537f96af4b9b8e3ea296d6e5c3c7ab72ce9f
2021-06-22 12:02:20 -0400 to 2021-07-05 23:34:47 -0400
- Apply review comments
- Fix some style issues
- Move the list of coercions to the reference
- Add an example that shows the null-pointer opt does not happen
- Remove casting list from the nomicon (rust-lang-nursery/nomicon#287)
- Audit `ignore` annotations (rust-lang-nursery/nomicon#288)
- rename typo "lifetime" to "reference" (rust-lang-nursery/nomicon#286)
- Add an incomplete warning to the top page (rust-lang-nursery/nomicon#274)

## reference

7 commits in d9699fa8f3186440fdaadd703d63d8d42322c176..ab60513a3a5a0591e237fddff5d027a982648392
2021-06-21 12:23:10 -0700 to 2021-07-05 08:27:31 -0700
- fix grammar in Expressions (rust-lang-nursery/reference#1057)
- fix comment in function parameter drop scope example (rust-lang-nursery/reference#1056)
- fix typo in macro-ambiguity.md (rust-lang-nursery/reference#1058)
- Mention (negative) infinity values on float-to-int casting (rust-lang-nursery/reference#1054)
-  (rust-lang-nursery/reference#841)
- Missing TypeParamBounds in TypeAlias (rust-lang-nursery/reference#1036)
- Be more precise about array offset in type layouts (rust-lang-nursery/reference#1034)

## book

34 commits in 55a26488ddefc8433e73a2e8352d70f7a5c7fc2b..a90f07f1e9a7fc75dc9105a6c6f16d5c13edceb0
2021-05-09 12:03:18 -0500 to 2021-07-05 14:43:12 -0400
- Clarify ?Sized syntax. Fixes rust-lang/book#2422.
- Add some notes that macros are different than functions
- Break up a long sentence. Fixes rust-lang/book#2329.
- Further clarify and make consistent the reference to deref coercion
- Update ch04-03-slices.md
- add usage for `String` reference
- Update ch15-02-deref.md (rust-lang/book#2780)
- Remove claim about performance of i32
- Reword to avoid awkward pluralization
- Make the link to the reference relative
- Merge remote-tracking branch 'origin/pr/2753'
- Reword number of library crates a package contains (rust-lang/book#2750)
- Clarify explanation of why you can test private functions; add link
- Merge remote-tracking branch 'origin/pr/2743'
- Fix code hiding that I broke in eb60fedc9
- Link to the exact later section we're talking about
- improve cross-references for newtype pattern
- ch12-05, listing 12-20: Add missing "does not compile" warning (rust-lang/book#2731)
- cargo format
- Merge remote-tracking branch 'origin/pr/2724'
- Remove ordinal numbers and only refer to indexes to avoid confusion
- Let's mention the former and current authors of tlborm.
- Update tlborm link to point to Veykril's up-to-date version (rust-lang/book#2722)
- Merge remote-tracking branch 'origin/pr/2720'
- Describe the ferris pictures in the alt text
- Merge remote-tracking branch 'origin/pr/2707'
- Reword ... explanation to include the word deprecated, list that first
- Precise that the `...` inclusive range pattern has been replaces (rust-lang/book#2714)
-  (rust-lang/book#2696)
- fix typo: missing "type" after generic (rust-lang/book#2777)
-  (rust-lang/book#2709)
- Remove sentence about how Rust used to be
- Fix a potentially confusing statement about static lifetimes of static variables. (rust-lang/book#2692)
- Replace 'which'. (rust-lang/book#2663)

## rust-by-example

2 commits in 805e016c5792ad2adabb66e348233067d5ea9f10..028f93a61500fe8f746ee7cc6b204ea6c9f42935
2021-05-20 17:08:34 -0300 to 2021-07-06 06:28:53 -0300
- Fix a couple of typos in the `integration_testing.md` file (rust-lang/rust-by-example#1448)
- Fix Structures type list (rust-lang/rust-by-example#1446)

## rustc-dev-guide

13 commits in fe34beddb41dea5cb891032512a8d5b842b99696..60e282559104035985331645907c3d9f842312c5
2021-06-21 21:50:12 +0200 to 2021-07-05 11:21:03 -0400
- Fixed typos in inline code
- Document lang items (rust-lang/rustc-dev-guide#1119)
- More specifics on what future-incompatible lints are used for
- Fix line lens
- Update information on lints particularly on future-incompatible
- Update section of lint store
- Update around half of the January 2021 date references (rust-lang/rustc-dev-guide#1155)
- Create issues for many TODOs (rust-lang/rustc-dev-guide#1163)
- Links from rustc-dev-guide to std-dev-guide (rust-lang/rustc-dev-guide#1152)
- Document how to mark features as incomplete (rust-lang/rustc-dev-guide#1151)
- Remove requests or suggestions about rebase and fixup contradictory to rust-highfive bot comment (rust-lang/rustc-dev-guide#1111)
- Generate glossary table correctly (rust-lang/rustc-dev-guide#1146)
- Correct the wrong serial number (rust-lang/rustc-dev-guide#1147)

## edition-guide

3 commits in c74b2a0d6bf55774cf15d69f05dfe05408b8f81a..5d57b3832f8d308a9f478ce0a69799548f27ad4d
2021-06-14 10:48:27 -0700 to 2021-07-05 10:33:32 +0200
- Add more info for warnings promoted to errors (rust-lang-nursery/edition-guide#247)
- Create triagebot.toml
- Clarify snippets in 2021 panic docs. (rust-lang-nursery/edition-guide#245)

## embedded-book

1 commits in cbec77fbd8eea0c13e390dd9eded1ae200e811d1..506840eb73b0749336e1d5274e16d6393892ee82
2021-06-10 06:26:32 +0000 to 2021-06-24 00:01:32 +0000
- Update book to track quickstart changes  (rust-embedded/book#296)
2021-07-07 12:17:45 +09:00
Yuki Okushi
9aee3c2883
Rollup merge of #86916 - godmar:@godmar/thread-yield-documentation-fix, r=joshtriplett
rewrote documentation for thread::yield_now()

The old documentation suggested the use of yield_now for repeated
polling instead of discouraging it; it also made the false claim that
channels are implemented using yield_now. (They are not, except for
a corner case).
2021-07-07 12:17:44 +09:00
Yuki Okushi
7be29c1627
Rollup merge of #86907 - pietroalbini:ci-cpu-stats-python3, r=Mark-Simulacrum
Migrate `cpu-usage-over-time.py` to Python 3

The only change here is a fix for `sys.platform` on Linux. Python 3.3 changed the API to return `"linux"` instead of `"linux2"`/`"linux3"`, so this PR uses `.startswith("linux")` to make the code work on Python 3 without breaking Python 2.
2021-07-07 12:17:43 +09:00