]> git.lizzy.rs Git - rust.git/log
rust.git
20 months agoRemove incorrect comment in `Vec::drain`
Maybe Waffle [Fri, 21 Oct 2022 15:29:02 +0000 (15:29 +0000)]
Remove incorrect comment in `Vec::drain`

20 months agoAuto merge of #102372 - abrown:issue-102157, r=thomcc
bors [Thu, 13 Oct 2022 00:37:28 +0000 (00:37 +0000)]
Auto merge of #102372 - abrown:issue-102157, r=thomcc

Allow compiling the `wasm32-wasi` std library with atomics

The issue #102157 demonstrates how currently the `-Z build-std` option will fail when re-compiling the standard library with `RUSTFLAGS` like `RUSTFLAGS="-C target-feature=+atomics,+bulk-memory -C link-args=--shared-memory"`. This change attempts to resolve those build issues by depending on the the WebAssembly `futex` module and providing an implementation for `env_lock`. Fixes #102157.

20 months agoAuto merge of #101679 - compiler-errors:rpitit-default-body, r=nikomatsakis
bors [Wed, 12 Oct 2022 21:03:47 +0000 (21:03 +0000)]
Auto merge of #101679 - compiler-errors:rpitit-default-body, r=nikomatsakis

Support default-body trait functions with return-position `impl Trait` in traits

Introduce a new `Trait` candidate kind for the `ImplTraitInTrait` projection candidate, which just projects an RPITIT down to its opaque type form.

This is a hack until we lower RPITITs to regular associated types, after which we will need to rework how these default bodies are type-checked, so comments are left in a few places for us to clean up later.

Fixes #101665

20 months agoAuto merge of #102975 - Dylan-DPC:rollup-vzuwsh2, r=Dylan-DPC
bors [Wed, 12 Oct 2022 17:48:31 +0000 (17:48 +0000)]
Auto merge of #102975 - Dylan-DPC:rollup-vzuwsh2, r=Dylan-DPC

Rollup of 7 pull requests

Successful merges:

 - #102623 (translation: eager translation)
 - #102719 (Enforce alphabetical sorting with tidy)
 - #102830 (Unify `tcx.constness` query and param env constness checks)
 - #102883 (Fix stabilization of `feature(half_open_range_patterns)`)
 - #102927 (Fix `let` keyword removal suggestion in structs)
 - #102936 (rustdoc: remove unused CSS `nav.sum`)
 - #102940 (Update books)

Failed merges:

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

20 months agoRollup merge of #102940 - ehuss:update-books, r=ehuss
Dylan DPC [Wed, 12 Oct 2022 16:43:26 +0000 (22:13 +0530)]
Rollup merge of #102940 - ehuss:update-books, r=ehuss

Update books

## nomicon

