Commit graph

225346 commits

Author SHA1 Message Date
yukang b002c9ff11 remove type ascription feature gate 2023-06-03 09:22:47 +08:00
bors dd5d7c729d Auto merge of #112162 - nnethercote:clarify-mono-item-usage, r=wesleywiser
Clarify mono item usage

Some commits that make the terminology around mono items clearer, and simplify related data structures.

r? `@wesleywiser`
2023-06-02 19:53:32 +00:00
bors 794249d768 Auto merge of #112212 - matthiaskrgr:rollup-e5ilgf0, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - #111647 (use c literals in compiler and library)
 - #112165 (Rename `impl_defaultness` to `defaultness`)
 - #112182 (CFI: Fix cfi with repr(transparent): transform_ty: unexpected Alias(Proj)
 - #112189 (Debug-assert that closures and generators are made with the right number of substitutions)
 - #112205 (Add rustdoc test for double-hyphen to dash doc comment conversion)
 - #112206 (Fix typo in `std::cell` module docs)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-06-02 16:53:40 +00:00
Matthias Krüger 4435544c35
Rollup merge of #112206 - k0ur0x:typo, r=Nilstrieb
Fix typo in `std::cell` module docs
2023-06-02 18:12:47 +02:00
Matthias Krüger 5397b31744
Rollup merge of #112205 - GuillaumeGomez:double-hyphen-to-dash, r=notriddle
Add rustdoc test for double-hyphen to dash doc comment conversion

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

This PR adds a regression test for #64081 so the issue can be closed.

r? `@notriddle`
2023-06-02 18:12:46 +02:00
Matthias Krüger 82130eb9d2
Rollup merge of #112189 - compiler-errors:bad-gen, r=cjgillot
Debug-assert that closures and generators are made with the right number of substitutions

