Commit Graph

224335 Commits

Author SHA1 Message Date
bohan
b2b2be1cad fix(diagnostic): wrap parens for ref impl trait param 2023-05-16 09:29:33 +08: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
Oli Scherer
87f9f99f9c Update some comments 2023-05-15 14:20:31 +00:00
Oli Scherer
ad424e65d8 Always fall back to PartialEq when a constant in a pattern is not recursively structural-eq 2023-05-15 14:20:31 +00:00
Oli Scherer
8d00f762dd Unnest a variable in prep for the next commit which needs access to the place 2023-05-15 14:20:31 +00:00
Wim Looman
a9cb4822be
Change Vec examples to not assert exact capacity except where it is guaranteed 2023-05-15 14:25:05 +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
bors
8006510ab0 Auto merge of #111088 - nnethercote:fix-FileEncoder-buf-size, r=WaffleLapkin
Fix the `FileEncoder` buffer size.

It allows a variable size, but in practice we always use the default of 8192 bytes. This commit fixes it to that size, which makes things slightly faster because the size can be hard-wired in generated code.

The commit also:
- Rearranges some buffer capacity checks so they're all in the same form (`x > BUFSIZE`).
- Removes some buffer capacity assertions and comments about them. With an 8192 byte buffer, we're not in any danger of overflowing a `usize`.

r? `@WaffleLapkin`
2023-05-15 08:58:23 +00:00
Nicholas Nethercote
e52794decd Don't try to eat non-existent decimal digits.
After seeing a `0`, if it's followed by any of `[0-9]`, `_`, `.`, `e`,
or `E`, we consume all the digits. But in the `.`, `e` and `E` cases
this is pointless because we know there aren't any digits.
2023-05-15 18:33:12 +10:00
Nicholas Nethercote
19967c5890 Make Cursor::number less DRY.
A tiny bit of repetition makes this easier to read, and avoids a test on
the "Not a base prefix" match arm.
2023-05-15 18:30:26 +10:00
Vagelis Prokopiou
5fa8c4aced wanting => want 2023-05-15 10:13:08 +03:00
John Kåre Alsaker
fff20a703d Move expansion of query macros in rustc_middle to rustc_middle::query 2023-05-15 08:49:13 +02:00
Scott McMurray
47232ade61 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-14 23:03:50 -07:00
bors
0bcfd2d96e Auto merge of #108273 - tspiteri:const_slice_split_at_not_mut, r=dtolnay
Stabilize const slice::split_at

This stabilizes the use of the following method in const context:

```rust
impl<T> [T] {
    pub const fn split_at(&self, mid: usize) -> (&[T], &[T]);
}
```

cc tracking issue #101158
2023-05-15 03:54:33 +00:00
bors
8d18c32b61 Auto merge of #111570 - compiler-errors:ct-err, r=BoxyUwU
Rename const error methods for consistency

renames `ty::Const`'s methods for creating a `ConstKind::Error` to be in the same naming style as `ty::Ty`'s equivalent methods.

r? `@BoxyUwU`
2023-05-15 01:03:29 +00:00