Commit graph

156045 commits

Author SHA1 Message Date
The8472
f1c588f1ef use fold instead of try_fold now that .by_ref().next() has been inlined 2021-10-11 23:36:04 +02:00
The8472
a398b6b9d4 inline next() on &mut Iterator impl 2021-10-11 17:50:03 +02:00
bors
86d6d2b738 Auto merge of #89755 - jkugelman:must-use-conversions-that-move-self, r=joshtriplett
Add #[must_use] to conversions that move self

Everything here got the same message. Is the wording okay?

```rust
#[must_use = "`self` will be dropped if the result is not used"]
```

I want to draw attention to these methods in particular:

```rust
alloc::sync::Arc<MaybeUninit<T>>     unsafe fn assume_init(self) -> Arc<T>;
alloc::sync::Arc<[MaybeUninit<T>]>   unsafe fn assume_init(self) -> Arc<[T]>;
core::pin::Pin<&'a mut T>            const fn into_ref(self) -> Pin<&'a T>;
core::pin::Pin<&'a mut T>            const fn get_mut(self) -> &'a mut T;
core::pin::Pin<&'a mut T>            const unsafe fn get_unchecked_mut(self) -> &'a mut T;
core::pin::Pin<&'a mut T>            unsafe fn map_unchecked_mut(self, func: F) -> Pin<&'a mut U>;
core::pin::Pin<&'a mut Pin<P>>       fn as_deref_mut(self) -> Pin<&'a mut P::Target>;
```

Parent issue: #89692

r? `@joshtriplett`
2021-10-11 07:27:44 +00:00
bors
9a757817c3 Auto merge of #89597 - michaelwoerister:improve-vtable-debuginfo, r=wesleywiser
Create more accurate debuginfo for vtables.

Before this PR all vtables would have the same name (`"vtable"`) in debuginfo. Now they get an unambiguous name that identifies the implementing type and the trait that is being implemented.

This is only one of several possible improvements:
- This PR describes vtables as arrays of `*const u8` pointers. It would nice to describe them as structs where function pointer is represented by a field with a name indicative of the method it maps to. However, this requires coming up with a naming scheme that avoids clashes between methods with the same name (which is possible if the vtable contains multiple traits).
- The PR does not update the debuginfo we generate for the vtable-pointer field in a fat `dyn` pointer. Right now there does not seem to be an easy way of getting ahold of a vtable-layout without also knowing the concrete self-type of a trait object.

r? `@wesleywiser`
2021-10-11 04:31:47 +00:00
bors
1ddd4e6d7e Auto merge of #89752 - matthiaskrgr:rollup-v4fgmwg, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - #89579 (Add regression test for issue 80108)
 - #89632 (Fix docblock code display on mobile)
 - #89691 (Move `DebuggerCommands` and `check_debugger_output` to a separate module)
 - #89707 (Apply clippy suggestions for std)
 - #89722 (Fix spelling: Cannonical -> Canonical)
 - #89736 (Remove unused CSS rule)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2021-10-11 01:06:26 +00:00
John Kugelman
b115781bcd Add #[must_use] to conversions that move self 2021-10-10 19:50:52 -04:00
Matthias Krüger
bf01a59be5
Rollup merge of #89736 - GuillaumeGomez:rm-unused-css-rule, r=dns2utf8
Remove unused CSS rule

As you can see in the firefox devtools:

