Commit graph

156297 commits

Author SHA1 Message Date
Clemens Wasser
71dd0b928b Apply clippy suggestions 2021-10-10 15:38:19 +02: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
5b5c12be1c Add #[must_use] to core and std constructors 2021-10-10 02:44:26 -04:00
John Kugelman
58cc18c56b Add #[must_use] to alloc constructors 2021-10-10 02:19:30 -04: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
sireliah
14aae67bbc Allow the E0482 to be tested 2021-10-09 21:54:02 +02:00
sireliah
a94e39e7f4 Add long explanation for error E0482 2021-10-09 21:49:09 +02: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
Jacob Hoffman-Andrews
d0a33fb175 Remove some stray whitespace. 2021-10-09 08:33:19 -07:00
rhysd
9211beef08 Use E0308 instead of E0495 for checking the error message improvement
because previous test does not cause the expected error message when
`-Z borrowck=mir`.
2021-10-10 00:23:35 +09:00
Guillaume Gomez
3e93472aa5
Rollup merge of #89700 - GuillaumeGomez:fix-rustdoc-higher-bound-html-gen, r=notriddle
Fix invalid HTML generation for higher bounds

Considering this is a bug, I cherry-picked the commit from #89676 so it's merged more quickly.

r? ``@notriddle``
2021-10-09 17:08:41 +02:00
Guillaume Gomez
9f32ab88af
Rollup merge of #89664 - timClicks:51430-document-boxed-conversions, r=m-ou-se
Add documentation to boxed conversions

Among other changes, documents whether allocations are necessary
to complete the type conversion.

Part of #51430, supersedes #89199
2021-10-09 17:08:41 +02:00
Guillaume Gomez
21a5101e21
Rollup merge of #89614 - cuviper:unicode-14, r=joshtriplett
Update to Unicode 14.0

