Commit Graph

677 Commits

Author SHA1 Message Date
Esteban Küber e6b84eb797 Suggest `move` in nested closure when appropriate
Fix #64008.
2023-02-02 16:26:01 +00:00
Matthias Krüger 08181eabfe
Rollup merge of #107577 - nnethercote:reinstate-hir-stats, r=jyn514
Reinstate the `hir-stats.rs` tests on stage 1.

r? ```@the8472```
2023-02-02 17:14:08 +01:00
Matthias Krüger 3e0995a440
Rollup merge of #107532 - compiler-errors:erase-regions-in-uninhabited, r=jackh726
Erase regions before doing uninhabited check in borrowck

~Also, fingerprint query keys/values when debug assertions are enabled. This should make it easier to check for issues like this without `-Cincremental`, and make UI tests a bit cleaner.~ edit: moving that to a separate PR

Fixes #107505
2023-02-02 17:14:07 +01:00
Matthias Krüger 6917040cf0
Rollup merge of #107524 - cjgillot:both-storage, r=RalfJung
Remove both StorageLive and StorageDead in CopyProp.

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

https://github.com/rust-lang/rust/pull/106908 removed StorageDead without the accompanying StorageLive. In loops, execution would see repeated StorageLive, without any StorageDead, which is UB.

So when removing storage statements, we have to remove both StorageLive and StorageDead.

~I also added a MIR validation pass for StorageLive. It may be a bit overzealous.~
2023-02-02 17:14:06 +01:00
Matthias Krüger e9c4e291c4
Rollup merge of #107493 - clubby789:range-fat-arrow-followup, r=estebank
Improve diagnostic for missing space in range pattern

Improves the diagnostic in #107425 by turning it into a note explaining the parsing issue.

r? `@compiler-errors`
2023-02-02 17:14:05 +01:00
Matthias Krüger 8f47954742
Rollup merge of #106919 - compiler-errors:underscore-typo-in-field-pat, r=jackh726
Recover `_` as `..` in field pattern
2023-02-02 17:14:05 +01:00
clubby789 4ab75de934 Improve diagnostic for missing space in range pattern 2023-02-02 13:18:12 +00:00
bors 97872b792c Auto merge of #107478 - compiler-errors:anon-enum-tys-are-ambiguous, r=estebank
Revert "Teach parser to understand fake anonymous enum syntax" and related commits

anonymous enum types are currently ambiguous in positions like:

* `|` operator: `a as fn() -> B | C`
* closure args: `|_: as fn() -> A | B`

I first tried to thread around `RecoverAnonEnum` into all these positions, but the resulting complexity in the compiler is IMO not worth it, or at least worth a bit more thinking time. In the mean time, let's revert this syntax for now, so we can go back to the drawing board.

Fixes #107461

cc: `@estebank` `@cjgillot` #106960

---
### Squashed revert commits:

Revert "review comment: Remove AST AnonTy"

This reverts commit 020cca8d36.

Revert "Ensure macros are not affected"

This reverts commit 12d18e4031.

Revert "Emit fewer errors on patterns with possible type ascription"

This reverts commit c847a01a3b.

Revert "Teach parser to understand fake anonymous enum syntax"

This reverts commit 2d82420665.
2023-02-02 12:01:17 +00:00
Mads Ravn f922c8395d PR fixing wrong order of format parameters in strings. Issue #106572
Adding

Adding

Fixing small issues for PR

Adding tests

Removing unused binding

Changing the wording on note

Fixing PR comment
2023-02-02 12:56:04 +01:00
Michael Goulet 9dd5d3e8e4 Recover _ as .. in field pattern 2023-02-02 06:10:02 +00:00
Michael Goulet 39db65c526 Add a test 2023-02-02 05:54:35 +00:00
Michael Goulet e4b2936983 Revert "Teach parser to understand fake anonymous enum syntax" and related commits
Revert "review comment: Remove AST AnonTy"

This reverts commit 020cca8d36.

Revert "Ensure macros are not affected"

This reverts commit 12d18e4031.

Revert "Emit fewer errors on patterns with possible type ascription"

This reverts commit c847a01a3b.

Revert "Teach parser to understand fake anonymous enum syntax"

This reverts commit 2d82420665.
2023-02-02 05:54:35 +00:00
Matthias Krüger 643fc97fd3
Rollup merge of #107576 - P1n3appl3:master, r=tmandry
Add proc-macro boilerplate to crt-static test

I was seeing this failure when running ui tests with with a `-Cpanic=abort` stdlib targeting fuchsia:

```
---- [ui] tests/ui/proc-macro/crt-static.rs stdout ----
normalized stderr:
warning: building proc macro crate with `panic=abort` may crash the compiler should the proc-macro panic

warning: 1 warning emitted

The actual stderr differed from the expected stderr.
```

`force-host` was enough to stop it from running/failing, not sure if I should also add `needs-unwind`?
2023-02-02 06:52:15 +01:00
Matthias Krüger 150b9d753b
Rollup merge of #107488 - nnethercote:fix-PartialEq-syntax, r=RalfJung
Fix syntax in `-Zunpretty-expanded` output for derived `PartialEq`.

If you do `derive(PartialEq)` on a packed struct, the output shown by `-Zunpretty=expanded` includes expressions like this:
```
{ self.x } == { other.x }
```
This is invalid syntax. This doesn't break compilation, because the AST nodes are constructed within the compiler. But it does mean anyone using `-Zunpretty=expanded` output as a guide for hand-written impls could get a nasty surprise.

This commit fixes things by instead using this form:
```
({ self.x }) == ({ other.x })
```

r? ``@RalfJung``
2023-02-02 06:52:14 +01:00
Matthias Krüger 480c4a18d5
Rollup merge of #107201 - compiler-errors:confusing-async-fn-note, r=estebank
Remove confusing 'while checking' note from opaque future type mismatches

Maybe I'm just misinterpreting the wording of the note. The only value I can see in this note is that it points out where the async's opaque future is coming from, but the way it's doing it is misleading IMO.

For example:

```rust
note: while checking the return type of the `async fn`
  --> $DIR/dont-suggest-missing-await.rs:7:24
   |
LL | async fn make_u32() -> u32 {
   |                        ^^^ checked the `Output` of this `async fn`, found opaque type
```

We point at the type `u32` in the HIR, but then say "found opaque type". We also say "while checking"... but we're typechecking a totally different function when we get this type mismatch!

r? ``@estebank`` but feel free to reassign and/or take your time reviewing this. I'd be inclined to also discuss reworking the presentation of this type mismatch to restore some of these labels in a way that makes it more clear what it's trying to point out.
2023-02-02 06:52:13 +01:00
Michael Goulet 64f5293956 Don't cause a cycle when formatting query description that references a FnDef 2023-02-02 05:49:07 +00:00
Bryan Garza 1a65219a49 Bless tests after rebase 2023-02-02 01:38:14 +00:00
Bryan Garza 776918971d Update test to not trigger stack overflow 2023-02-02 01:20:12 +00:00
Bryan Garza cb6de47d3b Move ignore-pass to large-arg test 2023-02-02 01:20:12 +00:00
Bryan Garza 7e56265ea0 Update based on PR comments 2023-02-02 01:20:12 +00:00
Bryan Garza cc8f990e91 Add tests to assert current behavior of large future sizes
Based on a couple of sources:
- https://swatinem.de/blog/future-size/
- https://github.com/rust-lang/rust/issues/62958
2023-02-02 01:20:12 +00:00
Nicholas Nethercote e30cd18fcc Reinstate the `hir-stats.rs` tests on stage 1. 2023-02-02 10:24:30 +11:00
Joseph Ryan fb38578082 Add proc-macro boilerplate to crt-static test 2023-02-01 13:35:36 -08:00
Xiretza 87ef37dbd7 rustc_parse: migrate more to diagnostic structs 2023-02-01 21:50:34 +01:00
Xiretza ac9c66bff5 tests: rename test cases to match new behaviour 2023-02-01 21:50:34 +01:00
Xiretza 0757d5f83f Fix condition for "missing `struct`" diagnostic on tuple structs
The check previously matched this, and suggested adding a missing
`struct`:

pub Foo(...):

It was probably intended to match this instead (semicolon instead of
colon):

pub Foo(...);
2023-02-01 21:50:34 +01:00
Xiretza f2acbb9d1e Forbid #[suggestion_*(...)] on Vecs
It is ambiguous whether this should produce several `.span_suggestions()`
calls or one `.multipart_suggestions()` call.
2023-02-01 21:49:45 +01:00
bors 11d96b5930 Auto merge of #107257 - inquisitivecrystal:ffi-attr, r=davidtwco
Strengthen validation of FFI attributes

Previously, `codegen_attrs` validated the attributes `#[ffi_pure]`, `#[ffi_const]`, and `#[ffi_returns_twice]` to make sure that they were only used on foreign functions. However, this validation was insufficient in two ways:

1. `codegen_attrs` only sees items for which code must be generated, so it was unable to raise errors when the attribute was incorrectly applied to macros and the like.
2. the validation code only checked that the item with the attr was foreign, but not that it was a foreign function, allowing these attributes to be applied to foreign statics as well.

This PR moves the validation to `check_attr`, which sees all items. It additionally changes the validation to ensure that the attribute's target is `Target::ForeignFunction`, only allowing the attributes on foreign functions and not foreign statics. Because these attributes are unstable, there is no risk for backwards compatibility. The changes also ending up making the code much easier to read.

