Commit Graph

159304 Commits

Author SHA1 Message Date
Matthias Krüger
b56e3d955a
Rollup merge of #91321 - matthewjasper:constaint-placeholders, r=jackh726
Handle placeholder regions in NLL type outlive constraints

Closes #76168
2021-12-02 22:16:09 +01:00
Matthias Krüger
444635df25
Rollup merge of #89954 - GuillaumeGomez:legacy-const-generic-doc, r=Amanieu
Fix legacy_const_generic doc arguments display

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

cc ``@Amanieu``
2021-12-02 22:16:08 +01:00
Chris Denton
49aa5baf36
Emphasise that an OsStr[ing] is not necessarily a platform string 2021-12-02 21:02:56 +00:00
Nicholas Nethercote
66153d76e2 Improve the comments in Symbol::interner. 2021-12-03 07:12:31 +11:00
Chris Denton
d8832425fc
Document file path case sensitivity 2021-12-02 19:48:10 +00:00
Eric Holk
0cb769347d Code review feedback
Add a note about `IntoFuture` in error messages where T is not a future.

Change await-into-future.rs to be a run-pass test.
2021-12-02 11:36:56 -08:00
Scott McMurray
b96b9b4093 Make array::{try_from_fn, try_map} and Iterator::try_find generic over Try
Fixes 85115

This only updates unstable functions.

`array::try_map` didn't actually exist before, despite the tracking issue 79711 still being open from the old PR 79713.
2021-12-02 11:23:50 -08:00
bors
acbe4443cc Auto merge of #91318 - eggyal:reduce-boilerplate-around-infallible-folders, r=jackh726
Reduce boilerplate around infallible folders

Further to https://github.com/rust-lang/rust/pull/91230#issuecomment-981059666

r? `@jackh726`
2021-12-02 19:12:00 +00:00
Chris Denton
6df44a389c
Document how last_os_error should be used 2021-12-02 17:53:57 +00:00
bors
d5d830a50f Auto merge of #7463 - ThibsG:find_any_7392, r=xFrednet
Fix `any()` not taking reference in `search_is_some` lint

`find` gives reference to the item, but `any` does not, so suggestion is broken in some specific cases.

Fixes: #7392

changelog: [`search_is_some`] Fix suggestion for `any()` not taking item by reference
2021-12-02 17:27:54 +00:00
vallentin
f26821c969
Fixed same_name_method description 2021-12-02 18:25:09 +01:00
Jack Huey
b77ed83ee2
Change to check-pass 2021-12-02 12:11:31 -05:00
Frank Steffahn
51875e3d5a Add additional test from rust issue number 91068 2021-12-02 17:46:57 +01:00
Martin Habovstiak
41e21aa1c2 Implement write() method for Box<MaybeUninit<T>>
This adds method similar to `MaybeUninit::write` main difference being
it returns owned `Box`. This can be used to elide copy from stack
safely, however it's not currently tested that the optimization actually
occurs.

Analogous methods are not provided for `Rc` and `Arc` as those need to
handle the possibility of sharing. Some version of them may be added in
the future.

This was discussed in #63291 which this change extends.
2021-12-02 17:18:34 +01:00
Alan Egerton
cf683e644f
Rename TypeFolderFallible to FallibleTypeFolder 2021-12-02 16:14:18 +00:00
eggyal
d79e17daf0
Update compiler/rustc_middle/src/ty/fold.rs
Co-authored-by: lcnr <rust@lcnr.de>
2021-12-02 16:14:16 +00:00
Alan Egerton
bfc434b6d0
Reduce boilerplate around infallible folders 2021-12-02 16:14:16 +00:00
Alan Egerton
db7295fa96
Remove no-longer used IdFunctor::map_id 2021-12-02 15:45:40 +00:00
bors
e5038e2099 Auto merge of #91455 - matthiaskrgr:rollup-gix2hy6, r=matthiaskrgr
Rollup of 4 iffy pull requests

Successful merges:

 - #89234 (Disallow non-c-like but "fieldless" ADTs from being casted to integer if they use arbitrary enum discriminant)
 - #91045 (Issue 90702 fix: Stop treating some crate loading failures as fatal errors)
 - #91394 (Bump stage0 compiler)
 - #91411 (Enable svh tests on msvc)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2021-12-02 14:53:20 +00:00
