Commit graph

156170 commits

Author SHA1 Message Date
Urgau
55fad29903
Apply documentation suggestions from code review
Co-authored-by: Guillaume Gomez <guillaume1.gomez@gmail.com>
2021-10-15 12:21:25 +02:00
Loïc BRANSTETT
7d6cfb7754 Oops, inverted condition, fix that 2021-10-14 10:50:46 +02:00
Loïc BRANSTETT
e252274fb1 Add regression test for #89852 2021-10-14 02:12:18 +02:00
Loïc BRANSTETT
15c876db9c Deduplicate macro_rules! from module_exports when documenting them
This can append if within the same module a `#[macro_export] macro_rules!`
is declared but also a reexport of itself producing two export of the same
macro in the same module. In that case we only want to document it once.
2021-10-14 01:51:35 +02:00
bors
eeb16a2a89 Auto merge of #89822 - tmiasko:overflap-duplicates, r=cjgillot
Deduplicate regions ids before merging them

The merging code does not expect to see any duplicates.

Fixes #89820.

r? `@cjgillot`
2021-10-13 16:42:53 +00:00
bors
81117ff930 Auto merge of #89847 - JohnTitor:rollup-xfymeo4, r=JohnTitor
Rollup of 12 pull requests

Successful merges:

 - #89768 (add some more testcases)
 - #89777 (Edit explanation of test for nested type ascriptions)
 - #89781 (Add missing words in `Infallible` docs)
 - #89782 (Improve CJK font in rustdoc)
 - #89794 (Add #[must_use] to to_value conversions)
 - #89814 (Fix uppercase/lowercase error)
 - #89816 (Fix invalid rules in .gitignore)
 - #89817 (Add #[inline] to int log10 functions.)
 - #89818 (Use Option::map_or instead of open coding it)
 - #89828 (Fix config.toml overflow-checks options)
 - #89840 (fix the stage0 tools config file path in `config.toml.example`)
 - #89845 (Add davidtwco to the `.mailmap`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2021-10-13 13:41:48 +00:00
Yuki Okushi
e21f8920d3
Rollup merge of #89845 - davidtwco:davidtwco-mailmap, r=oli-obk
Add davidtwco to the `.mailmap`
2021-10-13 21:55:19 +09:00
Yuki Okushi
d01cfe1bf1
Rollup merge of #89840 - wangkirin:master, r=jyn514
fix the stage0 tools config file path in `config.toml.example`

in  #88362  , the `stage0.txt ` have been switched to `stage0.json`  , but in `config.toml.example` the guide didn't change ,  this PR fix  this issue
2021-10-13 21:55:18 +09:00
Yuki Okushi
72626bfb15
Rollup merge of #89828 - rusticstuff:overflow-check-options-take-two, r=Mark-Simulacrum
Fix config.toml overflow-checks options

This a follow-up PR to #87784.

Improvements:
* Add missing entries for overflow-checks to config.toml.example.
* Add --enable-overflow-checks-std option to configure script.
* Make rust.overflow-checks-stdoption default to rust.overflow-checks.

Also adds the missing  `--enable-debug-assertions-std `option to configure script.

r? ```@Mark-Simulacrum```
cc ```@jyn514```
2021-10-13 21:55:18 +09:00
Yuki Okushi
6eb0a5f0e8
Rollup merge of #89818 - LingMan:map_or, r=oli-obk
Use Option::map_or instead of open coding it

````@rustbot```` modify labels +C-cleanup +T-compiler
2021-10-13 21:55:17 +09:00
Yuki Okushi
59ebfdd7e0
Rollup merge of #89817 - m-ou-se:int-log-10-inline, r=the8472
Add #[inline] to int log10 functions.
2021-10-13 21:55:16 +09:00
Yuki Okushi
7948883754
Rollup merge of #89816 - Canop:master, r=Mark-Simulacrum
Fix invalid rules in .gitignore

`**node_modules` in a .gitignore is the same than
`*node_modules` or `*****node_modules`.

It matches every file whose name ends with `node_modules`,
including `not_node_modules`.

