Commit Graph

234001 Commits

Author SHA1 Message Date
bors
366dab13f7 Auto merge of #115699 - RalfJung:interpret-abi-compat, r=oli-obk
interpret: change ABI-compat test to be type-based

This makes the test consistent across targets. Otherwise the chances are very high that ABI mismatches get accepted on x86_64 but still fail on many other targets with more complicated ABIs.

This implements (most of) the rules described in https://github.com/rust-lang/rust/pull/115476.
2023-09-12 03:34:55 +00:00
bors
36b8e4aa75 Auto merge of #115689 - Alexendoo:clippy-doc-comments, r=notriddle,Manishearth,flip1995
Reuse rustdoc's doc comment handling in Clippy

Moves `source_span_for_markdown_range` and `span_of_attrs` (renamed to `span_of_fragments`) to `rustc_resolve::rustdoc` so it can be used in Clippy

Fixes https://github.com/rust-lang/rust-clippy/issues/10277
Fixes https://github.com/rust-lang/rust-clippy/issues/5593
Fixes https://github.com/rust-lang/rust-clippy/issues/10263
Fixes https://github.com/rust-lang/rust-clippy/issues/2581
2023-09-12 01:45:24 +00:00
bors
725afd287a Auto merge of #115671 - Zalathar:mapgen, r=wesleywiser
coverage: Clean up encoding of per-function coverage mapping payloads

This PR contains several small improvements to the code in `rustc_codegen_llvm::coverageinfo::mapgen` that prepares a function's coverage mappings for FFI, and passes them over to LLVM to be encoded into a vector of bytes.

These changes are in preparation for some future changes to the coverage implementation, but they should all stand on their own as worthwhile.

There shouldn't be any changes to the resulting coverage mappings, as verified by the existing `tests/coverage-map` and `tests/run-coverage` suites.

The changes are mostly independent of each other, though they are indirectly affected by the indentation changes made when introducing `GlobalFileTable`.
2023-09-12 00:03:09 +00:00
yukang
f9a9ff20a2 cleanup on messages 2023-09-12 07:27:17 +08:00
bors
b4e54c6e39 Auto merge of #115767 - matthiaskrgr:rollup-byf3lvq, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #115548 (Extract parallel operations in `rustc_data_structures::sync` into a new `parallel` submodule)
 - #115591 (Add regression test for LLVM 17-rc3 miscompile)
 - #115631 (Don't ICE when computing ctype's `repr_nullable_ptr` for possibly-unsized ty)
 - #115708 (fix homogeneous_aggregate not ignoring some ZST)
 - #115730 (Some more small driver refactors)
 - #115749 (Allow loading the SMIR for constants and statics)
 - #115757 (Add a test for #108030)
 - #115761 (Update books)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-09-11 20:53:42 +00:00
ouz-a
3ec0165f5f Remove assert that checks type equality 2023-09-11 23:08:40 +03:00
Santiago Pastorino
5860c4b006
Remove spastorino as "on vacation" 2023-09-11 16:55:34 -03:00
bors
98363cbf6a Auto merge of #11477 - samueltardieu:11474, r=xFrednet
Auto deref does not apply on union field

changelog: [`explicit_auto_deref`]: do not suggest propose to auto-dereference an union field

Fix #11474
2023-09-11 19:42:10 +00:00
Matthias Krüger
059231f9dc
Rollup merge of #115761 - rustbot:docs-update, r=ehuss
Update books

## rust-lang/edition-guide

1 commits in 2751bdcef125468ea2ee006c11992cd1405aebe5..34fca48ed284525b2f124bf93c51af36d6685492
2023-09-06 20:34:00 UTC to 2023-09-06 20:34:00 UTC

