]> git.lizzy.rs Git - rust.git/log
rust.git
2 years agoAdd a few tests for `UnsafeCell`
inquisitivecrystal [Tue, 31 Aug 2021 23:32:01 +0000 (16:32 -0700)]
Add a few tests for `UnsafeCell`

2 years agoStabilize `UnsafeCell::raw_get()`
inquisitivecrystal [Tue, 31 Aug 2021 21:44:13 +0000 (14:44 -0700)]
Stabilize `UnsafeCell::raw_get()`

2 years agoAuto merge of #88535 - m-ou-se:rollup-jeusxbo, r=m-ou-se
bors [Tue, 31 Aug 2021 16:47:06 +0000 (16:47 +0000)]
Auto merge of #88535 - m-ou-se:rollup-jeusxbo, r=m-ou-se

Rollup of 10 pull requests

Successful merges:

 - #85017 (Add carrying_add, borrowing_sub, widening_mul, carrying_mul methods to integers)
 - #86362 (Avoid cloning LocalDecls)
 - #88391 (Fix json tuple struct enum variant )
 - #88399 (Disallow the aapcs CC on Aarch64)
 - #88418 (Allow `~const` bounds on trait assoc functions)
 - #88445 (Clean up the lowering of AST items)
 - #88495 (Add `TcpStream::set_linger` and `TcpStream::linger`)
 - #88501 (Use right span in prelude collision suggestions with macros. )
 - #88504 (Keep turbofish in prelude collision lint.)
 - #88524 (Remove unnecessary `mut` from udp doctests)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

2 years agoRollup merge of #88524 - soenkehahn:master, r=jyn514
Mara Bos [Tue, 31 Aug 2021 15:55:02 +0000 (17:55 +0200)]
Rollup merge of #88524 - soenkehahn:master, r=jyn514

Remove unnecessary `mut` from udp doctests

I don't think this `mut` is necessary, since both `recv_from` and `send_to` take `&self`.

2 years agoRollup merge of #88504 - m-ou-se:turbofish-please-stay, r=oli-obk
Mara Bos [Tue, 31 Aug 2021 15:55:00 +0000 (17:55 +0200)]
Rollup merge of #88504 - m-ou-se:turbofish-please-stay, r=oli-obk

Keep turbofish in prelude collision lint.

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

2 years agoRollup merge of #88501 - m-ou-se:prelude-collusion-oh-no-macros-help, r=estebank
Mara Bos [Tue, 31 Aug 2021 15:54:59 +0000 (17:54 +0200)]
Rollup merge of #88501 - m-ou-se:prelude-collusion-oh-no-macros-help, r=estebank

Use right span in prelude collision suggestions with macros.

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

r? `@estebank`

2 years agoRollup merge of #88495 - ibraheemdev:tcp-linger, r=joshtriplett
Mara Bos [Tue, 31 Aug 2021 15:54:58 +0000 (17:54 +0200)]
Rollup merge of #88495 - ibraheemdev:tcp-linger, r=joshtriplett

Add `TcpStream::set_linger` and `TcpStream::linger`

Adds methods for getting/setting the `SO_LINGER` option on TCP sockets. Behavior is consistent across Unix and Windows.

