]> git.lizzy.rs Git - rust.git/log
rust.git
2 years agoMore nll revisions
Jack Huey [Sat, 2 Apr 2022 02:12:17 +0000 (22:12 -0400)]
More nll revisions

2 years agoMove some tests with compare-mode=nll output to revisions
Jack Huey [Fri, 1 Apr 2022 23:51:50 +0000 (19:51 -0400)]
Move some tests with compare-mode=nll output to revisions

2 years agoAuto merge of #95526 - Dylan-DPC:rollup-0ikl5l5, r=Dylan-DPC
bors [Thu, 31 Mar 2022 17:45:26 +0000 (17:45 +0000)]
Auto merge of #95526 - Dylan-DPC:rollup-0ikl5l5, r=Dylan-DPC

Rollup of 5 pull requests

Successful merges:

 - #91416 (Specialize infinite-type "insert some indirection" suggestion for Option)
 - #95384 (Update target_has_atomic documentation for stabilization)
 - #95517 (small rustc_borrowck cleanup)
 - #95520 (Fix typos in core::ptr docs)
 - #95523 (remove unused field from `infcx`)

Failed merges:

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

2 years agoRollup merge of #95523 - lcnr:yeet-unused-field, r=oli-obk
Dylan DPC [Thu, 31 Mar 2022 15:29:56 +0000 (17:29 +0200)]
Rollup merge of #95523 - lcnr:yeet-unused-field, r=oli-obk

remove unused field from `infcx`

r? `@oli-obk` did we stop needing that for opaque types?

2 years agoRollup merge of #95520 - rust-lang:ptrtypo, r=lcnr
Dylan DPC [Thu, 31 Mar 2022 15:29:55 +0000 (17:29 +0200)]
Rollup merge of #95520 - rust-lang:ptrtypo, r=lcnr

Fix typos in core::ptr docs

2 years agoRollup merge of #95517 - lcnr:rustc_borrowck-misc, r=jackh726
Dylan DPC [Thu, 31 Mar 2022 15:29:54 +0000 (17:29 +0200)]
Rollup merge of #95517 - lcnr:rustc_borrowck-misc, r=jackh726

small rustc_borrowck cleanup

r? `@jackh726` because of the second commit, seems like that comment was missed in #91243

2 years agoRollup merge of #95384 - ehuss:doc-target_has_atomic-stabilized, r=Dylan-DPC
Dylan DPC [Thu, 31 Mar 2022 15:29:53 +0000 (17:29 +0200)]
Rollup merge of #95384 - ehuss:doc-target_has_atomic-stabilized, r=Dylan-DPC

Update target_has_atomic documentation for stabilization

`cfg(target_has_atomic)` was stabilized in #93824, but this small note in the docs was not updated at the time.

2 years agoRollup merge of #91416 - compiler-errors:infinite-ty-option-box, r=estebank
Dylan DPC [Thu, 31 Mar 2022 15:29:52 +0000 (17:29 +0200)]
Rollup merge of #91416 - compiler-errors:infinite-ty-option-box, r=estebank

Specialize infinite-type "insert some indirection" suggestion for Option

Suggest `Option<Box<_>>` instead of `Box<Option<_>>` for infinitely-recursive members of a struct.

Not sure if I can get the span of the generic subty of the Option so I can make this a `+++`-style suggestion. The current output is a tiny bit less fancy looking than the original suggestion.

Should I limit the specialization to just `Option<Box<TheOuterStruct>>`? Because right now it applies to all `Option` members in the struct that are returned by `Representability::SelfRecursive`.

Fixes #91402

r? `@estebank`
(since you wrote the original suggestion and are definitely most familiar with it!)

2 years agoAuto merge of #90204 - cjgillot:owner-pull, r=michaelwoerister
bors [Thu, 31 Mar 2022 15:20:59 +0000 (15:20 +0000)]
Auto merge of #90204 - cjgillot:owner-pull, r=michaelwoerister

Make lowering pull-based

~Based on https://github.com/rust-lang/rust/pull/90451~
Part of https://github.com/rust-lang/rust/pull/88186

The current lowering code visits all the item-likes in the AST in order, and lowers them one by one.
This PR changes it to index the AST and then proceed to lowering on-demand. This is closer to the logic of query-based lowering.

2 years agoremove unused field from `infcx`
lcnr [Thu, 31 Mar 2022 14:52:47 +0000 (16:52 +0200)]
remove unused field from `infcx`

2 years agoaddress comments, add test for shadowed Box type
Michael Goulet [Fri, 18 Feb 2022 03:49:45 +0000 (19:49 -0800)]
address comments, add test for shadowed Box type

2 years agoSpecialize suggestion for Option<T>
Michael Goulet [Wed, 1 Dec 2021 05:30:05 +0000 (21:30 -0800)]
Specialize suggestion for Option<T>