This PR is best reviewed commit by commit. Additionally, I was considering moving the tests to the `attribute` subdirectory, to get them out of the general UI directory. I could do that as part of this PR or a follow-up, as the reviewer prefers.

CC: #58328, #58329
2023-02-01 11:37:24 +00:00
Deadbeef 679dde7338 fix parser mistaking const closures for const item 2023-02-01 06:44:30 +00:00
Matthias Krüger f41f154dfb
Rollup merge of #107533 - pnkfelix:distinguish-generator-state-in-print-type-sizes, r=compiler-errors
Extend `-Z print-type-sizes` to distinguish generator upvars+locals from "normal" fields.

For example, for this code:

```rust
async fn wait() {}

async fn test(arg: [u8; 8192]) {
    wait().await;
    drop(arg);
}

async fn test_ideal(_rg: [u8; 8192]) {
    wait().await;
    // drop(arg);
}

fn main() {
    let gen_t = test([0; 8192]);
    let gen_i = test_ideal([0; 8192]);
    println!("expect {}, got: {}",
             std::mem::size_of_val(&gen_i),
             std::mem::size_of_val(&gen_t));
}
```

the `-Z print-type-sizes` output used to start with:

```
print-type-size type: `[async fn body@issue-62958-a.rs:3:32: 6:2]`: 16386 bytes, alignment: 1 bytes
print-type-size     discriminant: 1 bytes
print-type-size     variant `Suspend0`: 16385 bytes
print-type-size         field `.arg`: 8192 bytes, offset: 0 bytes, alignment: 1 bytes
print-type-size         field `.arg`: 8192 bytes
print-type-size         field `.__awaitee`: 1 bytes
...
print-type-size type: `std::mem::ManuallyDrop<[u8; 8192]>`: 8192 bytes, alignment: 1 bytes
print-type-size     field `.value`: 8192 bytes
...
```

but with this change, it now instead prints:

```
print-type-size type: `[async fn body@issue-62958-a.rs:3:32: 6:2]`: 16386 bytes, alignment: 1 bytes
print-type-size     discriminant: 1 bytes
print-type-size     variant `Suspend0`: 16385 bytes
print-type-size         upvar `.arg`: 8192 bytes, offset: 0 bytes, alignment: 1 bytes
print-type-size         local `.arg`: 8192 bytes
print-type-size         local `.__awaitee`: 1 bytes
...
print-type-size type: `std::mem::ManuallyDrop<[u8; 8192]>`: 8192 bytes, alignment: 1 bytes
print-type-size     field `.value`: 8192 bytes
```