r? `@joshtriplett` (I noticed you've been reviewing net related PRs)

2 years agoRollup merge of #88445 - inquisitivecrystal:ast-lowering, r=cjgillot
Mara Bos [Tue, 31 Aug 2021 15:54:57 +0000 (17:54 +0200)]
Rollup merge of #88445 - inquisitivecrystal:ast-lowering, r=cjgillot

Clean up the lowering of AST items

This PR simplifies and improves `rustc_ast_lowering::item` in various minor ways. The reasons for the changes should mostly be self evident, though I'm happy to specifically explain anything if needed.

These changes used to be part of #88019, but I removed them after it was pointed out that some of my other changes to `rustc_ast_lowering` were unnecessary. It felt like a bad idea to clean up code which I didn't even need to touch anymore.

r? `@cjgillot`

2 years agoRollup merge of #88418 - fee1-dead:trait-assoc-tilde-const, r=oli-obk
Mara Bos [Tue, 31 Aug 2021 15:54:56 +0000 (17:54 +0200)]
Rollup merge of #88418 - fee1-dead:trait-assoc-tilde-const, r=oli-obk

Allow `~const` bounds on trait assoc functions

r? `@oli-obk`

2 years agoRollup merge of #88399 - nagisa:nagisa/aapcs-on-aarch, r=petrochenkov
Mara Bos [Tue, 31 Aug 2021 15:54:55 +0000 (17:54 +0200)]
Rollup merge of #88399 - nagisa:nagisa/aapcs-on-aarch, r=petrochenkov

Disallow the aapcs CC on Aarch64

This never really worked and makes LLVM assert.

2 years agoRollup merge of #88391 - GuillaumeGomez:fix-json-enum-variant, r=camelid,notriddle
Mara Bos [Tue, 31 Aug 2021 15:54:54 +0000 (17:54 +0200)]
Rollup merge of #88391 - GuillaumeGomez:fix-json-enum-variant, r=camelid,notriddle

Fix json tuple struct enum variant

Fixes #87887.

cc `@dsherret` `@camelid`

r? `@notriddle`

2 years agoRollup merge of #86362 - ptrojahn:insert_vars_and_temps, r=jackh726
Mara Bos [Tue, 31 Aug 2021 15:54:53 +0000 (17:54 +0200)]
Rollup merge of #86362 - ptrojahn:insert_vars_and_temps, r=jackh726

Avoid cloning LocalDecls

2 years agoRollup merge of #85017 - clarfonthey:carrying_widening, r=m-ou-se
Mara Bos [Tue, 31 Aug 2021 15:54:52 +0000 (17:54 +0200)]
Rollup merge of #85017 - clarfonthey:carrying_widening, r=m-ou-se

Add carrying_add, borrowing_sub, widening_mul, carrying_mul methods to integers

This comes in part from my own attempts to make (crude) big integer implementations, and also due to the stalled discussion in [RFC 2417](https://github.com/rust-lang/rfcs/pull/2417). My understanding is that changes like these are best offered directly as code and then an RFC can be opened if there needs to be more discussion before stabilisation. Since all of these methods are unstable from the start, I figured I might as well offer them now.

I tried looking into intrinsics, messed around with a few different implementations, and ultimately concluded that these are "good enough" implementations for now to at least put up some code and maybe start bikeshedding on a proper API for these.

For the `carrying_add` and `borrowing_sub`, I tried looking into potential architecture-specific code and realised that even using the LLVM intrinsics for `addcarry` and `subborrow` on x86 specifically, I was getting exactly the same assembly as the naive implementation using `overflowing_add` and `overflowing_sub`, although the LLVM IR did differ because of the architecture-specific code. Longer-term I think that they would be best suited to specific intrinsics as that would make optimisations easier (instructions like add-carry tend to use implicit flags, and thus can only be optimised if they're done one-after-another, and thus it would make the most sense to have compact intrinsics that can be merged together easily).

For `widening_mul` and `carrying_mul`, for now at least, I simply cast to the larger type and perform arithmetic that way, since we currently have no intrinsic that would work better for 128-bit integers. In the future, I also think that some form of intrinsic would work best to cover that case, but for now at least, I think that they're "good enough" for now.

The main reasoning for offering these directly to the standard library even though they're relatively niche optimisations is to help ensure that the code generated for them is optimal. Plus, these operations alone aren't enough to create big integer implementations, although they could help simplify the code required to do so and make it a bit more accessible for the average implementor.

That said, I 100% understand if any or all of these methods are not desired simply because of how niche they are. Up to you. 🤷🏻

2 years agodisable `tcp_linger` feature in `std`
Ibraheem Ahmed [Tue, 31 Aug 2021 15:19:39 +0000 (11:19 -0400)]
disable `tcp_linger` feature in `std`

Co-authored-by: Mara Bos <m-ou.se@m-ou.se>
2 years agoUse and_then instead of unwrap_or_default.
Mara Bos [Tue, 31 Aug 2021 14:24:58 +0000 (16:24 +0200)]
Use and_then instead of unwrap_or_default.

2 years agoAdd macro test for prelude collision suggestions.
Mara Bos [Mon, 30 Aug 2021 18:37:07 +0000 (20:37 +0200)]
Add macro test for prelude collision suggestions.

2 years agoUse right span in prelude collision suggestions with macros.
Mara Bos [Mon, 30 Aug 2021 18:34:26 +0000 (20:34 +0200)]
Use right span in prelude collision suggestions with macros.

2 years agoPull Span::find_ancestor_inside loop into its own function.
Mara Bos [Mon, 30 Aug 2021 18:17:12 +0000 (20:17 +0200)]
Pull Span::find_ancestor_inside loop into its own function.

2 years agoAvoid cloning LocalDecls
Paul Trojahn [Thu, 3 Jun 2021 17:24:48 +0000 (19:24 +0200)]
Avoid cloning LocalDecls

2 years agoAuto merge of #88527 - m-ou-se:rollup-az6xtc5, r=m-ou-se
bors [Tue, 31 Aug 2021 11:20:32 +0000 (11:20 +0000)]
Auto merge of #88527 - m-ou-se:rollup-az6xtc5, r=m-ou-se

Rollup of 14 pull requests

Successful merges:

 - #88394 (Document `std::env::current_exe` possible rename behaviour)
 - #88406 (Tait nest infer test)
 - #88408 (Add inference cycle TAIT test)
 - #88409 (Add auto trait leakage TAIT test)
 - #88413 (Add weird return types TAIT test)
 - #88450 (fix(rustc_parse): correct span in `maybe_whole_expr!`)
 - #88462 (rustdoc: Stop using resolver for macro loading)
 - #88465 (Adding examples to docs of `std::time` module)
 - #88486 (Remove unused arena macro args)
 - #88492 (Use MaybeUninit::write in functor.rs)
 - #88496 (Fix prelude collision lint suggestion for generics with lifetimes)
 - #88497 (Fix prelude collision suggestions for glob imported traits. )
 - #88503 (Warn when [T; N].into_iter() is ambiguous in the new edition. )
 - #88509 (Don't suggest extra <> in dyn suggestion.)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

2 years agoRollup merge of #88509 - m-ou-se:dyn-no-left-shift-right-shift-just-single-angle...
Mara Bos [Tue, 31 Aug 2021 08:41:30 +0000 (10:41 +0200)]
Rollup merge of #88509 - m-ou-se:dyn-no-left-shift-right-shift-just-single-angle-brackets-please-thanks, r=petrochenkov

Don't suggest extra <> in dyn suggestion.

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

2 years agoRollup merge of #88503 - m-ou-se:array-into-inter-ambiguous, r=cjgillot
Mara Bos [Tue, 31 Aug 2021 08:41:29 +0000 (10:41 +0200)]
Rollup merge of #88503 - m-ou-se:array-into-inter-ambiguous, r=cjgillot

Warn when [T; N].into_iter() is ambiguous in the new edition.

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

In https://github.com/rust-lang/rust/issues/88475, a situation was found where `[T; N].into_iter()` becomes *ambiguous* in the new edition. This is different than the case where `(&[T; N]).into_iter()` resolves differently, which was the only case handled by the `array_into_iter` lint. This is almost identical to the new-traits-in-the-prelude problem. Effectively, due to the array-into-iter hack disappearing in Rust 2021, we effectively added `IntoIterator` to the 'prelude' in Rust 2021 specifically for arrays.

This modifies the prelude collisions lint to detect that case and emit a `array_into_iter` lint in that case.

2 years agoRollup merge of #88497 - m-ou-se:prelude-collision-glob, r=nikomatsakis
Mara Bos [Tue, 31 Aug 2021 08:41:28 +0000 (10:41 +0200)]
Rollup merge of #88497 - m-ou-se:prelude-collision-glob, r=nikomatsakis

Fix prelude collision suggestions for glob imported traits.

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

cc `@nikomatsakis`

2 years agoRollup merge of #88496 - m-ou-se:prelude-collision-lifetime-generics, r=petrochenkov
Mara Bos [Tue, 31 Aug 2021 08:41:27 +0000 (10:41 +0200)]
Rollup merge of #88496 - m-ou-se:prelude-collision-lifetime-generics, r=petrochenkov

Fix prelude collision lint suggestion for generics with lifetimes

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

cc `@nikomatsakis`

2 years agoRollup merge of #88492 - est31:maybe_uninit_write, r=wesleywiser
Mara Bos [Tue, 31 Aug 2021 08:41:26 +0000 (10:41 +0200)]
Rollup merge of #88492 - est31:maybe_uninit_write, r=wesleywiser

Use MaybeUninit::write in functor.rs

MaybeUninit::write is stable as of 1.55.0.

2 years agoRollup merge of #88486 - bjorn3:better_arena_macro, r=jackh726
Mara Bos [Tue, 31 Aug 2021 08:41:25 +0000 (10:41 +0200)]
Rollup merge of #88486 - bjorn3:better_arena_macro, r=jackh726

Remove unused arena macro args

2 years agoRollup merge of #88465 - marcospb19:master, r=joshtriplett
Mara Bos [Tue, 31 Aug 2021 08:41:24 +0000 (10:41 +0200)]
Rollup merge of #88465 - marcospb19:master, r=joshtriplett

Adding examples to docs of `std::time` module

And adding missing link to `Duration` from `Instant`.

2 years agoRollup merge of #88462 - petrochenkov:macstore, r=jyn514
Mara Bos [Tue, 31 Aug 2021 08:41:23 +0000 (10:41 +0200)]
Rollup merge of #88462 - petrochenkov:macstore, r=jyn514

rustdoc: Stop using resolver for macro loading

r? `@jyn514`

2 years agoRollup merge of #88450 - notriddle:notriddle/maybe_whole_expr, r=cjgillot
Mara Bos [Tue, 31 Aug 2021 08:41:22 +0000 (10:41 +0200)]
Rollup merge of #88450 - notriddle:notriddle/maybe_whole_expr, r=cjgillot

fix(rustc_parse): correct span in `maybe_whole_expr!`

Fixes #87812

2 years agoRollup merge of #88413 - spastorino:weird-return-types-tait-test, r=oli-obk
Mara Bos [Tue, 31 Aug 2021 08:41:21 +0000 (10:41 +0200)]
Rollup merge of #88413 - spastorino:weird-return-types-tait-test, r=oli-obk

Add weird return types TAIT test

r? `@oli-obk`

Related to #86727

2 years agoRollup merge of #88409 - spastorino:autoleakage-tait-test, r=oli-obk
Mara Bos [Tue, 31 Aug 2021 08:41:20 +0000 (10:41 +0200)]
Rollup merge of #88409 - spastorino:autoleakage-tait-test, r=oli-obk

Add auto trait leakage TAIT test

r? `@oli-obk`

Related to #86727

2 years agoRollup merge of #88408 - spastorino:inference-cycle-tait-test, r=oli-obk
Mara Bos [Tue, 31 Aug 2021 08:41:19 +0000 (10:41 +0200)]
Rollup merge of #88408 - spastorino:inference-cycle-tait-test, r=oli-obk

Add inference cycle TAIT test

r? `@oli-obk`

Related to #86727

2 years agoRollup merge of #88406 - spastorino:tait-nest-infer-test, r=oli-obk
Mara Bos [Tue, 31 Aug 2021 08:41:18 +0000 (10:41 +0200)]
Rollup merge of #88406 - spastorino:tait-nest-infer-test, r=oli-obk

Tait nest infer test

r? `@oli-obk`

Related to #86727

2 years agoRollup merge of #88394 - ChrisDenton:patch-1, r=joshtriplett
Mara Bos [Tue, 31 Aug 2021 08:41:17 +0000 (10:41 +0200)]
Rollup merge of #88394 - ChrisDenton:patch-1, r=joshtriplett

Document `std::env::current_exe` possible rename behaviour

It might not be obvious that the "path of the current running executable" may (or may not) imply "at the time it was loaded".

This came up recently in chat so I thought it might be worth documenting.

2 years agoAuto merge of #88491 - RalfJung:miri, r=RalfJung
bors [Tue, 31 Aug 2021 08:32:31 +0000 (08:32 +0000)]
Auto merge of #88491 - RalfJung:miri, r=RalfJung

update miri

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

2 years agoAuto merge of #88467 - sexxi-goose:issue-88431, r=nikomatsakis
bors [Tue, 31 Aug 2021 06:01:52 +0000 (06:01 +0000)]
Auto merge of #88467 - sexxi-goose:issue-88431, r=nikomatsakis

2229: Drop any deref in move closure

Fixes: #88431
r? `@nikomatsakis`

2 years agoRemove unnecessary `mut` from udp doctests
Sönke Hahn [Tue, 31 Aug 2021 04:31:34 +0000 (22:31 -0600)]
Remove unnecessary `mut` from udp doctests

2 years agoAuto merge of #88414 - Aaron1011:guess-foreign-head-span, r=estebank
bors [Tue, 31 Aug 2021 03:34:22 +0000 (03:34 +0000)]
Auto merge of #88414 - Aaron1011:guess-foreign-head-span, r=estebank

Don't use `guess_head_span` in `predicates_of` for foreign span

Previously, the result of `predicates_of` for a foreign trait
would depend on the *current* state of the corresponding source
file in the foreign crate. This could lead to ICEs during incremental
compilation, since the on-disk contents of the upstream source file
could potentially change without the upstream crate being recompiled.

Additionally, this ensure that that the metadata we produce for a crate
only depends on its *compiled* upstream dependencies (e.g an rlib or
rmeta file), *not* the current on-disk state of the upstream crate
source files.

2 years agoAuto merge of #88100 - HTG-YT:edition2021-compopt-stabilization, r=m-ou-se
bors [Tue, 31 Aug 2021 01:03:55 +0000 (01:03 +0000)]
Auto merge of #88100 - HTG-YT:edition2021-compopt-stabilization, r=m-ou-se

Make Edition 2021 Stable

An item of #87959.

This is an "on-demand" pull request, which means it will be merged when it is the right time to.

2 years agoAuto merge of #88369 - lcnr:cec-rename, r=oli-obk
bors [Mon, 30 Aug 2021 22:21:01 +0000 (22:21 +0000)]
Auto merge of #88369 - lcnr:cec-rename, r=oli-obk

update const generics feature gates

**tl;dr: split const generics into three features: `adt_const_params`, `const_generics_defaults` and `generic_const_exprs`**

continuing the work of `@BoxyUwU` in #88324, this PR
- renames `feature(const_evaluatable_checked)` to `feature(generic_const_exprs)` which now doesn't need any other feature gate to work. Previously `feature(const_evaluatable_checked)` was only useful in combination with `feature(const_generics)`.
- completely removes `feature(lazy_normalization_consts)`. This feature only supplied the parents generics to anonymous constants, which is pretty useless as generic anon consts are only allowed with `feature(generic_const_exprs)` anyways.
- moves the ability to use additional const param types from `feature(const_generics)` into `feature(adt_const_params)`. As `feature(const_generics)` is now mostly useless without `feature(generic_const_exprs)` we also remove that feature flag.
- updates tests, removing duplicates and unnecessary revisions in some cases and also deletes all unused `*.stderr` files.

I not also remove the ordering restriction for const and type parameters if any of the three const generics features is active.
This ordering restriction feels like the only "real" use of the current `feature(const_generics)` right now so this change isn't a perfect solution, but as I intend to stabilize the ordering - and `feature(const_generics_defaults)` -  in the very near future, I think this is acceptable for now.

---

cc `@rust-lang/project-const-generics` about the new feature names and this change in general.

I don't think we need any external approval for this change but I do intend to publish an update to the const generics tracking issue the day this PR lands, so I don't want this merged yet.

Apologies to whoever ends up reviewing this PR :sweat_smile: :heart:

r? rust-lang/project-const-generics

2 years agoTurn to ifs into a match.
Mara Bos [Mon, 30 Aug 2021 21:57:16 +0000 (23:57 +0200)]
Turn to ifs into a match.

2 years agoAdd test for extra <> in dyn suggestion.
Mara Bos [Mon, 30 Aug 2021 20:34:46 +0000 (22:34 +0200)]
Add test for extra <> in dyn suggestion.

2 years agoDon't suggest extra <> in dyn suggestion.
Mara Bos [Mon, 30 Aug 2021 20:34:34 +0000 (22:34 +0200)]
Don't suggest extra <> in dyn suggestion.

2 years agoTest that turbofish does not swim away in prelude collusion suggestion.
Mara Bos [Mon, 30 Aug 2021 19:55:30 +0000 (21:55 +0200)]
Test that turbofish does not swim away in prelude collusion suggestion.

2 years agoKeep turbofish in prelude collision lint.
Mara Bos [Mon, 30 Aug 2021 19:55:10 +0000 (21:55 +0200)]
Keep turbofish in prelude collision lint.

2 years agoAdd test for 2021 ambiguous [T; N].into_iter().
Mara Bos [Mon, 30 Aug 2021 19:23:56 +0000 (21:23 +0200)]
Add test for 2021 ambiguous [T; N].into_iter().

2 years agoWarn when [T; N].into_iter() is ambiguous in the new edition.
Mara Bos [Mon, 30 Aug 2021 19:19:24 +0000 (21:19 +0200)]
Warn when [T; N].into_iter() is ambiguous in the new edition.

2 years agoNo longer pass -Z unstable-options for edition 2021 in test.
Mara Bos [Mon, 30 Aug 2021 13:42:45 +0000 (15:42 +0200)]
No longer pass -Z unstable-options for edition 2021 in test.

2 years agoUpdate test output for stable Rust 2021.
Mara Bos [Mon, 30 Aug 2021 13:41:26 +0000 (15:41 +0200)]
Update test output for stable Rust 2021.

2 years agoAuto merge of #88466 - sexxi-goose:issue-88372, r=nikomatsakis
bors [Mon, 30 Aug 2021 18:27:54 +0000 (18:27 +0000)]
Auto merge of #88466 - sexxi-goose:issue-88372, r=nikomatsakis

2229: Handle update to capture kind properly

Fixes: #88372
r? `@nikomatsakis`

2 years agoclean up `c::linger` conversion
ibraheemdev [Mon, 30 Aug 2021 18:00:21 +0000 (14:00 -0400)]
clean up `c::linger` conversion

2 years agoadd `TcpStream::set_linger` and `TcpStream::linger`
ibraheemdev [Mon, 30 Aug 2021 17:02:15 +0000 (13:02 -0400)]
add `TcpStream::set_linger` and `TcpStream::linger`

2 years agoAdd test for glob imported prelude collision trait.
Mara Bos [Mon, 30 Aug 2021 17:21:40 +0000 (19:21 +0200)]
Add test for glob imported prelude collision trait.

2 years agoFix prelude collision suggestions for glob imported traits.
Mara Bos [Mon, 30 Aug 2021 17:21:22 +0000 (19:21 +0200)]
Fix prelude collision suggestions for glob imported traits.

2 years agoAdd and update tests.
Mara Bos [Mon, 30 Aug 2021 17:02:29 +0000 (19:02 +0200)]
Add and update tests.

2 years agoFix lifetime generics in <T<..> as Trait>::try_from suggestion.
Mara Bos [Mon, 30 Aug 2021 17:01:34 +0000 (19:01 +0200)]
Fix lifetime generics in <T<..> as Trait>::try_from suggestion.

2 years agoFix lifetime generics in <T as Trait<..>>::try_from suggestion.
Mara Bos [Mon, 30 Aug 2021 17:01:34 +0000 (19:01 +0200)]
Fix lifetime generics in <T as Trait<..>>::try_from suggestion.

2 years agoUse MaybeUninit::write in functor.rs
est31 [Mon, 30 Aug 2021 15:23:08 +0000 (17:23 +0200)]
Use MaybeUninit::write in functor.rs

MaybeUninit::write is stable as of 1.55.0.

2 years agoupdate miri
Ralf Jung [Mon, 30 Aug 2021 15:12:39 +0000 (11:12 -0400)]
update miri

2 years agoUpdate LATEST_STABLE_EDITION to 2021.
Mara Bos [Mon, 30 Aug 2021 13:33:09 +0000 (15:33 +0200)]
Update LATEST_STABLE_EDITION to 2021.

2 years agoupdate rustc cmdargs markdown section
HTG-YT [Wed, 18 Aug 2021 01:05:48 +0000 (09:05 +0800)]
update rustc cmdargs markdown section

2 years agomake edition 2021 stable
HTG-YT [Tue, 17 Aug 2021 01:42:23 +0000 (09:42 +0800)]
make edition 2021 stable

2 years agoRemove unused arena macro args
bjorn3 [Mon, 30 Aug 2021 11:09:38 +0000 (13:09 +0200)]
Remove unused arena macro args

2 years agoDisallow the aapcs CC on Aarch64
Simonas Kazlauskas [Fri, 27 Aug 2021 16:36:18 +0000 (19:36 +0300)]
Disallow the aapcs CC on Aarch64

This never really worked and makes LLVM assert.

2 years agoAuto merge of #87680 - mati865:stacker-psm-update, r=Mark-Simulacrum,nagisa
bors [Mon, 30 Aug 2021 10:42:53 +0000 (10:42 +0000)]
Auto merge of #87680 - mati865:stacker-psm-update, r=Mark-Simulacrum,nagisa

Update stacker and psm crates

Primarily to include https://github.com/rust-lang/stacker/pull/54

2 years ago`feature(const_param_types)` -> `feature(adt_const_params)`
lcnr [Mon, 30 Aug 2021 08:59:53 +0000 (10:59 +0200)]
`feature(const_param_types)` -> `feature(adt_const_params)`

2 years agoallow unordered const/ty params if any cg feature is active
lcnr [Thu, 26 Aug 2021 19:12:02 +0000 (21:12 +0200)]
allow unordered const/ty params if any cg feature is active

2 years ago`feature(const_generics)` -> `feature(const_param_types)`
lcnr [Fri, 27 Aug 2021 16:04:57 +0000 (18:04 +0200)]
`feature(const_generics)` -> `feature(const_param_types)`

2 years agoremove lazy_normalization_consts
Ellen [Wed, 25 Aug 2021 12:31:18 +0000 (13:31 +0100)]
remove lazy_normalization_consts

2 years agorename const_evaluatable_checked to generic_const_exprs
Ellen [Wed, 25 Aug 2021 09:21:39 +0000 (10:21 +0100)]
rename const_evaluatable_checked to generic_const_exprs

:sparkles:

2 years agoAuto merge of #88281 - asquared31415:asm-docs, r=Amanieu
bors [Mon, 30 Aug 2021 07:54:11 +0000 (07:54 +0000)]
Auto merge of #88281 - asquared31415:asm-docs, r=Amanieu

Update unstable docs for `asm!` macro

This adds documentation that SPIR-V is supported, expands on the restrictions for labels, and has some minor cleanups or clarifications.

r? `@joshtriplett`

2 years agoAuto merge of #88456 - inquisitivecrystal:private-macro, r=jyn514
bors [Mon, 30 Aug 2021 05:23:54 +0000 (05:23 +0000)]
Auto merge of #88456 - inquisitivecrystal:private-macro, r=jyn514

Fix: don't document private macros by default

As part of #88019, I made it so private macros are documented in `--document-private-items` mode. Unfortunately, it appears that I also accidentally made them be documented when *not* in `--document-private-items` mode. This PR fixes that and adds a regression test.

r? `@jyn514` (I hope you don't mind that I keep sending PRs your way)

Fixes #88453.

2 years agoClean up the lowering of AST items
inquisitivecrystal [Sat, 28 Aug 2021 23:22:12 +0000 (16:22 -0700)]
Clean up the lowering of AST items

2 years agoAdding examples to docs of std::time module
João M. Bezerra [Sun, 29 Aug 2021 18:58:20 +0000 (15:58 -0300)]
Adding examples to docs of std::time module

And adding missing link to Duration from Instant

2 years agoAuto merge of #88337 - eddyb:field-failure-is-not-an-option, r=nagisa
bors [Sun, 29 Aug 2021 22:54:26 +0000 (22:54 +0000)]
Auto merge of #88337 - eddyb:field-failure-is-not-an-option, r=nagisa

rustc_target: `TyAndLayout::field` should never error.

This refactor (making `TyAndLayout::field` return `TyAndLayout` without any `Result` around it) is based on a simple observation, regarding `TyAndLayout::field`:

If `cx.layout_of(ty)` succeeds (for some `cx` and `ty`), then `.field(cx, i)` on the resulting `TyAndLayout` should *always* succeed in computing `cx.layout_of(field_ty)` (where `field_ty` is the type of the `i`th field of `ty`).

The reason for this is that no matter which field is chosen, `cx.layout_of(field_ty)` *will have already been computed*, as part of computing `cx.layout_of(ty)`, as we cannot determine the layout of *any* type without considering the layouts of *all* of its fields.

And so it should be fine to turn any errors into ICEs, since they likely indicate a `cx` mismatch, or some other edge case that is due to a compiler bug (as opposed to ever being an user-facing error).

<hr/>

Each commit should probably be reviewed separately, though note that there's some `where` clauses (in `rustc_target::abi::call::*`) that change in most commits.

cc `@nagisa` `@oli-obk`

2 years agorustc_target: remove `LayoutOf` bound from `TyAbiInterface`.
Eduard-Mihai Burtescu [Wed, 25 Aug 2021 15:15:09 +0000 (18:15 +0300)]
rustc_target: remove `LayoutOf` bound from `TyAbiInterface`.

2 years agorustc_target: `TyAndLayout::field` should never error.
Eduard-Mihai Burtescu [Wed, 25 Aug 2021 15:05:10 +0000 (18:05 +0300)]
rustc_target: `TyAndLayout::field` should never error.

2 years ago2229: Drop any deref in move closure
Aman Arora [Sun, 29 Aug 2021 20:28:58 +0000 (16:28 -0400)]
2229: Drop any deref in move closure

2 years agoAuto merge of #88280 - sexxi-goose:non-exhaustive, r=nikomatsakis
bors [Sun, 29 Aug 2021 20:27:14 +0000 (20:27 +0000)]
Auto merge of #88280 - sexxi-goose:non-exhaustive, r=nikomatsakis

Handle match statements with non exhaustive variants in closures

This PR ensures that the behavior for match statements with non exhaustive variants is the same inside and outside closures.

If we have a non-exhaustive SingleVariant which is defined in a different crate, then we should handle the case the same way we would handle a MultiVariant: borrow the match discriminant.

Closes https://github.com/rust-lang/project-rfc-2229/issues/59
r? `@nikomatsakis`

2 years ago2229: Handle update to capture kind properly
Aman Arora [Sun, 29 Aug 2021 19:37:03 +0000 (15:37 -0400)]
2229: Handle update to capture kind properly

2 years agoAuto merge of #88262 - klensy:pprust-cow, r=nagisa
bors [Sun, 29 Aug 2021 17:46:29 +0000 (17:46 +0000)]
Auto merge of #88262 - klensy:pprust-cow, r=nagisa

Cow'ify some pprust methods

Reduce number of potential needless de/allocations by using `Cow<'static, str>` instead of explicit `String` type.

2 years agorustdoc: Stop using resolver for macro loading
Vadim Petrochenkov [Sun, 29 Aug 2021 15:13:29 +0000 (18:13 +0300)]
rustdoc: Stop using resolver for macro loading

2 years agoAuto merge of #88461 - GuillaumeGomez:rollup-khgu0eb, r=GuillaumeGomez
bors [Sun, 29 Aug 2021 15:18:58 +0000 (15:18 +0000)]
Auto merge of #88461 - GuillaumeGomez:rollup-khgu0eb, r=GuillaumeGomez

Rollup of 13 pull requests

Successful merges:

 - #80543 (Notify when an `I-prioritize` issue is closed or reopened)
 - #83251 (Suggestion for call on immutable binding of mutable type)
 - #85534 (add rustc-demangle assertion on mangled symbol)
 - #88173 (Refactor Markdown length-limited summary implementation)
 - #88349 (Add const and static TAIT tests)
 - #88357 (add unsized coercion test)
 - #88381 (Handle stack_t.ss_sp type change for DragonFlyBSD)
 - #88387 (Remove vestigial rustfix tests.)
 - #88396 (Bump vulnerable crates)
 - #88407 (Fix formatting in release notes from 52a988344bce11)
 - #88411 (Remove `Session.if_let_suggestions`)
 - #88417 (RELEASES.md: fix broken link)
 - #88419 (Fix code blocks color in Ayu theme)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

2 years agoRollup merge of #88419 - GuillaumeGomez:code-blocks-colors, r=camelid,notriddle
Guillaume Gomez [Sun, 29 Aug 2021 14:25:37 +0000 (16:25 +0200)]
Rollup merge of #88419 - GuillaumeGomez:code-blocks-colors, r=camelid,notriddle

Fix code blocks color in Ayu theme

Fixes #88415.

cc `@camelid`
r? `@notriddle`

2 years agoRollup merge of #88417 - xu-cheng:rel-fix-link, r=jyn514
Guillaume Gomez [Sun, 29 Aug 2021 14:25:36 +0000 (16:25 +0200)]
Rollup merge of #88417 - xu-cheng:rel-fix-link, r=jyn514

RELEASES.md: fix broken link

2 years agoRollup merge of #88411 - Aaron1011:remove-session-if-let, r=estebank
Guillaume Gomez [Sun, 29 Aug 2021 14:25:35 +0000 (16:25 +0200)]
Rollup merge of #88411 - Aaron1011:remove-session-if-let, r=estebank

Remove `Session.if_let_suggestions`

We can instead if either the LHS or RHS types contain
`TyKind::Error`. In addition to covering the case where
we would have previously updated `if_let_suggestions`, this might
also prevent redundant errors in other cases as well.

2 years agoRollup merge of #88407 - nebkor:release-note-1.55x2, r=Mark-Simulacrum
Guillaume Gomez [Sun, 29 Aug 2021 14:25:34 +0000 (16:25 +0200)]
Rollup merge of #88407 - nebkor:release-note-1.55x2, r=Mark-Simulacrum

Fix formatting in release notes from 52a988344bce11

I neglected to add a line that allowed the `[cargo/9663]` short-hand to resolve to an actual link in the rendered markdown on github.

2 years agoRollup merge of #88396 - klensy:bump-deps-vuln, r=Mark-Simulacrum
Guillaume Gomez [Sun, 29 Aug 2021 14:25:33 +0000 (16:25 +0200)]
Rollup merge of #88396 - klensy:bump-deps-vuln, r=Mark-Simulacrum

Bump vulnerable crates

crossbeam-deque v0.7.3 -> v0.7.4:
    https://rustsec.org/advisories/RUSTSEC-2021-0093
    https://github.com/crossbeam-rs/crossbeam/pull/728/files

openssl-src v111.15.0+1.1.1k -> v111.16.0+1.1.1l:
    https://rustsec.org/advisories/RUSTSEC-2021-0097
    https://rustsec.org/advisories/RUSTSEC-2021-0098
    https://www.openssl.org/news/vulnerabilities-1.1.1.html

tar v0.4.35 -> v0.4.37:
    https://rustsec.org/advisories/RUSTSEC-2021-0080
    updated to 0.4.37 as there breaking change in 0.4.36: https://github.com/alexcrichton/tar-rs/pull/260

2 years agoRollup merge of #88387 - ehuss:remove-rustfix-tests, r=Mark-Simulacrum
Guillaume Gomez [Sun, 29 Aug 2021 14:25:32 +0000 (16:25 +0200)]
Rollup merge of #88387 - ehuss:remove-rustfix-tests, r=Mark-Simulacrum

Remove vestigial rustfix tests.

The directory `src/test/rustfix` is not actually tested. It looks like a mistake was made when rustfix tests were originally introduced in #50084.  In commit 6f2d023028bbd666be2c211b923b32faf10a41da they were moved to `src/test/ui`, but the tests in the original directory weren't deleted.

2 years agoRollup merge of #88381 - rtzoeller:dfly_stack_t_ss_sp_void, r=dtolnay
Guillaume Gomez [Sun, 29 Aug 2021 14:25:31 +0000 (16:25 +0200)]
Rollup merge of #88381 - rtzoeller:dfly_stack_t_ss_sp_void, r=dtolnay

Handle stack_t.ss_sp type change for DragonFlyBSD

stack_t.ss_sp is now c_void on DragonFlyBSD, like the rest of the BSDs.

Changed in https://github.com/rust-lang/libc/commit/02922ef7504906589d02c2e4d97d1172fa247cc3.

2 years agoRollup merge of #88357 - lcnr:stabilize-relaxed_struct_unsize, r=Mark-Simulacrum
Guillaume Gomez [Sun, 29 Aug 2021 14:25:30 +0000 (16:25 +0200)]
Rollup merge of #88357 - lcnr:stabilize-relaxed_struct_unsize, r=Mark-Simulacrum

add unsized coercion test

we had no tests in our test suite for this case

2 years agoRollup merge of #88349 - spastorino:const-static-types-tait-test, r=oli-obk
Guillaume Gomez [Sun, 29 Aug 2021 14:25:29 +0000 (16:25 +0200)]
Rollup merge of #88349 - spastorino:const-static-types-tait-test, r=oli-obk

Add const and static TAIT tests

r? ``@oli-obk``

Related to #86727

2 years agoRollup merge of #88173 - camelid:refactor-markdown-length-limit, r=GuillaumeGomez
Guillaume Gomez [Sun, 29 Aug 2021 14:25:28 +0000 (16:25 +0200)]
Rollup merge of #88173 - camelid:refactor-markdown-length-limit, r=GuillaumeGomez

Refactor Markdown length-limited summary implementation

This PR is a new approach to #79749.

This PR refactors the implementation of `markdown_summary_with_limit()`,
separating the logic of determining when the limit has been reached from
the actual rendering process.

The main advantage of the new approach is that it guarantees that all
HTML tags are closed, whereas the previous implementation could generate
tags that were never closed. It also ensures that no empty tags are
generated (e.g., `<em></em>`).

The new implementation consists of a general-purpose struct
`HtmlWithLimit` that manages the length-limiting logic and a function
`markdown_summary_with_limit()` that renders Markdown to HTML using the
struct.

r? `@GuillaumeGomez`

2 years agoRollup merge of #85534 - csmoe:demagnle-assert, r=michaelwoerister
Guillaume Gomez [Sun, 29 Aug 2021 14:25:28 +0000 (16:25 +0200)]
Rollup merge of #85534 - csmoe:demagnle-assert, r=michaelwoerister

add rustc-demangle assertion on mangled symbol

cc https://github.com/rust-lang/rust/issues/60705#issuecomment-844880365
r? `@michaelwoerister`

2 years agoRollup merge of #83251 - estebank:issue-83241, r=oli-obk
Guillaume Gomez [Sun, 29 Aug 2021 14:25:26 +0000 (16:25 +0200)]
Rollup merge of #83251 - estebank:issue-83241, r=oli-obk

Suggestion for call on immutable binding of mutable type

When calling a method requiring a mutable self borrow on an inmutable
to a mutable borrow of the type, suggest making the binding mutable.

Fix #83241.

2 years agoRollup merge of #80543 - LeSeulArtichaut:notify-close, r=spastorino
Guillaume Gomez [Sun, 29 Aug 2021 14:25:26 +0000 (16:25 +0200)]
Rollup merge of #80543 - LeSeulArtichaut:notify-close, r=spastorino

Notify when an `I-prioritize` issue is closed or reopened

Companion PR to rust-lang/triagebot#1078, blocked on that PR.
r? ``@spastorino`` cc ``@rust-lang/wg-prioritization``

2 years agoAdd rustdonc-json tests for enum variants
Guillaume Gomez [Fri, 27 Aug 2021 12:58:50 +0000 (14:58 +0200)]
Add rustdonc-json tests for enum variants

2 years agoUse the correct type for Enum variant tuples
Guillaume Gomez [Fri, 27 Aug 2021 12:43:22 +0000 (14:43 +0200)]
Use the correct type for Enum variant tuples

2 years agoAuto merge of #88208 - petrochenkov:lowspan, r=Aaron1011
bors [Sun, 29 Aug 2021 12:38:05 +0000 (12:38 +0000)]
Auto merge of #88208 - petrochenkov:lowspan, r=Aaron1011

ast_lowering: Introduce `lower_span` for catching all spans entering HIR

This PR cherry-picks the `fn lower_span` change from https://github.com/rust-lang/rust/pull/84373.
I also introduced `fn lower_ident` for lowering spans in identifiers, and audited places where HIR structures with spans or identifiers are constructed and added a few missing `lower_span`s/`lower_ident`s.

Having a hook for spans entering HIR can be useful for things other than https://github.com/rust-lang/rust/pull/84373, e.g. https://github.com/rust-lang/rust/issues/35148.
I also want to check whether this change causes perf regressions due to some accidental inlining issues.

r? `@cjgillot`

2 years agoAuto merge of #88312 - jackh726:issue-87748, r=nikomatsakis
bors [Sun, 29 Aug 2021 10:12:54 +0000 (10:12 +0000)]
Auto merge of #88312 - jackh726:issue-87748, r=nikomatsakis

Treat types in unnormalized function signatures as well-formed

Fixes #87748

r? `@nikomatsakis`