Just in case.
2023-06-02 18:12:46 +02:00
Matthias Krüger ec51b15b81
Rollup merge of #112182 - rcvalle:rust-cfi-fix-111185, r=compiler-errors
CFI: Fix cfi with repr(transparent): transform_ty: unexpected Alias(Proj

Fixes https://github.com/rust-lang/rust/issues/111185 by normalizing ty::Alias before encoding.
2023-06-02 18:12:45 +02:00
Matthias Krüger f121f77d8a
Rollup merge of #112165 - fee1-dead-contrib:rn-defualtness, r=compiler-errors
Rename `impl_defaultness` to `defaultness`

Since this isn't just about the `impl`.
2023-06-02 18:12:45 +02:00
Matthias Krüger a3b639ce43
Rollup merge of #111647 - klensy:cstr, r=oli-obk
use c literals in compiler and library

Use c literals #108801 in compiler and library

currently blocked on:
* <strike>rustfmt: don't know how to format c literals</strike> nope, nightly one works.
* <strike>bootstrap</strike>

r? `@ghost`
`@rustbot` blocked
2023-06-02 18:12:45 +02:00
bors a9baa16482 Auto merge of #112152 - jyn514:doc-msg, r=clubby789
Fix the progress message for `x doc rustc`

This makes it more clear that we're using stage 0 *to document* rustc, not that we're documenting stage0 rustc itself.

It also fixes a bug in `msg_sysroot_tool` that would print `Docing`, and removes the `Debug` impl for `Kind` to make sure it doesn't happen again.

Before:
```
Documenting stage0 compiler {rustc-main} (aarch64-apple-darwin)
```

After:
```
Documenting compiler {rustc-main} (stage0 -> stage1, aarch64-apple-darwin)
```

thanks `@BoxyUwU` for catching this!
2023-06-02 14:03:37 +00:00
Kourosh 9df4572277
Fix typo in std::cell module docs 2023-06-02 15:30:40 +03:30
Guillaume Gomez 653f9c7f28 Add rustdoc test for double-hyphen to dash doc comment conversion 2023-06-02 13:51:01 +02:00
bors 0939ec13d8 Auto merge of #112203 - flip1995:clippyup, r=Manishearth
Update Clippy

r? `@Manishearth`
2023-06-02 10:55:54 +00:00
Philipp Krones 612c342346
Update Cargo.lock 2023-06-02 11:42:42 +02:00
Philipp Krones 1c161271de
Merge commit '30448e8cf98d4754350db0c959644564f317bc0f' into clippyup 2023-06-02 11:41:57 +02:00
klensy 2f459f7f14 fix ptr cast 2023-06-02 11:26:34 +03:00
bors 30448e8cf9 Auto merge of #10871 - flip1995:rustup, r=flip1995
Rustup

r? `@ghost`

changelog: none
2023-06-02 08:22:37 +00:00
Philipp Krones 84f8ce801e
Bump Clippy version -> 0.1.72 2023-06-02 10:18:34 +02:00
Philipp Krones dfdc25834e
Bump nightly version -> 2023-06-02 2023-06-02 10:18:17 +02:00
Philipp Krones aa3247c891
Merge remote-tracking branch 'upstream/master' into rustup 2023-06-02 10:17:55 +02:00
bors 50ab3ce6c9 Auto merge of #10607 - beetrees:toml-spans, r=giraffate
Add spans to `clippy.toml` error messages

Adds spans to errors and warnings encountered when parsing `clippy.toml`.

changelog: Errors and warnings generated when parsing `clippy.toml` now point to the location in the TOML file the error/warning occurred.
2023-06-02 08:01:31 +00:00
bors 8ebf04225d Auto merge of #112198 - compiler-errors:rollup-o2xe4of, r=compiler-errors
Rollup of 7 pull requests

Successful merges:

 - #111670 (Require that const param tys implement `ConstParamTy`)
 - #111914 (CFI: Fix cfi with async: transform_ty: unexpected GeneratorWitness(Bi…)
 - #112030 (Migrate `item_trait_alias` to Askama)
 - #112150 (Support 128-bit atomics on all x86_64 Apple targets)
 - #112174 (Fix broken link)
 - #112190 (Improve comments on `TyCtxt` and `GlobalCtxt`.)
 - #112193 (Check tuple elements are `Sized` in `offset_of`)

Failed merges:

 - #112071 (Group rfcs tests)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-06-02 07:57:21 +00:00
Michael Goulet ebb7f642e4
Rollup merge of #112193 - clubby789:offset-of-tuple-sized, r=est31
Check tuple elements are `Sized` in `offset_of`

Fixes #112186
2023-06-01 23:07:39 -07:00
Michael Goulet 2286046412
Rollup merge of #112190 - nnethercote:improve-comments-TyCtxt-GlobalCtxt, r=compiler-errors
Improve comments on `TyCtxt` and `GlobalCtxt`.

By adding some non-obvious information that took me a little while to figure out.

r? `@compiler-errors`
2023-06-01 23:07:39 -07:00
Michael Goulet 71982341b4
Rollup merge of #112174 - cuishuang:master, r=jyn514
Fix broken link

The previous link is no longer accessible.

Use the latest link.
2023-06-01 23:07:39 -07:00
Michael Goulet fc557576a4
Rollup merge of #112150 - taiki-e:apple-atomic-128, r=Amanieu
Support 128-bit atomics on all x86_64 Apple targets

On x86_64, we currently set `max_atomic_width` to 128 only on macOS.

ad8304a0d5/compiler/rustc_target/src/spec/x86_64_apple_darwin.rs (L8)

However, other x86_64 Apple targets (iOS, tvOS, and watchOS) are also core2+ and support cmpxchg16b.

ad8304a0d5/compiler/rustc_target/src/spec/apple_base.rs (L71-L76)

```console
# Script to get targets that support cmpxchg16b by default:
$ (for target in $(rustc --print target-list); do [[ $target == "x86_64"* ]] && rustc --print cfg --target "$target" | grep -q cmpxchg16b && echo "$target"; done)
x86_64-apple-darwin
x86_64-apple-ios
x86_64-apple-ios-macabi
x86_64-apple-tvos
x86_64-apple-watchos-sim
x86_64h-apple-darwin
```

r? `@Amanieu`
2023-06-01 23:07:38 -07:00
Michael Goulet 8ceb283c92
Rollup merge of #112030 - sladyn98:item-trait-alias, r=GuillaumeGomez
Migrate `item_trait_alias` to Askama

This PR migrates `item_trait_alias` to Askama

Refers https://github.com/rust-lang/rust/issues/108868
2023-06-01 23:07:37 -07:00
Michael Goulet ceec2250a3
Rollup merge of #111914 - rcvalle:rust-cfi-fix-111184, r=compiler-errors
CFI: Fix cfi with async: transform_ty: unexpected GeneratorWitness(Bi…

Fixes https://github.com/rust-lang/rust/issues/111184 by encoding ty::Generator parent substs only.
2023-06-01 23:07:37 -07:00
Michael Goulet 24404e6409
Rollup merge of #111670 - compiler-errors:const-param-ty, r=BoxyUwU
Require that const param tys implement `ConstParamTy`

1. Require that const param tys implement `ConstParamTy` instead of using `search_for_adt_const_param_violation`
2. Add `StructuralPartialEq` as a supertrait for `ConstParamTy`, since we need to make sure that we derive *both* `PartialEq` and `Eq`
3. Implement `ConstParamTy` for tuples up to 12 (or whatever the default for tuples is)
4. Add some custom diagnostics to `ConstParamTy` errors, to avoid regressions from (1.). It's still not as great as it could be -- will point out inline in comments.

r? `@BoxyUwU`
2023-06-01 23:07:36 -07:00
bors 33c3d10128 Auto merge of #111677 - fee1-dead-contrib:rustc_const_eval-translatable, r=oli-obk,RalfJung
Use translatable diagnostics in `rustc_const_eval`

This PR:

* adds a `no_span` parameter to `note` / `help` attributes when using `Subdiagnostic` to allow adding notes/helps without using a span
* has minor tweaks and changes to error messages
2023-06-02 05:11:49 +00:00
Nicholas Nethercote 4f800b56d0 Clarify follow_inlining.
I found this confusing because it includes the root item, plus the
inlined items reachable from the root item. The new formulation
separates the two parts more clearly.
2023-06-02 13:07:30 +10:00
Nicholas Nethercote 3806bad6cf Simplify place_inlined_mono_items.
Currently it overwrites all the CGUs with new CGUs. But those new CGUs
are just copies of the old CGUs, possibly with some things added. This
commit changes things so that each CGU just gets added to in place,
which makes things simpler and clearer.
2023-06-02 13:07:30 +10:00
Nicholas Nethercote f1fe797ee2 Change representation of UsageMap::used_map.
It currently uses ranges, which index into `UsageMap::used_items`. This
commit changes it to just use `Vec`, which is much simpler to construct
and use. This change does result in more allocations, but it is few
enough that the perf impact is negligible.
2023-06-02 13:07:30 +10:00
Nicholas Nethercote 5b0c56b333 Introduce UsageMap::user_map.
`UsageMap` contains `used_map`, which maps from an item to the item it
uses. This commit add `user_map`, which is the inverse.

We already compute this inverse, but later on, and it is only held as a
local variable. Its simpler and nicer to put it next to `used_map`.
2023-06-02 13:07:30 +10:00
Nicholas Nethercote de2911f454 Overhaul CGU formation terminology.
Currently, the code uses multiple words to describe when a mono item `f`
uses a mono item `g`, all of which have problems.

- `f` references `g`: confusing because there are multiple kinds of use,
  e.g. "`f` calls `g`" is one, but "`f` takes a (`&T`-style) reference
  of `g`" is another, and that's two subtly different meanings of
  "reference" in play.

- `f` accesses `g`: meh, "accesses" makes me think of data, and this is
  code.

- `g` is a neighbor (or neighbour) of `f`: is verbose, and doesn't
  capture the directionality.

This commit changes the code to use "`f` uses `g`" everywhere. I think
it's better than the current terminology, and the consistency is
important.

Also, `InliningMap` is renamed `UsageMap` because (a) it was always
mostly about usage, and (b) the inlining information it did record was
removed in a recent commit.
2023-06-02 13:07:28 +10:00
bors 774a3d1523 Auto merge of #111553 - cjgillot:mir-e2e, r=scottmcm
Add a few MIR pre-codegen tests

r? `@scottmcm`
2023-06-02 02:36:07 +00:00
cui fliter bbfadf067c Fix broken link
Signed-off-by: cui fliter <imcusg@gmail.com>
2023-06-02 09:36:01 +08:00
clubby789 d722f27684 Test invalid tuple field identifiers 2023-06-02 01:33:09 +00:00
clubby789 731601ccd1 Check tuple elements are Sized in offset_of 2023-06-02 01:18:59 +00:00
Nicholas Nethercote c625880a41 Improve comments on TyCtxt and GlobalCtxt. 2023-06-02 10:07:58 +10:00
beetrees 6f13a37499
Add spans to clippy.toml error messages 2023-06-02 00:56:27 +01:00
bors f85ab544df Auto merge of #112184 - matthiaskrgr:rollup-tlh72el, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #111496 (Extra context for unreachable_pub lint)
 - #111802 (Make `x test --dry-run` less verbose)
 - #112133 (Migrate GUI colors test to original CSS color format)
 - #112146 (Fix `src/etc/pre-push.sh` when `build.locked-deps` is already set)
 - #112147 (add inline-const test for elided lifetimes being infer vars)
 - #112154 (Fix bug in utf16_to_utf8 for zero length strings)
 - #112155 (Improve CGU debug printing.)
 - #112173 (Mention GuillaumeGomez in case GUI tests are updated)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-06-01 23:39:56 +00:00
Ramon de C Valle 76ff5ec886 CFI: Fix cfi with async: transform_ty: unexpected GeneratorWitness(Binde
Fixes #111184 by encoding ty::Generator parent substs only.
2023-06-01 23:22:54 +00:00
Michael Goulet 36a91abba3 Assert that closures and generators are made with the right number of substitutions 2023-06-01 22:37:20 +00:00
Camille GILLOT d796c600ad Rebase fallout. 2023-06-01 21:43:52 +00:00
Camille GILLOT 1ad37804a6 Remove brittle test. 2023-06-01 21:41:58 +00:00
Camille GILLOT b90e165744 Restrict test to x64. 2023-06-01 21:41:58 +00:00
Camille GILLOT 36cae3a3a2 Annotate needs-unwind. 2023-06-01 21:41:58 +00:00
Camille GILLOT 051dd6714c Remove duplication. 2023-06-01 21:41:58 +00:00
Camille GILLOT 3483e77263 Remove spurious comments. 2023-06-01 21:41:58 +00:00