(spawned off of investigation of https://github.com/rust-lang/rust/issues/62958 )
2023-02-01 05:54:40 +01:00
Matthias Krüger a37a59f45e
Rollup merge of #107499 - compiler-errors:deduce_sig_from_projection-generator-tweak, r=michaelwoerister
Do not depend on Generator trait when deducing closure signature

1. Do not depend on `Generator` trait when deducing closure signature.
2. Compare the name of the `Generator::Return` associated item, rather than its order in the trait. Seems more stable this way.
2023-02-01 05:54:39 +01:00
Matthias Krüger 6390d25eab
Rollup merge of #107487 - edward-shen:edward-shen/107213-round-2, r=estebank
Make the "extra if in let...else block" hint a suggestion

Changes the hint to a suggestion, suggested in #107213.

r? ```@estebank```
2023-02-01 05:54:39 +01:00
Matthias Krüger 0d2ab67742
Rollup merge of #107389 - zvavybir:master, r=estebank
Fixing confusion between mod and remainder

Like many programming languages, rust too confuses remainder and modulus.  The `%` operator and the associated `Rem` trait is (as the trait name suggests) the remainder, but since most people are linguistically more familiar with the modulus the documentation sometimes claims otherwise.  This PR tries to fix this problem in rustc.
2023-02-01 05:54:37 +01:00
Nicholas Nethercote 75e87d1f81 Fix syntax in `-Zunpretty-expanded` output for derived `PartialEq`.
If you do `derive(PartialEq)` on a packed struct, the output shown by
`-Zunpretty=expanded` includes expressions like this:
```
{ self.x } == { other.x }
```
This is invalid syntax. This doesn't break compilation, because the AST
nodes are constructed within the compiler. But it does mean anyone using
`-Zunpretty=expanded` output as a guide for hand-written impls could get
a nasty surprise.

This commit fixes things by instead using this form:
```
({ self.x }) == ({ other.x })
```
2023-02-01 15:14:05 +11:00
bors ad8e1dc286 Auto merge of #107536 - GuillaumeGomez:rollup-xv7dx2h, r=GuillaumeGomez
Rollup of 12 pull requests

Successful merges:

 - #106898 (Include both md and yaml ICE ticket templates)
 - #107331 (Clean up eslint annotations and remove unused JS function)
 - #107348 (small refactor to new projection code)
 - #107354 (rustdoc: update Source Serif 4 from 4.004 to 4.005)
 - #107412 (avoid needless checks)
 - #107467 (Improve enum checks)
 - #107486 (Track bound types like bound regions)
 - #107491 (rustdoc: remove unused CSS from `.setting-check`)
 - #107508 (`Edition` micro refactor)
 - #107525 (PointeeInfo is advisory only)
 - #107527 (rustdoc: stop making unstable items transparent)
 - #107535 (Replace unwrap with ? in TcpListener doc)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2023-02-01 01:15:02 +00:00
Michael Goulet 2c23c7f0cd Erase regions before uninhabited check 2023-02-01 01:14:34 +00:00
Felix S. Klock II 362c4fa755 Bless updated output from print-type-sizes tests. 2023-01-31 20:00:54 -05:00
Guillaume Gomez 9e0bfe0fb0
Rollup merge of #107527 - notriddle:notriddle/wcagcontrast, r=GuillaumeGomez
rustdoc: stop making unstable items transparent

Fixes #93393
2023-01-31 23:38:54 +01:00
Ralf Jung dfc4a7b2d0 make unaligned_reference a hard error 2023-01-31 20:28:11 +01:00
Michael Howell f75b350467 rustdoc: stop making unstable items transparent
Fixes #93393
2023-01-31 11:27:09 -07:00
Camille GILLOT e8ac0404bd Remove assignment. 2023-01-31 18:07:57 +00:00
Camille GILLOT 3c10cf088a Remove both StorageLive and StorageDead in CopyProp. 2023-01-31 17:50:04 +00:00
Camille GILLOT 05ee406cc8 Add test. 2023-01-31 17:49:57 +00:00
Michael Howell 3a20cbf9fc rustdoc: remove inconsistently-present sidebar tooltips
Discussed in
https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/Inconsistent.20sidebar.20tooltips/near/323565625
2023-01-31 10:12:13 -07:00
bors f361413cbf Auto merge of #106399 - estebank:type-err-span-label, r=nagisa
Modify primary span label for E0308

Looking at the reactions to https://hachyderm.io/`@ekuber/109622160673605438,` a lot of people seem to have trouble understanding the current output, where the primary span label on type errors talks about the specific types that diverged, but these can be deeply nested type parameters. Because of that we could see "expected i32, found u32" in the label while the note said "expected Vec<i32>, found Vec<u32>". This understandably confuses people. I believe that once people learn to read these errors it starts to make more sense, but this PR changes the output to be more in line with what people might expect, without sacrificing terseness.

Fix #68220.
2023-01-31 13:53:40 +00:00
bors a64ef7d07d Auto merge of #100754 - davidtwco:translation-incremental, r=compiler-errors
incremental: migrate diagnostics

- Apply the diagnostic migration lints to more functions on `Session`, namely: `span_warn`, `span_warn_with_code`, `warn` `note_without_error`, `span_note_without_error`, `struct_note_without_error`.
- Add impls of `IntoDiagnosticArg` for `std::io::Error`, `std::path::Path` and `std::path::PathBuf`.
- Migrate the `rustc_incremental` crate's diagnostics to translatable diagnostic structs.

r? `@compiler-errors`
cc #100717
2023-01-31 10:20:58 +00:00
Michael Goulet 7892cc3c5f Do not depend on Generator trait when deducing closure signature 2023-01-31 02:59:36 +00:00
Yuki Okushi f95f835470
Rollup merge of #107479 - compiler-errors:probe-can-call-ocx, r=BoxyUwU
Use `ObligationCtxt::new_in_snapshot` in `satisfied_from_param_env`

We can evaluate nested `ConstEvaluatable` obligations in an evaluation probe, which will ICE if we use `ObligationCtxt::new`.

Fixes #107474
Fixes #106666

r? `@BoxyUwU` but feel free to reassign
cc `@JulianKnodt` who i think added this assertion code

Not sure if the rustdoc test is needed, but can't hurt. They're the same root cause, though.
2023-01-31 11:46:25 +09:00
Yuki Okushi b10e60170c
Rollup merge of #107476 - notriddle:notriddle/item-decl-3, r=GuillaumeGomez
rustdoc: remove unnecessary wrapper `div.item-decl` from HTML
2023-01-31 11:46:24 +09:00
Yuki Okushi 6eeb981a58
Rollup merge of #107245 - compiler-errors:new-solver-unsizing, r=lcnr
Implement unsizing in the new trait solver

This makes hello world compile! Ignore the first commit, that's just #107146 which is waiting on merge.

I'll leave some comments inline about design choices that might be debatable.

r? `@lcnr` (until we have a new trait solver reviewer group...)
2023-01-31 11:46:22 +09:00
bors 487e83b711 Auto merge of #105650 - cassaundra:float-literal-suggestion, r=pnkfelix
Fix invalid float literal suggestions when recovering an integer

Only suggest adding a zero to integers with a preceding dot when the change will result in a valid floating point literal.

For example, `.0x0` should not be turned into `0.0x0`.

r? nnethercote
2023-01-31 00:03:08 +00:00
Edward Shen e905b93706
Make the "extra if in let...else block" hint a suggestion 2023-01-30 14:09:40 -08:00
Esteban Küber 449dfc64f0 Fix unquoted projection types in label 2023-01-30 22:02:30 +00:00
Esteban Küber d86835769c Make structured suggestion for fn casting verbose 2023-01-30 21:55:25 +00:00
Esteban Küber 6c2c8edac3 Tweak E0271 wording 2023-01-30 21:51:35 +00:00
Esteban Küber 5ae8e23816 Mention fn coercion rules (needs to be expanded) 2023-01-30 21:51:33 +00:00
Cassaundra Smith 80fcd7c40e
Fix invalid float literal suggestions when recovering an integer
Only suggest adding a zero to integers with a preceding dot when the change will
result in a valid floating point literal.

For example, `.0x0` should not be turned into `0.0x0`.
2023-01-30 13:39:25 -08:00
Esteban Küber 153ed09fb3 Tweak use of trimmed paths 2023-01-30 20:12:21 +00:00
Esteban Küber ab8dc9a0ad Hide lifetimes of `impl Trait` in force trimmed paths 2023-01-30 20:12:21 +00:00
Esteban Küber 252c43b42b Do not mention lifetime names in force trimmed paths 2023-01-30 20:12:21 +00:00
Esteban Küber 81973a39e0 Don't show `for<'lt>` in force trimmed paths 2023-01-30 20:12:21 +00:00
Esteban Küber 62ba3e70a1 Modify primary span label for E0308
The previous output was unintuitive to users.
2023-01-30 20:12:19 +00:00
Matthias Kaak 8d7b092a11
Improved wording of error messages of missing remainder implementations 2023-01-30 19:54:33 +00:00
Michael Goulet c24844048f Trait upcasting support in new solver 2023-01-30 19:11:01 +00:00
Michael Goulet 085a48e798 Implement unsizing in the new trait solver 2023-01-30 19:11:01 +00:00
Michael Goulet 343a359109 Use ObligationCtxt::new_in_snapshot in satisfied_from_param_env 2023-01-30 19:04:59 +00:00
Michael Howell 7080f80e8b rustdoc: remove unnecessary wrapper div.item-decl from HTML 2023-01-30 11:06:18 -07:00
David Wood 2ff46641a9 incremental: migrate diagnostics
Migrate the `rustc_incremental` crate's diagnostics to translatable
diagnostic structs.

Signed-off-by: David Wood <david.wood@huawei.com>
2023-01-30 17:11:35 +00:00
Matthias Krüger d79a40d4d3
Rollup merge of #107469 - LLBlumire:master, r=jyn514
Change turbofish context link to an archive link

The original tweet in the chain linked to (via quote tweet), and thus the through line of links back to Anna's tweet where she named the turbofish (https://web.archive.org/web/20210911061514/https://twitter.com/whoisaldeka/status/914914008225816576) are lost as the user whoisaldeka has deleted their twitter account.

Switching to an archive link preserves this through line, allowing someone to browse back to see the point at which Anna created the turbofish, as was the original intent of including this context.

I was sharing this test with some friends as I often do, and noticed the changes (I had only seen the version from before her death previously). Looking for context myself, I realized the deleted twitter account was breaking an important link in the chain for the context of who Anna was to begin with, and the exact moment the turbofish was so named.

As an alternative to using an archive, we could link to both the tweet where Anna names the turbofish, and the tweet where she refers to herself as its guardian, as two separate links - not requiring the quote tweet to connect them.
2023-01-30 17:50:12 +01:00
Matthias Krüger db9774951d
Rollup merge of #107172 - cjgillot:no-nal, r=nagisa
Reimplement NormalizeArrayLen based on SsaLocals

Based on https://github.com/rust-lang/rust/pull/106908
Fixes https://github.com/rust-lang/rust/issues/105929

Only the last commit "Reimplement NormalizeArrayLen" is relevant.
2023-01-30 17:50:09 +01:00
Lucille Blumire 8348f25493
Update bastion-of-the-turbofish.rs
The original tweet in the chain linked to, and thus the through line of links back to Anna's tweet where she named the turbofish (https://web.archive.org/web/20210911061514/https://twitter.com/whoisaldeka/status/914914008225816576) are lost as the user whoisaldeka has deleted their twitter account.

Switching to an archive link preserves this through line, allowing someone to browse back to see the point at which Anna created the turbofish, as was the original intent of including this context.
2023-01-30 14:22:41 +00:00
bors fba9f33c7c Auto merge of #107463 - Dylan-DPC:rollup-6mq1li8, r=Dylan-DPC
Rollup of 6 pull requests

Successful merges:

 - #101569 (Don't re-export private/unstable ArgumentV1 from `alloc`.)
 - #106106 (Pass `branch.{branch}.remote=origin` to `git submodule update`)
 - #107146 (Make `unsizing_params_for_adt` into a query)
 - #107264 (Add option to include private items in library docs)
 - #107452 (Fix typo in `{Rc, Arc}::get_mut_unchecked` docs)
 - #107459 (end entry paragraph with a period (.))

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2023-01-30 11:14:21 +00:00
Dylan DPC 28340bab88
Rollup merge of #101569 - m-ou-se:alloc-no-rexport-argumentv1, r=thomcc
Don't re-export private/unstable ArgumentV1 from `alloc`.

The `alloc::fmt::ArgumentV1` re-export was marked as `#[stable]` even though the original `core::fmt::ArgumentV1` is `#[unstable]` (and `#[doc(hidden)]`).

(It wasn't usable though:

```
error[E0658]: use of unstable library feature 'fmt_internals': internal to format_args!
 --> src/main.rs:4:12
  |
4 |     let _: alloc::fmt::ArgumentV1 = todo!();
  |            ^^^^^^^^^^^^^^^^^^^^^^
  |
  = help: add `#![feature(fmt_internals)]` to the crate attributes to enable
```
)

Part of #99012
2023-01-30 15:11:44 +05:30
bors 3f25e56496 Auto merge of #104429 - nnethercote:more-deriving-on-packed-structs, r=RalfJung
More deriving on packed structs

See [here](https://github.com/rust-lang/rust/pull/104429#issuecomment-1320909245) for the t-lang nomination summary, and [here](https://github.com/rust-lang/rust/pull/104429#issuecomment-1360077895) for the approval.

r? `@RalfJung`
2023-01-30 07:02:01 +00:00
Nicholas Nethercote 2e93f2c92f Allow more deriving on packed structs.
Currently, deriving on packed structs has some non-trivial limitations,
related to the fact that taking references on unaligned fields is UB.

The current approach to field accesses in derived code:
- Normal case: `&self.0`
- In a packed struct that derives `Copy`: `&{self.0}`
- In a packed struct that doesn't derive `Copy`: `&self.0`

Plus, we disallow deriving any builtin traits other than `Default` for any
packed generic type, because it's possible that there might be
misaligned fields. This is a fairly broad restriction.

Plus, we disallow deriving any builtin traits other than `Default` for most
packed types that don't derive `Copy`. (The exceptions are those where the
alignments inherently satisfy the packing, e.g. in a type with
`repr(packed(N))` where all the fields have alignments of `N` or less
anyway. Such types are pretty strange, because the `packed` attribute is
not having any effect.)

This commit introduces a new, simpler approach to field accesses:
- Normal case: `&self.0`
- In a packed struct: `&{self.0}`

In the latter case, this requires that all fields impl `Copy`, which is
a new restriction. This means that the following example compiles under
the old approach and doesn't compile under the new approach.
```
 #[derive(Debug)]
 struct NonCopy(u8);

 #[derive(Debug)
 #[repr(packed)]
 struct MyType(NonCopy);
```
(Note that the old approach's support for cases like this was brittle.
Changing the `u8` to a `u16` would be enough to stop it working. So not
much capability is lost here.)

However, the other constraints from the old rules are removed. We can now
derive builtin traits for packed generic structs like this:
```
 trait Trait { type A; }

 #[derive(Hash)]
 #[repr(packed)]
 pub struct Foo<T: Trait>(T, T::A);
```
To allow this, we add a `T: Copy` bound in the derived impl and a `T::A:
Copy` bound in where clauses. So `T` and `T::A` must impl `Copy`.

We can now also derive builtin traits for packed structs that don't derive
`Copy`, so long as the fields impl `Copy`:
```
 #[derive(Hash)]
 #[repr(packed)]
 pub struct Foo(u32);
```
This includes types that hand-impl `Copy` rather than deriving it, such as the
following, that show up in winapi-0.2:
```
 #[derive(Clone)]
 #[repr(packed)]
 struct MyType(i32);

 impl Copy for MyType {}
```
The new approach is simpler to understand and implement, and it avoids
the need for the `unsafe_derive_on_repr_packed` check.

One exception is required for backwards-compatibility: we allow `[u8]`
fields for now. There is a new lint for this,
`byte_slice_in_packed_struct_with_derive`.
2023-01-30 12:00:42 +11:00
Camille GILLOT a9aed861ac Reimplement NormalizeArrayLen. 2023-01-29 21:19:02 +00:00
bors e972bc8083 Auto merge of #107451 - matthiaskrgr:rollup-m4ucfu8, r=matthiaskrgr
Rollup of 11 pull requests

Successful merges:

 - #96763 (Fix maintainer validation message)
 - #106540 (Insert whitespace to avoid ident concatenation in suggestion)
 - #106763 (print why a test was ignored if its the only test specified)
 - #106769 (libtest: Print why a test was ignored if it's the only test specified.)
 - #106798 (Implement `signum` with `Ord`)
 - #107006 (Output tree representation on thir-tree)
 - #107078 (Update wording of invalid_doc_attributes docs.)
 - #107169 (Pass `--locked` to the x test tidy call)
 - #107431 (docs: remove colon from time header)
 - #107432 (rustdoc: remove unused class `has-srclink`)
 - #107448 (When stamp doesn't exist, should say Error, and print path to stamp file)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2023-01-29 19:29:49 +00:00
Mara Bos 47adb652d3 Update tests. 2023-01-29 20:19:26 +01:00
Matthias Krüger dd315fd1b6
Rollup merge of #107432 - notriddle:notriddle/has-srclink, r=GuillaumeGomez
rustdoc: remove unused class `has-srclink`

Stopped being used in CSS with 73d0f7c7b6.
2023-01-29 20:03:39 +01:00
Matthias Krüger 45446824e3
Rollup merge of #107006 - b-naber:thir-tree, r=jackh726
Output tree representation on thir-tree

The current output of `-Zunpretty=thir-tree` is really cumbersome to work with, using an actual tree representation should make it easier to see what the thir looks like.
2023-01-29 20:03:37 +01:00
Matthias Krüger 8691602151
Rollup merge of #106540 - lowr:patch/remove-paren-whitespace, r=cjgillot
Insert whitespace to avoid ident concatenation in suggestion

This PR tweaks the suggestion of removing misplaced parentheses around trait bounds so as to avoid concatenating two identifiers. Although subtle, this should make outputs less surprising especially when applying the `MachineApplicable` suggestions automatically.
2023-01-29 20:03:35 +01:00
bors c7bf469fec Auto merge of #100178 - mati865:upgrade-mingw-w64-on-CI, r=nikic
Upgrade mingw-w64 on CI

Continuation of https://github.com/rust-lang/rust/pull/99162

This will require copying related archives mentioned in https://github.com/rust-lang/rust/pull/100178#issuecomment-1352060140 to Rust's mirror.

This should fix multiple issues with currently used ancient releases but I'll ask folks to retest them using nightly once it goes live.
2023-01-29 16:31:42 +00:00
bors 2a4b00beaa Auto merge of #106908 - cjgillot:copyprop-ssa, r=oli-obk
Implement simple CopyPropagation based on SSA analysis

This PR extracts the "copy propagation" logic from https://github.com/rust-lang/rust/pull/106285.

MIR may produce chains of assignment between locals, like `_x = move? _y`.
This PR attempts to remove such chains by unifying locals.

The current implementation is a bit overzealous in turning moves into copies, and in removing storage statements.
2023-01-29 13:01:06 +00:00
Ryo Yoshida 807ebac887
Insert whitespace to avoid ident concatenation in suggestion 2023-01-29 21:01:35 +09:00
Mateusz Mikuła f6ea2ea551 Upgrade mingw-w64 on CI 2023-01-29 13:01:06 +01:00
bors d117135f5a Auto merge of #106253 - nbdd0121:upcast, r=compiler-errors
Skip possible where_clause_object_safety lints when checking `multiple_supertrait_upcastable`

Fix #106247

To achieve this, I lifted the `WhereClauseReferencesSelf` out from `object_safety_violations` and move it into `is_object_safe` (which is changed to a new query).

cc `@dtolnay`
r? `@compiler-errors`
2023-01-29 10:20:25 +00:00
bors a29efccb1e Auto merge of #107435 - matthiaskrgr:rollup-if5h6yu, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #106618 (Disable `linux_ext` in wasm32 and fortanix rustdoc builds.)
 - #107097 (Fix def-use dominance check)
 - #107154 (library/std/sys_common: Define MIN_ALIGN for m68k-unknown-linux-gnu)
 - #107397 (Gracefully exit if --keep-stage flag is used on a clean source tree)
 - #107401 (remove the usize field from CandidateSource::AliasBound)
 - #107413 (make more pleasant to read)
 - #107422 (Also erase substs for new infcx in pin move error)
 - #107425 (Check for missing space between fat arrow and range pattern)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2023-01-29 07:01:58 +00:00
Matthias Krüger 4e8f7e4fc9
Rollup merge of #107425 - clubby789:match-range-missing-space, r=compiler-errors
Check for missing space between fat arrow and range pattern

Fixes #107420

Ideally we wouldn't emit an error about expecting `=>` etc., but I'm not sure how to recover from this.

`@rustbot` label +A-diagnostics
2023-01-29 06:14:20 +01:00
Matthias Krüger 5ff6cdca7e
Rollup merge of #107422 - Nilstrieb:erase-the-ice, r=compiler-errors
Also erase substs for new infcx in pin move error

The code originally correctly erased the regions of the type it passed to the newly created infcx. But after the `fn_sig` query was made to return an `EarlyBinder<T>`, some substs that were around were substituted there without erasing their regions. They were then passed into the newly cerated infcx, which caused the ICE.

Fixes #107419

r? compiler-errors who reviewed the original PR adding this diagnostic
2023-01-29 06:14:20 +01:00
Matthias Krüger 4caa9dfa71
Rollup merge of #107097 - tmiasko:ssa, r=cjgillot
Fix def-use dominance check

A definition does not dominate a use in the same statement. For example
in MIR generated for compound assignment x += a (when overflow checks
are disabled).
2023-01-29 06:14:17 +01:00
bors 3cdd0197e7 Auto merge of #106227 - bryangarza:ctfe-limit, r=oli-obk
Use stable metric for const eval limit instead of current terminator-based logic

This patch adds a `MirPass` that inserts a new MIR instruction `ConstEvalCounter` to any loops and function calls in the CFG. This instruction is used during Const Eval to count against the `const_eval_limit`, and emit the `StepLimitReached` error, replacing the current logic which uses Terminators only.

The new method of counting loops and function calls should be more stable across compiler versions (i.e., not cause crates that compiled successfully before, to no longer compile when changes to the MIR generation/optimization are made).

Also see: #103877
2023-01-29 04:11:27 +00:00
Michael Howell 74e843c833 rustdoc: remove unused class `has-srclink`
Stopped being used in CSS with
73d0f7c7b6
2023-01-28 17:18:56 -07:00
bors 9f82651a5f Auto merge of #103659 - clubby789:improve-partialord-derive, r=nagisa
Special-case deriving `PartialOrd` for enums with dataless variants

I was able to get slightly better codegen by flipping the derived `PartialOrd` logic for two-variant enums.  I also tried to document the implementation of the derive macro to make the special-case logic a little clearer.
```rs
#[derive(PartialEq, PartialOrd)]
pub enum A<T> {
    A,
    B(T)
}
```
```diff
impl<T: ::core::cmp::PartialOrd> ::core::cmp::PartialOrd for A<T> {
   #[inline]
   fn partial_cmp(
       &self,
       other: &A<T>,
   ) -> ::core::option::Option<::core::cmp::Ordering> {
       let __self_tag = ::core::intrinsics::discriminant_value(self);
       let __arg1_tag = ::core::intrinsics::discriminant_value(other);
-      match ::core::cmp::PartialOrd::partial_cmp(&__self_tag, &__arg1_tag) {
-          ::core::option::Option::Some(::core::cmp::Ordering::Equal) => {
-              match (self, other) {
-                  (A::B(__self_0), A::B(__arg1_0)) => {
-                      ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0)
-                  }
-                  _ => ::core::option::Option::Some(::core::cmp::Ordering::Equal),
-              }
+      match (self, other) {
+          (A::B(__self_0), A::B(__arg1_0)) => {
+              ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0)
           }
-          cmp => cmp,
+          _ => ::core::cmp::PartialOrd::partial_cmp(&__self_tag, &__arg1_tag),
       }
   }
}
```
Godbolt: [Current](https://godbolt.org/z/GYjEzG1T8), [New](https://godbolt.org/z/GoK78qx15)
I'm not sure how common a case comparing two enums like this (such as `Option`) is, and if it's worth the slowdown of adding a special case to the derive. If it causes overall regressions it might be worth just manually implementing this for `Option`.
2023-01-28 22:11:11 +00:00
clubby789 4bfab39f9b Check for missing space between fat arrow and range pattern 2023-01-28 20:52:01 +00:00
Nilstrieb 832751fe1d Also erase substs for new infcx in pin move error
The code originally correctly erased the regions of the type it passed
to the newly created infcx. But after the `fn_sig` query was made to
return an `EarlyBinder<T>`, some substs that were around were
substituted there without erasing their regions. They were then passed
into the newly cerated infcx, which caused the ICE.
2023-01-28 20:43:16 +01:00
bors d6f0642827 Auto merge of #107206 - cjgillot:no-h2l-map, r=WaffleLapkin
Remove HirId -> LocalDefId map from HIR.

Having this map in HIR prevents the creating of new definitions after HIR has been built.
Thankfully, we do not need it.

Based on https://github.com/rust-lang/rust/pull/103902
2023-01-28 16:11:33 +00:00
Gary Guo 66f3ab90a1 Reintroduce multiple_supertrait_upcastable lint 2023-01-28 15:08:07 +00:00
bors bca8b4dc32 Auto merge of #107408 - matthiaskrgr:rollup-b5vz2ow, r=matthiaskrgr
Rollup of 9 pull requests

Successful merges:

 - #104012 (Improve unexpected close and mismatch delimiter hint in TokenTreesReader)
 - #104252 (Stabilize the const_socketaddr feature)
 - #105524 (Replace libc::{type} with crate::ffi::{type})
 - #107096 (Detect references to non-existant messages in Fluent resources)
 - #107355 (Add regression test for #60755)
 - #107384 (Remove `BOOL_TY_FOR_UNIT_TESTING`)
 - #107385 (Use `FallibleTypeFolder` for `ConstInferUnifier` not `TypeRelation`)
 - #107391 (rustdoc: remove inline javascript from copy-path button)
 - #107398 (Remove `ControlFlow::{BREAK, CONTINUE}`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2023-01-28 13:12:59 +00:00
Matthias Krüger b64a75f20b
Rollup merge of #107355 - JohnTitor:issue-60755, r=compiler-errors
Add regression test for #60755

Closes #60755
r? compiler-errors
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2023-01-28 11:11:07 +01:00
Matthias Krüger 53ccee0d38
Rollup merge of #107096 - clubby789:fluent-bad-messageref, r=compiler-errors
Detect references to non-existant messages in Fluent resources

Should help with cases like #107091, where `{variable}` (a message reference) is accidentally typed, rather than `{$variable}` (a variable reference)

Fixes #107370

```@rustbot``` label +A-translation
2023-01-28 11:11:07 +01:00
Matthias Krüger e3048c7838
Rollup merge of #104012 - chenyukang:yukang/fix-103882-deli-indentation, r=petrochenkov
Improve unexpected close and mismatch delimiter hint in TokenTreesReader

Fixes #103882
Fixes #68987
Fixes #69259

The inner indentation mismatching will be covered by outer block, the new added function `report_error_prone_delim_block` will find out the error prone candidates for reporting.
2023-01-28 11:11:05 +01:00
bors d8da513668 Auto merge of #106916 - lukas-code:overlapping-substs, r=estebank
Remove overlapping parts of multipart suggestions

This PR adds a debug assertion that the parts of a single substitution cannot overlap, fixes a overlapping substitution from the testsuite, and fixes https://github.com/rust-lang/rust/issues/106870.

Note that a single suggestion can still have multiple overlapping substitutions / possible edits, we just don't suggest overlapping replacements in a single edit anymore.

I've also included a fix for an unrelated bug where rustfix for `explicit_outlives_requirements` would produce multiple trailing commas for a where clause.
2023-01-28 10:00:56 +00:00
Camille GILLOT 1aab86eae2 Adapt ui-fulldeps. 2023-01-28 09:55:27 +00:00
Matthias Krüger c89bb159f6
Rollup merge of #107373 - michaelwoerister:dont-merge-vtables-when-debuginfo, r=WaffleLapkin
Don't merge vtables when full debuginfo is enabled.

This PR makes the compiler not emit the `unnamed_addr` attribute for vtables when full debuginfo is enabled, so that they don't get merged even if they have the same contents. This allows debuggers to more reliably map from a dyn pointer to the self-type of a trait object by looking at the vtable's debuginfo.

The PR only changes the behavior of the LLVM backend as other backends don't emit vtable debuginfo (as far as I can tell).

The performance impact of this change should be small as [measured](https://github.com/rust-lang/rust/pull/103514#issuecomment-1290833854) in a previous PR.
2023-01-28 05:20:19 +01:00
Matthias Krüger a5caa989c9
Rollup merge of #107339 - aliemjay:covariant, r=lcnr
internally change regions to be covariant

Surprisingly, we consider the reference type `&'a T` to be contravaraint in its lifetime parameter. This is confusing and conflicts with the documentation we have in the reference, rustnomicon, and rustc-dev-guide. This also arguably not the correct use of terminology since we can use `&'static u8` in a place where `&' a u8` is expected, this implies that `&'static u8 <: &' a u8` and consequently `'static <: ' a`, hence covariance.

Because of this, when relating two types, we used to switch the argument positions in a confusing way:
`Subtype(&'a u8 <: &'b u8) => Subtype('b <: 'a) => Outlives('a: 'b) => RegionSubRegion('b <= 'a)`

The reason for the current behavior is probably that we wanted `Subtype('b <: 'a)` and `RegionSubRegion('b <= 'a)` to be equivalent, but I don' t think this is a good reason since these relations are sufficiently different in that the first is a relation in the subtyping lattice and is intrinsic to the type-systems, while the the second relation is an implementation detail of regionck.

This PR changes this behavior to use covariance, so..
`Subtype(&'a u8 <: &'b u8) => Subtype('a <: 'b) => Outlives('a: 'b) => RegionSubRegion('b <= 'a) `

Resolves #103676

r? `@lcnr`
2023-01-28 05:20:18 +01:00
Matthias Krüger fa2cd945af
Rollup merge of #107306 - compiler-errors:correct-sugg-for-closure-arg-needs-borrow, r=oli-obk
Correct suggestions for closure arguments that need a borrow

Fixes #107301 by dealing with binders correctly
Fixes another issue where we were suggesting adding just `&` when we expected `&mut _` in a closure arg
2023-01-28 05:20:18 +01:00
Matthias Krüger 260e04879e
Rollup merge of #107190 - fmease:fix-81698, r=compiler-errors
Recover from more const arguments that are not wrapped in curly braces

Recover from some array, borrow, tuple & arithmetic expressions in const argument positions that lack curly braces and provide a suggestion to fix the issue continuing where #92884 left off. Examples of such expressions: `[]`, `[0]`, `[1, 2]`, `[0; 0xff]`, `&9`, `("", 0)` and `(1 + 2) * 3` (we previously did not recover from them).

I am not entirely happy with my current solution because the code that recovers from `[0]` (coinciding with a malformed slice type) and `[0; 0]` (coinciding with a malformed array type) is quite fragile as the aforementioned snippets are actually successfully parsed as types by `parse_ty` since it itself already recovers from them (returning `[⟨error⟩]` and `[⟨error⟩; 0]` respectively) meaning I have to manually look for `TyKind::Err`s and construct a separate diagnostic for the suggestion to attach to (thereby emitting two diagnostics in total).

Fixes #81698.
`@rustbot` label A-diagnostics
r? diagnostics
2023-01-28 05:20:17 +01:00
Matthias Krüger 28188d17ba
Rollup merge of #107100 - compiler-errors:issue-107087, r=lcnr
Use proper `InferCtxt` when probing for associated types in astconv

Fixes #107087
2023-01-28 05:20:16 +01:00
Matthias Krüger 7b78b6a78d
Rollup merge of #107022 - scottmcm:ordering-option-eq, r=m-ou-se
Implement `SpecOptionPartialEq` for `cmp::Ordering`

Noticed as I continue to explore options for having code using `partial_cmp` optimize better.

Before:
```llvm
; Function Attrs: mustprogress nofree nosync nounwind willreturn uwtable
define noundef zeroext i1 `@ordering_eq(i8` noundef %0, i8 noundef %1) unnamed_addr #0 {
start:
  %2 = icmp eq i8 %0, 2
  br i1 %2, label %bb1.i, label %bb3.i

bb1.i:                                            ; preds = %start
  %3 = icmp eq i8 %1, 2
  br label %"_ZN55_$LT$T$u20$as$u20$core..option..SpecOptionPartialEq$GT$2eq17hb7e7beacecde585fE.exit"

bb3.i:                                            ; preds = %start
  %.not.i = icmp ne i8 %1, 2
  %4 = icmp eq i8 %0, %1
  %spec.select.i = and i1 %.not.i, %4
  br label %"_ZN55_$LT$T$u20$as$u20$core..option..SpecOptionPartialEq$GT$2eq17hb7e7beacecde585fE.exit"

"_ZN55_$LT$T$u20$as$u20$core..option..SpecOptionPartialEq$GT$2eq17hb7e7beacecde585fE.exit": ; preds = %bb1.i, %bb3.i
  %.0.i = phi i1 [ %3, %bb1.i ], [ %spec.select.i, %bb3.i ]
  ret i1 %.0.i
}
```

After:
```llvm
; Function Attrs: mustprogress nofree norecurse nosync nounwind readnone willreturn uwtable
define noundef zeroext i1 `@ordering_eq(i8` noundef %0, i8 noundef %1) unnamed_addr #1 {
start:
  %2 = icmp eq i8 %0, %1
  ret i1 %2
}
```

(Which <https://alive2.llvm.org/ce/z/-rop5r> says LLVM *could* just do itself, but there's probably an issue already open for that problem from when this was originally looked at for `Option<NonZeroU8>` and friends.)
2023-01-28 05:20:15 +01:00
bors 6cd6bad51f Auto merge of #101692 - cjgillot:generator-lazy-witness, r=oli-obk
Compute generator saved locals on MIR

Generators are currently type-checked by introducing a `witness` type variable, which is unified with a `GeneratorWitness(captured types)` whose purpose is to ensure that the auto traits correctly migrate from the captured types to the `witness` type.  This requires computing the captured types on HIR during type-checking, only to re-do it on MIR later.

This PR proposes to drop the HIR-based computation, and only keep the MIR one.  This is done in 3 steps.
1. During type-checking, the `witness` type variable is never unified.  This allows to stall all the obligations that depend on it until the end of type-checking.  Then, the stalled obligations are marked as successful, and saved into the typeck results for later verification.
2. At type-checking writeback, `witness` is replaced by `GeneratorWitnessMIR(def_id, substs)`.  From this point on, all trait selection involving `GeneratorWitnessMIR` will fetch the MIR-computed locals, similar to what opaque types do.  There is no lifetime to be preserved here: we consider all the lifetimes appearing in this witness type to be higher-ranked.
3. After borrowck, the stashed obligations are verified against the actually computed types, in the `check_generator_obligations` query.  If any obligation was wrongly marked as fulfilled in step 1, it should be reported here.

There are still many issues:
- ~I am not too happy having to filter out some locals from the checked bounds, I think this is MIR building that introduces raw pointers polluting the analysis;~ solved by a check specific to static variables.
- the diagnostics for captured types don't show where they are used/dropped;
- I do not attempt to support chalk.

cc `@eholk` `@jyn514` for the drop-tracking work
r? `@oli-obk` as you warned me of potential unsoundness
2023-01-28 01:05:29 +00:00
Camille GILLOT d3d626920a Bless mir-opt tests. 2023-01-27 22:01:47 +00:00
Camille GILLOT 65c3c90f3e Restrict amount of ignored locals. 2023-01-27 22:01:12 +00:00
b-naber 92f2d27d1b address review 2023-01-27 22:13:55 +01:00
Matthias Kaak e02517d753
Fixed confusement between mod and remainder 2023-01-27 21:01:07 +00:00
Camille GILLOT c51fc382bd Bless ui-fulldeps. 2023-01-27 20:10:25 +00:00
Camille GILLOT 0e52a671d4 Bless tests. 2023-01-27 20:10:17 +00:00
Guillaume Gomez 4b3eef8734 Add rustdoc test to ensure that items into a `doc(hidden)` block are handled as expected 2023-01-27 20:33:42 +01:00
Camille GILLOT e2387ad484 Remember where a type was kept in MIR. 2023-01-27 18:59:32 +00:00
Camille GILLOT 1974b6b68d Introduce GeneratorWitnessMIR. 2023-01-27 18:58:44 +00:00
Camille GILLOT 03618d6afd Always require Drop for generators. 2023-01-27 18:58:23 +00:00
Camille GILLOT 9259da51ed Test the 3 generator handling versions for generator/async tests. 2023-01-27 18:58:13 +00:00
Camille GILLOT a20078f044 Add `drop_tracking_mir` option. 2023-01-27 18:57:34 +00:00
León Orell Valerian Liehr 80a1536c7a
recover more unbraced const args 2023-01-27 19:26:04 +01:00
Camille GILLOT d29dc057ba Do not merge locals that have their address taken. 2023-01-27 18:22:45 +00:00
Camille GILLOT 8f1dbe54ea Discard raw pointers from SSA locals. 2023-01-27 18:22:45 +00:00
Camille GILLOT d45815eb4a Only consider a local to be SSA if assignment dominates all uses. 2023-01-27 18:22:45 +00:00
Camille GILLOT 38b55dc684 Add tests. 2023-01-27 18:22:45 +00:00
Camille GILLOT 6ed9f8f62e Implement SSA CopyProp pass. 2023-01-27 18:22:45 +00:00
Camille GILLOT 8f7e441a54 Add mir-opt test. 2023-01-27 18:22:44 +00:00
Camille GILLOT 8ba0cd6c9e Make tests unit. 2023-01-27 18:22:44 +00:00
Michael Woerister e5995e6168 Don't merge vtables when full debuginfo is enabled. 2023-01-27 15:29:04 +00:00
Guillaume Gomez c918efa664 Update rustdoc/redirect test 2023-01-27 14:50:34 +01:00
Guillaume Gomez 3623613dc7 Update newly failing UI tests 2023-01-27 14:41:33 +01:00
Guillaume Gomez 3f057dd600 Add regression test for impl blocks in const expr 2023-01-27 14:41:33 +01:00
inquisitivecrystal bc23e9aa4c Improve tests for FFI attr validation 2023-01-27 05:28:52 -08:00
clubby789 ed707a106c Detect references to non-existant messages in Fluent resources 2023-01-27 11:27:22 +00:00
Guillaume Gomez 1b64e16643 Add regression test for #107350 2023-01-27 12:11:01 +01:00
Yuki Okushi dbe911ff36
Add regression test for #60755
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2023-01-27 19:46:56 +09:00
yukang cd233231aa Improve unexpected close and mismatch delimiter hint in TokenTreesReader 2023-01-27 17:45:41 +08:00
Yuki Okushi 17a2e1fef3
Rollup merge of #107336 - notriddle:notriddle/import-item-module-item, r=GuillaumeGomez
rustdoc: remove mostly-unused CSS classes `import-item` and `module-item`
2023-01-27 12:57:57 +09:00
Yuki Okushi d68b5a42e2
Rollup merge of #107284 - notriddle:notriddle/plus, r=jsha
rustdoc: use smarter encoding for playground URL

The old way would compress okay with DEFLATE, but this version makes uncompressed docs smaller, which matters for memory usage and stuff like `cargo doc`.

Try it out: <https://play.rust-lang.org/?code=fn+main()+{%0Alet+mut+v+=+Vec::new();%0Av.push(1+/+1);%0Aprintln!(%22{}%22,+v[0]);%0A}>

In local testing, this change shrinks sample pages by anywhere between 4.0% and 0.031%

    $ du -b after.dir/std/vec/struct.Vec.html before.dir/std/vec/struct.Vec.html
    759235  after.dir/std/vec/struct.Vec.html
    781842  before.dir/std/vec/struct.Vec.html

100*((759235-781842)/781842)=-2.8

    $ du -b after.dir/std/num/struct.Wrapping.html before.dir/std/num/struct.Wrapping.html
    3194173 after.dir/std/num/struct.Wrapping.html
    3204351 before.dir/std/num/struct.Wrapping.html

100*((3194173-3204351)/3204351)=-0.031

    $ du -b after.dir/std/keyword.match.html before.dir/std/keyword.match.html
    8151    after.dir/std/keyword.match.html
    8495    before.dir/std/keyword.match.html

100*((8151-8495)/8495)=-4.0

Gzipped tarball sizes seem shrunk, but not by much.

    du -s before.tar.gz after.tar.gz
    69600   before.tar.gz
    69480   after.tar.gz

100*((69480-69600)/69600)=-0.17
2023-01-27 12:57:56 +09:00
Yuki Okushi 145241402d
Rollup merge of #107242 - notriddle:notriddle/title-ordering, r=GuillaumeGomez
rustdoc: make item links consistently use `title="{shortty} {path}"`

The ordering in item tables was flipped in 3030cbea95, making it inconsistent with the ordering in method signatures.

Compare these (before this PR is merged):

c8e6a9e8b6/src/librustdoc/html/render/print_item.rs (L455-L459)

c8e6a9e8b6/src/librustdoc/html/format.rs (L903-L908)
2023-01-27 12:57:55 +09:00
Ali MJ Al-Nasrawy 381187dc76 internally change regions to be covariant 2023-01-27 04:04:22 +03:00
Tomasz Miąsko e489971902 Fix def-use dominance check
A definition does not dominate a use in the same statement. For example
in MIR generated for compound assignment x += a (when overflow checks
are disabled).
2023-01-27 00:54:31 +01:00
bors d7948c843d Auto merge of #106812 - oli-obk:output_filenames, r=petrochenkov
make `output_filenames` a real query

part of #105462

This may be a perf regression and is not obviously the right way forward. We may store this information in the resolver after freezing it for example.
2023-01-26 20:32:28 +00:00
Michael Howell 97f8189614 rustdoc: remove mostly-unused CSS classes import/module-item 2023-01-26 12:55:19 -07:00
Michael Howell 51df99f3c2 rustdoc: use smarter encoding for playground URL
The old way would compress okay with DEFLATE, but this version makes
uncompressed docs smaller, which matters for memory usage and stuff
like `cargo doc`.

Try it out: <https://play.rust-lang.org/?code=fn+main()+{%0Alet+mut+v+=+Vec::new();%0Av.push(1+/+1);%0Aprintln!(%22{}%22,+v[0]);%0A}>

In local testing, this change shrinks sample pages by anywhere between
4.0% and 0.031%

    $ du -b after.dir/std/vec/struct.Vec.html before.dir/std/vec/struct.Vec.html
    759235  after.dir/std/vec/struct.Vec.html
    781842  before.dir/std/vec/struct.Vec.html

100*((759235-781842)/781842)=-2.8

    $ du -b after.dir/std/num/struct.Wrapping.html before.dir/std/num/struct.Wrapping.html
    3194173 after.dir/std/num/struct.Wrapping.html
    3204351 before.dir/std/num/struct.Wrapping.html

100*((3194173-3204351)/3204351)=-0.031

    $ du -b after.dir/std/keyword.match.html before.dir/std/keyword.match.html
    8151    after.dir/std/keyword.match.html
    8495    before.dir/std/keyword.match.html

100*((8151-8495)/8495)=-4.0

Gzipped tarball sizes seem shrunk, but not by much.

    du -s before.tar.gz after.tar.gz
    69600   before.tar.gz
    69480   after.tar.gz

100*((69480-69600)/69600)=-0.17
2023-01-26 10:51:10 -07:00
b-naber 3bce66f786 add test 2023-01-26 18:10:45 +01:00
bors c62665e09c Auto merge of #107328 - matthiaskrgr:rollup-lfqwo0o, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #106904 (Preserve split DWARF files when building archives.)
 - #106971 (Handle diagnostics customization on the fluent side (for one specific diagnostic))
 - #106978 (Migrate mir_build's borrow conflicts)
 - #107150 (`ty::tls` cleanups)
 - #107168 (Use a type-alias-impl-trait in `ObligationForest`)
 - #107189 (Encode info for Adt in a single place.)
 - #107322 (Custom mir: Add support for some remaining, easy to support constructs)
 - #107323 (Disable ConstGoto opt in cleanup blocks)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2023-01-26 15:58:08 +00:00
Matthias Krüger c87996a8ad
Rollup merge of #107322 - JakobDegen:custom-mir, r=tmiasko
Custom mir: Add support for some remaining, easy to support constructs

Some documentation for previous changes and support for `Deinit`, checked binops, len, and array repetition

r? ```@oli-obk``` or ```@tmiasko```
2023-01-26 15:02:22 +01:00
Matthias Krüger e8c17de11d
Rollup merge of #106978 - mejrs:mir_build3, r=davidtwco
Migrate mir_build's borrow conflicts

This also changes the error message slightly, for two reasons:

- I'm not a fan of saying "value borrowed, by `x`, here"
- it simplifies the error implementation significantly.
2023-01-26 15:02:20 +01:00
Matthias Krüger 4b97f07534
Rollup merge of #106971 - oli-obk:tait_error, r=davidtwco
Handle diagnostics customization on the fluent side (for one specific diagnostic)

r? ```@davidtwco```
2023-01-26 15:02:19 +01:00
Matthias Krüger 1b442befca
Rollup merge of #106904 - khuey:preserve_debuginfo_for_rlibs, r=davidtwco
Preserve split DWARF files when building archives.

r? ```@davidtwco```
2023-01-26 15:02:19 +01:00
bors 3e97763872 Auto merge of #106745 - m-ou-se:format-args-ast, r=oli-obk
Move format_args!() into AST (and expand it during AST lowering)

Implements https://github.com/rust-lang/compiler-team/issues/541

This moves FormatArgs from rustc_builtin_macros to rustc_ast_lowering. For now, the end result is the same. But this allows for future changes to do smarter things with format_args!(). It also allows Clippy to directly access the ast::FormatArgs, making things a lot easier.

This change turns the format args types into lang items. The builtin macro used to refer to them by their path. After this change, the path is no longer relevant, making it easier to make changes in `core`.

This updates clippy to use the new language items, but this doesn't yet make clippy use the ast::FormatArgs structure that's now available. That should be done after this is merged.
2023-01-26 12:44:47 +00:00
Jakob Degen d7f59e91e0 Custom mir: Add support for some remaining, easy to support constructs 2023-01-26 03:29:28 -08:00
bors 40fda7b3fe Auto merge of #107318 - matthiaskrgr:rollup-776kd81, r=matthiaskrgr
Rollup of 9 pull requests

Successful merges:

 - #97373 (impl DispatchFromDyn for Cell and UnsafeCell)
 - #106625 (Remove backwards compat for LLVM 12 coverage format)
 - #106779 (Avoid __cxa_thread_atexit_impl on Emscripten)
 - #106811 (Append .dwp to the binary filename instead of replacing the existing extension.)
 - #106836 (Remove optimistic spinning from `mpsc::SyncSender`)
 - #106946 (implement Hash for proc_macro::LineColumn)
 - #107074 (remove unnecessary check for opaque types)
 - #107287 (Improve fn pointer notes)
 - #107304 (Use `can_eq` to compare types for default assoc type error)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2023-01-26 09:14:05 +00:00
Matthias Krüger 3aeafca070
Rollup merge of #107304 - Nilstrieb:ᐸTy as PartialEqᐳ::eq because what else are we gonna use in rustc_middle, r=compiler-errors
Use `can_eq` to compare types for default assoc type error

This correctly handles inference variables like `{integer}`. I had to move all of this `note_and_explain` code to `rustc_infer`, it made no sense for it to be in `rustc_middle` anyways.

The commits are reviewed separately.

Fixes #106968
2023-01-26 07:53:26 +01:00
Matthias Krüger f2f123470f
Rollup merge of #107287 - mattjperez:improve-fn-pointer-notes, r=compiler-errors
Improve fn pointer notes

continuation of #105552

r? `@compiler-errors`
2023-01-26 07:53:25 +01:00
Matthias Krüger e0d71f500c
Rollup merge of #97373 - dimpolo:cell_dispatch_from_dyn, r=dtolnay
impl DispatchFromDyn for Cell and UnsafeCell

After some fruitful discussion on [Internals](https://internals.rust-lang.org/t/impl-dispatchfromdyn-for-cell-2/16520) here's my first PR to rust-lang/rust 🎉

Please let me know if there's something I missed.

This adds `DispatchFromDyn` impls for `Cell`, `UnsafeCell` and `SyncUnsafeCell`.
An existing test is also expanded to test the `Cell` impl (which requires the `UnsafeCell` impl)

The different `RefCell` types can not implement `DispatchFromDyn` since they have more than one (non ZST) field.

&nbsp;

**Edit:**
### What:
These changes allow one to make types like `MyRc`(code below), to be object safe method receivers after implementing `DispatchFromDyn` and `Deref` for them.

This allows for code like this:
```rust
struct MyRc<T: ?Sized>(Cell<NonNull<RcBox<T>>>);

/* impls for DispatchFromDyn, CoerceUnsized and Deref for MyRc*/

trait Trait {
    fn foo(self: MyRc<Self>);
}

let impls_trait = ...;
let rc = MyRc::new(impls_trait) as MyRc<dyn Trait>;
rc.foo();
```

Note: `Cell` and `UnsafeCell` won't directly become valid method receivers since they don't implement `Deref`. Making use of these changes requires a wrapper type and nightly features.

### Why:
A custom pointer type with interior mutability allows one to store extra information in the pointer itself.
These changes allow for such a type to be a method receiver.

### Examples:
My use case is a cycle aware custom `Rc` implementation that when dropping a cycle marks some references dangling.

On the [forum](https://internals.rust-lang.org/t/impl-dispatchfromdyn-for-cell/14762/8) andersk mentioned that they track if a `Gc` reference is rooted with an extra bit in the reference itself.
2023-01-26 07:53:21 +01:00
bors e187f8871e Auto merge of #107314 - matthiaskrgr:rollup-j40lnlj, r=matthiaskrgr
Rollup of 11 pull requests

Successful merges:

 - #106407 (Improve proc macro attribute diagnostics)
 - #106960 (Teach parser to understand fake anonymous enum syntax)
 - #107085 (Custom MIR: Support binary and unary operations)
 - #107086 (Print PID holding bootstrap build lock on Linux)
 - #107175 (Fix escaping inference var ICE in `point_at_expr_source_of_inferred_type`)
 - #107204 (suggest qualifying bare associated constants)
 - #107248 (abi: add AddressSpace field to Primitive::Pointer )
 - #107272 (Implement ObjectSafe and WF in the new solver)
 - #107285 (Implement `Generator` and `Future` in the new solver)
 - #107286 (ICE in new solver if we see an inference variable)
 - #107313 (Add Style Team Triagebot config)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2023-01-26 06:23:14 +00:00
Matthias Krüger 5be2f51428
Rollup merge of #107285 - compiler-errors:new-solver-future-and-generator, r=lcnr
Implement `Generator` and `Future` in the new solver

r? `@lcnr`
2023-01-26 06:15:28 +01:00
Matthias Krüger a8b5e5d9db
Rollup merge of #107248 - erikdesjardins:addrspace, r=oli-obk
abi: add AddressSpace field to Primitive::Pointer

...and remove it from `PointeeInfo`, which isn't meant for this.

There are still various places (marked with FIXMEs) that assume all pointers
have the same size and alignment. Fixing this requires parsing non-default
address spaces in the data layout string (and various other changes),
which will be done in a followup.
(That is, if it's actually worth it to support multiple different pointer sizes.
There is a lot of code that would be affected by that.)

Fixes #106367

r? ``@oli-obk``
cc ``@Patryk27``
2023-01-26 06:15:27 +01:00
Matthias Krüger a8e8406e60
Rollup merge of #107204 - euclio:assoc-const-suggestion, r=petrochenkov
suggest qualifying bare associated constants

Fixes #107199.
2023-01-26 06:15:26 +01:00
Matthias Krüger 5bc49807dd
Rollup merge of #107175 - compiler-errors:bad-types-in-vec-push, r=estebank
Fix escaping inference var ICE in `point_at_expr_source_of_inferred_type`

Fixes #107158

`point_at_expr_source_of_inferred_type` uses `lookup_probe` to adjust the self type of a method receiver -- but that method returns inference variables from inside a probe. That means that the ty vars are no longer valid, so we can't use any infcx methods on them.

Also, pass some extra span info to hack a quick solution to bad labels, resulting in this diagnostic improvement:

```rust
fn example2() {
    let mut x = vec![1];
    x.push("");
}
```

```diff
  error[E0308]: mismatched types
   --> src/main.rs:5:12
    |
  5 |     x.push("");
    |       ---- ^^
    |       |    |
    |       |    expected integer, found `&str`
-   |       |    this is of type `&'static str`, which causes `x` to be inferred as `Vec<{integer}>`
    |       arguments to this method are incorrect
```
(since that "which causes `x` to be inferred as `Vec<{integer}>` part is wrong)

r? `@estebank`

(we really should make this code better in general, cc #106590, but that's a bit bigger issue that needs some more thinking about)
2023-01-26 06:15:26 +01:00
Matthias Krüger f3644ca64d
Rollup merge of #107085 - tmiasko:custom-mir-operators, r=oli-obk
Custom MIR: Support binary and unary operations

Lower binary and unary operations directly to corresponding unchecked MIR
operations. Ultimately this might not be syntax we want, but it allows for
experimentation in the meantime.

r? ````@oli-obk```` ````@JakobDegen````
2023-01-26 06:15:24 +01:00
Matthias Krüger ba928ba041
Rollup merge of #106960 - estebank:parse-anon-enums, r=cjgillot
Teach parser to understand fake anonymous enum syntax

Parse `Ty | OtherTy` in function argument and return types.
Parse type ascription in top level patterns.

Minimally address #100741.
2023-01-26 06:15:24 +01:00
Matthias Krüger 8ae5116fae
Rollup merge of #106407 - mejrs:attr_check, r=compiler-errors
Improve proc macro attribute diagnostics

Closes https://github.com/rust-lang/rust/issues/102923
2023-01-26 06:15:23 +01:00
Matthew J Perez 3016f55579 improve fn pointer notes
- add note and suggestion for casting both expected and found fn items
  to fn pointers
- add note for casting expected fn item to fn pointer
2023-01-26 05:07:34 +00:00
Michael Goulet d600b94ebb Implement Generator and Future 2023-01-26 03:15:36 +00:00
bors 885bf62887 Auto merge of #105582 - saethlin:instcombine-assert-inhabited, r=cjgillot
InstCombine away intrinsic validity assertions

This optimization (currently) fires 246 times on the standard library. It seems to fire hardly at all on the big crates in the benchmark suite. Interesting.
2023-01-26 03:10:52 +00:00
yukang c4d00d710c add testcase for #104012 2023-01-26 10:52:57 +08:00
Matthias Krüger a20b86f881
Rollup merge of #107282 - BoxyUwU:erica_builtin_pointee_impls, r=compiler-errors
erica solver: implement builtin `Pointee` trait impl candidates

r? ```@compiler-errors```
2023-01-25 22:19:56 +01:00
Matthias Krüger c2f46df5a5
Rollup merge of #107256 - JakobDegen:delete-sai, r=cjgillot
Delete `SimplifyArmIdentity` and `SimplifyBranchSame` mir opts

I had attempted to fix the first of these opts in #94177 . However, despite that PR already being a full re-write, it still did not fix some of the core soundness issues. The optimizations that are attempted here are likely to be desirable, but I do not expect any of the currently written code to survive into a sound implementation. Deleting the code keeps us from having to maintain the passes in the meantime.

Closes #77359 , closes #72800 , closes #78628

r? ```@cjgillot```
2023-01-25 22:19:55 +01:00
Matthias Krüger c20e0daf32
Rollup merge of #107255 - lcnr:implied-b-hr, r=oli-obk
add test where we ignore hr implied bounds

r? types
2023-01-25 22:19:54 +01:00
Matthias Krüger 2ed3639f83
Rollup merge of #107244 - notriddle:notriddle/primitive-reference-link, r=GuillaumeGomez
rustdoc: rearrange HTML in primitive reference links

This patch avoids hard-to-click single character links by making the generic part of the link:

Before: <a href="#">&</a>T

After: <a href="#">&T</a>
2023-01-25 22:19:53 +01:00
Matthias Krüger 22e62a4fca
Rollup merge of #106944 - Nilstrieb:there-once-was-a-diagnostic, r=WaffleLapkin
Suggest using a lock for `*Cell: Sync` bounds

I mostly did this for `OnceCell<T>` at first because users will be confused to see that the `OnceCell<T>` in `std` isn't `Sync` but then extended it to `Cell<T>` and `RefCell<T>` as well.
2023-01-25 22:19:52 +01:00
Matthias Krüger 9e3f330656
Rollup merge of #106897 - estebank:issue-99430, r=davidtwco
Tweak E0597

CC #99430
2023-01-25 22:19:52 +01:00
Matthias Krüger f21728fee4
Rollup merge of #105345 - yanchen4791:issue-103582-fix, r=jackh726
Add hint for missing lifetime bound on trait object when type alias is used

Fix issue #103582.

The problem: When a type alias is used to specify the return type of the method in a trait impl, the suggestion for fixing the problem of "missing lifetime bound on trait object" of the trait impl will not be created. The issue caused by the code which searches for the return trait objects when constructing the hint suggestion is not able to find the trait objects since they are specified in the type alias path instead of the return path of the trait impl.

The solution: Trace the trait objects in the type alias path and provide them along with the alias span to generate the suggestion in case the type alias is used in return type of the method in the trait impl.
2023-01-25 22:19:51 +01:00
Nilstrieb 943000fdcf Use `can_eq` to compare types for default assoc type error
This works correctly with inference variables.
2023-01-25 21:25:42 +01:00
Michael Goulet b83ab0ce96 Suggest mutable borrows correctly 2023-01-25 19:37:10 +00:00
Michael Goulet 800f1f3513 Liberate late-bound regions correctly 2023-01-25 19:26:53 +00:00
Andy Russell 8b12d5f42f
suggest qualifying bare associated constants 2023-01-25 08:58:27 -05:00
Dylan DPC e78fa8a0bc
Rollup merge of #107232 - notriddle:notriddle/settings-choice, r=GuillaumeGomez
rustdoc: simplify settings popover DOM, CSS, JS

* Change the class names so that they all start with `setting-`. That should make it harder to accidentally use a setting class outside the settings popover, where loading the CSS might accidentally change the styles of something unrelated.
* Get rid of an unnecessary wrapper DIV around the radio button line.
* Simplify CSS selectors by making the DOM easier and more intuitive to target.
* Remove dead settings JS for obsolete select-wrapper
2023-01-25 17:01:44 +05:30
Dylan DPC 4e2b5d1f54
Rollup merge of #107213 - edward-shen:edward-shen/fix-accidental-let-else, r=compiler-errors
Add suggestion to remove if in let..else block

Adds an additional hint to failures where we encounter an else keyword while we're parsing an if-let expression.

This is likely that the user has accidentally mixed if-let and let..else together.

Fixes #103791.
2023-01-25 17:01:43 +05:30
Dylan DPC b36a8dcea3
Rollup merge of #106583 - estebank:suggest-result-coercion, r=compiler-errors
Suggest coercion of `Result` using `?`

Fix #47560.
2023-01-25 17:01:40 +05:30
Boxy 430dab0b42 implement builtin candidate 2023-01-24 23:24:30 +00:00
Matthew J Perez 1e22280f23
Add suggestions for function pointers
- On compiler-error's suggestion of moving this lower down the stack,
along the path of `report_mismatched_types()`, which is used
by `rustc_hir_analysis` and `rustc_hir_typeck`.
- update ui tests, add test
- add suggestions for references to fn pointers
- modify `TypeErrCtxt::same_type_modulo_infer` to take `T: relate::Relate` instead of `Ty`
2023-01-24 14:02:56 -05:00
Michael Howell 616a0db7d6 rustdoc: add test case based on #103357 2023-01-24 09:49:33 -07:00
dimi af58854168 add feature gate tests for DispatchFromDyn 2023-01-24 14:21:57 +01:00
Jakob Degen ad7393668f Delete `SimplifyArmIdentity` and `SimplifyBranchSame` mir opts 2023-01-24 04:13:52 -08:00
lcnr e6e93e021e add test where we ignore hr implied bounds 2023-01-24 12:41:18 +01:00
dimi a2d1cb2c22 impl DispatchFromDyn for Cell and UnsafeCell 2023-01-24 12:06:12 +01:00
Nathan Fenner 99638a6817 revert change to test source 2023-01-23 21:54:40 -08:00
Edward Shen a8b77cfe54
Add suggestion to remove if in let...else block
Adds an additional hint to failures where we encounter an else keyword
while we're parsing an if-let block.

This is likely that the user has accidentally mixed if-let and let...else
together.
2023-01-23 20:33:04 -08:00
Michael Howell e65b36110f rustdoc: rearrange HTML in primitive reference links
This patch avoids hard-to-click single character links by making
the generic part of the link:

Before: <a href="#">&</a>T

After: <a href="#">&T</a>
2023-01-23 17:32:22 -07:00
Bryan Garza bdb815a22a Move const-eval/stable-metric ui tests 2023-01-24 00:01:40 +00:00
Bryan Garza a8c9528e06 Bless z-help test for new flag 2023-01-23 23:56:22 +00:00
Bryan Garza 75b7c6c8ec Bless and update consts tests 2023-01-23 23:56:22 +00:00
Michael Howell 5dd87c58aa rustdoc: simplify settings popover DOM
* Changes the class names so that they all start with `setting-`.
  That should make it harder to accidentally use a setting class outside
  the settings popover, where loading the CSS might accidentally change
  the styles of something unrelated.
* Get rid of an unnecessary wrapper DIV around the radio button line.
* Simplify CSS selectors by making the DOM easier and more intuitive
  to target.
2023-01-23 15:08:33 -07:00
Nathan Fenner 2a67e99d7d Point at specific field in struct literal when trait fulfillment fails 2023-01-23 13:37:58 -08:00