The intent here was obviously to have `**/node_modules`
which is the same than just `node_modules`.

Reference on git ignoring rules format: https://git-scm.com/docs/gitignore
2021-10-13 21:55:15 +09:00
Yuki Okushi
06e4aee220
Rollup merge of #89814 - jkugelman:must-use-string-transforms-typo, r=joshtriplett
Fix uppercase/lowercase error

Fix https://github.com/rust-lang/rust/pull/89694#discussion_r726829890

r? ````@joshtriplett````
2021-10-13 21:55:14 +09:00
Yuki Okushi
c1bde6e4b6
Rollup merge of #89794 - jkugelman:must-use-to_value-conversions, r=joshtriplett
Add #[must_use] to to_value conversions

`NonNull<T>::cast` snuck in when I wasn't looking. What a scamp!

Parent issue: #89692

r? ````@joshtriplett````
2021-10-13 21:55:13 +09:00
Yuki Okushi
cabfda428d
Rollup merge of #89782 - konan8205:develop, r=jsha
Improve CJK font in rustdoc

This PR includes:
- Fix unicode range of korean letters in `rustdoc.css`.
- Add WOFF2 format version of Noto Sans KR font.
- Shorten the font file name.
2021-10-13 21:55:12 +09:00
Yuki Okushi
f759fff447
Rollup merge of #89781 - Wilfred:patch-2, r=JohnTitor
Add missing words in `Infallible` docs

This sentence was previously incomplete.
2021-10-13 21:55:11 +09:00
Yuki Okushi
cd5fe938e7
Rollup merge of #89777 - pierwill:fix-88233, r=Mark-Simulacrum
Edit explanation of test for nested type ascriptions

Fixes typo ("an ascribing") and removes extra.

Closes #88233.
2021-10-13 21:55:10 +09:00
Yuki Okushi
0caa6164a3
Rollup merge of #89768 - hellow554:tests, r=Mark-Simulacrum
add some more testcases

resolves #52893
resolves #68295
resolves #87750
resolves #88071

All these issues have been fixed according to glacier. Just adding a test so it can be closed.

Can anybody tell me why the github keywords do not work? 🤔
Please edit this post if you can fix it.
2021-10-13 21:55:10 +09:00
David Wood
646bc1d239 Add davidtwco to the .mailmap
Signed-off-by: David Wood <david.wood@huawei.com>
2021-10-13 11:12:54 +00:00
bors
5728bd64b4 Auto merge of #89587 - camelid:all-candidates, r=petrochenkov
Include rmeta candidates in "multiple matching crates" error

Only dylib and rlib candidates were included in the error. I think the
reason is that at the time this error was originally implemented, rmeta
crate sources were represented different from dylib and rlib sources.
I wrote up more detailed analysis in [this comment][1].

The new version of the code is also a bit easier to read and should be
more robust to future changes since it uses `CrateSources::paths()`.

I also changed the code to sort the candidates to make the output deterministic;
added full stderr tests for the error; and added a long error code explanation.

[1]: https://github.com/rust-lang/rust/pull/88675#issuecomment-935282436

cc `@Mark-Simulacrum` `@jyn514`
2021-10-13 10:38:12 +00:00
Wang Qilin
4b4d3ee60b fix the stage0 tools config file path in config.toml.example 2021-10-13 15:47:15 +08:00
bors
a16f686e4a Auto merge of #89802 - ehuss:update-cargo, r=ehuss
Update cargo