Matthias Krüger
822a058988
Rollup merge of #91411 - ChrisDenton:valid-paths, r=petrochenkov
Enable svh tests on msvc

These tests were ignored for msvc in #30778 because of additional notes that were being added for some reason. I'm fairly confident this has been fixed in the intervening years so lets try re-enabling these tests.

Fixes #31306
2021-12-02 15:52:04 +01:00
Matthias Krüger
d96ce3ea8e
Rollup merge of #91394 - Mark-Simulacrum:bump-stage0, r=pietroalbini
Bump stage0 compiler

r? `@pietroalbini` (or anyone else)
2021-12-02 15:52:03 +01:00
Matthias Krüger
87ca333210
Rollup merge of #91045 - mjptree:issue-90702-fix, r=petrochenkov
Issue 90702 fix: Stop treating some crate loading failures as fatal errors

Surface mulitple `extern crate` resolution errors at a time.

This is achieved by creating a dummy crate, instead of aborting directly after the resolution error. The `ExternCrateError` has been added to allow propagating the resolution error from `rustc_metadata` crate to the `rustc_resolve` with a minimal public surface. The `import_extern_crate` function is a block that was factored out from `build_reduced_graph_for_item` for better organization. The only added functionality made to it where the added error handling in the `process_extern_crate` call. The remaining bits in this function are the same as before.

Resolves #90702

r? `@petrochenkov`
2021-12-02 15:52:01 +01:00
Matthias Krüger
0666a33a6b
Rollup merge of #89234 - nbdd0121:discr, r=jackh726
Disallow non-c-like but "fieldless" ADTs from being casted to integer if they use arbitrary enum discriminant

Code like

```rust
#[repr(u8)]
enum Enum {
    Foo /* = 0 */,
    Bar(),
    Baz{}
}

let x = Enum::Bar() as u8;
```

seems to be unintentionally allowed so we couldn't disallow them now ~~, but we could disallow them if arbitrary enum discriminant is used before 1.56 hits stable~~ (stabilization was reverted).

Related: #88621

`@rustbot` label +T-lang
2021-12-02 15:52:00 +01:00
Chris Denton
7a145250c6
Document Windows TLS drop behaviour 2021-12-02 14:17:58 +00:00
Guillaume Gomez
d7528e2157 Rename CSS class main-inner into width-limiter 2021-12-02 14:21:32 +01:00
Guillaume Gomez
d7e998dd14 Rename ID "main" into "main-content" 2021-12-02 14:17:20 +01:00
Guillaume Gomez
1e55c31cbb Fix remaining bugs 2021-12-02 14:17:20 +01:00
bors
18bb8c61a9 Auto merge of #91354 - fee1-dead:const_env, r=spastorino
Cleanup: Eliminate ConstnessAnd

This is almost a behaviour-free change and purely a refactoring. "almost" because we appear to be using the wrong ParamEnv somewhere already, and this is now exposed by failing a test using the unstable `~const` feature.

We most definitely need to review all `without_const` and at some point should probably get rid of many of them by using `TraitPredicate` instead of `TraitRef`.

This is a continuation of https://github.com/rust-lang/rust/pull/90274.

r? `@oli-obk`

cc `@spastorino` `@ecstatic-morse`
2021-12-02 11:48:58 +00:00
Guillaume Gomez
5c75a4857e Add test for legacy-const-generic arguments 2021-12-02 11:27:01 +01:00
Guillaume Gomez
bd8d7e4a45 Transform const generics if the function uses rustc_legacy_const_generics 2021-12-02 11:27:01 +01:00
bors
392b0c5c25 Auto merge of #8057 - flip1995:rustup, r=flip1995
Rustup

r? `@ghost`

changelog: none
2021-12-02 09:36:28 +00:00
flip1995
ec57cc1455
Bump Clippy Version -> 0.1.59 2021-12-02 09:32:47 +00:00
flip1995
782b1a846e
Bump nightly version -> 2021-12-02 2021-12-02 09:32:38 +00:00
flip1995
abddd6c491
Merge remote-tracking branch 'upstream/master' into rustup 2021-12-02 09:32:09 +00:00
bors
d9baa36190 Auto merge of #91291 - GuillaumeGomez:const-deref-method, r=camelid
Fix const deref methods display

Fixes https://github.com/rust-lang/rust/issues/90855 (more information in the issue).