The Unicode Standard [announced Version 14.0](https://home.unicode.org/announcing-the-unicode-standard-version-14-0/) on September 14, 2021, and this pull request updates the generated tables in `core` accordingly.

This did require a little prep-work in `unicode-table-generator`. First, #81358 had modified the generated file instead of the tool, so that change is now reflected in the tool as well. Next, I found that the "Alphabetic" property in version 14 was panicking when generating a bitset, "cannot pack 264 into 8 bits". We've been using the skiplist for that anyway, so I changed this to fail gracefully. Finally, I confirmed that the tool still created the exact same tables for 13 before moving to 14.
2021-10-09 17:08:40 +02:00
Guillaume Gomez
703cb973ec
Rollup merge of #88436 - lf-:stabilize-command-access, r=yaahc
std: Stabilize command_access

Tracking issue: #44434 (not yet closed but the FCP is done so that should be soon).
2021-10-09 17:08:39 +02:00
Guillaume Gomez
3e4f95612e
Rollup merge of #87528 - :stack_overflow_obsd, r=joshtriplett
stack overflow handler specific openbsd change.
2021-10-09 17:08:38 +02:00
Guillaume Gomez
86bf3ce859
Rollup merge of #75644 - c410-f3r:array, r=yaahc
Add 'core::array::from_fn' and 'core::array::try_from_fn'

These auxiliary methods fill uninitialized arrays in a safe way and are particularly useful for elements that don't implement `Default`.

```rust
// Foo doesn't implement Default
struct Foo(usize);

let _array = core::array::from_fn::<_, _, 2>(|idx| Foo(idx));
```

Different from `FromIterator`, it is guaranteed that the array will be fully filled and no error regarding uninitialized state will be throw. In certain scenarios, however, the creation of an **element** can fail and that is why the `try_from_fn` function is also provided.

```rust
#[derive(Debug, PartialEq)]
enum SomeError {
    Foo,
}

let array = core::array::try_from_fn(|i| Ok::<_, SomeError>(i));
assert_eq!(array, Ok([0, 1, 2, 3, 4]));

let another_array = core::array::try_from_fn(|_| Err(SomeError::Foo));
assert_eq!(another_array, Err(SomeError::Foo));
 ```
2021-10-09 17:08:38 +02:00
bors
15491d7b6b Auto merge of #89343 - Mark-Simulacrum:no-args-queries, r=cjgillot
Refactor fingerprint reconstruction

This PR replaces can_reconstruct_query_key with fingerprint_style, which returns the style of the fingerprint for that query. This allows us to avoid trying to extract a DefId (or equivalent) from keys which *are* reconstructible because they're () but not as DefIds.

This is done with the goal of fixing -Zdump-dep-graph, which seems to have broken a while ago (I didn't try to bisect). Currently even on a `fn main() {}` file it'll ICE (you need to also pass -Zquery-dep-graph for it to work at all), and this patch indirectly fixes the cause of that ICE. This also adds a test for it continuing to work.
2021-10-09 13:13:07 +00:00
Guillaume Gomez
321425386a Fix invalid HTML generation for higher bounds 2021-10-09 14:41:28 +02:00
Mark Rousskov
415a9a2ea6 Add a test that -Zquery-dep-graph -Zdump-dep-graph works 2021-10-09 08:13:53 -04:00
bors
bb918d0a5b Auto merge of #89698 - matthiaskrgr:rollup-gna54x6, r=matthiaskrgr
Rollup of 10 pull requests

Successful merges:

 - #88707 (String.split_terminator: Add an example when using a slice of chars)
 - #89605 (Fix stabilization version for `bindings_after_at`)
 - #89634 (rustc_driver: Enable the `WARN` log level by default)
 - #89641 (make #[target_feature] work with `asm` register classes)
 - #89678 (Fix minor std::thread documentation typo)
 - #89684 (Fix asm docs typo)
 - #89687 (Move `read2_abbreviated` function into read2.rs)
 - #89693 (Add #[must_use] to stdin/stdout/stderr locks)
 - #89694 (Add #[must_use] to string/char transformation methods)
 - #89697 (Fix min LLVM version for bpf-types test)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2021-10-09 10:00:54 +00:00
Matthias Krüger
2e5a5e22b2
Rollup merge of #89697 - alessandrod:issue-89689, r=nikic
Fix min LLVM version for bpf-types test

The test requires https://reviews.llvm.org/D102118 which was released in LLVM 13.

Closes #89689
2021-10-09 11:56:08 +02:00
Matthias Krüger
827b540424
Rollup merge of #89694 - jkugelman:must-use-string-transforms, r=joshtriplett
Add #[must_use] to string/char transformation methods

These methods could be misconstrued as modifying their arguments instead of returning new values.

Where possible I made the note recommend a method that does mutate in place.

Parent issue: #89692
2021-10-09 11:56:07 +02:00
Matthias Krüger
ee804594c8
Rollup merge of #89693 - jkugelman:must-use-stdin-stdout-stderr-locks, r=joshtriplett
Add #[must_use] to stdin/stdout/stderr locks

Affected methods:

```rust
std::io           fn stdin_locked() -> StdinLock<'static>;
std::io::Stdin    fn lock(&self) -> StdinLock<'_>;
std::io           fn stdout_locked() -> StdoutLock<'static>;
std::io::Stdout   fn lock(&self) -> StdoutLock<'_>;
std::io           fn stderr_locked() -> StderrLock<'static>;
std::io::Stderr   fn lock(&self) -> StderrLock<'_>;
```

Parent issue: https://github.com/rust-lang/rust/issues/89692
2021-10-09 11:56:07 +02:00
Matthias Krüger
a06c664328
Rollup merge of #89687 - Nicholas-Baron:move_read2_abbreviated, r=Mark-Simulacrum
Move `read2_abbreviated` function into read2.rs

Work towards #89475.
2021-10-09 11:56:06 +02:00
Matthias Krüger
0481c67dd4
Rollup merge of #89684 - asquared31415:asm-doc-fix, r=joshtriplett
Fix asm docs typo

Fixes a typo in target feature names in the `asm` documentation
2021-10-09 11:56:02 +02:00
Matthias Krüger
346f833c3d
Rollup merge of #89678 - marcelo-gonzalez:master, r=joshtriplett
Fix minor std::thread documentation typo

callers of spawn_unchecked() need to make sure that the thread
not outlive references in the passed closure, not the other way around.
2021-10-09 11:56:01 +02:00
Matthias Krüger
5ebb6a8fd9
Rollup merge of #89641 - asquared31415:asm-feature-attr-regs, r=oli-obk
make #[target_feature] work with `asm` register classes

Fixes #89289
2021-10-09 11:56:00 +02:00
Matthias Krüger
9d14b6505b
Rollup merge of #89634 - hawkw:eliza/enable-err-warn, r=oli-obk
rustc_driver: Enable the `WARN` log level by default

This commit changes the `tracing_subscriber` initialization in
`rustc_driver` so that the `WARN` verbosity level is enabled by default
when the `RUSTC_LOG` env variable is empty. If the `RUSTC_LOG` env
variable is set, the filter string in the environment variable is
honored, instead.

Fixes #76824
Closes #89623

cc ``@eddyb,`` ``@oli-obk``
2021-10-09 11:55:59 +02:00
Matthias Krüger
03a34a291d
Rollup merge of #89605 - camelid:fix-version, r=nagisa
Fix stabilization version for `bindings_after_at`

According to the release notes and its PR milestone, it was stabilized
in 1.56.0.
2021-10-09 11:55:58 +02:00
Matthias Krüger
36db658796
Rollup merge of #88707 - sylvestre:split_example, r=yaahc
String.split_terminator: Add an example when using a slice of chars
2021-10-09 11:55:58 +02:00