- Update Rust 2018 "Path and module system changes" for Rust 1.72 (rust-lang/edition-guide#285)

## rust-lang/nomicon

2 commits in 388750b081c0893c275044d37203f97709e058ba..e3f3af69dce71cd37a785bccb7e58449197d940c
2023-09-11 15:57:05 UTC to 2023-09-11 15:55:35 UTC

- specify which integer overflows we mean (rust-lang/nomicon#419)
- remove 'fail to call destructors' from okay-list (rust-lang/nomicon#420)

## rust-lang/reference

4 commits in d43038932adeb16ada80e206d4c073d851298101..ee7c676fd6e287459cb407337652412c990686c0
2023-09-09 20:08:06 UTC to 2023-08-16 16:59:33 UTC

- Specify bit validity and padding of some types (rust-lang/reference#1392)
- implementations.md typo fix (rust-lang/reference#1399)
- Update section on default layout for `repr(Rust)` (rust-lang/reference#1396)
- conditional-compilation.md: Mention the "none" target_os value (rust-lang/reference#1395)

## rust-lang/rust-by-example

4 commits in 07e0df2f006e59d171c6bf3cafa9d61dbeb520d8..c954202c1e1720cba5628f99543cc01188c7d6fc
2023-08-22 18:49:29 UTC to 2023-08-22 18:46:56 UTC

- Improve transparency of 5_i32 versus 5i32 (rust-lang/rust-by-example#1707)
- Removed redundant comma (rust-lang/rust-by-example#1735)
- Fixed link to Functions (rust-lang/rust-by-example#1734)
- Pedantic `'static` lifetime corrections (rust-lang/rust-by-example#1732)

## rust-lang/rustc-dev-guide

25 commits in b123ab4754127d822ffb38349ce0fbf561f1b2fd..08bb147d51e815b96e8db7ba4cf870f201c11ff8
2023-09-11 10:36:36 UTC to 2023-08-18 21:13:31 UTC

- make link more pleasant to eye too (rust-lang/rustc-dev-guide#1778)
- The current playground link used in the page of MIR shows a optimized… (rust-lang/rustc-dev-guide#1789)
- Add section about building an optimized version of `rustc` (rust-lang/rustc-dev-guide#1787)
- Set max line length in `.editorconfig` to 100 (rust-lang/rustc-dev-guide#1788)
- Update minor how-to-build-and-run.md spelling mistake (rust-lang/rustc-dev-guide#1785)
- add sections in 'using git' (#1675) (rust-lang/rustc-dev-guide#1784)
- link std-dev-guide from landing page (#1699) (rust-lang/rustc-dev-guide#1783)
- Reword sentence about using `./x` over `./x.py` (rust-lang/rustc-dev-guide#1782)
- remove (excessive) indentation (rust-lang/rustc-dev-guide#1781)
- coverage tests have moved, twice (rust-lang/rustc-dev-guide#1780)
- remove extraneous word (rust-lang/rustc-dev-guide#1779)
- llvm updates (rust-lang/rustc-dev-guide#1761)
- make link more pleasant to eye (rust-lang/rustc-dev-guide#1777)
- date-check: test suites/classes using "revisions" (rust-lang/rustc-dev-guide#1738)
- share link target (rust-lang/rustc-dev-guide#1740)
- indicate full hierarchy of config option (rust-lang/rustc-dev-guide#1776)
- remove stray word (rust-lang/rustc-dev-guide#1773)
- it is lower-case (rust-lang/rustc-dev-guide#1772)
- Suggest enabling patch-binaries-for-nix in `shell.nix` (rust-lang/rustc-dev-guide#1774)
- Add additional licensing concerns to docs (rust-lang/rustc-dev-guide#1775)
- Fix broken MD link format (rust-lang/rustc-dev-guide#1771)
- update internal terminology: Substs -> GenericArgs (rust-lang/rustc-dev-guide#1769)
- Update suggested.md : missing word (rust-lang/rustc-dev-guide#1770)
- Update outdated doc for types (rust-lang/rustc-dev-guide#1768)
- Add dropck documentation (rust-lang/rustc-dev-guide#1767)
2023-09-11 21:16:24 +02:00
Matthias Krüger
48a10338bc
Rollup merge of #115757 - DianQK:lto-linkage-used-attr, r=wesleywiser
Add a test for #108030

Closes #108030.

This issue has been resolved in LLVM 17. I can verify that this test fails on 63a81b0c5a.

r? compiler
2023-09-11 21:16:23 +02:00
Matthias Krüger
2a087be735
Rollup merge of #115749 - oli-obk:smir_consts, r=compiler-errors
Allow loading the SMIR for constants and statics

cc https://github.com/rust-lang/project-stable-mir/issues/34

before this PR we were ICEing when trying to access the SMIR of anything other than functions
2023-09-11 21:16:23 +02:00
Matthias Krüger
c943ec2fba
Rollup merge of #115730 - bjorn3:some_driver_refactors, r=compiler-errors
Some more small driver refactors

To improve clarity and simplify some code.
2023-09-11 21:16:22 +02:00
Matthias Krüger
279e2576a0
Rollup merge of #115708 - RalfJung:homogeneous, r=davidtwco
fix homogeneous_aggregate not ignoring some ZST

This is an ABI-breaking change, because it fixes bugs in our ABI code. I'm not sure what that means for this PR, we don't really have a process for such changes, do we? I can only hope nobody relied on the old buggy behavior.

Fixes https://github.com/rust-lang/rust/issues/115664
2023-09-11 21:16:22 +02:00
Matthias Krüger
5a2b589ac7
Rollup merge of #115631 - compiler-errors:ctypes-unsized, r=davidtwco
Don't ICE when computing ctype's `repr_nullable_ptr` for possibly-unsized ty

We may not always be able to compute the layout of a type like `&T` when `T: ?Sized`, even if we're able to estimate its size skeleton.

r? davidtwco

Fixes #115628
2023-09-11 21:16:21 +02:00
Matthias Krüger
7a4904cbdb
Rollup merge of #115591 - djkoloski:issue_115385, r=cuviper
Add regression test for LLVM 17-rc3 miscompile

Closes #115385, see that issue for more details.
2023-09-11 21:16:21 +02:00
Matthias Krüger
f3cc59b741
Rollup merge of #115548 - Zoxc:parallel-extract, r=wesleywiser
Extract parallel operations in `rustc_data_structures::sync` into a new `parallel` submodule

This extracts parallel operations in `rustc_data_structures::sync` into a new `parallel` submodule. This cuts down on the size of the large `cfg_if!` in `sync` and makes it easier to compare between serial and parallel variants.
2023-09-11 21:16:20 +02:00
bors
e2b3676733 Auto merge of #114586 - oli-obk:patch_tait_rpit_order_check, r=lcnr,compiler-errors
Bubble up opaque <eq> opaque operations instead of picking an order

In case we are in `Bubble` mode (meaning every opaque type that is defined in the current crate is treated as if it were in its defining scope), we don't try to register an opaque type as the hidden type of another opaque type, but instead bubble up an obligation to equate them at the query caller site. Usually that means we have a `DefiningAnchor::Bind` and thus can reliably figure out whether an opaque type is in its defining scope. Where we can't, we'll error out, so the default is sound.

With this change we start using `AliasTyEq` predicates in the old solver, too.

fixes https://github.com/rust-lang/rust/issues/108498

But also regresses `tests/ui/impl-trait/anon_scope_creep.rs`. Our use of `Bubble` for `check_opaque_type_well_formed` is going to keep biting us.

r? `@lcnr` `@compiler-errors`
2023-09-11 19:01:38 +00:00
asquared31415
e36adff4c2 add source type for invalid bool casts 2023-09-11 18:10:07 +00:00
bors
3bf9c5a00a Auto merge of #3058 - RalfJung:no-merge, r=saethlin
enforce no-merge policy via triagebot

r? `@rust-lang/miri`
2023-09-11 17:14:09 +00:00
Ralf Jung
ee6b2ece20 enforce no-merge policy via triagebot 2023-09-11 19:02:50 +02:00
rustbot
5dd01ccf1c Update books 2023-09-11 13:01:15 -04:00
Oli Scherer
930affa39d Bubble up opaque <eq> opaque operations instead of picking an order 2023-09-11 16:53:39 +00:00
bors
0a199e4e93 Auto merge of #115758 - matthiaskrgr:rollup-khwbjj7, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #115335 (fix overflow in array length computation)
 - #115440 (bootstrap/format: remove unnecessary paths.push)
 - #115702 (Update mailmap)
 - #115727 (Implement fallback for effect param)
 - #115739 (Call `LateLintPass::check_attribute` from `with_lint_attrs`)
 - #115743 (Point out if a local trait has no implementations)
 - #115744 (Improve diagnostic for generic params from outer items (E0401))
 - #115752 (rustdoc: Add missing "Aliased type" title in the sidebar)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-09-11 16:50:22 +00:00
Camille GILLOT
6984030f80 Use write_immediate. 2023-09-11 16:29:42 +00:00
Camille GILLOT
7493ad0abe Duplicate output for test. 2023-09-11 16:29:42 +00:00
Camille GILLOT
bcfe1a4bf2 Remove cur_span hook. 2023-09-11 16:29:42 +00:00
Camille GILLOT
24adf07e5f Reuse throw_machine_stop_str! macro. 2023-09-11 16:29:41 +00:00
Camille GILLOT
4901893721 Inline callback. 2023-09-11 16:29:41 +00:00
Camille GILLOT
d278ce126c Return ImmTy in discriminant_for_variant. 2023-09-11 16:29:41 +00:00
Camille GILLOT
1d6a32c920 Interpret Immediate::Uninit as Bottom. 2023-09-11 16:29:41 +00:00
Camille GILLOT
b851e554dd Support CopyForDeref. 2023-09-11 16:29:41 +00:00
Camille GILLOT
82f0468009 Handle reading statics. 2023-09-11 16:29:41 +00:00
Camille GILLOT
6ad6b4381c Support non-scalar constants. 2023-09-11 16:29:41 +00:00
Matthew Jasper
b011a0a13b Reduce double errors for invalid let expressions
Previously some invalid let expressions would result in both a feature
error and a parsing error. Avoid this and ensure that we only emit the
parsing error when this happens.
2023-09-11 16:17:06 +00:00
Matthew Jasper
2d7a5f528c Update tools and fulldeps tests 2023-09-11 15:51:19 +00:00
Matthew Jasper
333388fd3c Move let expression checking to parsing
There was an incomplete version of the check in parsing and a second
version in AST validation. This meant that some, but not all, invalid
uses were allowed inside macros/disabled cfgs. It also means that later
passes have a hard time knowing when the let expression is in a valid
location, sometimes causing ICEs.

- Add a field to ExprKind::Let in AST/HIR to mark whether it's in a
  valid location.
- Suppress later errors and MIR construction for invalid let
  expressions.
2023-09-11 15:51:18 +00:00
Matthew Jasper
7b61f7f002 Don't create drop scopes after item statements
These scopes would not exist in MIR and can cause ICEs with invalid uses
of let expressions.
2023-09-11 15:51:18 +00:00
bors
864c3f3cc5 Auto merge of #3057 - pitaj:master, r=RalfJung
add subtree-sync label to rustc update PRs

For rust-lang/rust#114157
2023-09-11 15:47:50 +00:00
Peter Jaszkowiak
04e3b2e5f6 add subtree-sync label to rustc update PRs 2023-09-11 09:42:46 -06:00
Matthias Krüger
9ed6eea86b
Rollup merge of #115752 - GuillaumeGomez:aliased-type-title, r=notriddle
rustdoc: Add missing "Aliased type" title in the sidebar

Follow-up of https://github.com/rust-lang/rust/pull/115682.

The sections title are supposed to be present in the sidebar, we forgot to put this one so I added it into it. I also added the missing newly created `aliased-type` ID into the `DEFAULT_ID_MAP`.

r? `@notriddle`
2023-09-11 17:03:33 +02:00
Matthias Krüger
8b49731211
Rollup merge of #115744 - fmease:fix-e0401, r=compiler-errors
Improve diagnostic for generic params from outer items (E0401)

Generalize the wording of E0401 to talk about *outer items* instead of *outer functions* since the current phrasing is outdated. The outer item can be a function, constant, trait, ADT or impl block (see the new UI test for the more exotic examples).

Further, don't suggest introducing generic parameters to constant items unless the feature `generic_const_items` is enabled.

Lastly, make E0401 translatable while we're at it.

Fixes #115720.
2023-09-11 17:03:32 +02:00
Matthias Krüger
f279afb455
Rollup merge of #115743 - compiler-errors:no-impls, r=davidtwco
Point out if a local trait has no implementations

Slightly helps with #115741
2023-09-11 17:03:32 +02:00
Matthias Krüger
d24f575722
Rollup merge of #115739 - Alexendoo:lint-pass-check-attribute, r=oli-obk
Call `LateLintPass::check_attribute` from `with_lint_attrs`

Fixes #115571

For regular `register_late_pass` lints also means that `last_node_with_lint_attrs` is correct when in `check_attribute`, I've added a test that previously failed for `clippy::allow_attributes`

As far as I can see the only late lint in rustc that uses `check_attribute` is `unstable_features` which is allow by default and deprecated so this is mostly for clippy (or future rustc lints)
2023-09-11 17:03:32 +02:00
Matthias Krüger
e7a347baf8
Rollup merge of #115727 - fee1-dead-contrib:effect-fallback, r=oli-obk
Implement fallback for effect param

r? `@oli-obk` or `@lcnr`

tracking issue for this ongoing work: https://github.com/rust-lang/rust/issues/110395
2023-09-11 17:03:31 +02:00
Matthias Krüger
f30b27a6e8
Rollup merge of #115702 - jonas-schievink:update-mailmap, r=oli-obk
Update mailmap

https://github.com/rust-lang/team/pull/1071 / https://github.com/rust-lang/thanks/pull/58
2023-09-11 17:03:30 +02:00
Matthias Krüger
0a7451033b
Rollup merge of #115440 - RalfJung:bootstrap-fmt, r=Mark-Simulacrum
bootstrap/format: remove unnecessary paths.push

Cc https://github.com/rust-lang/rust/pull/106415#pullrequestreview-1606367042
I verified that this still formats all fileds when `get_modified_rs_files` is made to return an error.

r? ``@Nilstrieb``
2023-09-11 17:03:30 +02:00
Matthias Krüger
b99af95713
Rollup merge of #115335 - reez12g:issue-114912, r=davidtwco
fix overflow in array length computation

addressing https://github.com/rust-lang/rust/issues/114912
2023-09-11 17:03:29 +02:00
bors
3ebb5629d1 Auto merge of #115595 - surechen:114896, r=davidtwco
Fix incorrect mutable suggestion information for binding in ref pattern like:  `let &b = a;`

fixes #114896

I find we have to get pat_span but not local_decl.source_info.span for suggestion. In `let &b = a;`  pat_span is &b. I think check `let &b = a` in hir to make sure it is hir::Node::Local(hir::Local {pat: hir::Pat{kind: hir::PatKind::Ref(.......   can distinguish it from other situation, but I'm not sure.

If my processing method is not accurate, please guide me to modify it, thank you.

r? `@davidtwco`
2023-09-11 15:02:59 +00:00
DianQK
b99ace4179
Add a test for #108030
Closes #108030.
This issue has been resolved in LLVM 17.
2023-09-11 22:01:55 +08:00
lcnr
eac55eec9e dedup GoalEvaluationStep and GoalCandidate
also handle 2 panics when dumping proof trees for the whole test suite

- need to actually tell the proof tree builder about overflow
- need to handle a recursion_limit of 0 :<
2023-09-11 15:50:09 +02:00