![Screenshot from 2021-10-10 14-28-08](https://user-images.githubusercontent.com/3050060/136695689-16c77ceb-b1ab-40df-963a-048f2258e217.png)

It needs the display to be `grid` or `inline-grid`, which isn't the case.

r? `@dns2utf8`
2021-10-11 00:34:41 +02:00
Matthias Krüger
9d307f1ed4
Rollup merge of #89722 - jkugelman:cannonical-typo, r=joshtriplett
Fix spelling: Cannonical -> Canonical
2021-10-11 00:34:40 +02:00
Matthias Krüger
9c4791300a
Rollup merge of #89707 - clemenswasser:apply_clippy_suggestions, r=Mark-Simulacrum
Apply clippy suggestions for std
2021-10-11 00:34:39 +02:00
Matthias Krüger
1b8f7a9db5
Rollup merge of #89691 - Nicholas-Baron:debugger_commands, r=Mark-Simulacrum
Move `DebuggerCommands` and `check_debugger_output` to a separate module

Work towards #89475.

As part of this move, the public functions were changed to return `Result`. This is so that the error handling that initially took `&self: TestCx` can still use that `TestCx`.
2021-10-11 00:34:38 +02:00
Matthias Krüger
3fa897df26
Rollup merge of #89632 - GuillaumeGomez:fix-docblock-code, r=jsha
Fix docblock code display on mobile

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

Before:

![Screenshot from 2021-10-07 12-01-37](https://user-images.githubusercontent.com/3050060/136363624-72bedddd-b45e-48a0-89b4-6563612f8677.png)

After:

![Screenshot from 2021-10-07 20-17-21](https://user-images.githubusercontent.com/3050060/136440704-fa9ffa68-8e94-46a7-b556-c41aa5153750.png)

r? `@jsha`
2021-10-11 00:34:37 +02:00
Matthias Krüger
2bfbf97762
Rollup merge of #89579 - workingjubilee:regression-test-80108, r=Mark-Simulacrum
Add regression test for issue 80108

Closes #80108
2021-10-11 00:34:37 +02:00
bors
3bf55753c6 Auto merge of #89541 - workingjubilee:abbrev-shufvec-t, r=Mark-Simulacrum
Cleanup src/test/ui/{simd,simd-intrinsic}

Initial motivation was to simplify a huge macro expansion using a tuple, since we can just use an array in `#[repr(simd)]` now for the same result. But also, several tests were going unnoticed during development of SIMD intrinsics because people kept looking in the wrong directory, and many are basically run-pass vs. build-fail versions of the same tests, so let's keep them close together and simplify their names, so they're easier to sift through.
2021-10-10 22:25:49 +00:00
Jubilee Young
7fb6e1aa61 Add regression test for issue 80108 2021-10-10 14:09:55 -07:00
bors
41dfaaa3c6 Auto merge of #89739 - matthiaskrgr:rollup-kskwqy5, r=matthiaskrgr
Rollup of 11 pull requests

Successful merges:

 - #88374 (Fix documentation in Cell)
 - #88713 (Improve docs for int_log)
 - #89428 (Feature gate the non_exhaustive_omitted_patterns lint)
 - #89438 (docs: `std:#️⃣:Hash` should ensure prefix-free data)
 - #89520 (Don't rebuild GUI test crates every time you run test src/test/rustdoc-gui)
 - #89705 (Cfg hide no_global_oom_handling and no_fp_fmt_parse)
 - #89713 (Fix ABNF of inline asm options)
 - #89718 (Add #[must_use] to is_condition tests)
 - #89719 (Add #[must_use] to char escape methods)
 - #89720 (Add #[must_use] to math and bit manipulation methods)
 - #89735 (Stabilize proc_macro::is_available)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2021-10-10 19:05:13 +00:00
Matthias Krüger
4d89488c41
Rollup merge of #89735 - bjorn3:stabilize_proc_macro_is_available, r=petrochenkov
Stabilize proc_macro::is_available

Tracking issue: https://github.com/rust-lang/rust/issues/71436

The FCP for the stabilization of `proc_macro::is_available` has completed.
2021-10-10 18:22:26 +02:00
Matthias Krüger
c8b5a7b0c4
Rollup merge of #89720 - jkugelman:must-use-math-operations, r=joshtriplett
Add #[must_use] to math and bit manipulation methods

Also tidied up a few other nearby `#[must_use]`s.

Parent issue: #89692
2021-10-10 18:22:25 +02:00
Matthias Krüger
758a901a40
Rollup merge of #89719 - jkugelman:must-use-char-escape-methods, r=joshtriplett
Add #[must_use] to char escape methods

Parent issue: #89692
2021-10-10 18:22:24 +02:00
Matthias Krüger
0c04b1fc03
Rollup merge of #89718 - jkugelman:must-use-is_condition-tests, r=joshtriplett
Add #[must_use] to is_condition tests

There's nothing insightful to say about these so I didn't write any extra explanations.

Parent issue: #89692
2021-10-10 18:22:23 +02:00
Matthias Krüger
8aec76caf8
Rollup merge of #89713 - nbdd0121:doc2, r=Amanieu
Fix ABNF of inline asm options

This is the case since #73227.

r? `@camelid`
2021-10-10 18:22:22 +02:00
Matthias Krüger
ce6097dfa4
Rollup merge of #89705 - nbdd0121:doc, r=GuillaumeGomez
Cfg hide no_global_oom_handling and no_fp_fmt_parse

These are unstable sysroot customisation cfg options that only projects building their own sysroot will use (e.g. Rust-for-linux). Most users shouldn't care. `no_global_oom_handling` can be especially annoying since it's applied on many commonly used alloc crate methods (e.g. `Box::new`, `Vec::push`).

r? ```@GuillaumeGomez```
2021-10-10 18:22:21 +02:00
Matthias Krüger
f1d0ce70b6
Rollup merge of #89520 - GuillaumeGomez:cache-rustdoc-gui-test, r=Mark-Simulacrum
Don't rebuild GUI test crates every time you run test src/test/rustdoc-gui

This method has multiple advantages:

 * It'll completely remove the rustdoc-GUI test doc folder if rustdoc was updated
 * It'll rebuild GUI test crates only they have been updated

All in all, it's quite convenient! (even more with https://github.com/rust-lang/rust/pull/88816)

r? ```@Mark-Simulacrum```
2021-10-10 18:22:20 +02:00
Matthias Krüger
06cfd0af48
Rollup merge of #89438 - pierwill:prefix-free-hash, r=Amanieu
docs: `std:#️⃣:Hash` should ensure prefix-free data

Attempt to synthesize the discussion in #89429 into a suggestion regarding `Hash` implementations (not a hard requirement).

Closes #89429.
2021-10-10 18:22:20 +02:00
Matthias Krüger
cfa5391f0b
Rollup merge of #89428 - DevinR528:reachable-featuregate, r=Nadrieril,camelid
Feature gate the non_exhaustive_omitted_patterns lint

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

Add the machinery to gate the new `non_exhaustive_omitted_patterns` lint.

relates to https://github.com/rust-lang/rust/pull/89105 and https://github.com/rust-lang/rust/pull/89423
2021-10-10 18:22:19 +02:00
Matthias Krüger
4473b945bf
Rollup merge of #88713 - falk-hueffner:int-log10-documentation-fixes, r=scottmcm
Improve docs for int_log

* Clarify rounding.
* Avoid "wrapping" wording.
* Omit wrong claim on 0 only being returned in error cases.
* Typo fix for one_less_than_next_power_of_two.
2021-10-10 18:22:18 +02:00
Matthias Krüger
fd5bed73d0
Rollup merge of #88374 - joshlf:patch-2, r=JohnTitor
Fix documentation in Cell
2021-10-10 18:22:17 +02:00
bors
68dfa07e3b Auto merge of #89633 - rhysd:issue-65230, r=petrochenkov
Show detailed expected/found types in error message when trait paths are the same

Fixes #65230.

### Issue solved by this PR

```rust
trait T {
    type U;
    fn f(&self) -> Self::U;
}

struct X<'a>(&'a mut i32);

impl<'a> T for X<'a> {
    type U = &'a i32;
    fn f(&self) -> Self::U {
        self.0
    }
}

fn main() {}
```

Compiler generates the following note:

```
note: ...so that the types are compatible
  --> test.rs:10:28
   |
10 |       fn f(&self) -> Self::U {
   |  ____________________________^
11 | |         self.0
12 | |     }
   | |_____^
   = note: expected `T`
              found `T`
```

This note is not useful since the expected type and the found type are the same.

### How this PR solve the issue

When the expected type and the found type are exactly the same in string representation, the note falls back to the detailed string representation of trait ref:

```
note: ...so that the types are compatible
  --> test.rs:10:28
   |
10 |       fn f(&self) -> Self::U {
   |  ____________________________^
11 | |         self.0
12 | |     }
   | |_____^
   = note: expected `<X<'a> as T>`
              found `<X<'_> as T>`
```

So that a user can notice what was different between the expected one and the found one.
2021-10-10 15:59:28 +00:00
bors
0c87288f92 Auto merge of #89219 - nickkuk:str_split_once_get_unchecked, r=Mark-Simulacrum
Use get_unchecked in str::[r]split_once

This PR removes indices checking in `str::split_once` and `str::rsplit_once` methods.
2021-10-10 12:29:48 +00:00
Guillaume Gomez
5611b43d7f Remove unused CSS rule 2021-10-10 14:27:36 +02:00
Guillaume Gomez
d4f3cf03f9 Add test for <code> in doc blocks on mobile 2021-10-10 14:24:40 +02:00
bjorn3
09dd213cd2 Stabilize proc_macro::is_available 2021-10-10 14:09:54 +02:00
Guillaume Gomez
0bfac7f67f Fix <code> blocks in doc blocks display on mobile 2021-10-10 13:30:56 +02:00
bors
9e8356c6ad Auto merge of #88952 - skrap:add-armv7-uclibc, r=nagisa
Add new tier-3 target: armv7-unknown-linux-uclibceabihf

This change adds a new tier-3 target: armv7-unknown-linux-uclibceabihf

This target is primarily used in embedded linux devices where system resources are slim and glibc is deemed too heavyweight.  Cross compilation C toolchains are available [here](https://toolchains.bootlin.com/) or via [buildroot](https://buildroot.org).

The change is based largely on a previous PR #79380 with a few minor modifications.  The author of that PR was unable to push the PR forward, and graciously allowed me to take it over.

Per the [target tier 3 policy](https://github.com/rust-lang/rfcs/blob/master/text/2803-target-tier-policy.md), I volunteer to be the "target maintainer".

This is my first PR to Rust itself, so I apologize if I've missed things!
2021-10-10 08:16:22 +00:00
John Kugelman
169113935f Fix spelling: Cannonical -> Canonical 2021-10-10 00:44:34 -04:00
bors
c1cb97481a Auto merge of #89695 - jsha:more-templates, r=GuillaumeGomez
Move top part of print_item to Tera templates

Part of #84419.

This moves the first line of each item page (E.g. `Struct foo::Bar .... 1.0.0 [-][src]` into a Tera template.

I also moved template initialization into its own module and added a small macro to reduce duplication and opportunity for errors.
2021-10-10 04:41:03 +00:00
John Kugelman
bc9d13e658 Add #[must_use] to math and bit manipulation methods
Also tidied up a few other nearby `#[must_use]`s.
2021-10-09 22:43:32 -04:00
bors
6928fafe06 Auto merge of #89661 - rusticstuff:libisl_mirror_take_two, r=Mark-Simulacrum
CI: Use mirror for libisl downloads for more docker dist builds

http://isl.gforge.inria.fr fell from the net a couple of days ago. It hosts libisl source tarballs required by crosstool-ng, which we use for our docker dist cross-compilation builds. Some of the affected builds were already fixed in #89599.

This PR sets a mirror URL for the other builds requiring libisl-0.14. They use an older version of crosstool-ng (1.22.0), which has only one mirror setting for all downloads.

r? `@Mark-Simulacrum`
2021-10-10 01:46:11 +00:00
John Kugelman
fec9514727 Add #[must_use] to char escape methods 2021-10-09 21:35:09 -04:00
John Kugelman
475e9925a7 Add #[must_use] to is_condition tests
There's nothing insightful to say about these so I didn't write any
extra explanations.
2021-10-09 21:27:13 -04:00
bors
f086f47077 Auto merge of #89631 - camsteffen:clippy-boot-env, r=Mark-Simulacrum
Remove unused clippy bootstrap env vars

Continues rust-lang/rust-clippy#7646
2021-10-09 22:37:34 +00:00
Gary Guo
7b5bedf709 Fix ABNF of inline asm options 2021-10-09 21:27:33 +01:00
Nicholas-Baron
2d827ca3b8 Simplified 3 ifs found by clippy. 2021-10-09 12:18:01 -07:00
Nicholas-Baron
d2a522f423 Simplified two printlns picked out by clippy 2021-10-09 12:18:01 -07:00
Nicholas-Baron
0e2a782463 Move check_debugger_output to the debugger module 2021-10-09 12:18:01 -07:00
Nicholas-Baron
ce185739fc Move DebuggerCommands to its own file 2021-10-09 12:18:00 -07:00
bors
a8f2463c68 Auto merge of #88379 - camelid:cleanup-clean, r=jyn514
rustdoc: Cleanup various `clean` types

Cleanup various `clean` types.
2021-10-09 19:05:08 +00:00
pierwill
749194d847
Update library/core/src/hash/mod.rs
Co-authored-by: Amanieu d'Antras <amanieu@gmail.com>
2021-10-09 13:53:29 -05:00
Clemens Wasser
8545472a08 Apply clippy suggestions 2021-10-09 18:56:01 +02:00
Gary Guo
01825669b8 Cfg hide no_global_oom_handling and no_fp_fmt_parse 2021-10-09 17:07:33 +01:00
bors
bc8ad24020 Auto merge of #89703 - GuillaumeGomez:rollup-g3ulo9x, r=GuillaumeGomez
Rollup of 6 pull requests

Successful merges:

 - #75644 (Add 'core::array::from_fn' and 'core::array::try_from_fn')
 - #87528 (stack overflow handler specific openbsd change.)
 - #88436 (std: Stabilize command_access)
 - #89614 (Update to Unicode 14.0)
 - #89664 (Add documentation to boxed conversions)
 - #89700 (Fix invalid HTML generation for higher bounds)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2021-10-09 16:01:30 +00:00