Commit graph

137723 commits

Author SHA1 Message Date
Jonas Schievink
1e99f26894
Rollup merge of #80470 - SimonSapin:array-intoiter-type, r=m-ou-se
Stabilize by-value `[T; N]` iterator `core::array::IntoIter`

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

This is unblocked now that `min_const_generics` has been stabilized in https://github.com/rust-lang/rust/pull/79135.

This PR does *not* include the corresponding `IntoIterator` impl, which is https://github.com/rust-lang/rust/pull/65819. Instead, an iterator can be constructed through the `new` method.

`new` would become unnecessary when `IntoIterator` is implemented and might be deprecated then, although it will stay stable.
2021-01-31 01:47:25 +01:00
Jonas Schievink
054c29d22c
Rollup merge of #80279 - Yaulendil:str-as-mut, r=m-ou-se
Implement missing `AsMut<str>` for `str`

Allows `&mut str` to be taken by a Generic which requires `T` such that `T: AsMut<str>`. Motivating example:

```rust
impl<'i, T> From<T> for StructImmut<'i> where
    T: AsRef<str> + 'i,
{
    fn from(asref: T) -> Self {
        let string: &str = asref.as_ref();
        //  ...
    }
}

impl<'i, T> From<T> for StructMut<'i> where
    T: AsMut<str> + 'i,
{
    fn from(mut asmut: T) -> Self {
        let string: &mut str = asmut.as_mut();
        //  ...
    }
}
```

The Immutable form of this structure can be constructed by `StructImmut::from(s)` where `s` may be a `&String` or a `&str`, because `AsRef<str>` is implemented for `str`. However, the mutable form of the structure can be constructed in the same way **only** with a `&mut String`, and **not** with a `&mut str`.