7 commits in d56b42c549dbb7e7d0f712c51b39400260d114d4..c7957a74bdcf3b11e7154c1a9401735f23ebd484
2021-09-27 13:44:18 +0000 to 2021-10-11 20:17:07 +0000
- Add some more information to verbose version. (rust-lang/cargo#9968)
- Skip all `cargo fix` that tends to write to registry cache. (rust-lang/cargo#9938)
- Stabilize named profiles (rust-lang/cargo#9943)
- Update git2 (rust-lang/cargo#9963)
- Distinguish lockfile version req from normal dep in resolver error message (rust-lang/cargo#9847)
- nit: Allocated slightly bigger vec than needed (rust-lang/cargo#9954)
- Add shell completion for shorthand commands (rust-lang/cargo#9951)
2021-10-13 03:00:33 +00:00
Tomasz Miąsko
8aaf4ab59a Deduplicate regions ids before merging them
The merging code does not expect to see any duplicates.
2021-10-13 00:00:00 +00:00
bors
ef4b3069ba Auto merge of #89774 - the8472:inline-mut-iter-next, r=m-ou-se
inline next() on &mut Iterator impl

In [#87431](https://github.com/rust-lang/rust/pull/87431/files#diff-79a6b417b85ecf4f1a4ef2235135fedf540199caf6e9e1d154ac6a413b40a757R132-R136)   I found that `(&mut range).fold` doesn't optimize well because the default impl for for `fold` on `&mut Iterator` doesn't inline `next`. In that particular case it was worked around by using `try_fold` which takes a `&mut self` instead of `self`.

Let's see if this can be fixed more broadly.
2021-10-12 23:59:48 +00:00
bors
d7c97a02d1 Auto merge of #89105 - DevinR528:reachable-fix, r=Nadrieril
Fix: non_exhaustive_omitted_patterns by filtering unstable and doc hidden variants

Fixes: #89042

Now that #86809 has been merged there are cases (std::io::ErrorKind) where unstable feature gated variants were included in warning/error messages when the feature was not turned on. This filters those variants out of the return of `SplitWildcard::new`.

Variants marked `doc(hidden)` are filtered out of the witnesses list in `Usefulness::apply_constructor`.

Probably worth a perf run 🤷 since this area can be sensitive.
2021-10-12 20:54:15 +00:00
Noah Lev
bf2d2e5597 Work around different filenames for DLLs 2021-10-12 13:31:21 -07:00
Noah Lev
cc6a09009d Add long explanation for E0464
The test is copied from `src/test/ui/crate-loading/crateresolve1.rs` and
its auxiliary tests. I added it to the `compile_fail` code example check
exemption list since it's hard if not impossible to reproduce this error
in a standalone code example.
2021-10-12 13:10:12 -07:00
Noah Lev
2e56b6f98e Include rmeta candidates in "multiple matching crates" error
Only dylib and rlib candidates were included in the error. I think the
reason is that at the time this error was originally implemented, rmeta
crate sources were represented different from dylib and rlib sources.
I wrote up more detailed analysis in [this comment][1].

The new version of the code is also a bit easier to read and should be
more robust to future changes since it uses `CrateSources::paths()`.

[1]: https://github.com/rust-lang/rust/pull/88675#issuecomment-935282436
2021-10-12 13:10:11 -07:00
Noah Lev
ad49cb6e0c Add test for showing rmeta candidates in error 2021-10-12 13:10:11 -07:00
Noah Lev
642a43a9cd Test crate loading error stderr
And remove E0464 from test-exemption list, since it now has a full test.
2021-10-12 13:10:10 -07:00
Noah Lev
6792c6a851 Sort candidate libraries by source path in error
This makes the error output deterministic and thus testable.
2021-10-12 13:08:32 -07:00
Hans Kratz
905ed5fa89 Make rust.overflow-checks-stdoption default to rust.overflow-checks. 2021-10-12 21:57:40 +02:00
Hans Kratz
bcf7cf6670 Add --enable-debug-assertions-std option to configure script. 2021-10-12 21:49:06 +02:00
Hans Kratz
cfc7782a84 Add --enable-overflow-checks-std option to configure script. 2021-10-12 21:49:06 +02:00
Hans Kratz
7a646df098 Add missing entries for overflow-checks to config.toml.example. 2021-10-12 21:49:00 +02:00
bors
044674337a Auto merge of #89813 - the8472:rollup-f1f99mb, r=the8472
Rollup of 7 pull requests

Successful merges:

 - #89778 (Add #[must_use] to as_type conversions)
 - #89784 (Remove built-in query cache_hit tracking)
 - #89796 (Add #[must_use] to non-mutating verb methods)
 - #89797 (Add #[must_use] to is_condition tests)
 - #89799 (fix minor spelling error in Poll::ready docs)
 - #89800 (Update books)
 - #89809 (Remap ssa RealPredicate to llvm RealPredicate)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2021-10-12 17:57:34 +00:00
Eric Huss
d9f0eb54f7 Update winapi shared features.
Needed due to os_info.
2021-10-12 07:14:32 -07:00
Mara Bos
a6bb1fb641 Add #[inline] to int log10 functions. 2021-10-12 15:21:14 +02:00
Canop
e5cfe844c9 Fix invalid rules in .gitignore
`**node_modules` in a .gitignore is the same than
`*node_modules` or `*****node_modules`.

It matches every file whose name ends with `node_modules`,
including `not_node_modules`.

The intent here was obviously to have `**/node_modules`
which is the same than just `node_modules`.
2021-10-12 15:09:28 +02:00
John Kugelman
81eeb3e775 Fix uppercase/lowercase error 2021-10-12 08:53:54 -04:00
the8472
6cdf8030f0
Rollup merge of #89809 - tmiasko:remap-real-predicate, r=michaelwoerister
Remap ssa RealPredicate to llvm RealPredicate

to avoid relying on the discriminant of the former for FFI purposes
2021-10-12 14:53:13 +02:00
the8472
17c7635f7c
Rollup merge of #89800 - ehuss:update-books, r=ehuss
Update books

## nomicon

5 commits in 2747c4bb2cbc0639b733793ddb0bf4e9daa2634e..2d66852a27c5d0ec50ae021820d1de22caa2b1bd
2021-09-19 17:33:32 +0900 to 2021-10-07 19:00:37 +0900
- Fix typo/minor grammar error in subtyping.md (rust-lang/nomicon#317)
- doc: clarify `thread::scoped::JoinGuard` chapter (rust-lang/nomicon#313)
- Clarify niche optimization on enums with reprs (rust-lang/nomicon#315)
- Update rc decrement snipped (rust-lang/nomicon#316)
- Remove useless `unsafe`, `mut` and ptr casts in example in `send-and-sync.md` (rust-lang/nomicon#308)

## reference

2 commits in 13747275bd14c2d2b453100498532f9ae5504769..b5c68b02984f74e99d1f1b332029e05f607e2660
2021-09-24 17:44:04 +0900 to 2021-10-02 08:11:35 -0700
- Use subtrait/supertrait, not sub-trait, super-trait. (rust-lang/reference#1095)
- Fixed link typo in Generics.md (rust-lang/reference#1094)

## rust-by-example

3 commits in 28aca4a36962c709bce301c03114b5589381dfb8..9a60624fcad0140826c44389571dc622917cd632
2021-09-25 08:19:51 -0300 to 2021-10-04 08:13:53 -0300
- Change 1..n + 1 to 1..=n (rust-lang/rust-by-example#1467)
- Close rust-lang/rust-by-example#1464 (rust-lang/rust-by-example#1465)
- Fix incorrect formatted print hint; closes rust-lang/rust-by-example#1459. (rust-lang/rust-by-example#1466)

## rustc-dev-guide

11 commits in d1f03cbaa39d9164f5fe4b9b93762668142e0dad..fba15a46ca8efa97e8a955794724ac7ce27805b8
2021-09-24 12:00:29 +0900 to 2021-10-12 08:52:21 +0900
- Update some docs from 2021-10 date triage (rust-lang/rustc-dev-guide#1230)
- Recommend `rustfmt --edition=2021`
- Update sanitizer documentation
- Mention needs-sanitizer-hwaddress directive
- Address review comments
- Document tracing awesomeness
- Move log/tracing instructions to its own file
- Update src/closure.md
- Fix accidental HTML tag
- Update links to `rustc_mir` in Two Phase Borrows (rust-lang/rustc-dev-guide#1226)
- Update some docs from 2021-10 date triage (rust-lang/rustc-dev-guide#1224)

## edition-guide

1 commits in 2d9b1b9da706de24650fdc5c3b0182f55c82115d..7c0088ca744d293a5f4b1e2ac378e7c23d30fe55
2021-08-31 10:44:09 +0200 to 2021-10-05 13:28:05 +0200
- Clarify cargo resolver behavior in a workspace. (rust-lang/edition-guide#267)

## embedded-book

2 commits in 4c76da9ddb4650203c129fceffdea95a3466c205..270fccd339e5972d9c900e788f197e81a0bcd956
2021-09-12 12:43:03 +0000 to 2021-10-06 16:28:48 +0000
- Update section 1.4 to mention that some additional packages required  (rust-embedded/book#304)
- Change `-file-headers` to `--file-headers`  (rust-embedded/book#303)
2021-10-12 14:53:12 +02:00
the8472
7017410e5d
Rollup merge of #89799 - ast-ral:ready-method-spellck, r=joshtriplett
fix minor spelling error in Poll::ready docs

Fixes minor spelling error in the proposed `Poll::ready` docs. Not that my opinion matters, but +1 on the original PR (#89651), it reads much nicer to me than the `ready!` macro.
2021-10-12 14:53:11 +02:00
the8472
4cf0f1fede
Rollup merge of #89797 - jkugelman:must-use-is_condition-tests, r=joshtriplett
Add #[must_use] to is_condition tests

I threw in `std::path::Path::has_root` for funsies.

A continuation of #89718.

Parent issue: #89692

r? ```@joshtriplett```
2021-10-12 14:53:11 +02:00
the8472
a1bdd48106
Rollup merge of #89796 - jkugelman:must-use-non-mutating-verb-methods, r=joshtriplett
Add #[must_use] to non-mutating verb methods

These are methods that could be misconstrued to mutate their input, similar to #89694. I gave each one a different custom message.

I wrote that `upgrade` and `downgrade` don't modify the input pointers. Logically they don't, but technically they do...

Parent issue: #89692

r? ```@joshtriplett```
2021-10-12 14:53:10 +02:00
the8472
4ce1ce1f76
Rollup merge of #89784 - Mark-Simulacrum:delete-cache-hit-tracking, r=petrochenkov
Remove built-in query cache_hit tracking

This was already only enabled in debug_assertions builds. Generally, it seems
like most use cases that would use this could also use the -Zself-profile flag
which also tracks cache hits (in all builds), and so the extra cfg's and such
are not really necessary.

This is largely just a small cleanup though, which primarily is intended to make
other changes easier by avoiding the need to deal with this field.
2021-10-12 14:53:09 +02:00
the8472
b55a3c5d15
Rollup merge of #89778 - jkugelman:must-use-as_type-conversions, r=joshtriplett
Add #[must_use] to as_type conversions

Clippy missed these:

```rust
alloc::string::String   fn as_mut_str(&mut self) -> &mut str;
core::mem::NonNull<T>   unsafe fn as_uninit_mut<'a>(&mut self) -> &'a MaybeUninit<T>;
str                     unsafe fn as_bytes_mut(&mut self) -> &mut [u8];
str                     fn as_mut_ptr(&mut self) -> *mut u8;
```

Parent issue: #89692

r? ````@joshtriplett````
2021-10-12 14:53:08 +02:00
LingMan
7943c9c446 Use Option::map_or instead of open coding it 2021-10-12 14:47:52 +02:00
Devin Ragotzy
2a042d6105 Filter unstable and doc hidden variants in usefulness checking
Add test cases for unstable variants
Add test cases for doc hidden variants
Move is_doc_hidden to method on TyCtxt
Add unstable variants test to reachable-patterns ui test
Rename reachable-patterns -> omitted-patterns
2021-10-12 08:22:25 -04:00
Tomasz Miąsko
ce7713d6b4 Remap ssa RealPredicate to llvm RealPredicate
to avoid relying on the discriminant of the former for FFI purposes
2021-10-12 11:55:45 +02:00