Commit Graph

206397 Commits

Author SHA1 Message Date
Mara Bos
3ffcb65518 Update tests. 2022-09-27 13:31:50 +02:00
Mara Bos
9bec0de397 Rewrite and refactor format_args!() builtin macro. 2022-09-27 13:13:08 +02:00
bors
57ee5cf5a9 Auto merge of #102306 - lcnr:rustc_hir_analysis, r=compiler-errors
rename rustc_typeck to rustc_hir_analysis

first part of https://github.com/rust-lang/compiler-team/issues/529

r? `@compiler-errors`
2022-09-27 10:45:57 +00:00
David Wood
2286888ef9 session: remove now-unnecessary lint #[allow]s
In #101230, the internal diagnostic migration lints -
`diagnostic_outside_of_impl` and `untranslatable_diagnostic` - were
modified so that they wouldn't trigger on functions annotated with
`#[rustc_lint_diagnostics]`. However, this change has to make it into
the bootstrap compiler before the `#[allow]` annotations that it aims to
remove can be removed, which is possible now that #102051 has landed.

Signed-off-by: David Wood <david.wood@huawei.com>
2022-09-27 11:01:49 +01:00
lcnr
1fc86a63f4 rustc_typeck to rustc_hir_analysis 2022-09-27 10:37:23 +02:00
bors
d9297d22ad Auto merge of #102314 - TaKO8Ki:add-label-to-struct-enum-union-ident, r=estebank
Add a label to struct/enum/union ident name

Based on https://github.com/rust-lang/rust/pull/94996#discussion_r831694150
cc: `@estebank`
2022-09-27 07:30:11 +00:00
Nicholas Nethercote
b69c335327 Tweak FulfillProcessor.
Avoids some unnecessary references and lifetimes.
2022-09-27 16:37:00 +10:00
Nicholas Nethercote
c91c64708b Fix an incorrect comment.
If a `\x` escape occurs in a non-byte literals (e.g. char literal,
string literal), it must be <= 0xff.
2022-09-27 15:25:34 +10:00
bors
de0b511daa Auto merge of #102189 - davidtwco:translation-derive-enums, r=compiler-errors
macros: diagnostic derive on enums

Part of #100717.

Extends `#[derive(Diagnostic)]` to work on enums too where each variant acts like a distinct diagnostic - being able to represent diagnostics this way can be quite a bit simpler for some parts of the compiler.

r? `@compiler-errors`
cc `@Xiretza`
2022-09-27 04:39:25 +00:00
Michael Goulet
594134d873 Structured suggestion for missing mut/const in pointer 2022-09-27 02:47:07 +00:00
Nicholas Nethercote
7f7e2165b1 Rename some variables.
These make the delimiter processing clearer.
2022-09-27 12:04:03 +10:00
bors
cd4d9d934f Auto merge of #102331 - notriddle:rollup-dmefd2d, r=notriddle
Rollup of 6 pull requests

Successful merges:

 - #102283 (Improve code example for Option::unwrap_or_default)
 - #102319 (rustdoc: merge CSS `table` rules into `.docblock`)
 - #102321 ( Rustdoc-Json: List impls for primitives)
 - #102322 (Document that Display automatically implements ToString)
 - #102325 (rustdoc: give `.line-number` / `.line-numbers` meaningful names)
 - #102326 (rustdoc: Update doc comment for splitn_mut to include mutable in the …)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-09-27 01:58:36 +00:00
Takayuki Maeda
5d05908c70 fix a ui test 2022-09-27 10:28:53 +09:00
Takayuki Maeda
4f44dee501 add a label to struct/enum/union ident name 2022-09-27 10:28:50 +09:00
Takayuki Maeda
e123a61297 create a new local var 2022-09-27 10:22:46 +09:00
Matthew Kelly
0d9c01480b remove implied link bound per review
also update .stderr outputs
2022-09-26 20:50:33 -04:00
Matthew Kelly
24aab524cb Merge remote-tracking branch 'origin/master' into mpk/add-long-error-message-for-E0311 2022-09-26 19:59:52 -04:00
Nicholas Nethercote
880ebb657a Minor improvements.
Add some comments, and mark one path as unreachable.
2022-09-27 09:53:04 +10:00
Josh Stone
35adb36779 Avoid LLVM-deprecated Optional::hasValue
LLVM 15 added `Optional::has_value`, and LLVM `main` (16) has deprecated
`hasValue`. However, its `explicit operator bool` does the same thing,
and was added long ago, so we can use that across our full LLVM range of
compatibility.
2022-09-26 16:51:18 -07:00
bors
f3a6fbf2f2 Auto merge of #102283 - GuillaumeGomez:option-code-example-unwrap-or-default, r=thomcc
Improve code example for Option::unwrap_or_default

