Commit Graph

224287 Commits

Author SHA1 Message Date
bors
a673ad6b57 Auto merge of #111639 - Nilstrieb:rollup-vg149lm, r=Nilstrieb
Rollup of 10 pull requests

Successful merges:

 - #111428 (refactor(resolve): clean up the early error return caused by non-call)
 - #111449 (Recover `impl<T ?Sized>` correctly)
 - #111572 (Document that `missing_copy_implementations` and `missing_debug_implementations` only apply to public items.)
 - #111602 (Suppress "erroneous constant used" for constants tainted by errors)
 - #111605 (fixup version placeholder for `cfi_encoding` feature)
 - #111607 (Add clubby789 to the bootstrap review rotation)
 - #111614 (Add more interesting nonsense to weird-exprs.rs)
 - #111617 (Fixed typo)
 - #111620 (Add eholk back to compiler-contributors reviewers)
 - #111621 (Fix release date of 1.58.1 in release notes.)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2023-05-16 10:16:26 +00:00
Nilstrieb
5c0b8f164e
Rollup merge of #111621 - ehuss:relnotes-1.58.1-date, r=Mark-Simulacrum
Fix release date of 1.58.1 in release notes.

This fixes the release notes to have the correct release date for 1.58.1. The [blog announcement](https://blog.rust-lang.org/2022/01/20/Rust-1.58.1.html) has the correct date and link (which is otherwise broken without this change).

Closes #94278
2023-05-16 11:39:42 +02:00
Nilstrieb
607ed89a33
Rollup merge of #111620 - eholk:eholk-back-from-vacation, r=wesleywiser
Add eholk back to compiler-contributors reviewers

```@eholk``` is back from vacation so he can review things again.

r? ```@wesleywiser```
2023-05-16 11:39:41 +02:00
Nilstrieb
0db9de843d
Rollup merge of #111617 - kesleta:master, r=Dylan-DPC
Fixed typo

Fixed typo in BTree Curser.
2023-05-16 11:39:41 +02:00
Nilstrieb
87e25f7855
Rollup merge of #111614 - aDotInTheVoid:nonsense, r=cjgillot
Add more interesting nonsense to weird-exprs.rs

Some cursed things rust allows that I've ran into.

[The second is taken from here](https://twitter.com/Lucretiel/status/1638929955751964679)
2023-05-16 11:39:40 +02:00
Nilstrieb
6e48dcf77f
Rollup merge of #111607 - jyn514:clubby-reviews, r=clubby789
Add clubby789 to the bootstrap review rotation

r? `````@clubby789````` - thank you for volunteering!

I have been meaning for a very long time now to write up how to do reviews, but I haven't gotten around to it yet :( here is a short summary:

1. If you're not sure what the changes does or if it's ok, always feel free to ping someone else on the team, especially in the first few weeks. You can use `r? bootstrap` to get triagebot to assign someone else.
2. Bootstrap unfortunately has very few tests. Things that touch CLI or toml parsing should likely have a test in `src/bootstrap/config/tests.rs`; things that touch "core" build logic should have a test in `builder/tests.rs`, anything else kinda just slips in :( see https://github.com/rust-lang/rust/issues/102563 for ideas on how to improve the situation here.
3. "Major" changes should be documented in `src/bootstrap/CHANGELOG.md`. "Major" is up to you, but if it breaks a config option or otherwise is likely to break *someone's* build, it's probably major. If it breaks nearly *everyone*'s build, it should also update `VERSION` in `lib.rs`; this should be very rare. Please also ping me or Mark-Simulacrum for major changes (I might set up a triagebot ping for this so you don't have to remember).
4. Once you've approved the PR, tell bors it's ok - you've been contributing for a while so you know how bors works, but here's a cheatsheet just in case: https://bors.rust-lang.org

Documentation about how to use bootstrap lives at https://rustc-dev-guide.rust-lang.org/building/bootstrapping.html; internal docs live in `src/bootstrap/README.md`. The latter unfortunately is not very complete.
2023-05-16 11:39:40 +02:00
Nilstrieb
ecdf373826
Rollup merge of #111605 - klensy:fixup_version, r=compiler-errors
fixup version placeholder for `cfi_encoding` feature

Mentioned https://github.com/rust-lang/rust/pull/105452#discussion_r1184772529
2023-05-16 11:39:39 +02:00
Nilstrieb
3e34be004e
Rollup merge of #111602 - tmiasko:erroneous-constant-used, r=oli-obk
Suppress "erroneous constant used" for constants tainted by errors

When constant evaluation fails because its MIR is tainted by errors,
suppress note indicating that erroneous constant was used, since those
errors have to be fixed regardless of the constant being used or not.

Fixes #110891.
2023-05-16 11:39:39 +02:00
Nilstrieb
f6da357016
Rollup merge of #111572 - kpreid:mdi, r=compiler-errors
Document that `missing_copy_implementations` and `missing_debug_implementations` only apply to public items.

I encountered #111359 (fixed) and noticed that the documentation didn't say that it was _intended_ that `missing_debug_implementations` only applies to public items. This PR fixes that, and makes the same wording change to `missing_copy_implementations` which has the same condition.

I chose the words to also be similar to `missing_docs` which already had such a remark.
2023-05-16 11:39:39 +02:00
Nilstrieb
87a0cd9a41
Rollup merge of #111449 - compiler-errors:recover-impl-generics-correctly, r=Nilstrieb
Recover `impl<T ?Sized>` correctly

Fixes #111327

r? ````@Nilstrieb```` but you can re-roll

Alternatively, happy to close this if we're okay with just saying "sorry #111327 is just a poor side-effect of parser ambiguity" 🤷
2023-05-16 11:39:38 +02:00
Nilstrieb
f65281534f
Rollup merge of #111428 - bvanjoi:fix-109250, r=Nilstrieb
refactor(resolve): clean up the early error return caused by non-call

closes https://github.com/rust-lang/rust/issues/109250

It seems no bad happened, r? ``@Nilstrieb``
2023-05-16 11:39:38 +02:00
bors
72b2716246 Auto merge of #111472 - djkoloski:compiletest_cfg_current_target, r=compiler-errors
Get current target config from` --print=cfg`

Compiletest was switched to querying all targets using `--print=all-target-specs-json` and `--print=target-spec-json` in #108905. This unintentionally prevented codegen flags like `-Cpanic` from being reflected in the current target configuration. This change gets the current compiletest target config using `--print=cfg` like it was previously while still using the faster prints for getting information on all other targets.

Fixes #110850.

`@jyn514` might be interested in reviewing since they commented on the issue.
cc `@tmandry` since this issue is affecting Fuchsia.
2023-05-16 07:20:46 +00:00
bors
3ea9ad5324 Auto merge of #111134 - GilShoshan94:remove-send-bound-on-error, r=dtolnay
Remove unnecessary Send bound

Hi,

While working on a [PR on Tokio](https://github.com/tokio-rs/tokio/pull/5666), I took inspiration from the std channel mpsc and stumbled on a `Send` bound for a `Error` impl.

Tokio's maintainer `@Darksonn` pointed out to me that `Error` used to required the `Send` bound long time ago (here https://github.com/rust-lang/rust/pull/23541).

In the meantime, the `Send` bound `Error` got removed (see https://github.com/rust-lang/rust/pull/21312 and https://github.com/rust-lang/rust/pull/23799).

So here a PR to removed this bound for `SendError<T>`, `TrySendError<T>` and `SendTimeoutError<T>`.
2023-05-16 04:03:26 +00:00
bors
76e79ca026 Auto merge of #111044 - jmillikin:nonzero-negation, r=dtolnay
Stabilize feature `nonzero_negation_ops`

Fixes #102443

ACP: https://github.com/rust-lang/libs-team/issues/105
2023-05-16 01:07:42 +00:00
bors
ea54255501 Auto merge of #111221 - compiler-errors:yeet-generalizer, r=lcnr
Combine three generalizer implementations

Fixes #111092
Fixes #109505

This code is a bit delicate and there were subtle changes between them, so I'll leave inline comments where further inspection is needed.

Regarding this comment from #109813 -- "add tests triggering all codepaths: at least the combine and the const generalizer", can't really do that now, and I don't really know how we'd get a higher-ranked const error since non-lifetime binders doesn't *really* support `for<const ..>` (it errors out when you try to use it).

r? `@lcnr`
2023-05-15 22:16:50 +00:00
Eric Huss
eeeb70e31e Fix release date of 1.58.1 in release notes. 2023-05-15 14:08:51 -07:00
Eric Holk
c11fd9297a
Add eholk back to compiler-contributors reviewers
@eholk is back from vacation so he can review things again.
2023-05-15 13:35:00 -07:00
Alona Enraght-Moony
65f9603a4e Add more interesting nonsense to weird-exprs.rs 2023-05-15 21:22:13 +01:00
Benjamin Atelsek
9688a6cebb Fixed typo 2023-05-15 15:13:21 -04:00
bors
ce5919fcef Auto merge of #107707 - calebzulawski:remove-features, r=Amanieu
Remove misleading target feature aliases

Fixes #100752.  This is a follow up to #103750. These aliases could not be completely removed until rust-lang/stdarch#1355 landed.

cc `@Amanieu`
2023-05-15 18:47:52 +00:00
Michael Goulet
a5763ff8d3 Recover impl<T ?Sized> correctly 2023-05-15 17:14:59 +00:00
Michael Goulet
a2678e15e5 Replace RelationDir with Variance 2023-05-15 17:00:16 +00:00
jyn
29a81f5436 Add clubby789 to the bootstrap review rotation 2023-05-15 11:48:15 -05:00
Michael Goulet
41501c7449 Rename super_relate_* to structurally_relate_* 2023-05-15 16:40:42 +00:00
Michael Goulet
6d0b6c0d2c Tweaks and a test 2023-05-15 16:40:42 +00:00
Michael Goulet
4ce2123ecc yeet ConstInferUnifier 2023-05-15 16:40:42 +00:00
Michael Goulet
c270b0a8a8 Simplify delegate 2023-05-15 16:40:42 +00:00
Michael Goulet
338e7642fb Combine TypeGeneralizer and Generalizer 2023-05-15 16:40:42 +00:00
klensy
9799fb1ddc fixup version placeholder for cfi_encoding feature 2023-05-15 19:19:13 +03:00
bors
63b2ee0faf Auto merge of #111601 - matthiaskrgr:rollup-e5dguzb, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #108291 (Fix more benchmark test with black_box)
 - #108356 (improve doc test for UnsafeCell::raw_get)
 - #110049 (Don't claim `LocalKey::with` prevents a reference to be sent across threads)
 - #111525 (Stop checking for the absence of something that doesn't exist)
 - #111538 (Make sure the build.rustc version is either the same or 1 apart)
 - #111578 (Move expansion of query macros in rustc_middle to rustc_middle::query)
 - #111584 (Number lexing tweaks)
 - #111587 (Custom MIR: Support `Rvalue::CopyForDeref`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2023-05-15 15:18:09 +00:00
Matthias Krüger
eeebb6590a
Rollup merge of #111587 - cbeuw:copy-for-deref, r=oli-obk
Custom MIR: Support `Rvalue::CopyForDeref`

r? `@oli-obk` or `@tmiasko` or `@JakobDegen`
2023-05-15 17:12:47 +02:00
Matthias Krüger
119b72289b
Rollup merge of #111584 - nnethercote:number-lexing-tweaks, r=matklad
Number lexing tweaks

A couple of improvements to things that puzzled me when I was looking at this code.

r? `@matklad`
2023-05-15 17:12:46 +02:00
Matthias Krüger
2f0b456903
Rollup merge of #111578 - Zoxc:query-macro-move, r=cjgillot
Move expansion of query macros in rustc_middle to rustc_middle::query

This moves the expansion of `define_callbacks!` and `define_feedable!` from `rustc_middle::ty::query` to `rustc_middle::query`.

This means that types used in queries are both imported and used in `rustc_middle::query` instead of being split between these modules. It also decouples `rustc_middle::ty::query` further from `rustc_middle` which is helpful since we want to move `rustc_middle::ty::query` to the query system crates.
2023-05-15 17:12:46 +02:00
Matthias Krüger
9267843e72
Rollup merge of #111538 - chenyukang:yukang-fix-110067-version-issue, r=jyn514
Make sure the build.rustc version is either the same or 1 apart

Fixes #110067
r? `@jyn514`
2023-05-15 17:12:45 +02:00
Matthias Krüger
e52fbff5e8
Rollup merge of #111525 - scottmcm:slice-position-tweak, r=Mark-Simulacrum
Stop checking for the absence of something that doesn't exist

A couple of codegen tests are doing
```
// CHECK-NOT: slice_index_len_fail
```

However, that function no longer exists: [the only places](https://github.com/search?q=repo%3Arust-lang%2Frust+slice_index_len_fail&type=code) it occurs in the repo are in those tests.

So this PR updates the tests to check for the absense of the functions that are actually used today to panic for out-of-bounds indexing.
2023-05-15 17:12:45 +02:00
Matthias Krüger
c93c2985d8
Rollup merge of #110049 - SkiFire13:localkey-with-docs-fix, r=workingjubilee
Don't claim `LocalKey::with` prevents a reference to be sent across threads

The documentation for `LocalKey` claims that `with` yields a reference that cannot be sent across threads, but this is false since you can easily do that with scoped threads. What it actually prevents is the reference from outliving the current thread.
2023-05-15 17:12:44 +02:00
Matthias Krüger
1063548a1a
Rollup merge of #108356 - gftea:master, r=workingjubilee
improve doc test for UnsafeCell::raw_get

improve docs of public API `UnsafeCell::raw_get`
2023-05-15 17:12:44 +02:00
Matthias Krüger
fc30207b16
Rollup merge of #108291 - chenyukang:yukang/fix-benchmarks, r=workingjubilee
Fix more benchmark test with black_box

Follow up fix for https://github.com/rust-lang/rust/issues/107590
2023-05-15 17:12:43 +02:00
bors
2913ad6db0 Auto merge of #111585 - matthiaskrgr:rollup-468pykj, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #102673 (Update doc for `PhantomData` to match code example)
 - #111531 (Fix ice caused by shorthand fields in NoFieldsForFnCall)
 - #111547 (Start node has no immediate dominator)
 - #111548 (add util function to TokenStream to eliminate some clones)
 - #111560 (Simplify find_width_of_character_at_span.)
 - #111569 (Appease lints)
 - #111581 (Fix some misleading and copy-pasted `Pattern` examples)
 - #111582 ((docs) Change "wanting" to "want")

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2023-05-15 11:56:07 +00:00
Andy Wang
3d938ddb39
Documentation 2023-05-15 12:08:16 +02:00
Andy Wang
1bd6e168b2
Address FIXME 2023-05-15 12:05:17 +02:00
Andy Wang
c3ab4f28d3
Add CopyForDeref to custom MIR 2023-05-15 12:05:10 +02:00
Matthias Krüger
75186c0f7d
Rollup merge of #111582 - Vagelis-Prokopiou:fix/wanting, r=workingjubilee
(docs) Change "wanting" to "want"

Changing " If you’re wanting" to "If you want".

Wanting is not wrong, of course, but I think that "If you want" feels more natural to most readers.
2023-05-15 10:58:42 +02:00
Matthias Krüger
9d8c11ba75
Rollup merge of #111581 - scottmcm:fix-pattern-comment, r=workingjubilee
Fix some misleading and copy-pasted `Pattern` examples

These examples were listed twice and also were confusable with doing a substring match instead of a any-of-set match.
2023-05-15 10:58:42 +02:00
Matthias Krüger
74952de4b7
Rollup merge of #111569 - LucasFA:linkchecker-lints, r=ehuss
Appease lints

Resolved an unnecessary drop warning that appeared when running the linkchecker. Some clippy warnings, too.

Edit: Well this fired up all the CI pipeline. I hope that's not a problem.
2023-05-15 10:58:41 +02:00
Matthias Krüger
ee914a4ee9
Rollup merge of #111560 - m-ou-se:span-char-boundary-stuff, r=cjgillot
Simplify find_width_of_character_at_span.

This makes `find_width_of_character_at_span` simpler and more robust against bad spans.

Fixes (but does not close, per beta policy) https://github.com/rust-lang/rust/issues/111485
2023-05-15 10:58:41 +02:00
Matthias Krüger
916ba6dec1
Rollup merge of #111548 - calebcartwright:by-ref-tokentree2, r=compiler-errors
add util function to TokenStream to eliminate some clones

Another proposed change in the same vein as #111492 trying to get rid of some clones.

This adds a TokenStream helper function so that rustdoc can directly get a chunks iterator over the underlying token trees so that it no longer needs the clones and vec.
2023-05-15 10:58:40 +02:00
Matthias Krüger
be8718a80b
Rollup merge of #111547 - tmiasko:immediate-dominator, r=cjgillot
Start node has no immediate dominator

Change the immediate_dominator return type to Option, and use None to
indicate that node has no immediate dominator.

Also fix the issue where the start node would be returned as its own
immediate dominator.
2023-05-15 10:58:40 +02:00
Matthias Krüger
7a1f3e7a88
Rollup merge of #111531 - chenyukang:yukang-fix-111416-ice, r=compiler-errors
Fix ice caused by shorthand fields in NoFieldsForFnCall

Fixes #111416
2023-05-15 10:58:39 +02:00
Matthias Krüger
28bc8745ad
Rollup merge of #102673 - lukas-code:infered-lifetimes, r=ehuss
Update doc for `PhantomData` to match code example

After https://github.com/rust-lang/rust/pull/106621, there is no longer a `T: 'a` annotation in the doc example, so update the text to match the code.
2023-05-15 10:58:39 +02:00