2 years agoFix typos in core::ptr docs
bstrie [Thu, 31 Mar 2022 13:56:36 +0000 (09:56 -0400)]
Fix typos in core::ptr docs

2 years agoupdate comment
lcnr [Thu, 31 Mar 2022 13:41:52 +0000 (15:41 +0200)]
update comment

2 years agoAuto merge of #95511 - Dylan-DPC:rollup-4n880fd, r=Dylan-DPC
bors [Thu, 31 Mar 2022 12:55:13 +0000 (12:55 +0000)]
Auto merge of #95511 - Dylan-DPC:rollup-4n880fd, r=Dylan-DPC

Rollup of 5 pull requests

Successful merges:

 - #95445 (Don't build the full compiler before running unit tests)
 - #95470 (Fix last rustdoc-gui spurious test)
 - #95478 (Add note to the move size diagnostic)
 - #95495 (Remove unneeded `to_string` call)
 - #95505 (Fix library/std compilation on openbsd.)

Failed merges:

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

2 years agoRecord item-likes in ItemLowerer.
Camille GILLOT [Thu, 15 Jul 2021 15:41:48 +0000 (17:41 +0200)]
Record item-likes in ItemLowerer.

2 years agoCreate a new LoweringContext for each item-like.
Camille GILLOT [Thu, 15 Jul 2021 14:40:41 +0000 (16:40 +0200)]
Create a new LoweringContext for each item-like.

2 years agoMake lowering pull-based.
Camille GILLOT [Wed, 14 Jul 2021 23:18:39 +0000 (01:18 +0200)]
Make lowering pull-based.

2 years agoImplement with_parent_item_lifetime_defs on ItemLowerer.
Camille GILLOT [Wed, 14 Jul 2021 18:28:56 +0000 (20:28 +0200)]
Implement with_parent_item_lifetime_defs on ItemLowerer.

2 years agoMove lower_crate outside the LoweringContext.
Camille GILLOT [Wed, 14 Jul 2021 19:00:02 +0000 (21:00 +0200)]
Move lower_crate outside the LoweringContext.

2 years agoStop emitting lints during lowering.
Camille GILLOT [Sat, 31 Jul 2021 20:50:43 +0000 (22:50 +0200)]
Stop emitting lints during lowering.

2 years agoStore next_disambiguator in Definitions.
Camille GILLOT [Fri, 2 Apr 2021 14:47:08 +0000 (16:47 +0200)]
Store next_disambiguator in Definitions.

2 years agoRemove mutability in ResolverAstLowering.
Camille GILLOT [Thu, 1 Apr 2021 17:05:14 +0000 (19:05 +0200)]
Remove mutability in ResolverAstLowering.

2 years agoRollup merge of #95505 - sunfishcode:sunfishcode/fix-openbsd, r=dtolnay
Dylan DPC [Thu, 31 Mar 2022 11:09:55 +0000 (13:09 +0200)]
Rollup merge of #95505 - sunfishcode:sunfishcode/fix-openbsd, r=dtolnay

Fix library/std compilation on openbsd.

Fix a minor typo from #95241 which prevented compilation on x86_64-unknown-openbsd.

2 years agoRollup merge of #95495 - GuillaumeGomez:rm-unneeded-to-string, r=notriddle
Dylan DPC [Thu, 31 Mar 2022 11:09:54 +0000 (13:09 +0200)]
Rollup merge of #95495 - GuillaumeGomez:rm-unneeded-to-string, r=notriddle

Remove unneeded `to_string` call