Fixes #100054.
Follow-up of #102259.

r? `@thomcc`
2022-09-26 23:17:52 +00:00
Michael Howell
7381d7d8b2
Rollup merge of #102326 - yancyribbens:splin-mut-doc-change, r=thomcc
rustdoc: Update doc comment for splitn_mut to include mutable in the …

The doc comment for [splitn](https://github.com/rust-lang/rust/blob/master/library/core/src/slice/mod.rs#L2051:L2056) is the exact same as the comment for [splitn_mut](https://github.com/rust-lang/rust/blob/master/library/core/src/slice/mod.rs#L2079:L2084).  The doc comment for `splitn_mut` should instead say it's working on a mutable subslice.
2022-09-26 15:40:55 -07:00
Michael Howell
76b21341a8
Rollup merge of #102325 - notriddle:notriddle/line-number, r=GuillaumeGomez
rustdoc: give `.line-number` / `.line-numbers` meaningful names
2022-09-26 15:40:55 -07:00
Michael Howell
66bab6b781
Rollup merge of #102322 - sigaloid:master, r=GuillaumeGomez
Document that Display automatically implements ToString

Closes #92941

r? rust-lang/docs
2022-09-26 15:40:54 -07:00
Michael Howell
0415560382
Rollup merge of #102321 - aDotInTheVoid:rdj-prim-impls, r=GuillaumeGomez
Rustdoc-Json: List impls for primitives

 Closes #101695

 Partially addresses #100961

r? ``@GuillaumeGomez``
2022-09-26 15:40:54 -07:00
Michael Howell
dc4fb6b572
Rollup merge of #102319 - notriddle:notriddle/td-th, r=GuillaumeGomez
rustdoc: merge CSS `table` rules into `.docblock`

This was added in 510107815f, to fix the display of the module items and search results tables (see the discussion in https://github.com/rust-lang/rust/pull/86725).

Those aren't tables any more. The only remaining table is in docblock, which has its own padding declarations.
2022-09-26 15:40:53 -07:00
Michael Howell
2668a6839a
Rollup merge of #102283 - GuillaumeGomez:option-code-example-unwrap-or-default, r=thomcc
Improve code example for Option::unwrap_or_default

Fixes #100054.
Follow-up of #102259.

r? ``@thomcc``
2022-09-26 15:40:52 -07:00
Michael Howell
3fac709eab rustdoc: remove no-op CSS .srclink { font-weight; font-size }
When this CSS was added in 34bd2b845b, source
links were nested below headers.

34bd2b845b/src/librustdoc/html/render.rs (L4015-L4019)

Now, thanks to 458e7219bc, they are now
siblings of headers, and thanks to
270d09dca9, they have the same font size that
they would've had anyway.
2022-09-26 15:28:49 -07:00
bors
8b705839cd Auto merge of #102324 - matthiaskrgr:rollup-6l70oz3, r=matthiaskrgr
Rollup of 5 pull requests

Successful merges:

 - #101875 (Allow more `!Copy` impls)
 - #101996 (Don't duplicate region names for late-bound regions in print of Binder)
 - #102181 (Add regression test)
 - #102273 (Allow `~const` bounds on non-const functions)
 - #102286 (Recover some items that expect braces and don't take semicolons)

Failed merges:

 - #102314 (Add a label to struct/enum/union ident name)

r? `@ghost`
`@rustbot` modify labels: rollup
2022-09-26 19:57:51 +00:00
Michael Howell
9ca2ae3fa7 rustdoc: simplify example-line-numbers CSS selector 2022-09-26 12:49:08 -07:00
Michael Howell
0b97831af7 rustdoc: give .line-number / .line-numbers meaningful names 2022-09-26 11:48:03 -07:00
yancy
40f404468a rustdoc: Update doc comment for splitn_mut to include mutable in the description 2022-09-26 20:20:13 +02:00
Matthias Krüger
6f5e8c2ed4
Rollup merge of #102286 - compiler-errors:recover-semi-in-block-item, r=davidtwco
Recover some items that expect braces and don't take semicolons

Fixes #102262
2022-09-26 19:19:21 +02:00
Matthias Krüger
e9bec2fdd4
Rollup merge of #102273 - woppopo:relax_const_bound, r=fee1-dead
Allow `~const` bounds on non-const functions

Makes the behavior of bound of trait-associated functions and non-associated functions consistent.
2022-09-26 19:19:21 +02:00
Matthias Krüger
0857ddeed6
Rollup merge of #102181 - inquisitivecrystal:issue-100878-test, r=Mark-Simulacrum
Add regression test

This adds a regression test for issue #100878.

Closes #100878.
2022-09-26 19:19:20 +02:00
Matthias Krüger
b02062e886
Rollup merge of #101996 - b-naber:binder-print, r=lcnr
Don't duplicate region names for late-bound regions in print of Binder

Fixes https://github.com/rust-lang/rust/issues/101280
2022-09-26 19:19:20 +02:00
Matthias Krüger
4d4a3691e9
Rollup merge of #101875 - fmease:allow-more-negative-copy-impls, r=lcnr
Allow more `!Copy` impls

You can already implement `!Copy` for a lot of types (with `#![feature(negative_impls)]`). However, before this PR you could not implement `!Copy` for ADTs whose fields don't implement `Copy` which didn't make any sense. Further, you couldn't implement `!Copy` for types impl'ing `Drop` (equally nonsensical).

``@rustbot`` label T-types F-negative_impls
Fixes #101836.

r? types
2022-09-26 19:19:19 +02:00
bors
1d1f142660 Auto merge of #102257 - cjgillot:let-else-lint, r=dingxiangfei2009
Fix lint scoping for let-else.

The scoping for let-else is inconsistent with HIR nesting.  This creates cases, in `ui/let-else/let-else-allow-unused.rs` for instance, where an `allow` lint attribute does not apply to the bindings created by `let-else`.

This PR is an attempt to correct this.

As there is no lint that currently relies on this, the test for this behaviour is https://github.com/rust-lang/rust/pull/101500.

cc `@dingxiangfei2009` as you filed https://github.com/rust-lang/rust/pull/101894
2022-09-26 17:17:07 +00:00
Nixon Enraght-Moony
aac7429c17 Rustdoc-Json: List impls for primitives
Closes #101695
2022-09-26 18:06:48 +01:00
Matthew Esposito
4fad063cba Document that Display entails ToString 2022-09-26 13:03:59 -04:00
Michael Howell
99904445b8 rustdoc: merge table { border-collapse } into .docblock table`
This was added in 510107815f, to fix the
display of the module items and search results tables (see the discussion in
https://github.com/rust-lang/rust/pull/86725).

Those aren't tables any more. The only remaining table is in docblock, which
needs this attribute to look right.
2022-09-26 09:54:44 -07:00
Michael Howell
1fe3ce476c rustdoc: remove unneeded CSS td, th { padding 0 }
This was added in 510107815f, to fix
the display of the module items and search results tables (see the discussion
in https://github.com/rust-lang/rust/pull/86725).

Those aren't tables any more. The only remaining table is in docblock, which
has its own padding declarations.
2022-09-26 09:20:20 -07:00
bors
e1d7dec558 Auto merge of #102051 - pietroalbini:pa-bootstrap-update, r=Mark-Simulacrum
Update bootstrap compiler to 1.65.0

This PR updates the bootstrap compiler to Rust 1.65.0, removing the various `cfg(bootstrap)`s.

r? `@Mark-Simulacrum`
2022-09-26 14:22:43 +00:00
b-naber
6118ee343f address review 2022-09-26 14:21:39 +02:00
bors
84946fe241 Auto merge of #102184 - chenyukang:fix-102087-add-binding-sugg, r=nagisa
Suggest Default::default() when binding isn't initialized

Fixes #102087
2022-09-26 11:41:58 +00:00
b-naber
897adb8666 bless tests 2022-09-26 13:10:56 +02:00
b-naber
456f4e8d22 don't duplicate late-bound region names in print of Binder 2022-09-26 13:10:55 +02:00
David Wood
f20c882b8b macros: support diagnostic derive on enums
Signed-off-by: David Wood <david.wood@huawei.com>
2022-09-26 11:59:19 +01:00
Guillaume Gomez
475aeab79e Improve code example for Option::unwrap_or_default 2022-09-26 12:37:41 +02:00
Pietro Albini
f7b0c858a5
actually fix line number 2022-09-26 10:14:52 +02:00
Pietro Albini
81cfb14d99
fix line number in expected test output 2022-09-26 10:14:51 +02:00