Commit Graph

165685 Commits

Author SHA1 Message Date
Camille GILLOT
6e4fb2038a Make lowering pull-based. 2022-03-31 13:47:22 +02:00
Camille GILLOT
41902f2859 Implement with_parent_item_lifetime_defs on ItemLowerer. 2022-03-31 13:47:02 +02:00
Camille GILLOT
dc8b6b4be4 Move lower_crate outside the LoweringContext. 2022-03-31 13:46:40 +02:00
Camille GILLOT
4b598d3f75 Stop emitting lints during lowering. 2022-03-31 13:46:06 +02:00
Camille GILLOT
c10a1cebe7 Store next_disambiguator in Definitions. 2022-03-31 13:34:54 +02:00
Camille GILLOT
b29fa94d22 Remove mutability in ResolverAstLowering. 2022-03-31 13:24:33 +02:00
Dylan DPC
0b71ca84b0
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.
2022-03-31 13:09:55 +02:00
Dylan DPC
57206d79d9
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`
2022-03-31 13:09:54 +02:00
Dylan DPC
4388ac58a2
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
2022-03-31 13:09:53 +02:00
Dylan DPC
c6764c982d
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``
2022-03-31 13:09:52 +02:00
Dylan DPC
14d8bfdbfd
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.
2022-03-31 13:09:52 +02:00
lcnr
d7cada1767 obligation cause: RepeatVec -> RepeatValueCopy 2022-03-31 12:51:46 +02:00
bors
df20355fa9 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`
2022-03-31 10:33:56 +00:00
bors
e730969b0d 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)
2022-03-31 07:40:18 +00:00
bors
ffaf6f0d0c 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
2022-03-31 05:12:45 +00:00
Eric Huss
307df1612f Update cargo 2022-03-30 21:28:18 -07:00
Nicholas Nethercote
c6fedd4f10 Make MatcherPos not derive Clone.
It's only used in one place, and there we clone and then make a bunch of
modifications. It's clearer if we duplicate more explicitly, and there's
a symmetry now between `sequence()` and `empty_sequence()`.
2022-03-31 14:40:43 +11:00
Nicholas Nethercote
f68a0449ed Remove MatcherPos::stack.
`parse_tt` needs a way to get from within submatchers make to the
enclosing submatchers. Currently it has two distinct mechanisms for
this:
- `Delimited` submatchers use `MatcherPos::stack` to record stuff about
  the parent (and further back ancestors).
- `Sequence` submatchers use `MatcherPosSequence::parent` to point to
  the parent matcher position.

Having two mechanisms is really confusing, and it took me a long time to
understand all this.

This commit eliminates `MatcherPos::stack`, and changes `Delimited`
submatchers to use the same mechanism as sequence submatchers. That
mechanism is also changed a bit: instead of storing the entire parent
`MatcherPos`, we now only store the necessary parts from the parent
`MatcherPos`.

Overall this is a small performance win, with the positives outweighing
the negatives, but it's mostly for clarity.
2022-03-31 14:39:00 +11:00
Dylan DPC
1b7d6dbd30
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.
2022-03-31 04:57:28 +02:00
Dylan DPC
c90a94707f
Rollup merge of #95491 - faern:stabilize-vec_retain_mut, r=yaahc
Stabilize feature vec_retain_mut on Vec and VecDeque

Closes #90829
2022-03-31 04:57:27 +02:00
Dylan DPC
64a3767fee
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)
2022-03-31 04:57:26 +02:00
Dylan DPC
4ce6567daa
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.
2022-03-31 04:57:25 +02:00
Dylan DPC
32c5a57a00
Rollup merge of #95130 - workingjubilee:stably-finished, r=m-ou-se
Stabilize thread::is_finished

Closes #90470.

r? `@m-ou-se`
2022-03-31 04:57:25 +02:00
Michael Goulet
7b2eaa3d8f Restore impl Future<Output = Type> to async blocks 2022-03-30 19:26:35 -07:00
Dan Gohman
c89f11e1db Fix library/std compilation on openbsd.
Fix a minor typo from #95241 which prevented compilation on x86_64-unknown-openbsd.
2022-03-30 18:06:21 -07:00
Nicholas Nethercote
048bd67d51 Clarify idx handling in sequences.
By adding comments, and improving an assertion. I finally fully
understand this part!
2022-03-31 11:48:36 +11:00
Nicholas Nethercote
2e423c7fd0 Remove MatcherPos::match_lo.
It's redundant w.r.t. other fields.
2022-03-31 11:48:35 +11:00
Nicholas Nethercote
21699c41af Simplify exit of Delimited submatchers.
Currently, we detect an exit from a `Delimited` submatcher when `idx`
exceeds the bounds of the current submatcher *and* there is a `stack`
entry.

This commit changes it to something simpler: just look for a
`CloseDelim` token.
2022-03-31 11:48:34 +11:00
bors
a39ac5ae17 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
2022-03-31 00:29:54 +00:00
Dylan DPC
d6c959c680
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.
2022-03-31 00:26:32 +02:00
Dylan DPC
86388f6171
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)
2022-03-31 00:26:31 +02:00
Dylan DPC
1c3657b20d
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````
2022-03-31 00:26:30 +02:00
Dylan DPC
e08ab08a2e
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`
2022-03-31 00:26:29 +02:00
Dylan DPC
943ea7fae5
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).
2022-03-31 00:26:28 +02:00
Dylan DPC
b75f384d0b
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
2022-03-31 00:26:28 +02:00
bors
a40c595695 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.
2022-03-30 22:09:56 +00:00
Jack Huey
4e570a68a1 Add the generic_associated_types_extended feature 2022-03-30 17:41:11 -04:00
Yuri Astrakhan
8d7b124c1f a few mode feedback fixes per @bjorn3 2022-03-30 17:28:19 -04:00
Yuri Astrakhan
a6dd658254 Addressed comments by @compiler-errors and @bjorn3 2022-03-30 17:04:46 -04:00
Vadim Petrochenkov
1004783ef9 Stabilize native library modifier syntax and the whole-archive modifier specifically 2022-03-30 23:53:21 +03:00
Yuri Astrakhan
c9c6e22f4b Remove bad rustdoc trailing backslash 2022-03-30 15:50:27 -04:00
Yuri Astrakhan
5160f8f843 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.
2022-03-30 15:14:15 -04:00
Guillaume Gomez
8c0a8f5f89 Remove unneeded to_string call 2022-03-30 21:13:15 +02:00
bors
c5cf08d37b 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`
2022-03-30 19:08:01 +00:00
Linus Färnstrand
796f385190 Stabilize feature vec_retain_mut on Vec and VecDeque 2022-03-30 20:28:50 +02:00
InfRandomness
d65b9a19db Add note to the lint diagnostic 2022-03-30 20:00:03 +02:00
Jules Bertholet
c8ab63b30f Only show associated consts from inherent impls in sidebar 2022-03-30 13:49:50 -04:00
Grisha Vartanyan
759d1e6af8 Update error message & remove outdated test comment 2022-03-30 18:20:30 +02:00
bors
bb5c437a2c Auto merge of #95458 - calebcartwright:sync-rustfmt-subtree, r=calebcartwright
Sync rustfmt subtree

r? `@calebcartwright`
2022-03-30 15:57:58 +00:00
Oli Scherer
11446779b0 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.
2022-03-30 13:17:46 +00:00