r? `@camelid`
2021-12-02 06:11:05 +00:00
Ralf Jung
b11d88006c disable tests in Miri that take too long 2021-12-01 22:48:59 -05:00
bors
a2b7b7891e Auto merge of #91003 - psumbera:sparc64-abi, r=nagisa
fix sparc64 ABI for aggregates with floating point members

Fixes #86163
2021-12-02 02:59:44 +00:00
Yacin Tmimi
ec46ffd981 Determine when new comment lines are needed for itemized blocks
Fixes 5088

Previously, rustfmt would add a new comment line anytime it reformatted
an itemized block within a comment when ``wrap_comments=true``. This
would lead to rustfmt adding empty comments with trailing whitespace.

Now, new comment lines are only added if the original comment spanned
multiple lines, if the comment needs to be wrapped, or if the comment
originally started with an empty comment line.
2021-12-01 18:31:10 -06:00
Jubilee Young
8003b04323 impl Op<&'_ RHS> for &'_ LHS 2021-12-01 15:45:01 -08:00
Jubilee Young
257fa7aa6d Drop splats for Simd<T, _>
Unfortunately, splatting impls currently break several crates.
Rust needs more time to review possible mitigations, so
drop the impls for the `impl Add<T> for Simd<T, _>` pattern, for now.
2021-12-01 15:40:53 -08:00
Jubilee Young
6094f22ceb impl unary.rs for Simd<{i,u}{8,16,32,64,size}, _>
In order to assure type soundness, these "base" impls
need to go directly on Simd<T, _> for every scalar type argument.
A bit of cleanup of ops.rs is still warranted.
2021-12-01 15:40:46 -08:00
bors
76938d64a4 Auto merge of #90446 - cjgillot:late-elided, r=jackh726
Lint elided lifetimes in path during lifetime resolution.

The lifetime elision lint is known to be brittle and can be redundant with later lifetime resolution errors. This PR aims to remove the redundancy by performing the lint after lifetime resolution.

This PR proposes to carry the information that an elision should be linted against by using a special `LifetimeName`. I am not certain this is the best solution, but it is certainly the easiest.

Fixes https://github.com/rust-lang/rust/issues/60199
Fixes https://github.com/rust-lang/rust/issues/55768
Fixes https://github.com/rust-lang/rust/issues/63110
Fixes https://github.com/rust-lang/rust/issues/71957
2021-12-01 23:22:43 +00:00
Noah Lev
fe88fcfa39 Migrate a test to use @snapshot
I'd been thinking about implementing snapshot testing for a while, but
This test is what finally made me do it. It really benefits from using
snapshot testing, so it's a good initial place to use `@snapshot`.
2021-12-01 15:12:12 -08:00
Noah Lev
e2846a779d Implement @snapshot check for htmldocck
This form of check allows performing snapshot tests (à la `src/test/ui`)
on rustdoc HTML output, making it easier to create and update tests.

See this Zulip thread [1] for more information about the motivation for
this change.

[1]: https://zulip-archive.rust-lang.org/stream/266220-rustdoc/topic/HTML.20snapshot.20tests.html#262651142
2021-12-01 15:12:10 -08:00
Michael
2ca9333011 Improve suggestion for extern crate self error message 2021-12-01 21:59:54 +00:00
David Tolnay
b516a8c5cb
Pretty print empty blocks as {} 2021-12-01 13:50:13 -08:00
Fabian Wolff
ba7374e517 Improve diagnostic for missing half of binary operator in if condition 2021-12-01 22:36:50 +01:00
Michael
62f4ce993e Stop treating extern crate loading failures as fatal errors 2021-12-01 21:04:13 +00:00
Michael
10b3a571d2 Factor out build reduced graph for extern crate 2021-12-01 21:04:12 +00:00
bors
48a5999fce Auto merge of #91433 - matthiaskrgr:rollup-118ql06, r=matthiaskrgr
Rollup of 5 pull requests

Successful merges:

 - #88502 (Add slice take methods)
 - #91313 (expand: Turn `ast::Crate` into a first class expansion target)
 - #91424 (Update LLVM with patches for better llvm-cov diagnostics)
 - #91425 (Include lint errors in error count for `-Ztreat-err-as-bug`)
 - #91430 (Add tests for `normalize-docs` overflow errors)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2021-12-01 20:14:07 +00:00