This change does have some precedent, because as can be seen in [the Implementors](https://doc.rust-lang.org/std/convert/trait.AsMut.html#implementors), `AsMut<[T]>` is implemented for `[T]` as well as for `Vec<T>`, but `AsMut<str>` is implemented only for `String`. This would complete the symmetry.

As a trait implementation, this should be immediately stable.
2021-01-31 01:47:23 +01:00
Jonas Schievink
b28a1b2951
Rollup merge of #80053 - gilescope:include-ignore, r=m-ou-se
stabilise `cargo test -- --include-ignored`

stabilise `cargo test -- --include-ignored`

On stable there's no way to run ignored tests as well as the normal tests.

An example use case where stabilising this would help:
Exercism has some initial tests and then some additional ignored tests that people run currently with --ignore but currently they can't run all the tests in one go without being on nightly. It would be a little more ergonomic if this flag was stablilised.

( Fixes  #65770 )

I built with ./x.py build -i library/test - but as libtest is a dylib is there an easy way to invoke it manually to check it's working as expected? (I've updated the automated tests.)
2021-01-31 01:47:22 +01:00
Jonas Schievink
ac37c326ae
Rollup merge of #79285 - yoshuawuyts:stabilize-arc_mutate_strong_count, r=m-ou-se
Stabilize Arc::{increment,decrement}_strong_count

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

Stabilizes `Arc::{incr,decr}_strong_count`, enabling unsafely incrementing an decrementing the Arc strong count directly with fewer gotchas. This API was first introduced on nightly six months ago, and has not seen any changes since. The initial PR showed two existing pieces of code that would benefit from this API, and included a change inside the stdlib to use this.

Given the small surface area, predictable use, and no changes since introduction, I'd like to propose we stabilize this.

closes https://github.com/rust-lang/rust/issues/71983
r? `@Mark-Simulacrum`

## Links
 * [Initial implementation](https://github.com/rust-lang/rust/pull/70733)
 * [Motivation from #68700](https://github.com/rust-lang/rust/pull/68700#discussion_r396169064)
 * [Real world example in an executor](https://docs.rs/extreme/666.666.666666/src/extreme/lib.rs.html#13)
2021-01-31 01:47:20 +01:00
Jonas Schievink
1bf130519c
Rollup merge of #78044 - oberien:empty-seek, r=m-ou-se
Implement io::Seek for io::Empty

Fix #78029
2021-01-31 01:47:18 +01:00
pierwill
fabb332c1a Edit multiple error code Markdown files
Makes small edits to several error code files. Fixes some
missing punctuation. Changes some wording, grammar, and formatting
for clarity and readability.

Adds a link to the rustup book in E0658.
2021-01-30 15:57:46 -08:00
bors
b3897e3d13 Auto merge of #81560 - flip1995:clippyup, r=Manishearth
Update Clippy

r? `@Manishearth`

Biweekly Clippy update (2 days late)
2021-01-30 23:55:16 +00:00
kadmin
6946534d84 Remove const_in_array_rep_expr 2021-01-30 23:20:24 +00:00
Eric Huss
4749ad0912 Add some links to the cell docs. 2021-01-30 14:41:23 -08:00
b-naber
9946b54823 add suggestion for nested fields 2021-01-30 23:19:41 +01:00
oberien
f1cd17961c impl Seek for Empty
Fix #78029
2021-01-30 23:00:10 +01:00
Mara Bos
bef4ec2fc5
Bump as_mut_str_for_str stable version. 2021-01-30 22:10:25 +01:00
bors
04caa632dd Auto merge of #81565 - nikic:revert, r=nagisa
Revert dist-x86_64-linux update to Clang 11

This reverts commit cb6787ae82, reversing changes made to 0248c6f178.

The change causes errors when linking rustc shared objects with the binutils linker.

Fixes #81554.

r? `@Mark-Simulacrum`
2021-01-30 20:46:58 +00:00
bjorn3
84f24e530a Re-enable mir inlining for the sysroot 2021-01-30 21:26:37 +01:00
Mara Bos
fe4ac95cb8
Bump stable version of arc_mutate_strong_count 2021-01-30 21:08:30 +01:00
Ömer Sinan Ağacan
8b5187f7ea Fix an old FIXME in redundant paren lint
Referenced bug was fixed a while ago
2021-01-30 22:39:56 +03:00
bjorn3
7657ebccc8 Fix macOS build 2021-01-30 20:05:38 +01:00
Ömer Sinan Ağacan
5f1a7aa46d Add a test for #71202
Closes #71202
2021-01-30 21:54:01 +03:00
bjorn3
356d749952 Update Readme.md for the fixed abi compatibility 2021-01-30 19:38:57 +01:00
Mara Bos
3a0ae08ae2 Update clippy test output for panic macros. 2021-01-30 19:33:21 +01:00
Mara Bos
db85dac219 Update clippy test output for panic macros. 2021-01-30 19:33:21 +01:00
bjorn3
d34b5e2885 Rustup to rustc 1.51.0-nightly (b12290861 2021-01-29) 2021-01-30 19:29:02 +01:00
pierwill
adfb04fc4e Edit rustc_typeck top-level docs
Edit punctuation and wording in note on type variables
vs. type parameters.

Also add missing punctuation and two inter-doc links.
2021-01-30 10:04:19 -08:00
Ivan Tham
131ee07844
Remove extra trailing spaces 2021-01-31 01:36:15 +08:00
bjorn3
8faae2992a Add missing dir to .gitignore 2021-01-30 18:27:28 +01:00
Ivan Tham
6d7ef10b46
Fix docblock short code missing end whitespaces 2021-01-31 01:27:21 +08:00
Ivan Tham
d3048eea3c
Improve docblock readability on small screen 2021-01-31 01:19:29 +08:00
The8472
55d6247f52 Clarify that guarantees extend to other advancing iterator methods. 2021-01-30 18:07:48 +01:00
flip1995
ac912be984 Merge commit '95c0459217d1661edfa794c8bb122452b92fb485' into clippyup 2021-01-30 18:06:34 +01:00
flip1995
21758bf1fb
Merge commit '95c0459217d1661edfa794c8bb122452b92fb485' into clippyup 2021-01-30 18:06:34 +01:00
bors
95c0459217 Auto merge of #6654 - flip1995:no_lazy_static_regex, r=flip1995
No lazy static regex

r? `@llogiq`

#6500

regex is unnecessary for this lint (https://github.com/rust-lang/rust-clippy/pull/6500#discussion_r558555071)
lazy_static is unnecessary. The std lazy feature should be  used instead.

changelog: none
2021-01-30 16:49:45 +00:00
Ivan Tham
4a2a5f0780
Fix ascii art text wrapping in mobile
Fix #81377
2021-01-31 00:45:19 +08:00
Nikita Popov
8c7611caf0 Revert "Auto merge of #81489 - nikic:x86-64-dist-update, r=Mark-Simulacrum"
This reverts commit cb6787ae82, reversing
changes made to 0248c6f178.
2021-01-30 17:44:49 +01:00
flip1995
3874631600
Remove unknown_clippy_lints allow attribute 2021-01-30 17:43:20 +01:00
flip1995
797cf6554d
Get rid of regex and lazy_static dependencies 2021-01-30 17:43:00 +01:00
bors
fd20a8be0d Auto merge of #81453 - jumbatm:clashing-extern-decl-perf, r=nagisa
clashing_extern_declarations: Use symbol interning to avoid string alloc.

Use symbol interning as a hack to avoid allocating a string for every symbol name we store in the seen set. This hopefully addresses the minor perf regression described in https://github.com/rust-lang/rust/pull/80009#issuecomment-763526902.

r? `@nagisa`
2021-01-30 16:41:05 +00:00
bjorn3
f3447682d0 Handle PassMode::Cast in combination with #[repr(align)] 2021-01-30 17:26:51 +01:00
bjorn3
18de1b1fde
Merge pull request #1131 from bjorn3/abi_compat
Full abi compatibilty
2021-01-30 16:53:15 +01:00
bjorn3
6a739b3ae1
Merge pull request #1132 from Uriopass/master
Don't set RUSTFLAGS when no specific linker is needed
2021-01-30 16:31:48 +01:00
Paris DOUADY
3eb649c631 dont set rustflags when no specific linker needed 2021-01-30 16:25:48 +01:00
bors
4db76a6bcc Auto merge of #6653 - flip1995:rustup, r=flip1995
Rustup

changelog: Deprecate `unknown_clippy_lints` (integrated in `unknown_lints`)

r? `@ghost`
2021-01-30 14:53:30 +00:00
flip1995
60ab57e4eb
Bump nightly version -> 2021-01-30 2021-01-30 15:52:02 +01:00
flip1995
e2859437f9
Merge remote-tracking branch 'upstream/master' into rustup 2021-01-30 15:51:16 +01:00
Steve Heindel
642d27d40a Fix typo in E0759 2021-01-30 09:48:37 -05:00
J. Ryan Stinnett
7e3217845d Balance sidebar Deref cycle check with main content
The `Deref` cycle checks added as part of #80653 were "unbalanced" in the sense
that the main content code path checks for cycles _before_ descending, while the
sidebar checks _after_. Checking _before_ is correct, so this changes the
sidebar path to match the main content path.
2021-01-30 14:23:50 +00:00
Konrad Borowski
56c27360b1 Replace predecessor with range in collections documentation
Fixes #81548.
2021-01-30 14:24:06 +01:00
bjorn3
7fcf59f19e Add print on panic for predefining of a function 2021-01-30 14:19:13 +01:00
Ralf Jung
944237f6cd codegen: assume constants cannot fail to evaluate
also don't submit code to LLVM when the session has errors
2021-01-30 12:29:57 +01:00
bjorn3
2d6981756d Handle argument extension mode 2021-01-30 12:25:20 +01:00
bjorn3
b5ddb76f84 Force stack slot size to be a multiple of 16
This ensures that all stack slots are aligned to 16 bytes. Without this
linking against crates compiled with cg_llvm may cause a crash due to
simd instructions requiring a 16 byte alignment.
2021-01-30 12:11:40 +01:00