1 commits in f53bfa056929217870a5d2df1366d2e7ba35096d..9c73283775466d22208a0b28afcab44db4c0cc10
2022-09-05 07:19:02 -0700 to 2022-09-30 07:31:22 +0900
- Fix typo (rust-lang/nomicon#380)

## reference

9 commits in a7cdac33ca7356ad49d5c2b5e2c5010889b33eee..f6ed74f582bddcec73f753eafaab3749c4f7df61
2022-09-19 17:39:58 -0700 to 2022-10-08 02:43:26 -0700
- Typo 'a' -> 'an' (rust-lang/reference#1280)
- One line one sentence for expressions and statements main chapters (rust-lang/reference#1277)
- Document let else statements (rust-lang/reference#1156)
- Document `label_break_value` in the reference (rust-lang/reference#1263)
- Document target_has_atomic (rust-lang/reference#1171)
- update 'unsafe' (rust-lang/reference#1278)
- Update tokens.md (rust-lang/reference#1276)
- One sentence, one line Patterns chapter (rust-lang/reference#1275)
- Use semver-compliant example version (rust-lang/reference#1272)

## rust-by-example

9 commits in 767a6bd9727a596d7cfdbaeee475e65b2670ea3a..5e7b296d6c345addbd748f242aae28c42555c015
2022-09-14 09:17:18 -0300 to 2022-10-05 08:24:45 -0300
- Make it clear that rustdoc uses the commonmark spec (rust-lang/rust-by-example#1622)
- Update defaults.md (rust-lang/rust-by-example#1615)
- added "see also" for the @ binding sigil (rust-lang/rust-by-example#1612)
- add more precision to the effects of --bin flag (rust-lang/rust-by-example#1607)
- create bar project in cargo/dependencies example (rust-lang/rust-by-example#1606)
- use consistent wording about type annotation (rust-lang/rust-by-example#1603)
- cast.md improvements (rust-lang/rust-by-example#1599)
- Fix typo in macros.md (rust-lang/rust-by-example#1598)
- Corrected mistaken "The" instead of "There" (rust-lang/rust-by-example#1617)

## rustc-dev-guide

2 commits in 9a86c0467bbe42056f73fdf5b03fff757d7c4a9b..7518c3445dc02df0d196f5f84e568d633c5141fb
2022-10-07 18:34:51 +0200 to 2022-10-08 12:29:47 +0200
- Update debugging.md
- Use llvm subdomain for compiler-explorer link

## embedded-book

1 commits in 4ce51cb7441a6f02b5bf9b07b2eb755c21ab7954..c533348edd69f11a8f4225d633a05d7093fddbf3
2022-09-15 08:53:09 +0000 to 2022-10-10 10:16:49 +0000
- Fix a typo in registers.md  (rust-embedded/book#330)

20 months agoRollup merge of #102936 - notriddle:notriddle/nav-sum, r=Dylan-DPC
Dylan DPC [Wed, 12 Oct 2022 16:43:26 +0000 (22:13 +0530)]
Rollup merge of #102936 - notriddle:notriddle/nav-sum, r=Dylan-DPC

rustdoc: remove unused CSS `nav.sum`

This was added in 4fd061c426902b0904c65e64a3780b21f9ab3afb, but never actually used.

20 months agoRollup merge of #102927 - compiler-errors:let, r=davidtwco
Dylan DPC [Wed, 12 Oct 2022 16:43:26 +0000 (22:13 +0530)]
Rollup merge of #102927 - compiler-errors:let, r=davidtwco

Fix `let` keyword removal suggestion in structs

(1.) Fixes a bug where, given this code:
```rust
struct Foo {
  let x: i32,
}
```

We were parsing the field name as `let` instead of `x`, which causes issues later on in the type-checking phase.

(2.) Also, suggestions for `let: i32` as a field regressed, displaying this extra `help:` which is removed by this PR

```
help: remove the let, the `let` keyword is not allowed in struct field definitions
  |
2 -     let: i32,
2 +     : i32,
```

(3.) Makes the suggestion text a bit more succinct, since we don't need to re-explain that `let` is not allowed in this position (since it's in a note that follows). This causes the suggestion to render inline as well.

cc `@gimbles,` this addresses a few nits I mentioned in your PR.

20 months agoRollup merge of #102883 - Urgau:fix-stabilization-half_open_range_patterns, r=lcnr
Dylan DPC [Wed, 12 Oct 2022 16:43:25 +0000 (22:13 +0530)]
Rollup merge of #102883 - Urgau:fix-stabilization-half_open_range_patterns, r=lcnr

Fix stabilization of `feature(half_open_range_patterns)`

Fixes https://github.com/rust-lang/rust/pull/102275/files#r991292215 by removing the relevant code that was [already partial moved](https://github.com/rust-lang/rust/pull/102275/files#diff-307e0d3a2037c11a3fa16822fbaa0fec08e57ac7d0d6e7354f6005c9482a9e26).

cc `@Undin`

20 months agoRollup merge of #102830 - compiler-errors:constness-parity, r=fee1-dead
Dylan DPC [Wed, 12 Oct 2022 16:43:25 +0000 (22:13 +0530)]
Rollup merge of #102830 - compiler-errors:constness-parity, r=fee1-dead

Unify `tcx.constness` query and param env constness checks

The checks that we do in the `constness` query seem inconsistent with the checks that we do to determine if an item's param-env is const, so I merged them into the `constness` query and call that from the `param_env` query.

I'm not sure if this totally makes sense -- is there a case where `tcx.param_env()` would return a const param-env for an item whose `tcx.constness()` is `Constness::NotConst`? Because if not, it seems a bit dangerous that these two differ.

Luckily, not many places actually use `tcx.constness()`, and the checks in `tcx.param_env()` seem stricter than the checks in `tcx.constness()` (at least for the types of items we type-check).

Also, due to the way that `tcx.param_env()` is implemented, it _never_ used to return a const param-env for a item coming from a different crate, which also seems dangerous (though also probably not weaponizable currently, because we seldom actually compute the param-env for a non-local item).

20 months agoRollup merge of #102719 - Nilstrieb:tidy-alphabetical, r=jackh726
Dylan DPC [Wed, 12 Oct 2022 16:43:24 +0000 (22:13 +0530)]
Rollup merge of #102719 - Nilstrieb:tidy-alphabetical, r=jackh726

Enforce alphabetical sorting with tidy

We have many places where things are supposed to be sorted alphabetically. For the smaller and more recent size assertions, this is mostly upheld, but in other more... alive places it's very messy.

This introduces a new tidy directive to check that a section of code is sorted alphabetically and fixes all places where sorting has gone wrong.

20 months agoRollup merge of #102623 - davidtwco:translation-eager, r=compiler-errors
Dylan DPC [Wed, 12 Oct 2022 16:43:23 +0000 (22:13 +0530)]
Rollup merge of #102623 - davidtwco:translation-eager, r=compiler-errors

translation: eager translation

Part of #100717. See [Zulip thread](https://rust-lang.zulipchat.com/#narrow/stream/336883-i18n/topic/.23100717.20lists!/near/295010720) for additional context.

- **Store diagnostic arguments in a `HashMap`**: Eager translation will enable subdiagnostics to be translated multiple times with different arguments - this requires the ability to replace the value of one argument with a new value, which is better suited to a `HashMap` than the previous storage, a `Vec`.
- **Add `AddToDiagnostic::add_to_diagnostic_with`**: `AddToDiagnostic::add_to_diagnostic_with` is similar to the previous `AddToDiagnostic::add_to_diagnostic` but takes a function that can be used by the caller to modify diagnostic messages originating from the subdiagnostic (such as performing translation eagerly). `add_to_diagnostic` now just calls `add_to_diagnostic_with` with an empty closure.
- **Add `DiagnosticMessage::Eager`**: Add variant of `DiagnosticMessage` for eagerly translated messages
(messages in the target language which don't need translated by the emitter during emission). Also adds `eager_subdiagnostic` function which is intended to be invoked by the diagnostic derive for subdiagnostic fields which are marked as needing eager translation.
- **Support `#[subdiagnostic(eager)]`**: Add support for `eager` argument to the `subdiagnostic` attribute which generates a call to `eager_subdiagnostic`.
- **Finish migrating `rustc_query_system`**: Using eager translation, migrate the remaining repeated cycle stack diagnostic.
- **Split formatting initialization and use in diagnostic derives**: Diagnostic derives have previously had to take special care when ordering the generated code so that fields were not used after a move.

  This is unlikely for most fields because a field is either annotated with a subdiagnostic attribute and is thus likely a `Span` and copiable, or is a argument, in which case it is only used once by `set_arg`
anyway.

  However, format strings for code in suggestions can result in fields being used after being moved if not ordered carefully. As a result, the derive currently puts `set_arg` calls last (just before emission), such as:

      let diag = { /* create diagnostic */ };

      diag.span_suggestion_with_style(
          span,
          fluent::crate::slug,
          format!("{}", __binding_0),
          Applicability::Unknown,
          SuggestionStyle::ShowAlways
      );
      /* + other subdiagnostic additions */

      diag.set_arg("foo", __binding_0);
      /* + other `set_arg` calls */

      diag.emit();

  For eager translation, this doesn't work, as the message being translated eagerly can assume that all arguments are available - so arguments _must_ be set first.

  Format strings for suggestion code are now separated into two parts - an initialization line that performs the formatting into a variable, and a usage in the subdiagnostic addition.

  By separating these parts, the initialization can happen before arguments are set, preserving the desired order so that code compiles, while still enabling arguments to be set before subdiagnostics are added.

      let diag = { /* create diagnostic */ };

      let __code_0 = format!("{}", __binding_0);
      /* + other formatting */

      diag.set_arg("foo", __binding_0);
      /* + other `set_arg` calls */

      diag.span_suggestion_with_style(
          span,
          fluent::crate::slug,
          __code_0,
          Applicability::Unknown,
          SuggestionStyle::ShowAlways
      );
      /* + other subdiagnostic additions */

      diag.emit();

- **Remove field ordering logic in diagnostic derive:** Following the approach taken in earlier commits to separate formatting initialization from use in the subdiagnostic derive, simplify the diagnostic derive by removing the field-ordering logic that previously solved this problem.

r? ```@compiler-errors```

20 months agoAdd broken test for AFIT with RPITIT
Michael Goulet [Wed, 5 Oct 2022 03:52:38 +0000 (03:52 +0000)]
Add broken test for AFIT with RPITIT

20 months agoAuto merge of #102732 - RalfJung:assert_unsafe_precondition2, r=bjorn3
bors [Wed, 12 Oct 2022 14:39:43 +0000 (14:39 +0000)]
Auto merge of #102732 - RalfJung:assert_unsafe_precondition2, r=bjorn3

nicer errors from assert_unsafe_precondition

This makes the errors shown by cargo-careful nicer, and since `panic_no_unwind` is `nounwind noreturn` it hopefully doesn't have bad codegen impact. Thanks to `@bjorn3` for the hint!

Would be nice if we could somehow supply our own (static) message to print, currently it always prints `panic in a function that cannot unwind`. But still, this is better than before.

20 months agoError if tidy-alphabetical-end was not found
Nilstrieb [Fri, 7 Oct 2022 17:38:38 +0000 (19:38 +0200)]
Error if tidy-alphabetical-end was not found

20 months agoUse `tidy-alphabetical` in the compiler
Nilstrieb [Wed, 5 Oct 2022 19:46:21 +0000 (21:46 +0200)]
Use `tidy-alphabetical` in the compiler

20 months agoAdd tidy directoy `tidy-alphabetical`
Nilstrieb [Tue, 4 Oct 2022 20:34:07 +0000 (22:34 +0200)]
Add tidy directoy `tidy-alphabetical`

It can be used to ensure that a list of things is sorted alphabetically.
It goes off lines, but contains several heuristics to work with normal
Rust code (looking at indentation, ignoring comments and attributes).

20 months agoAuto merge of #102460 - flba-eb:fix_85261_prevent_alloc_after_fork, r=thomcc
bors [Wed, 12 Oct 2022 10:51:31 +0000 (10:51 +0000)]
Auto merge of #102460 - flba-eb:fix_85261_prevent_alloc_after_fork, r=thomcc

Prevent UB in child process after calling libc::fork

After calling libc::fork, the child process tried to access a TLS variable when processing a panic. This caused a memory allocation which is UB in the child.
To prevent this from happening, the panic handler will not access the TLS variable in case `panic::always_abort` was called before.

Fixes #85261 (not only on Android systems, but also on Linux/QNX with TLS disabled, see issue for more details)

Main drawbacks of this fix:
* Panic messages can incorrectly omit `core::panic::PanicInfo` struct in case several panics (of multiple threads) occur at the same time. The handler cannot distinguish between multiple panics in different threads or recursive ones in the same thread, but the message will contain a hint about the uncertainty.
* `panic_count::increase()` will be a bit slower as it has an additional `if`, but this should be irrelevant as it is only called in case of a panic.

20 months agoAuto merge of #102948 - Dylan-DPC:rollup-j8h74rb, r=Dylan-DPC
bors [Wed, 12 Oct 2022 06:57:24 +0000 (06:57 +0000)]
Auto merge of #102948 - Dylan-DPC:rollup-j8h74rb, r=Dylan-DPC

Rollup of 8 pull requests

Successful merges:

 - #102110 (Migrate rustc_passes diagnostics)
 - #102187 (Use correct location for type tests in promoted constants)
 - #102239 (Move style guide to rust-lang/rust)
 - #102578 (Panic for invalid arguments of `{integer primitive}::ilog{,2,10}` in all modes)
 - #102811 (Use memset to initialize readbuf)
 - #102890 (Check representability in adt_sized_constraint)
 - #102913 (unify `IsPattern` and `IsImport` enum in `show_candidates`)
 - #102924 (rustdoc: remove unused classes from sidebar links)

Failed merges:

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

20 months agoRollup merge of #102924 - notriddle:notriddle/sidebar-link-class, r=GuillaumeGomez
Dylan DPC [Wed, 12 Oct 2022 05:41:27 +0000 (11:11 +0530)]
Rollup merge of #102924 - notriddle:notriddle/sidebar-link-class, r=GuillaumeGomez

rustdoc: remove unused classes from sidebar links

Since https://github.com/rust-lang/rust/commit/98f05a0282625a5fda6e90ebf3b05a4bd7608f65 removed separate colors from the currently-selected item, there's no need to have item classes on sidebar links.

Preview: https://notriddle.com/notriddle-rustdoc-demos/sidebar-link-class/std/vec/struct.Vec.html

While cleaning up the CSS to remove unneeded `.content` selectors, this PR changes the `h1.fqn a` CSS selector to just be `h1 a`, so that the header link color selector is less specific than the typed link at the end. Since https://github.com/rust-lang/rust/pull/89506 made docblocks start at `h2`, the main page link header should be the only h1 in the page now.

20 months agoRollup merge of #102913 - SparrowLii:import-candidate, r=compiler-errors
Dylan DPC [Wed, 12 Oct 2022 05:41:26 +0000 (11:11 +0530)]
Rollup merge of #102913 - SparrowLii:import-candidate, r=compiler-errors

unify `IsPattern` and `IsImport` enum in `show_candidates`

Follow-up of #102876
A binding cannot appear in both pattern and import at the same time, so it makes sense to unify them
r? `@compiler-errors`

20 months agoRollup merge of #102890 - camsteffen:adt-sized-representability, r=cjgillot
Dylan DPC [Wed, 12 Oct 2022 05:41:26 +0000 (11:11 +0530)]
Rollup merge of #102890 - camsteffen:adt-sized-representability, r=cjgillot

Check representability in adt_sized_constraint

Now that representability is a query, we can use it to preemptively avoid a cycle in `adt_sized_constraint`.

I moved the representability check into `check_mod_type_wf` to avoid a scenario where rustc quits before checking all the types for representability. This also removes the check from rustdoc, which is alright AFAIK.

r? ``@cjgillot``

20 months agoRollup merge of #102811 - the8472:bufread-memset, r=m-ou-se
Dylan DPC [Wed, 12 Oct 2022 05:41:25 +0000 (11:11 +0530)]
Rollup merge of #102811 - the8472:bufread-memset, r=m-ou-se

Use memset to initialize readbuf

The write loop was found to be slow in #102727

The proper fix is in #102760 but this might still help debug builds and code running under miri by using the write_bytes intrinsic instead of writing one byte at a time.

20 months agoRollup merge of #102578 - lukas-code:ilog-panic, r=m-ou-se
Dylan DPC [Wed, 12 Oct 2022 05:41:25 +0000 (11:11 +0530)]
Rollup merge of #102578 - lukas-code:ilog-panic, r=m-ou-se

Panic for invalid arguments of `{integer primitive}::ilog{,2,10}` in all modes

Decision made in https://github.com/rust-lang/rust/issues/100422#issuecomment-1245864700

resolves https://github.com/rust-lang/rust/issues/100422

tracking issue: https://github.com/rust-lang/rust/issues/70887

r? `@m-ou-se`

20 months agoRollup merge of #102239 - joshtriplett:style-guide, r=calebcartwright
Dylan DPC [Wed, 12 Oct 2022 05:41:24 +0000 (11:11 +0530)]
Rollup merge of #102239 - joshtriplett:style-guide, r=calebcartwright

Move style guide to rust-lang/rust

Per [RFC 3309](https://rust-lang.github.io/rfcs/3309-style-team.html).

20 months agoRollup merge of #102187 - b-naber:inline-const-source-info, r=eholk
Dylan DPC [Wed, 12 Oct 2022 05:41:24 +0000 (11:11 +0530)]
Rollup merge of #102187 - b-naber:inline-const-source-info, r=eholk

Use correct location for type tests in promoted constants

Previously we forgot to remap the location in a type test collected when visiting the body of a promoted constant back to the usage location, causing an ICE when trying to get span information for that type test.

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

20 months agoRollup merge of #102110 - CleanCut:migrate_rustc_passes_diagnostics, r=davidtwco
Dylan DPC [Wed, 12 Oct 2022 05:41:23 +0000 (11:11 +0530)]
Rollup merge of #102110 - CleanCut:migrate_rustc_passes_diagnostics, r=davidtwco

Migrate rustc_passes diagnostics

Picks up abandoned work from https://github.com/rust-lang/rust/pull/100870

I would like to do this collaboratively, as there is a lot of work! Here's the process:

- Comment below that you are willing to help and I will add you as a collaborator to my `rust` fork (that gives you write access)
- Indicate which file/task you would like to work on (so we don't duplicate work) from the list below
- Do the work, push up a commit, comment that you're done with that file/task
- Repeat until done 😄

### Files to Migrate (in `compiler/rustc_passes/src/`)

- [x] check_attr.rs ``@CleanCut``
- [x] check_const.rs ``@CleanCut``
- [x] dead.rs ``@CleanCut``
- [x] debugger_visualizer.rs ``@CleanCut``
- [x] diagnostic_items.rs ``@CleanCut``
- [x] entry.rs ``@CleanCut``
- [x] lang_items.rs ``@CleanCut``
- [x] layout_test.rs ``@CleanCut``
- [x] lib_features.rs ``@CleanCut``
- [x] ~liveness.rs~ ``@CleanCut`` Nothing to do
- [x] loops.rs ``@CleanCut``
- [x] naked_functions.rs ``@CleanCut``
- [x] stability.rs ``@CleanCut``
- [x] weak_lang_items.rs ``@CleanCut``

### Tasks

- [x] Rebase on current `master` ``@CleanCut``
- [x] Review work from [the earlier PR](https://github.com/rust-lang/rust/pull/100870) and make sure it all looks good
  - [x] compiler/rustc_error_messages/locales/en-US/passes.ftl ``@CleanCut``
  - [x] compiler/rustc_passes/src/check_attr.rs ``@CleanCut``
  - [x] compiler/rustc_passes/src/errors.rs ``@CleanCut``
  - [x] compiler/rustc_passes/src/lang_items.rs ``@CleanCut``
  - [x] compiler/rustc_passes/src/lib.rs ``@CleanCut``
  - [x] compiler/rustc_passes/src/weak_lang_items.rs ``@CleanCut``

20 months agoTyAlias needs encoded constness too, for layout computation in rustdoc
Michael Goulet [Wed, 12 Oct 2022 04:17:21 +0000 (04:17 +0000)]
TyAlias needs encoded constness too, for layout computation in rustdoc

20 months agoUnify tcx.constness and param env constness checks
Michael Goulet [Sun, 9 Oct 2022 06:54:00 +0000 (06:54 +0000)]
Unify tcx.constness and param env constness checks

20 months agoAuto merge of #102692 - nnethercote:TokenStreamBuilder, r=Aaron1011
bors [Wed, 12 Oct 2022 03:46:16 +0000 (03:46 +0000)]
Auto merge of #102692 - nnethercote:TokenStreamBuilder, r=Aaron1011

Remove `TokenStreamBuilder`

`TokenStreamBuilder` is used to combine multiple token streams. It can be removed, leaving the code a little simpler and a little faster.

r? `@Aaron1011`

20 months agoAuto merge of #102934 - weihanglo:update-cargo, r=ehuss
bors [Wed, 12 Oct 2022 00:56:14 +0000 (00:56 +0000)]
Auto merge of #102934 - weihanglo:update-cargo, r=ehuss

Update cargo

9 commits in 3cdf1ab25dc4fe56f890e8c7330d53a23ad905d3..b8f30cb23c4e5f20854a4f683325782b7cff9837 2022-10-07 17:34:03 +0000 to 2022-10-10 19:16:06 +0000

- Add more doc comments for three modules (rust-lang/cargo#11207)
- docs: fix (rust-lang/cargo#11208)
- Add completions for `cargo remove` (rust-lang/cargo#11204)
- Config file loaded via CLI takes priority over env vars (rust-lang/cargo#11077)
- Use `#[default]` when possible (rust-lang/cargo#11197)
- Implement RFC 3289: source replacement ambiguity (rust-lang/cargo#10907)
- Use correct version of cargo in test (rust-lang/cargo#11193)
- Check empty input for login (rust-lang/cargo#11145)
- Add retry support to sparse registries (rust-lang/cargo#11069)

20 months agounify `IsPattern` and `IsImport` enum
SparrowLii [Wed, 12 Oct 2022 00:46:52 +0000 (08:46 +0800)]
unify `IsPattern` and `IsImport` enum

20 months agoUpdate books
Eric Huss [Tue, 11 Oct 2022 23:04:17 +0000 (16:04 -0700)]
Update books

20 months agorustdoc: merge identical CSS selectors
Michael Howell [Tue, 11 Oct 2022 22:05:22 +0000 (15:05 -0700)]
rustdoc: merge identical CSS selectors

20 months agorustdoc: remove unused CSS `nav.sum`
Michael Howell [Tue, 11 Oct 2022 21:46:49 +0000 (14:46 -0700)]
rustdoc: remove unused CSS `nav.sum`

This was added in 4fd061c426902b0904c65e64a3780b21f9ab3afb, but never
actually used.

20 months agoUpdate cargo
Weihang Lo [Tue, 11 Oct 2022 20:52:56 +0000 (21:52 +0100)]
Update cargo

9 commits in 3cdf1ab25dc4fe56f890e8c7330d53a23ad905d3..b8f30cb23c4e5f20854a4f683325782b7cff9837
2022-10-07 17:34:03 +0000 to 2022-10-10 19:16:06 +0000

- Add more doc comments for three modules (rust-lang/cargo#11207)
- docs: fix (rust-lang/cargo#11208)
- Add completions for `cargo remove` (rust-lang/cargo#11204)
- Config file loaded via CLI takes priority over env vars (rust-lang/cargo#11077)
- Use `#[default]` when possible (rust-lang/cargo#11197)
- Implement RFC 3289: source replacement ambiguity (rust-lang/cargo#10907)
- Use correct version of cargo in test (rust-lang/cargo#11193)
- Check empty input for login (rust-lang/cargo#11145)
- Add retry support to sparse registries (rust-lang/cargo#11069)

20 months agoreorder panicking.rs to put main entry points at the top
Ralf Jung [Sat, 8 Oct 2022 08:48:53 +0000 (10:48 +0200)]
reorder panicking.rs to put main entry points at the top

20 months agouse panic_fmt_nounwind for assert_unsafe_precondition
Ralf Jung [Thu, 6 Oct 2022 10:40:56 +0000 (12:40 +0200)]
use panic_fmt_nounwind for assert_unsafe_precondition

20 months agoadd panic_fmt_nounwind for panicing without unwinding, and use it for panic_no_unwind
Ralf Jung [Thu, 6 Oct 2022 10:40:43 +0000 (12:40 +0200)]
add panic_fmt_nounwind for panicing without unwinding, and use it for panic_no_unwind

20 months agorename rustc_allocator_nounwind to rustc_nounwind
Ralf Jung [Thu, 6 Oct 2022 10:33:29 +0000 (12:33 +0200)]
rename rustc_allocator_nounwind to rustc_nounwind

20 months agofix: return type of single-threaded dummy lock must be droppable
Andrew Brown [Tue, 11 Oct 2022 18:42:44 +0000 (11:42 -0700)]
fix: return type of single-threaded dummy lock must be droppable

20 months agoFix let removal suggestion in struct
Michael Goulet [Tue, 11 Oct 2022 17:01:22 +0000 (17:01 +0000)]
Fix let removal suggestion in struct

20 months agoAuto merge of #102926 - matthiaskrgr:rollup-oe2cdzj, r=matthiaskrgr
bors [Tue, 11 Oct 2022 17:20:48 +0000 (17:20 +0000)]
Auto merge of #102926 - matthiaskrgr:rollup-oe2cdzj, r=matthiaskrgr

Rollup of 11 pull requests

Successful merges:

 - #100387 (Check uniqueness of impl items by trait item when applicable.)
 - #101727 (Stabilize map_first_last)
 - #101774 (Warn about safety of `fetch_update`)
 - #102227 (fs::get_path solarish version.)
 - #102445 (Add `is_empty()` method to `core::ffi::CStr`.)
 - #102612 (Migrate `codegen_ssa` to diagnostics structs - [Part 1])
 - #102685 (Interpret EH actions properly)
 - #102869 (Add basename and dirname aliases)
 - #102889 (rustc_hir: Less error-prone methods for accessing `PartialRes` resolution)
 - #102893 (Fix ICE #102878)
 - #102912 (:arrow_up: rust-analyzer)

Failed merges:

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

20 months agoRollup merge of #102912 - lnicola:rust-analyzer-2022-10-11, r=lnicola
Matthias Krüger [Tue, 11 Oct 2022 16:59:51 +0000 (18:59 +0200)]
Rollup merge of #102912 - lnicola:rust-analyzer-2022-10-11, r=lnicola

:arrow_up: rust-analyzer

r? `@ghost`

20 months agoRollup merge of #102893 - TaKO8Ki:fix-102878, r=davidtwco
Matthias Krüger [Tue, 11 Oct 2022 16:59:50 +0000 (18:59 +0200)]
Rollup merge of #102893 - TaKO8Ki:fix-102878, r=davidtwco

Fix ICE #102878

Fixes #102878

20 months agoRollup merge of #102889 - petrochenkov:partres, r=cjgillot
Matthias Krüger [Tue, 11 Oct 2022 16:59:50 +0000 (18:59 +0200)]
Rollup merge of #102889 - petrochenkov:partres, r=cjgillot

rustc_hir: Less error-prone methods for accessing `PartialRes` resolution

20 months agoRollup merge of #102869 - azdavis:master, r=joshtriplett
Matthias Krüger [Tue, 11 Oct 2022 16:59:49 +0000 (18:59 +0200)]
Rollup merge of #102869 - azdavis:master, r=joshtriplett

Add basename and dirname aliases

Users might be used to the POSIX names of these functions. In fact, here's a [blog post][1] about this very thing.

[1]: https://boinkor.net/2019/07/basename-and-dirname-in-rust/

20 months agoRollup merge of #102685 - nbdd0121:unwind, r=m-ou-se
Matthias Krüger [Tue, 11 Oct 2022 16:59:49 +0000 (18:59 +0200)]
Rollup merge of #102685 - nbdd0121:unwind, r=m-ou-se

Interpret EH actions properly

The EH actions stored in the LSDA follows the format of GCC except table (even for LLVM-generated code). An missing action in the table is the encoding for `Terminate`, see https://github.com/gcc-mirror/gcc/blob/master/libstdc%2B%2B-v3/libsupc%2B%2B/eh_personality.cc#L522-L526.

The currently code interprets it as `None`, as a workaround for #35011, an issue that seems to occur in LLVM 3.7 and not after 3.9. These are very old versions of LLVM and we don't support them anymore, so remove this workaround and interpret them properly.

Note that LLVM currently does not emit any `Terminate` actions, but GCC does. Although GCC backend currently doesn't do unwinding, removing it preemptively would prevent future developers from wasting time to figure out what's wrong.

``@rustbot`` label: +T-compiler

20 months agoRollup merge of #102612 - JhonnyBillM:migrate-codegen-ssa-to-diagnostics-structs...
Matthias Krüger [Tue, 11 Oct 2022 16:59:48 +0000 (18:59 +0200)]
Rollup merge of #102612 - JhonnyBillM:migrate-codegen-ssa-to-diagnostics-structs, r=davidtwco

Migrate `codegen_ssa` to diagnostics structs - [Part 1]

Initial migration of `codegen_ssa`. Going to split this crate migration in at least two PRs in order to avoid a huge PR and to quick off some questions around:

1. Translating messages from "external" crates.
2. Interfacing with OS messages.
3. Adding UI tests while migrating diagnostics.

_See comments below._

20 months agoRollup merge of #102445 - jmillikin:cstr-is-empty, r=Mark-Simulacrum
Matthias Krüger [Tue, 11 Oct 2022 16:59:48 +0000 (18:59 +0200)]
Rollup merge of #102445 - jmillikin:cstr-is-empty, r=Mark-Simulacrum

Add `is_empty()` method to `core::ffi::CStr`.

ACP: https://github.com/rust-lang/libs-team/issues/106

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

20 months agoRollup merge of #102227 - devnexen:solarish_get_path, r=m-ou-se
Matthias Krüger [Tue, 11 Oct 2022 16:59:47 +0000 (18:59 +0200)]
Rollup merge of #102227 - devnexen:solarish_get_path, r=m-ou-se

fs::get_path solarish version.

similar to linux, albeit there is no /proc/self notion on solaris
 based system thus flattening the difference for simplification sake.

20 months agoRollup merge of #101774 - Riolku:atomic-update-aba, r=m-ou-se
Matthias Krüger [Tue, 11 Oct 2022 16:59:46 +0000 (18:59 +0200)]
Rollup merge of #101774 - Riolku:atomic-update-aba, r=m-ou-se

Warn about safety of `fetch_update`

Specifically as it relates to the ABA problem.

`fetch_update` is a useful function, and one that isn't provided by, say, C++. However, this does not mean the function is magic. It is implemented in terms of `compare_exchange_weak`, and in particular, suffers from the ABA problem. See the following code, which is a naive implementation of `pop` in a lock-free queue:

```rust
fn pop(&self) -> Option<i32> {
    self.front.fetch_update(Ordering::Relaxed, Ordering::Acquire, |front| {
        if front == ptr::null_mut() {
            None
        }
        else {
            Some(unsafe { (*front).next })
        }
    }.ok()
}
```

This code is unsound if called from multiple threads because of the ABA problem. Specifically, suppose nodes are allocated with `Box`. Suppose the following sequence happens:

```
Initial: Queue is X -> Y.

Thread A: Starts popping, is pre-empted.
Thread B: Pops successfully, twice, leaving the queue empty.
Thread C: Pushes, and `Box` returns X (very common for allocators)
Thread A: Wakes up, sees the head is still X, and stores Y as the new head.
```

But `Y` is deallocated. This is undefined behaviour.

Adding a note about this problem to `fetch_update` should hopefully prevent users from being misled, and also, a link to this common problem is, in my opinion, an improvement to our docs on atomics.

20 months agoRollup merge of #101727 - est31:stabilize_map_first_last, r=m-ou-se
Matthias Krüger [Tue, 11 Oct 2022 16:59:46 +0000 (18:59 +0200)]
Rollup merge of #101727 - est31:stabilize_map_first_last, r=m-ou-se

Stabilize map_first_last

Stabilizes the following functions:

```Rust
impl<T> BTreeSet<T> {
    pub fn first(&self) -> Option<&T> where T: Ord;
    pub fn last(&self) -> Option<&T> where T: Ord;
    pub fn pop_first(&mut self) -> Option<T> where T: Ord;
    pub fn pop_last(&mut self) -> Option<T> where T: Ord;
}

impl<K, V> BTreeMap<K, V> {
    pub fn first_key_value(&self) -> Option<(&K, &V)> where K: Ord;
    pub fn last_key_value(&self) -> Option<(&K, &V)> where K: Ord;
    pub fn first_entry(&mut self) -> Option<OccupiedEntry<'_, K, V>> where K: Ord;
    pub fn last_entry(&mut self) -> Option<OccupiedEntry<'_, K, V>> where K: Ord;
    pub fn pop_first(&mut self) -> Option<(K, V)> where K: Ord;
    pub fn pop_last(&mut self) -> Option<(K, V)> where K: Ord;
}
```

Closes #62924

~~Blocked on the [FCP](https://github.com/rust-lang/rust/issues/62924#issuecomment-1179489929) finishing.~~ Edit: It finished!

20 months agoRollup merge of #100387 - cjgillot:hygiene-trait-impl, r=petrochenkov
Matthias Krüger [Tue, 11 Oct 2022 16:59:45 +0000 (18:59 +0200)]
Rollup merge of #100387 - cjgillot:hygiene-trait-impl, r=petrochenkov

Check uniqueness of impl items by trait item when applicable.

When checking uniqueness of item names in impl blocks, we currently use the same definition of hygiene as for toplevel items.  This means that a plain item and one generated by a macro 2.0 do not collide.

This hygiene rule does not match with how impl items resolve to associated trait items. As a consequence, we misdiagnose the trait impls.

This PR proposes to consider that trait impl items are uses of the corresponding trait items during resolution, instead of checking for duplicates later. An error is emitted when a trait impl item is used twice.

There should be no stable breakage, since macros 2.0 are still unstable.

r? ``@petrochenkov``
cc ``@RalfJung``

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

20 months agorustdoc: remove unneeded `.content` selector from link colors
Michael Howell [Tue, 11 Oct 2022 16:22:40 +0000 (09:22 -0700)]
rustdoc: remove unneeded `.content` selector from link colors

Since 98f05a0282625a5fda6e90ebf3b05a4bd7608f65 and
b5963f07e611cf2a09a310eb74c1a93adfaeb9de removed color classes from sidebar
items, there's no need for the selectors to be so specific any more.

This commit does have to change `h1.fqn a` to just be `h1 a`, so that the
header link color selector is less specific than the typed link at the end.
Since #89506 made docblocks start at `h2`, the main page link header should
be the only h1 in the page now.

20 months agorustdoc: remove unused classes from sidebar
Michael Howell [Tue, 11 Oct 2022 15:50:41 +0000 (08:50 -0700)]
rustdoc: remove unused classes from sidebar

Since 98f05a0282625a5fda6e90ebf3b05a4bd7608f65 removed separate colors
from the currently-selected item, there's no need to have item classes on
sidebar links.

20 months agoAuto merge of #102894 - RalfJung:compiler_builtins, r=Amanieu
bors [Tue, 11 Oct 2022 14:04:59 +0000 (14:04 +0000)]
Auto merge of #102894 - RalfJung:compiler_builtins, r=Amanieu

update compiler_builtins

r? `@Amanieu`

20 months agoAuto merge of #102915 - JohnTitor:rollup-5ht99y1, r=JohnTitor
bors [Tue, 11 Oct 2022 11:03:12 +0000 (11:03 +0000)]
Auto merge of #102915 - JohnTitor:rollup-5ht99y1, r=JohnTitor

Rollup of 7 pull requests

Successful merges:

 - #102258 (Remove unused variable in float formatting.)
 - #102277 (Consistently write `RwLock`)
 - #102412 (Never panic in `thread::park` and `thread::park_timeout`)
 - #102589 (scoped threads: pass closure through MaybeUninit to avoid invalid dangling references)
 - #102625 (fix backtrace small typo)
 - #102859 (Move lifetime resolution module to rustc_hir_analysis.)
 - #102898 (rustdoc: remove unneeded `<div>` wrapper from sidebar DOM)

Failed merges:

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

20 months agoRollup merge of #102898 - notriddle:notriddle/sidebar-block, r=GuillaumeGomez
Yuki Okushi [Tue, 11 Oct 2022 09:37:55 +0000 (18:37 +0900)]
Rollup merge of #102898 - notriddle:notriddle/sidebar-block, r=GuillaumeGomez

rustdoc: remove unneeded `<div>` wrapper from sidebar DOM

When this was added, the sidebar had a bit more complex style. It can be removed, now.

Preview: https://notriddle.com/notriddle-rustdoc-demos/sidebar-block/std/index.html

20 months agoRollup merge of #102859 - cjgillot:collect-lifetimes, r=oli-obk
Yuki Okushi [Tue, 11 Oct 2022 09:37:55 +0000 (18:37 +0900)]
Rollup merge of #102859 - cjgillot:collect-lifetimes, r=oli-obk

Move lifetime resolution module to rustc_hir_analysis.

Now that lifetime resolution has been removed from it, this file has nothing to do in `rustc_resolve`.  It's purpose is to compute Debruijn indices for lifetimes, so let's put it in type collection.

20 months agoRollup merge of #102625 - Rageking8:fix-backtrace-small-typo, r=m-ou-se
Yuki Okushi [Tue, 11 Oct 2022 09:37:54 +0000 (18:37 +0900)]
Rollup merge of #102625 - Rageking8:fix-backtrace-small-typo, r=m-ou-se

fix backtrace small typo

20 months agoRollup merge of #102589 - RalfJung:scoped-threads-dangling, r=m-ou-se
Yuki Okushi [Tue, 11 Oct 2022 09:37:54 +0000 (18:37 +0900)]
Rollup merge of #102589 - RalfJung:scoped-threads-dangling, r=m-ou-se

scoped threads: pass closure through MaybeUninit to avoid invalid dangling references

The `main` function defined here looks roughly like this, if it were written as a more explicit stand-alone function:
```rust
// Not showing all the `'lifetime` tracking, the point is that
// this closure might live shorter than `thread`.
fn thread(control: ..., closure: impl FnOnce() + 'lifetime) {
    closure();
    control.signal_done();
    // A lot of time can pass here.
}
```
Note that `thread` continues to run even after `signal_done`! Now consider what happens if the `closure` captures a reference of lifetime `'lifetime`:
- The type of `closure` is a struct (the implicit unnameable closure type) with a `&'lifetime mut T` field. References passed to a function are marked with `dereferenceable`, which is LLVM speak for *this reference will remain live for the entire duration of this function*.
- The closure runs, `signal_done` runs. Then -- potentially -- this thread gets scheduled away and the main thread runs, seeing the signal and returning to the user. Now `'lifetime` ends and the memory the reference points to might be deallocated.
- Now we have UB! The reference that as passed to `thread` with the promise of remaining live for the entire duration of the function, actually got deallocated while the function still runs. Oops.

Long-term I think we should be able to use `ManuallyDrop` to fix this without `unsafe`, or maybe a new `MaybeDangling` type. I am working on an RFC for that. But in the mean time it'd be nice to fix this so that Miri with `-Zmiri-retag-fields` (which is needed for "full enforcement" of all the LLVM flags we generate) stops erroring on scoped threads.

Fixes https://github.com/rust-lang/rust/issues/101983
r? `@m-ou-se`

20 months agoRollup merge of #102412 - joboet:dont_panic, r=m-ou-se
Yuki Okushi [Tue, 11 Oct 2022 09:37:53 +0000 (18:37 +0900)]
Rollup merge of #102412 - joboet:dont_panic, r=m-ou-se

Never panic in `thread::park` and `thread::park_timeout`

fixes #102398

`@rustbot` label +T-libs +T-libs-api

20 months agoRollup merge of #102277 - mgeisler:rwlock, r=m-ou-se
Yuki Okushi [Tue, 11 Oct 2022 09:37:52 +0000 (18:37 +0900)]
Rollup merge of #102277 - mgeisler:rwlock, r=m-ou-se

Consistently write `RwLock`

Before the documentation sometimes referred to an "rwlock" and sometimes to "`RwLock`".

20 months agoRollup merge of #102258 - cjgillot:core-kappa, r=m-ou-se
Yuki Okushi [Tue, 11 Oct 2022 09:37:52 +0000 (18:37 +0900)]
Rollup merge of #102258 - cjgillot:core-kappa, r=m-ou-se

Remove unused variable in float formatting.

20 months agoAuto merge of #102755 - pcc:data-local-tmp, r=Mark-Simulacrum
bors [Tue, 11 Oct 2022 08:09:41 +0000 (08:09 +0000)]
Auto merge of #102755 - pcc:data-local-tmp, r=Mark-Simulacrum

tools/remote-test-{server,client}: Use /data/local/tmp on Android

The /data/tmp directory does not exist, at least not on recent versions of Android, which currently leads to test failures on that platform. I checked a virtual device running AOSP master and a Nexus 5 running Android Marshmallow and on both devices the /data/tmp directory does not exist and /data/local/tmp does, so let's switch to /data/local/tmp.

20 months ago:arrow_up: rust-analyzer
Laurențiu Nicola [Tue, 11 Oct 2022 07:37:35 +0000 (10:37 +0300)]
:arrow_up: rust-analyzer

20 months agoReport duplicate definitions in trait impls during resolution.
Camille GILLOT [Wed, 10 Aug 2022 19:31:26 +0000 (21:31 +0200)]
Report duplicate definitions in trait impls during resolution.

20 months agorustc_hir: Less error-prone methods for accessing `PartialRes` resolution
Vadim Petrochenkov [Mon, 10 Oct 2022 15:21:35 +0000 (19:21 +0400)]
rustc_hir: Less error-prone methods for accessing `PartialRes` resolution

20 months agoAuto merge of #102724 - pcc:scs-fix-test, r=Mark-Simulacrum
bors [Tue, 11 Oct 2022 04:27:13 +0000 (04:27 +0000)]
Auto merge of #102724 - pcc:scs-fix-test, r=Mark-Simulacrum

Fix the sanitizer_scs_attr_check.rs test

The test is failing when targeting aarch64 Android. The intent appears to have been to look for a function attributes comment (or the absence of one) on the line preceding the function declaration. But this isn't quite possible with FileCheck and the test as written was looking for a line with `no_scs` after a line with `scs`, which doesn't appear in the output. Instead, match on the function attributes comment on the line following the demangled function name comment.

20 months agoRemove outdated comment
Michael Howell [Tue, 11 Oct 2022 00:53:27 +0000 (17:53 -0700)]
Remove outdated comment

20 months agoAuto merge of #102896 - matthiaskrgr:rollup-jg5xawz, r=matthiaskrgr
bors [Tue, 11 Oct 2022 00:36:26 +0000 (00:36 +0000)]
Auto merge of #102896 - matthiaskrgr:rollup-jg5xawz, r=matthiaskrgr

Rollup of 6 pull requests

Successful merges:

 - #101360 (Point out incompatible closure bounds)
 - #101789 (`let`'s not needed in struct field definitions)
 - #102846 (update to syn-1.0.102)
 - #102871 (rustdoc: clean up overly complex `.trait-impl` CSS selectors)
 - #102876 (suggest candidates for unresolved import)
 - #102888 (Improve rustdoc-gui search-color test)

Failed merges:

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

20 months agoDo not alias for fs
Ariel Davis [Tue, 11 Oct 2022 00:05:59 +0000 (17:05 -0700)]
Do not alias for fs

20 months agoAuto merge of #101720 - GuillaumeGomez:warn-INVALID_HTML_TAGS, r=notriddle
bors [Mon, 10 Oct 2022 21:41:02 +0000 (21:41 +0000)]
Auto merge of #101720 - GuillaumeGomez:warn-INVALID_HTML_TAGS, r=notriddle

Change default level of INVALID_HTML_TAGS to warning and stabilize it

Fixes of #67799.

cc `@Nemo157`
r? `@notriddle`

20 months agoCheck representability in adt_sized_constraint
Cameron Steffen [Mon, 10 Oct 2022 16:22:41 +0000 (11:22 -0500)]
Check representability in adt_sized_constraint

20 months agoRollup merge of #102888 - GuillaumeGomez:improve-search-color-check, r=notriddle
Matthias Krüger [Mon, 10 Oct 2022 18:47:34 +0000 (20:47 +0200)]
Rollup merge of #102888 - GuillaumeGomez:improve-search-color-check, r=notriddle

Improve rustdoc-gui search-color test

Thanks to the add of "functions" in `browser-ui-test`, we can start to reduce the size of the scripts. It'll be very useful for all color checks.

r? `@notriddle`

20 months agoRollup merge of #102876 - SparrowLii:import-candidate, r=fee1-dead
Matthias Krüger [Mon, 10 Oct 2022 18:47:34 +0000 (20:47 +0200)]
Rollup merge of #102876 - SparrowLii:import-candidate, r=fee1-dead

suggest candidates for unresolved import

Currently we prompt suggestion of candidates(help notes of `use xxx::yyy`) for names which cannot be resolved, but we don't do that for import statements themselves that couldn't be resolved. It seems reasonable to add candidate help information for these statements as well.
Fixes #102711

20 months agoRollup merge of #102871 - notriddle:notriddle/trait-impl-anchor, r=GuillaumeGomez
Matthias Krüger [Mon, 10 Oct 2022 18:47:33 +0000 (20:47 +0200)]
Rollup merge of #102871 - notriddle:notriddle/trait-impl-anchor, r=GuillaumeGomez

rustdoc: clean up overly complex `.trait-impl` CSS selectors

When added in 45964368f4a2e31c94e9bcf1cef933c087d21544, these multi-class selectors were present in the initial commit, but no reason was given why the shorter selector wouldn't work.

20 months agoRollup merge of #102846 - zertosh:update-syn, r=dtolnay
Matthias Krüger [Mon, 10 Oct 2022 18:47:33 +0000 (20:47 +0200)]
Rollup merge of #102846 - zertosh:update-syn, r=dtolnay

update to syn-1.0.102

This update removes the only `.gitignore` found in `rustc-src`:

    vendor/syn/tests/.gitignore
    vendor/syn-1.0.91/tests/.gitignore
    vendor/syn-1.0.95/tests/.gitignore

To check-in `rustc-src` for hermetic builds in environments with
restrictive `.gitignore` policies, one has to remove these
`tests/.gitignore` and patch the respective
`.cargo-checksum.json`.`syn` >1.0.101 includes dtolnay/syn@3c49303bed7a,
which removes its `tests/.gitignore`. Now the `syn` crates.io package
has no `.gitignore`.

[`rustc-src`'s `vendor`][] is produced from the root `Cargo.toml`,
`src/tools/rust-analyzer/Cargo.toml`,
`compiler/rustc_codegen_cranelift/Cargo.toml`, and
`src/bootstrap/Cargo.toml`. `rustc_codegen_cranelift` does not use
`syn`.

[`rustc-src`'s `vendor`]:
  https://github.com/rust-lang/rust/blob/c0784109daa0/src/bootstrap/dist.rs#L934-L940

This was produced with:

    cargo update --package syn --precise 1.0.102 \

    cargo update --package syn --precise 1.0.102 \
        --manifest-path src/tools/rust-analyzer/Cargo.toml

    cargo update --package syn --precise 1.0.102 \
        --manifest-path src/bootstrap/Cargo.toml

20 months agoRollup merge of #101789 - gimbles:let, r=estebank
Matthias Krüger [Mon, 10 Oct 2022 18:47:32 +0000 (20:47 +0200)]
Rollup merge of #101789 - gimbles:let, r=estebank

`let`'s not needed in struct field definitions

Fixes #101683

20 months agoRollup merge of #101360 - compiler-errors:multiple-closure-bounds, r=petrochenkov
Matthias Krüger [Mon, 10 Oct 2022 18:47:31 +0000 (20:47 +0200)]
Rollup merge of #101360 - compiler-errors:multiple-closure-bounds, r=petrochenkov

Point out incompatible closure bounds

Fixes #100295

20 months agoFix unclosed HTML tag in clippy doc
Guillaume Gomez [Mon, 10 Oct 2022 18:45:04 +0000 (20:45 +0200)]
Fix unclosed HTML tag in clippy doc

20 months agoAuto merge of #102596 - scottmcm:option-bool-calloc, r=Mark-Simulacrum
bors [Mon, 10 Oct 2022 18:42:40 +0000 (18:42 +0000)]
Auto merge of #102596 - scottmcm:option-bool-calloc, r=Mark-Simulacrum

Do the `calloc` optimization for `Option<bool>`

Inspired by <https://old.reddit.com/r/rust/comments/xtiqj8/why_is_this_functional_version_faster_than_my_for/iqqy37b/>.

20 months agorustdoc: remove unneeded `<div>` wrapper from sidebar DOM
Michael Howell [Mon, 10 Oct 2022 18:37:19 +0000 (11:37 -0700)]
rustdoc: remove unneeded `<div>` wrapper from sidebar DOM

When this was added, the sidebar had a bit more complex style. It can be
removed, now.

20 months agoupdate compiler_builtins
Ralf Jung [Mon, 10 Oct 2022 18:13:45 +0000 (20:13 +0200)]
update compiler_builtins

20 months agofix #102878
Takayuki Maeda [Mon, 10 Oct 2022 17:43:36 +0000 (02:43 +0900)]
fix #102878

20 months agoMove lifetime resolution module to rustc_hir_analysis.
Camille GILLOT [Sun, 9 Oct 2022 20:26:39 +0000 (20:26 +0000)]
Move lifetime resolution module to rustc_hir_analysis.

20 months agoFix unclosed HTML tag in rustfmt doc
Guillaume Gomez [Mon, 10 Oct 2022 16:29:17 +0000 (18:29 +0200)]
Fix unclosed HTML tag in rustfmt doc

20 months agoFix compiler docs
Guillaume Gomez [Sun, 9 Oct 2022 14:15:23 +0000 (16:15 +0200)]
Fix compiler docs

20 months agoFix doc lint error
Guillaume Gomez [Sat, 8 Oct 2022 12:42:38 +0000 (14:42 +0200)]
Fix doc lint error

20 months agoStabilize rustdoc CHECK_INVALID_HTML_TAGS check
Guillaume Gomez [Mon, 12 Sep 2022 10:07:43 +0000 (12:07 +0200)]
Stabilize rustdoc CHECK_INVALID_HTML_TAGS check

20 months agoUpdate rustdoc tests
Guillaume Gomez [Tue, 13 Sep 2022 10:01:07 +0000 (12:01 +0200)]
Update rustdoc tests

20 months agoChange default lint level of INVALID_HTML_TAGS to warning
Guillaume Gomez [Mon, 12 Sep 2022 13:02:45 +0000 (15:02 +0200)]
Change default lint level of INVALID_HTML_TAGS to warning

20 months agomake up your mind, rustfmt
Nathan Stocks [Mon, 10 Oct 2022 16:06:44 +0000 (10:06 -0600)]
make up your mind, rustfmt

20 months agoImplement `env_lock` with `RwLock`
Andrew Brown [Thu, 29 Sep 2022 18:17:15 +0000 (11:17 -0700)]
Implement `env_lock` with `RwLock`

Copying the approach of the Unix target, this change uses the standard
`RwLock` to protect against concurrent access of libc's environment.
This locking is only enabled when WebAssembly's `atomics` feature is
also enabled.

20 months agoSimplify result color checks
Guillaume Gomez [Mon, 10 Oct 2022 15:59:51 +0000 (17:59 +0200)]
Simplify result color checks

20 months agoUpdate browser-ui-test version to 0.12.2
Guillaume Gomez [Mon, 10 Oct 2022 13:09:38 +0000 (15:09 +0200)]
Update browser-ui-test version to 0.12.2

20 months agoAllow compiling the `wasm32-wasi` std library with atomics
Andrew Brown [Tue, 27 Sep 2022 18:50:47 +0000 (11:50 -0700)]
Allow compiling the `wasm32-wasi` std library with atomics

The issue #102157 demonstrates how currently the `-Z build-std` option
will fail when re-compiling the standard library with `RUSTFLAGS` like
`RUSTFLAGS="-C target-feature=+atomics,+bulk-memory -C
link-args=--shared-memory"`. This change attempts to resolve those build
issues by depending on the the WebAssembly `futex` module and providing
an implementation for `env_lock`. Fixes #102157.

20 months agoremove out-of-date fixme
Nathan Stocks [Mon, 10 Oct 2022 15:52:53 +0000 (09:52 -0600)]
remove out-of-date fixme

20 months agoFix stabilization of `feature(half_open_range_patterns)`
Urgau [Mon, 10 Oct 2022 13:45:05 +0000 (15:45 +0200)]
Fix stabilization of `feature(half_open_range_patterns)`

20 months agomacros: simplify field ordering in diag derive
David Wood [Mon, 3 Oct 2022 15:10:34 +0000 (16:10 +0100)]
macros: simplify field ordering in diag derive

Following the approach taken in earlier commits to separate formatting
initialization from use in the subdiagnostic derive, simplify the
diagnostic derive by removing the field-ordering logic that previously
solved this problem.

Signed-off-by: David Wood <david.wood@huawei.com>