Fixes a confusion I made when reading `@camelid's` comment [here](https://github.com/rust-lang/rust/pull/95096#discussion_r838851170).

r? `@notriddle`

2 years agoRollup merge of #95478 - InfRandomness:infrandomness/lint_largemove_note, r=compiler...
Dylan DPC [Thu, 31 Mar 2022 11:09:53 +0000 (13:09 +0200)]
Rollup merge of #95478 - InfRandomness:infrandomness/lint_largemove_note, r=compiler-errors

Add note to the move size diagnostic

context: https://github.com/rust-lang/rust/issues/83518

2 years agoRollup merge of #95470 - GuillaumeGomez:fix-gui-spurious-test, r=notriddle
Dylan DPC [Thu, 31 Mar 2022 11:09:52 +0000 (13:09 +0200)]
Rollup merge of #95470 - GuillaumeGomez:fix-gui-spurious-test, r=notriddle

Fix last rustdoc-gui spurious test

This should the last spurious failing GUI test from https://github.com/rust-lang/rust/issues/93784.

r? ``@notriddle``

2 years agoRollup merge of #95445 - jyn514:rustc-unit-tests, r=Dylan-DPC
Dylan DPC [Thu, 31 Mar 2022 11:09:52 +0000 (13:09 +0200)]
Rollup merge of #95445 - jyn514:rustc-unit-tests, r=Dylan-DPC

Don't build the full compiler before running unit tests

This has been present since `builder.ensure` was first added in https://github.com/rust-lang/rust/pull/43059.
It's unclear to me why it was added then - I tested these changes locally
with `x test compiler/rustc_data_structures --stage 0` and they worked fine.

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

2 years agoobligation cause: `RepeatVec` -> `RepeatValueCopy`
lcnr [Thu, 31 Mar 2022 10:50:53 +0000 (12:50 +0200)]
obligation cause: `RepeatVec` -> `RepeatValueCopy`

2 years agoAuto merge of #95456 - RalfJung:size, r=oli-obk
bors [Thu, 31 Mar 2022 10:33:56 +0000 (10:33 +0000)]
Auto merge of #95456 - RalfJung:size, r=oli-obk

allow large Size again

This basically reverts most of https://github.com/rust-lang/rust/pull/80042, and instead does the panic in `bits()` with a `#[cold]` function to make sure it does not get inlined.

https://github.com/rust-lang/rust/pull/80042 added a comment about an invariant ("The top 3 bits are ALWAYS zero") that is not actually enforced, and if it were enforced that would be a problem for https://github.com/rust-lang/rust/pull/95388. So I think we should not have that invariant, and I adjusted the code accordingly.

r? `@oli-obk` Cc `@sivadeilra`

2 years agoAuto merge of #95507 - ehuss:update-cargo, r=ehuss
bors [Thu, 31 Mar 2022 07:40:18 +0000 (07:40 +0000)]
Auto merge of #95507 - ehuss:update-cargo, r=ehuss

Update cargo

13 commits in 109bfbd055325ef87a6e7f63d67da7e838f8300b..1ef1e0a12723ce9548d7da2b63119de9002bead8
2022-03-17 21:43:09 +0000 to 2022-03-31 00:17:18 +0000
- Support `-Zmultitarget` in cargo config (rust-lang/cargo#10473)
- doc: Fix document url for libcurl format (rust-lang/cargo#10515)
- Fix wrong info in "Environment variables" docs (rust-lang/cargo#10513)
- Use the correct flag in --locked --offline error message (rust-lang/cargo#10512)
- Don't treat host/target duplicates as duplicates (rust-lang/cargo#10466)
- Unstable --keep-going flag (rust-lang/cargo#10383)
- Part 1 of RFC2906 - Packages can inherit fields from their root workspace (rust-lang/cargo#10497)
- Remove unused profile support for -Zpanic-abort-tests (rust-lang/cargo#10495)
- HTTP registry implementation (rust-lang/cargo#10470)
- Add a notice about review capacity. (rust-lang/cargo#10501)
- Add tests for ignoring symlinks (rust-lang/cargo#10047)
- Update doc string for deps_of/compute_deps. (rust-lang/cargo#10494)
- Consistently use crate::display_error on errors during drain (rust-lang/cargo#10394)

2 years agoAuto merge of #95506 - Dylan-DPC:rollup-b6kxzjc, r=Dylan-DPC
bors [Thu, 31 Mar 2022 05:12:45 +0000 (05:12 +0000)]
Auto merge of #95506 - Dylan-DPC:rollup-b6kxzjc, r=Dylan-DPC

Rollup of 5 pull requests

Successful merges:

 - #95130 (Stabilize thread::is_finished)
 - #95263 (Restore `impl Future<Output = Type>` to async blocks)
 - #95471 (Don't ICE when opaque types get their hidden type constrained again.)
 - #95491 (Stabilize feature vec_retain_mut on Vec and VecDeque)
 - #95497 (Spellchecking compiler comments)

Failed merges:

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

2 years agoUpdate cargo
Eric Huss [Thu, 31 Mar 2022 04:28:18 +0000 (21:28 -0700)]
Update cargo

2 years agoRollup merge of #95497 - nyurik:compiler-spell-comments, r=compiler-errors
Dylan DPC [Thu, 31 Mar 2022 02:57:28 +0000 (04:57 +0200)]
Rollup merge of #95497 - nyurik:compiler-spell-comments, r=compiler-errors

Spellchecking compiler comments

This PR cleans up the rest of the spelling mistakes in the compiler comments. This PR does not change any literal or code spelling issues.

2 years agoRollup merge of #95491 - faern:stabilize-vec_retain_mut, r=yaahc
Dylan DPC [Thu, 31 Mar 2022 02:57:27 +0000 (04:57 +0200)]
Rollup merge of #95491 - faern:stabilize-vec_retain_mut, r=yaahc

Stabilize feature vec_retain_mut on Vec and VecDeque

Closes #90829

2 years agoRollup merge of #95471 - oli-obk:tait_ice, r=estebank
Dylan DPC [Thu, 31 Mar 2022 02:57:26 +0000 (04:57 +0200)]
Rollup merge of #95471 - oli-obk:tait_ice, r=estebank

Don't ICE when opaque types get their hidden type constrained again.

Contrary to popular belief, `codegen_fulfill_obligation` does not get used solely in codegen, so we cannot rely on `param_env` being set to RevealAll and thus revealing the hidden types instead of constraining them.

Fixes #89312 (for real this time)

2 years agoRollup merge of #95263 - compiler-errors:async-block-pretty, r=jackh726
Dylan DPC [Thu, 31 Mar 2022 02:57:25 +0000 (04:57 +0200)]
Rollup merge of #95263 - compiler-errors:async-block-pretty, r=jackh726

Restore `impl Future<Output = Type>` to async blocks

I was sad when I undid some of the code I wrote in #91096 in the PR #95225, so I fixed it here to not print `[async output]`.

This PR "manually" normalizes the associated type `<[generator] as Generator>::Return` type which appears very frequently in `impl Future` types that result from async block desugaring.

2 years agoRollup merge of #95130 - workingjubilee:stably-finished, r=m-ou-se
Dylan DPC [Thu, 31 Mar 2022 02:57:25 +0000 (04:57 +0200)]
Rollup merge of #95130 - workingjubilee:stably-finished, r=m-ou-se

Stabilize thread::is_finished

Closes #90470.

r? `@m-ou-se`

2 years agoRestore `impl Future<Output = Type>` to async blocks
Michael Goulet [Thu, 31 Mar 2022 02:26:35 +0000 (19:26 -0700)]
Restore `impl Future<Output = Type>` to async blocks

2 years agoFix library/std compilation on openbsd.
Dan Gohman [Thu, 31 Mar 2022 01:06:21 +0000 (18:06 -0700)]
Fix library/std compilation on openbsd.

Fix a minor typo from #95241 which prevented compilation on x86_64-unknown-openbsd.

2 years agoAuto merge of #95501 - Dylan-DPC:rollup-arx6sdc, r=Dylan-DPC
bors [Thu, 31 Mar 2022 00:29:54 +0000 (00:29 +0000)]
Auto merge of #95501 - Dylan-DPC:rollup-arx6sdc, r=Dylan-DPC

Rollup of 6 pull requests

Successful merges:

 - #93901 (Stabilize native library modifier syntax and the `whole-archive` modifier specifically)
 - #94806 (Fix `cargo run tidy`)
 - #94869 (Add the generic_associated_types_extended feature)
 - #95011 (async: Give predictable name to binding generated from .await expressions.)
 - #95251 (Reduce max hash in raw strings from u16 to u8)
 - #95298 (Fix double drop of allocator in IntoIter impl of Vec)

Failed merges:

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

2 years agoRollup merge of #95298 - jhorstmann:fix-double-drop-of-allocator-in-vec-into-iter...
Dylan DPC [Wed, 30 Mar 2022 22:26:32 +0000 (00:26 +0200)]
Rollup merge of #95298 - jhorstmann:fix-double-drop-of-allocator-in-vec-into-iter, r=oli-obk

Fix double drop of allocator in IntoIter impl of Vec

Fixes #95269

The `drop` impl of `IntoIter` reconstructs a `RawVec` from `buf`, `cap` and `alloc`, when that `RawVec` is dropped it also drops the allocator. To avoid dropping the allocator twice we wrap it in `ManuallyDrop` in the `InttoIter` struct.

Note this is my first contribution to the standard library, so I might be missing some details or a better way to solve this.

2 years agoRollup merge of #95251 - GrishaVar:hashes-u16-to-u8, r=dtolnay
Dylan DPC [Wed, 30 Mar 2022 22:26:31 +0000 (00:26 +0200)]
Rollup merge of #95251 - GrishaVar:hashes-u16-to-u8, r=dtolnay

Reduce max hash in raw strings from u16 to u8

[Relevant discussion](https://rust-lang.zulipchat.com/#narrow/stream/237824-t-lang.2Fdoc/topic/Max.20raw.20string.20delimiters)

2 years agoRollup merge of #95011 - michaelwoerister:awaitee_field, r=tmandry
Dylan DPC [Wed, 30 Mar 2022 22:26:30 +0000 (00:26 +0200)]
Rollup merge of #95011 - michaelwoerister:awaitee_field, r=tmandry

async: Give predictable name to binding generated from .await expressions.

This name makes it to debuginfo and allows debuggers to identify such bindings and their captured versions in suspended async fns.

This will be useful for async stack traces, as discussed in https://internals.rust-lang.org/t/async-debugging-logical-stack-traces-setting-goals-collecting-examples/15547.

I don't know if this needs some discussion by ````@rust-lang/compiler,```` e.g. about the name of the binding (`__awaitee`) or about the fact that this PR introduces a (soft) guarantee about a compiler generated name. Although, regarding the later, I think the same reasoning applies here as it does for debuginfo in general.

r? ````@tmandry````

2 years agoRollup merge of #94869 - jackh726:gats_extended, r=compiler-errors
Dylan DPC [Wed, 30 Mar 2022 22:26:29 +0000 (00:26 +0200)]
Rollup merge of #94869 - jackh726:gats_extended, r=compiler-errors

Add the generic_associated_types_extended feature

Right now, this only ignore obligations that reference new placeholders in `poly_project_and_unify_type`. In the future, this might do other things, like allowing object-safe GATs.

**This feature is *incomplete* and quite likely unsound. This is mostly just for testing out potential future APIs using a "relaxed" set of rules until we figure out *proper* rules.**

Also drive by cleanup of adding a `ProjectAndUnifyResult` enum instead of using a `Result<Result<Option>>`.

r? `@nikomatsakis`

2 years agoRollup merge of #94806 - jyn514:cargo-run-tidy, r=Mark-Simulacrum
Dylan DPC [Wed, 30 Mar 2022 22:26:28 +0000 (00:26 +0200)]
Rollup merge of #94806 - jyn514:cargo-run-tidy, r=Mark-Simulacrum

Fix `cargo run tidy`

When I implemented rust-only bootstrapping in https://github.com/rust-lang/rust/pull/92260,
I neglected to test stage0 tools - it turns out they were broken because
they couldn't find the sysroot of the initial bootstrap compiler.

This fixes stage0 tools by using `rustc --print sysroot` instead of assuming rustc is already in a
sysroot and hard-coding the relative directory.

Fixes https://github.com/rust-lang/rust/issues/94797 (properly, without having to change rustup).

2 years agoRollup merge of #93901 - petrochenkov:linkmod, r=wesleywiser
Dylan DPC [Wed, 30 Mar 2022 22:26:28 +0000 (00:26 +0200)]
Rollup merge of #93901 - petrochenkov:linkmod, r=wesleywiser

Stabilize native library modifier syntax and the `whole-archive` modifier specifically

Stabilization report: https://github.com/rust-lang/rust/pull/93901#issuecomment-1041325522

cc https://github.com/rust-lang/rust/issues/81490

2 years agoAuto merge of #95436 - cjgillot:static-mut, r=oli-obk
bors [Wed, 30 Mar 2022 22:09:56 +0000 (22:09 +0000)]
Auto merge of #95436 - cjgillot:static-mut, r=oli-obk

Remember mutability in `DefKind::Static`.

This allows to compute the `BodyOwnerKind` from `DefKind` only, and
removes a direct dependency of some MIR queries onto HIR.

As a side effect, it also simplifies metadata, since we don't need 4
flavours of `EntryKind::*Static` any more.

2 years agoAdd the generic_associated_types_extended feature
Jack Huey [Fri, 11 Mar 2022 23:46:49 +0000 (18:46 -0500)]
Add the generic_associated_types_extended feature

2 years agoa few mode feedback fixes per @bjorn3
Yuri Astrakhan [Wed, 30 Mar 2022 21:28:19 +0000 (17:28 -0400)]
a few mode feedback fixes per @bjorn3

2 years agoAddressed comments by @compiler-errors and @bjorn3
Yuri Astrakhan [Wed, 30 Mar 2022 21:04:46 +0000 (17:04 -0400)]
Addressed comments by @compiler-errors and @bjorn3

2 years agoStabilize native library modifier syntax and the `whole-archive` modifier specifically
Vadim Petrochenkov [Fri, 11 Feb 2022 07:08:35 +0000 (15:08 +0800)]
Stabilize native library modifier syntax and the `whole-archive` modifier specifically

2 years agoRemove bad rustdoc trailing backslash
Yuri Astrakhan [Wed, 30 Mar 2022 19:50:27 +0000 (15:50 -0400)]
Remove bad rustdoc trailing backslash

2 years agoSpellchecking compiler comments
Yuri Astrakhan [Wed, 30 Mar 2022 19:14:15 +0000 (15:14 -0400)]
Spellchecking compiler comments

This PR cleans up the rest of the spelling mistakes in the compiler comments. This PR does not change any literal or code spelling issues.

2 years agoRemove unneeded `to_string` call
Guillaume Gomez [Wed, 30 Mar 2022 19:13:15 +0000 (21:13 +0200)]
Remove unneeded `to_string` call

2 years agoAuto merge of #95425 - nnethercote:yet-more-parse_tt-improvements, r=petrochenkov
bors [Wed, 30 Mar 2022 19:08:01 +0000 (19:08 +0000)]
Auto merge of #95425 - nnethercote:yet-more-parse_tt-improvements, r=petrochenkov

Yet more `parse_tt` improvements

Including lots of comment improvements, and an overhaul of how `matches` work that gives big speedups.

r? `@petrochenkov`

2 years agoStabilize feature vec_retain_mut on Vec and VecDeque
Linus Färnstrand [Wed, 30 Mar 2022 05:48:48 +0000 (07:48 +0200)]
Stabilize feature vec_retain_mut on Vec and VecDeque

2 years agoAdd note to the lint diagnostic
InfRandomness [Wed, 30 Mar 2022 15:53:29 +0000 (17:53 +0200)]
Add note to the lint diagnostic

2 years agoUpdate error message & remove outdated test comment
Grisha Vartanyan [Wed, 30 Mar 2022 16:20:30 +0000 (18:20 +0200)]
Update error message & remove outdated test comment

2 years agoAuto merge of #95458 - calebcartwright:sync-rustfmt-subtree, r=calebcartwright
bors [Wed, 30 Mar 2022 15:57:58 +0000 (15:57 +0000)]
Auto merge of #95458 - calebcartwright:sync-rustfmt-subtree, r=calebcartwright

Sync rustfmt subtree

r? `@calebcartwright`

2 years agoDon't ICE when opaque types get their hidden type constrained again.
Oli Scherer [Wed, 30 Mar 2022 13:17:46 +0000 (13:17 +0000)]
Don't ICE when opaque types get their hidden type constrained again.

Contrary to popular belief, `codegen_fulfill_obligation` does not get used solely in codegen, so we cannot rely on `param_env` being set to RevealAll and thus revealing the hidden types instead of constraining them.

2 years agoFix last rustdoc-gui spurious test
Guillaume Gomez [Wed, 30 Mar 2022 12:30:46 +0000 (14:30 +0200)]
Fix last rustdoc-gui spurious test

2 years agoAuto merge of #94963 - lcnr:inherent-impls-std, r=oli-obk,m-ou-se
bors [Wed, 30 Mar 2022 12:28:50 +0000 (12:28 +0000)]
Auto merge of #94963 - lcnr:inherent-impls-std, r=oli-obk,m-ou-se

allow arbitrary inherent impls for builtin types in core

Part of https://github.com/rust-lang/compiler-team/issues/487. Slightly adjusted after some talks with `@m-ou-se` about the requirements of `t-libs-api`.

This adds a crate attribute `#![rustc_coherence_is_core]` which allows arbitrary impls for builtin types in core.

For other library crates impls for builtin types should be avoided if possible. We do have to allow the existing stable impls however. To prevent us from accidentally adding more of these in the future, there is a second attribute `#[rustc_allow_incoherent_impl]` which has to be added to **all impl items**. This only supports impls for builtin types but can easily be extended to additional types in a future PR.

This implementation does not check for overlaps in these impls. Perfectly checking that requires us to check the coherence of these incoherent impls in every crate, as two distinct dependencies may add overlapping methods. It should be easy enough to detect if it goes wrong and the attribute is only intended for use inside of std.

The first two commits are mostly unrelated cleanups.

2 years agoDon't stabilize ScopedJoinHandle::is_finished yet.
Mara Bos [Wed, 30 Mar 2022 11:59:27 +0000 (13:59 +0200)]
Don't stabilize ScopedJoinHandle::is_finished yet.

2 years agoAuto merge of #95241 - Gankra:cleaned-provenance, r=workingjubilee
bors [Wed, 30 Mar 2022 10:09:10 +0000 (10:09 +0000)]
Auto merge of #95241 - Gankra:cleaned-provenance, r=workingjubilee

Strict Provenance MVP

This patch series examines the question: how bad would it be if we adopted
an extremely strict pointer provenance model that completely banished all
int<->ptr casts.

The key insight to making this approach even *vaguely* pallatable is the

ptr.with_addr(addr) -> ptr

function, which takes a pointer and an address and creates a new pointer
with that address and the provenance of the input pointer. In this way
the "chain of custody" is completely and dynamically restored, making the
model suitable even for dynamic checkers like CHERI and Miri.

This is not a formal model, but lots of the docs discussing the model
have been updated to try to the *concept* of this design in the hopes
that it can be iterated on.

See #95228

2 years agoclippy: nameres for primitive type impls
lcnr [Wed, 30 Mar 2022 09:57:53 +0000 (11:57 +0200)]
clippy: nameres for primitive type impls

2 years agotypo
lcnr [Wed, 30 Mar 2022 09:24:26 +0000 (11:24 +0200)]
typo

2 years agorework error messages for incorrect inherent impls
lcnr [Tue, 29 Mar 2022 07:47:32 +0000 (09:47 +0200)]
rework error messages for incorrect inherent impls

2 years agofix rustdoc wrt builtin impls switch
lcnr [Fri, 18 Mar 2022 16:02:32 +0000 (17:02 +0100)]
fix rustdoc wrt builtin impls switch

2 years agoget clippy to compile again
lcnr [Fri, 18 Mar 2022 12:33:40 +0000 (13:33 +0100)]
get clippy to compile again

2 years agofix rustdoc
lcnr [Fri, 18 Mar 2022 10:45:00 +0000 (11:45 +0100)]
fix rustdoc

2 years agofix behavior for empty impls
lcnr [Fri, 18 Mar 2022 10:44:55 +0000 (11:44 +0100)]
fix behavior for empty impls

2 years agoupdate rustdoc
lcnr [Tue, 15 Mar 2022 15:56:46 +0000 (16:56 +0100)]
update rustdoc

2 years agoremove now unnecessary lang items
lcnr [Tue, 15 Mar 2022 15:56:28 +0000 (16:56 +0100)]
remove now unnecessary lang items

2 years agoupdate ui tests
lcnr [Tue, 15 Mar 2022 15:32:52 +0000 (16:32 +0100)]
update ui tests

2 years agorework implementation for inherent impls for builtin types
lcnr [Tue, 15 Mar 2022 15:30:30 +0000 (16:30 +0100)]
rework implementation for inherent impls for builtin types

2 years agoremove `NoMatchData::new`
lcnr [Fri, 11 Mar 2022 11:20:27 +0000 (12:20 +0100)]
remove `NoMatchData::new`

2 years agoupdate comment
lcnr [Fri, 11 Mar 2022 10:59:40 +0000 (11:59 +0100)]
update comment

2 years agoasync: Give predictable, reserved name to binding generated from .await expressions.
Michael Woerister [Wed, 16 Mar 2022 14:52:21 +0000 (15:52 +0100)]
async: Give predictable, reserved name to binding generated from .await expressions.

This name makes it to debuginfo and allows debuggers to identify such bindings and
their captured versions in suspended async fns.

2 years agoAuto merge of #95466 - Dylan-DPC:rollup-g7ddr8y, r=Dylan-DPC
bors [Wed, 30 Mar 2022 07:45:42 +0000 (07:45 +0000)]
Auto merge of #95466 - Dylan-DPC:rollup-g7ddr8y, r=Dylan-DPC

Rollup of 5 pull requests

Successful merges:

 - #95294 (Document Linux kernel handoff in std::io::copy and std::fs::copy)
 - #95443 (Clarify how `src/tools/x` searches for python)
 - #95452 (fix since field version for termination stabilization)
 - #95460 (Spellchecking compiler code)
 - #95461 (Spellchecking some comments)

Failed merges:

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

2 years agoRollup merge of #95461 - nyurik:spelling, r=lcnr
Dylan DPC [Wed, 30 Mar 2022 07:10:07 +0000 (09:10 +0200)]
Rollup merge of #95461 - nyurik:spelling, r=lcnr

Spellchecking some comments

This PR attempts to clean up some minor spelling mistakes in comments

2 years agoRollup merge of #95460 - nyurik:spelling-str, r=lcnr
Dylan DPC [Wed, 30 Mar 2022 07:10:06 +0000 (09:10 +0200)]
Rollup merge of #95460 - nyurik:spelling-str, r=lcnr

Spellchecking compiler code

Address some spelling mistakes in strings, private function names, and function params.

2 years agoRollup merge of #95452 - yaahc:termination-version-correction, r=ehuss
Dylan DPC [Wed, 30 Mar 2022 07:10:05 +0000 (09:10 +0200)]
Rollup merge of #95452 - yaahc:termination-version-correction, r=ehuss

fix since field version for termination stabilization

fixes incorrect version fields in stabilization of https://github.com/rust-lang/rust/pull/93840

r? `@ehuss`

2 years agoRollup merge of #95443 - jyn514:clarify-python-search-logic, r=Dylan-DPC
Dylan DPC [Wed, 30 Mar 2022 07:10:04 +0000 (09:10 +0200)]
Rollup merge of #95443 - jyn514:clarify-python-search-logic, r=Dylan-DPC

Clarify how `src/tools/x` searches for python

Before, it confusingly looked like `python` was chosen last instead of first.

2 years agoRollup merge of #95294 - sourcefrog:doc-copy, r=dtolnay
Dylan DPC [Wed, 30 Mar 2022 07:10:04 +0000 (09:10 +0200)]
Rollup merge of #95294 - sourcefrog:doc-copy, r=dtolnay

Document Linux kernel handoff in std::io::copy and std::fs::copy

2 years agoSpellchecking compiler code
Yuri Astrakhan [Wed, 30 Mar 2022 05:42:10 +0000 (01:42 -0400)]
Spellchecking compiler code

Address some spelling mistakes in strings, private function names, and function params.

2 years agoSpellchecking some comments
Yuri Astrakhan [Wed, 30 Mar 2022 05:39:38 +0000 (01:39 -0400)]
Spellchecking some comments

This PR attempts to clean up some minor spelling mistakes in comments

2 years agoAuto merge of #94081 - oli-obk:lazy_tait_take_two, r=nikomatsakis
bors [Wed, 30 Mar 2022 05:04:45 +0000 (05:04 +0000)]
Auto merge of #94081 - oli-obk:lazy_tait_take_two, r=nikomatsakis

Lazy type-alias-impl-trait take two

### user visible change 1: RPIT inference from recursive call sites

Lazy TAIT has an insta-stable change. The following snippet now compiles, because opaque types can now have their hidden type set from wherever the opaque type is mentioned.

```rust
fn bar(b: bool) -> impl std::fmt::Debug {
    if b {
        return 42
    }
    let x: u32 = bar(false); // this errors on stable
    99
}
```

The return type of `bar` stays opaque, you can't do `bar(false) + 42`, you need to actually mention the hidden type.

### user visible change 2: divergence between RPIT and TAIT in return statements

Note that `return` statements and the trailing return expression are special with RPIT (but not TAIT). So

```rust
#![feature(type_alias_impl_trait)]
type Foo = impl std::fmt::Debug;

fn foo(b: bool) -> Foo {
    if b {
        return vec![42];
    }
    std::iter::empty().collect() //~ ERROR `Foo` cannot be built from an iterator
}

fn bar(b: bool) -> impl std::fmt::Debug {
    if b {
        return vec![42]
    }
    std::iter::empty().collect() // Works, magic (accidentally stabilized, not intended)
}
```

But when we are working with the return value of a recursive call, the behavior of RPIT and TAIT is the same:

```rust
type Foo = impl std::fmt::Debug;

fn foo(b: bool) -> Foo {
    if b {
        return vec![];
    }
    let mut x = foo(false);
    x = std::iter::empty().collect(); //~ ERROR `Foo` cannot be built from an iterator
    vec![]
}

fn bar(b: bool) -> impl std::fmt::Debug {
    if b {
        return vec![];
    }
    let mut x = bar(false);
    x = std::iter::empty().collect(); //~ ERROR `impl Debug` cannot be built from an iterator
    vec![]
}
```

### user visible change 3: TAIT does not merge types across branches

In contrast to RPIT, TAIT does not merge types across branches, so the following does not compile.

```rust
type Foo = impl std::fmt::Debug;

fn foo(b: bool) -> Foo {
    if b {
        vec![42_i32]
    } else {
        std::iter::empty().collect()
        //~^ ERROR `Foo` cannot be built from an iterator over elements of type `_`
    }
}
```

It is easy to support, but we should make an explicit decision to include the additional complexity in the implementation (it's not much, see a721052457cf513487fb4266e3ade65c29b272d2 which needs to be reverted to enable this).

### PR formalities

previous attempt: #92007

This PR also includes #92306 and #93783, as they were reverted along with #92007 in #93893

fixes #93411
fixes #88236
fixes #89312
fixes #87340
fixes #86800
fixes #86719
fixes #84073
fixes #83919
fixes #82139
fixes #77987
fixes #74282
fixes #67830
fixes #62742
fixes #54895

2 years agoMerge commit '5ff7b632a95bac6955611d85040859128902c580' into sync-rustfmt-subtree
Caleb Cartwright [Wed, 30 Mar 2022 04:17:30 +0000 (23:17 -0500)]
Merge commit '5ff7b632a95bac6955611d85040859128902c580' into sync-rustfmt-subtree

2 years agoPreserve semicolon after macro call inside foreign mod
David Tolnay [Tue, 29 Mar 2022 19:59:07 +0000 (12:59 -0700)]
Preserve semicolon after macro call inside foreign mod

2 years agoAdd test of macro calls inside extern block
David Tolnay [Tue, 29 Mar 2022 20:09:28 +0000 (13:09 -0700)]
Add test of macro calls inside extern block

2 years agoWarn that platform-specific behavior may change
Martin Pool [Wed, 30 Mar 2022 02:43:40 +0000 (19:43 -0700)]
Warn that platform-specific behavior may change

2 years agofix unix typedef
Aria Beingessner [Wed, 30 Mar 2022 02:45:31 +0000 (22:45 -0400)]
fix unix typedef

2 years agoAuto merge of #95455 - RalfJung:miri, r=RalfJung
bors [Wed, 30 Mar 2022 02:41:44 +0000 (02:41 +0000)]
Auto merge of #95455 - RalfJung:miri, r=RalfJung

update miri

Fixes https://github.com/rust-lang/rust/issues/95357
r? `@ghost`

2 years agoallow large Size again
Ralf Jung [Wed, 30 Mar 2022 02:25:38 +0000 (22:25 -0400)]
allow large Size again

2 years agoupdate miri
Ralf Jung [Wed, 30 Mar 2022 02:13:33 +0000 (22:13 -0400)]
update miri

2 years agofixup feature position in liballoc
Aria Beingessner [Tue, 29 Mar 2022 21:45:54 +0000 (17:45 -0400)]
fixup feature position in liballoc

2 years agoclarify that WASM has address spaces
Aria Beingessner [Mon, 28 Mar 2022 18:26:24 +0000 (14:26 -0400)]
clarify that WASM has address spaces

2 years agofix doc link
Aria Beingessner [Mon, 28 Mar 2022 18:06:16 +0000 (14:06 -0400)]
fix doc link

2 years agorefine the definition of temporal provenance
Aria Beingessner [Mon, 28 Mar 2022 17:16:04 +0000 (13:16 -0400)]
refine the definition of temporal provenance