Commit Graph

209148 Commits

Author SHA1 Message Date
Ralf Jung
6e3b0df8b8 pthread_setname_np returns an int on macOS 2022-10-28 10:31:43 +02:00
bors
898f463c93 Auto merge of #103672 - matthiaskrgr:rollup-dyk3civ, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - #103585 (Migrate source line numbers CSS to CSS variables)
 - #103608 (Remap early bound lifetimes in return-position `impl Trait` in traits too)
 - #103609 (Emit a nicer error on `impl Self {`)
 - #103631 (Add test for issue 36007)
 - #103643 (rustdoc: stop hiding focus outlines on non-rustdoc-toggle details tags)
 - #103645 (Update cargo)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-10-28 06:49:38 +00:00
Eric Huss
c2b0cc14d1 Update note about unstable split-debuginfo flag. 2022-10-27 22:24:07 -07:00
Matthias Krüger
2f00f57aef
Rollup merge of #103645 - weihanglo:update-cargo, r=weihanglo
Update cargo

6 commits in 9210810d1fd7b51ae0439a0a363cc50e36963455..7e484fc1a766f56dbc95380f45719698e0c82749 2022-10-25 22:31:50 +0000 to 2022-10-27 15:20:57 +0000
- fix(publish): Block until it is in index (rust-lang/cargo#11062)
- Add Accept-Encoding request header to enable compression (rust-lang/cargo#11292)
- Update contrib docs for highfive transition (rust-lang/cargo#11294)
- Migrate from highfive to triagebot (rust-lang/cargo#11293)
- Fix dupe word typos (rust-lang/cargo#11287)
- Fix confusing error messages when using -Zsparse-registry (rust-lang/cargo#11283)
2022-10-28 07:06:48 +02:00
Matthias Krüger
32c96248c5
Rollup merge of #103643 - notriddle:notriddle/summary-focus-visible, r=GuillaumeGomez
rustdoc: stop hiding focus outlines on non-rustdoc-toggle details tags

We really shouldn't be overriding this kind of stuff unless the browser default is really broken (like outlining the thing that isn't clickable). This directly reverts b8f4e74cbc.
2022-10-28 07:06:47 +02:00
Matthias Krüger
19b406d16b
Rollup merge of #103631 - Rageking8:Add-test-for-issue-36007, r=compiler-errors
Add test for issue 36007

Fixes #36007

r? ``@compiler-errors``
2022-10-28 07:06:47 +02:00
Matthias Krüger
ab0d9dfefe
Rollup merge of #103609 - BoxyUwU:fix_impl_self_cycle, r=compiler-errors
Emit a nicer error on `impl Self {`

currently it emits a "cycle detected error" but this PR makes it emit a more user friendly error specifically saying that `Self` is disallowed in that position. this is a pretty hacky fix so i dont expect this to be merged (I basically only made this PR because i wanted to see if CI passes)

r? ``@compiler-errors``
2022-10-28 07:06:46 +02:00
Matthias Krüger
112fd022cd
Rollup merge of #103608 - compiler-errors:rpitit-early-lt, r=cjgillot
Remap early bound lifetimes in return-position `impl Trait` in traits too

Fixes part of #103457

r? ``@cjgillot,`` though feel free to reassign, just thought you'd have sufficient context to review.
2022-10-28 07:06:46 +02:00
Matthias Krüger
6e1613a0c5
Rollup merge of #103585 - GuillaumeGomez:source-line-css, r=notriddle
Migrate source line numbers CSS to CSS variables

Part of https://github.com/rust-lang/rust/pull/98460.

No UI changes.

r? ``@notriddle``
2022-10-28 07:06:45 +02:00
Matthias Krüger
84663cee39
Rollup merge of #103641 - compiler-errors:issue-103624, r=cjgillot
Don't carry MIR location in `ConstraintCategory::CallArgument`

It turns out that `ConstraintCategory::CallArgument` cannot just carry a MIR location in it, since we may bubble them up to totally different MIR bodies.

So instead, revert the commit a6b5f95fb0, and instead just erase regions from the original `Option<Ty<'tcx>>` that it carried, so that it doesn't ICE with the changes in #103220.

Best reviewed in parts -- the first is just a revert, and the second is where the meaningful changes happen.

Fixes #103624
2022-10-28 07:06:43 +02:00
Matthias Krüger
f541ad9165
Rollup merge of #103550 - notriddle:notriddle/no-suggest-static-candidates, r=wesleywiser
diagnostics: do not suggest static candidates as traits to import

If it's a static candidate, then it's already implemented. Do not suggest it a second time for implementing.

Partial fix for #102354
2022-10-28 07:06:43 +02:00
Matthias Krüger
2f02cf8768
Rollup merge of #103523 - GuillaumeGomez:inline-doc-comment-impl-block, r=notriddle
Fix unwanted merge of inline doc comments for impl blocks

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

We need this merge mechanism for inlined items but it's completely unwanted for impl blocks (at least the doc comments are, not the other attributes) since we want to keep what `cfg()` is put on the `pub use` or other attributes.

r? ``@notriddle``
2022-10-28 07:06:42 +02:00
Matthias Krüger
270e0c5357
Rollup merge of #103283 - nbarrios1337:unsafe-impl-suggestions, r=cjgillot
Add suggestions for unsafe impl error codes

Adds suggestions for users to add `unsafe` to trait impls that should be `unsafe`, and remove `unsafe` from trait impls that do not require `unsafe`

With the folllowing code:

```rust
struct Foo {}

struct Bar {}

trait Safe {}

unsafe trait Unsafe {}

impl Safe for Foo {} // ok

impl Unsafe for Foo {} // E0200

unsafe impl Safe for Bar {} // E0199

unsafe impl Unsafe for Bar {} // ok

// omitted empty main fn
```

The current rustc output is:
```
error[E0199]: implementing the trait `Safe` is not unsafe
  --> e0200.rs:13:1
   |
13 | unsafe impl Safe for Bar {} // E0199
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0200]: the trait `Unsafe` requires an `unsafe impl` declaration
  --> e0200.rs:11:1
   |
11 | impl Unsafe for Foo {} // E0200
   | ^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to 2 previous errors

Some errors have detailed explanations: E0199, E0200.
For more information about an error, try `rustc --explain E0199`.
```

With this PR, the future rustc output would be:
```
error[E0199]: implementing the trait `Safe` is not unsafe
  --> ../../temp/e0200.rs:13:1
   |
13 | unsafe impl Safe for Bar {} // E0199
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
help: remove `unsafe` from this trait implementation
   |
13 - unsafe impl Safe for Bar {} // E0199
13 + impl Safe for Bar {} // E0199
   |

error[E0200]: the trait `Unsafe` requires an `unsafe impl` declaration
  --> ../../temp/e0200.rs:11:1
   |
11 | impl Unsafe for Foo {} // E0200
   | ^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: the trait `Unsafe` enforces invariants that the compiler can't check. Review the trait documentation and make sure this implementation upholds those invariants before adding the `unsafe` keyword
help: add `unsafe` to this trait implementation
   |
11 | unsafe impl Unsafe for Foo {} // E0200
   | ++++++

error: aborting due to 2 previous errors

Some errors have detailed explanations: E0199, E0200.
For more information about an error, try `rustc --explain E0199`.
```

``@rustbot`` label +T-compiler +A-diagnostics +A-suggestion-diagnostics
2022-10-28 07:06:42 +02:00
Matthias Krüger
c404092084
Rollup merge of #102642 - bryangarza:afit-tests, r=compiler-errors
Add tests for static async functions in traits

This patch adds test cases for AFIT, the majority of which are currently expected to run as `check-fail`.

---

Note: I grabbed the cases from https://hackmd.io/SwRcXCiWQV-WRJ4BYs53fA

Also, I'm not sure if the `async-associated-types2` and `async-associated-types2-desugared` are correct, I modified them a bit from the examples in the HackMD.
2022-10-28 07:06:41 +02:00
Rageking8
92b314ba30 add test for issue 98634 2022-10-28 10:07:54 +08:00
Ben Kimock
17b86cb611 Do fewer passes and generally be more efficient when filtering tests 2022-10-27 21:34:56 -04:00
Michael Howell
509d8ad454 rustdoc: remove redundant div.search-container
This wrapper DIV was originally added in
89e1fb3223, when it allowed the search bar's
size to be calculated without using `calc()`. This `width` hack can be
removed using flexbox.
2022-10-27 17:48:26 -07:00
bors
cdd7afeaad Auto merge of #103654 - flip1995:clippy_backport, r=Manishearth
Move clippy::uninlined_format_args back to pedantic

Before `beta` is branched tomorrow we want to move this lint back to `pedantic` so that it is not enabled by default.

Clippy PR: https://github.com/rust-lang/rust-clippy/pull/9728
Zulip discussion: https://rust-lang.zulipchat.com/#narrow/stream/257328-clippy/topic/.60uninlined_format_args.60.20category/near/306306974

r? `@Manishearth`
2022-10-28 00:34:32 +00:00
Bryan Garza
bfdefdbfb7 Update tests based on feedback
- Add comment to some tests that will break when #102745 is implemented
- Mark a test with known-bug
- Delete duplicate test
2022-10-27 22:58:54 +00:00
Bryan Garza
0b3b046436 Update src/test/ui/async-await/in-trait/async-example.rs
Co-authored-by: Michael Goulet <michael@errs.io>
2022-10-27 22:58:54 +00:00
Bryan Garza
9a05081d5f Add additional tests for static AFIT 2022-10-27 22:58:54 +00:00
Bryan Garza
11b1439380 Update tests based on feedback 2022-10-27 22:58:54 +00:00
Bryan Garza
8a0ebca97e Update static AFIT tests based on feedback 2022-10-27 22:58:54 +00:00
Bryan Garza
97423d331f Add tests for static async functions in traits
This patch adds test cases for AFIT, the majority of which are currently
expected to run as `check-fail`.
2022-10-27 22:58:53 +00:00
bors
bd4a56bce8 Auto merge of #2624 - WaffleLapkin:iforgor💀, r=RalfJung
Implement `ptr_mask` intrinsic

I promised I'll implement it, but then forgot 😅
2022-10-27 22:48:45 +00:00
bors
126dbdc9c7 Auto merge of #103629 - matthiaskrgr:rollup-r94tqfa, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #103110 (remove redundant Send impl for references)
 - #103255 (Clean up hidden type registration)
 - #103394 (Clarify documentation about the memory layout of `UnsafeCell`)
 - #103408 (Clean return-position `impl Trait` in traits correctly in rustdoc)
 - #103505 (rustdoc: parse self-closing tags and attributes in `invalid_html_tags`)
 - #103524 (rustc_metadata: Add struct and variant constructors to module children at encoding time)
 - #103544 (Add flag to forbid recovery in the parser)
 - #103616 (rustdoc: remove CSS workaround for Firefox 29)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-10-27 21:36:07 +00:00
Boxy
b3425587a6 tidy + move logic to fn 2022-10-27 22:29:16 +01:00
Boxy
ca5a6e43dd use proper spans 2022-10-27 22:18:26 +01:00
Boxy
c00ff9c4d0 DoIt 2022-10-27 21:48:47 +01:00
Philipp Krones
3f24108662
Move clippy::uninlined_format_args back to pedantic 2022-10-27 22:24:24 +02:00
Maybe Waffle
7663305dff Implement ptr_mask intrinsic 2022-10-27 23:47:50 +04:00
Camille GILLOT
cb1e7d9676 Only ban duplication across parameters. 2022-10-27 19:04:48 +00:00
Gary Guo
bfac2daef9 Ignore test on mingw32 2022-10-27 18:22:40 +01:00
Weihang Lo
4d9114fe80
Update cargo
6 commits in 9210810d1fd7b51ae0439a0a363cc50e36963455..7e484fc1a766f56dbc95380f45719698e0c82749
2022-10-25 22:31:50 +0000 to 2022-10-27 15:20:57 +0000
- fix(publish): Block until it is in index (rust-lang/cargo#11062)
- Add Accept-Encoding request header to enable compression (rust-lang/cargo#11292)
- Update contrib docs for highfive transition (rust-lang/cargo#11294)
- Migrate from highfive to triagebot (rust-lang/cargo#11293)
- Fix dupe word typos (rust-lang/cargo#11287)
- Fix confusing error messages when using -Zsparse-registry (rust-lang/cargo#11283)
2022-10-28 01:18:50 +08:00
Michael Howell
dd912add18 rustdoc: stop hiding focus outlines on non-rustdoc-toggle details tags
We really shouldn't be overriding this kind of stuff unless the browser
default is really broken (like outlining the thing that isn't clickable).
This directly reverts b8f4e74cbc.
2022-10-27 10:01:28 -07:00
Michael Goulet
4e0c27bbfd Erase regions from CallArgument, add test + bless 2022-10-27 16:26:55 +00:00
Chris Denton
5857c3045a
Use stdio in UWP apps
This has been supported since Windows 10.0.16299. See https://learn.microsoft.com/en-us/uwp/win32-and-com/win32-apis#apis-from-api-ms-win-core-console-l1-1-0dll
2022-10-27 17:21:30 +01:00
Michael Goulet
dce44faf5b Revert "Make ClosureOutlivesRequirement not rely on an unresolved type"
This reverts commit a6b5f95fb0.
2022-10-27 16:15:11 +00:00
Julien Cretin
dad28ad6d5 Add multivalue target feature to WASM target 2022-10-27 18:08:30 +02:00
Michael Goulet
2f9794b84a remove _types from ocx method names 2022-10-27 15:43:37 +00:00
Michael Goulet
ce11ae5d0d Address some more nits 2022-10-27 15:43:33 +00:00
Michael Goulet
d793d80cf7 (almost) Always use ObligationCtxt when dealing with canonical queries 2022-10-27 15:43:33 +00:00
Maybe Waffle
c8c4971073 Update miri 2022-10-27 19:10:33 +04:00
Rageking8
f4ac137f3c add test for issue 36007 2022-10-27 22:56:20 +08:00
Maybe Waffle
dc53c8f25f Update tooling 2022-10-27 18:41:26 +04:00
bors
d022e0ec53 Auto merge of #13496 - rust-lang:lnicola-patch-1, r=jonas-schievink
internal: Clarify feature policy

CC #13495
2022-10-27 13:37:45 +00:00
Laurențiu Nicola
05514d8233
Clarify feature policy 2022-10-27 16:35:07 +03:00
Michael Woerister
9117ea9758 Introduce UnordMap, UnordSet, and UnordBag (see MCP 533)
MCP 533: https://github.com/rust-lang/compiler-team/issues/533

Also, as an example, substitute UnordMap for FxHashMap in
used_trait_imports query result.
2022-10-27 13:23:26 +00:00
Matthias Krüger
ae4dc12519
Rollup merge of #103616 - rust-lang:notriddle/moz-box-sizing, r=GuillaumeGomez
rustdoc: remove CSS workaround for Firefox 29

CSS variables, which rustdoc now relies on, are only supported in Firefox 31 and later: https://www.mozilla.org/en-US/firefox/31.0/releasenotes/

This means it’s fine to also rely on unprefixed box-sizing, which is supported in Firefox 29 and later: https://www.mozilla.org/en-US/firefox/29.0/releasenotes/
2022-10-27 15:03:58 +02:00
Matthias Krüger
f9dfb6e32f
Rollup merge of #103544 - Nilstrieb:no-recovery-pls, r=compiler-errors
Add flag to forbid recovery in the parser

To start the effort of fixing #103534, this adds a new flag to the parser, which forbids the parser from doing recovery, which it shouldn't do in macros.

This doesn't add any new checks for recoveries yet and is just here to bikeshed the names for the functions here before doing more.

r? `@compiler-errors`
2022-10-27 15:03:58 +02:00