about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2022-07-25Add a clickable link to the layout sectionest31-1/+7
2022-07-24Auto merge of #99409 - tmiasko:atomic-tests, r=m-ou-sebors-1/+109
Test codegen of atomic compare-exchange with additional memory orderings * Add a test for atomic operations introduced in #97423 & #98383. * Add a test for fallback code generation strategy used on LLVM 12 introduced in #98385. Use a separate test case instead of a revision system since test will be gone once LLVM 12 is no longer supported.
2022-07-24Auto merge of #93429 - fee1-dead-contrib:allow-super-trait-tilde-const, ↵bors-0/+100
r=oli-obk Allow `trait A: ~const B` What's included: a minimal working change set for `~const` supertraits to work. r? `@oli-obk`
2022-07-24Auto merge of #99251 - cuviper:hashbrown-0.12, r=Mark-Simulacrumbors-1/+1
Upgrade indexmap and thorin-dwp to use hashbrown 0.12 This removes the last dependencies on hashbrown 0.11. This also upgrades to hashbrown 0.12.3 to fix a double-free (#99372).
2022-07-24Auto merge of #95548 - rcvalle:rust-cfi-2, r=nagisabors-68/+712
Add fine-grained LLVM CFI support to the Rust compiler This PR improves the LLVM Control Flow Integrity (CFI) support in the Rust compiler by providing forward-edge control flow protection for Rust-compiled code only by aggregating function pointers in groups identified by their return and parameter types. Forward-edge control flow protection for C or C++ and Rust -compiled code "mixed binaries" (i.e., for when C or C++ and Rust -compiled code share the same virtual address space) will be provided in later work as part of this project by identifying C char and integer type uses at the time types are encoded (see Type metadata in the design document in the tracking issue https://github.com/rust-lang/rust/issues/89653). LLVM CFI can be enabled with -Zsanitizer=cfi and requires LTO (i.e., -Clto). Thank you again, `@eddyb,` `@nagisa,` `@pcc,` and `@tmiasko` for all the help!
2022-07-23Auto merge of #99652 - GuillaumeGomez:rollup-38v0x7y, r=GuillaumeGomezbors-180/+238
Rollup of 6 pull requests Successful merges: - #99298 (Make `ui-fulldeps/gated-plugins` and `ui-fulldeps/multiple-plugins` tests stage 2 only) - #99396 (Add some additional double-adjustment regression tests) - #99449 (Do not resolve associated const when there is no provided value) - #99595 (Mark atomics as unsupported on thumbv6m) - #99627 (Lock stdout once when listing tests) - #99638 (Remove Clean trait implementation for hir::Ty and middle::Ty) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-07-23Rollup merge of #99638 - GuillaumeGomez:rm-clean-trait, r=notriddleGuillaume Gomez-136/+153
Remove Clean trait implementation for hir::Ty and middle::Ty While going through the code, I realized that the "remove the Clean trait" effort which was started a while ago was never finished. The idea behind it was to make it much simpler to go through the different clean steps (which is definitely not easy when you just have `something.clean(cx)`). I'm planning to finish this effort. cc ``@camelid`` r? ``@notriddle``
2022-07-23Rollup merge of #99449 - compiler-errors:assoc-const-missing-item, r=lcnrGuillaume Gomez-40/+33
Do not resolve associated const when there is no provided value Fixes #98629, since now we just delay a bug when we're not able to evaluate a const item due to the value not actually being provided by anything. This means compilation proceeds forward to where the "missing item in impl" error is emitted. ---- The root issue here is that when we're looking for the defining `LeafDef` in `resolve_associated_item`, we end up getting the trait's AssocItem instead of the impl's AssocItem (which does not exist). This resolution "succeeds" even if the trait's item has no default value, and then since this item has no value to evaluate, it turns into a const eval error. This root issue becomes problematic (as in #98629) when this const eval error happens in wfcheck (for example, due to normalizing the param-env of something that references this const). Since this happens sooner than the check that an impl actually provides all of the items that a trait requires (which happens during later typecheck), we end up aborting compilation early with only this un-informative message. I'm not exactly sure _why_ this bug arises due to #96591 -- perhaps valtrees are evaluated more eagerly than in the old system? r? ``@oli-obk`` or ``@lcnr`` since y'all are familiar with const eval and reviewed #96591, though feel free to reassign. This is a regression from stable to beta, so I would be open to considering this for beta backport. It seems correct to me, especially given the improvements in the other UI tests this PR touches, but may have some side-effects that I'm unaware of...?
2022-07-23Rollup merge of #99396 - compiler-errors:missing-tests, r=Mark-SimulacrumGuillaume Gomez-0/+46
Add some additional double-adjustment regression tests I accidentally missed these when I rebased #98785 cc #98894 and #98897
2022-07-23Rollup merge of #99298 - ChrisDenton:ignore-plugins-stage1, r=Mark-SimulacrumGuillaume Gomez-4/+6
Make `ui-fulldeps/gated-plugins` and `ui-fulldeps/multiple-plugins` tests stage 2 only These test can fail on stage 1. Fixes #99295
2022-07-23Auto merge of #98208 - ivanloz:master, r=nagisabors-2/+39
Add support for LLVM ShadowCallStack. LLVMs ShadowCallStack provides backward edge control flow integrity protection by using a separate shadow stack to store and retrieve a function's return address. LLVM currently only supports this for AArch64 targets. The x18 register is used to hold the pointer to the shadow stack, and therefore this only works on ABIs which reserve x18. Further details are available in the [LLVM ShadowCallStack](https://clang.llvm.org/docs/ShadowCallStack.html) docs. # Usage `-Zsanitizer=shadow-call-stack` # Comments/Caveats * Currently only enabled for the aarch64-linux-android target * Requires the platform to define a runtime to initialize the shadow stack, see the [LLVM docs](https://clang.llvm.org/docs/ShadowCallStack.html) for more detail.
2022-07-23Update documentation for LLVM CFI supportRamon de C Valle-29/+85
This commit updates the documentation for the LLVM Control Flow Integrity (CFI) support in the Rust compiler (see #95548 and #89653).
2022-07-23Add fine-grained LLVM CFI support to the Rust compilerRamon de C Valle-39/+627
This commit improves the LLVM Control Flow Integrity (CFI) support in the Rust compiler by providing forward-edge control flow protection for Rust-compiled code only by aggregating function pointers in groups identified by their return and parameter types. Forward-edge control flow protection for C or C++ and Rust -compiled code "mixed binaries" (i.e., for when C or C++ and Rust -compiled code share the same virtual address space) will be provided in later work as part of this project by identifying C char and integer type uses at the time types are encoded (see Type metadata in the design document in the tracking issue #89653). LLVM CFI can be enabled with -Zsanitizer=cfi and requires LTO (i.e., -Clto).
2022-07-23Add testsDeadbeef-0/+100
2022-07-23Remove Clean trait implementation for hir::Ty and middle::TyGuillaume Gomez-136/+153
2022-07-23Rollup merge of #99617 - ehuss:update-mdbook, r=Dylan-DPCMatthias Krüger-1/+1
Update mdbook This updates mdbook from 0.4.20 to 0.4.21 Changelog: https://github.com/rust-lang/mdBook/blob/master/CHANGELOG.md#mdbook-0421 This contains a single fix that prevents mdbook from compiling on nightly (due to #99413). This will be necessary to keep everything working after the next master bootstrap switch.
2022-07-23Rollup merge of #99580 - fmease:fix-issue-99565, r=estebankMatthias Krüger-2/+23
Don't suggest unnameable generic arguments Fixes #99565. `@rustbot` label T-compiler A-diagnostics r? `@rust-lang/wg-diagnostics`
2022-07-23Auto merge of #99599 - RalfJung:miri-stage-0, r=RalfJungbors-8/+16
miri: make --stage 0 testing work This needs https://github.com/rust-lang/miri/pull/2415 or it'll break Miri entirely. also fixes https://github.com/rust-lang/rust/issues/99589
2022-07-23Auto merge of #99623 - RalfJung:rollup-0h066kc, r=RalfJungbors-1/+28
Rollup of 3 pull requests Successful merges: - #99588 (Update books) - #99602 (cargotest: do not run quickcheck tests in xsv) - #99607 (interpret: fix vtable check debug assertion) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-07-22Rollup merge of #99602 - RalfJung:xsv, r=Mark-SimulacrumRalf Jung-1/+28
cargotest: do not run quickcheck tests in xsv Fixes https://github.com/rust-lang/rust/issues/73514 I know https://github.com/rust-lang/rust/issues/70659 discusses a larger overhaul of cargotest, but that seems to have stalled and I'd like to fix the immediate issue of PRs failing due to random test failures in xsv. This still runs the vast majority of tests by numbers: ``` test result: ok. 394 passed; 0 failed; 0 ignored; 0 measured; 32 filtered out; finished in 1.84s ``` So the loss in test coverage is hopefully not too big.
2022-07-22Rollup merge of #99588 - ehuss:update-books, r=ehussRalf Jung-0/+0
Update books ## nomicon 1 commits in 70db9e4189f64d1d8e2451b1046111fb356b6dc2..8d1e4dccf71114ff56f328f671f2026d8e6b62a2 2022-06-27 20:47:21 +0900 to 2022-07-18 18:12:35 -0400 - Should be `align_of` instead of `size_of` ## reference 11 commits in 9fce337a55ee4a4629205f6094656195cecad231..a92be0fef439b3d8e0468d82cb24812d303520a0 2022-06-22 13:59:28 -0700 to 2022-07-21 19:01:23 -0700 - Add `IntoFuture::into_future` desugaring (rust-lang/reference#1233) - Remove uses of the phrase "in Rust" (rust-lang/reference#1241) - Revert "Add stable references of `macro_metavar_expr`" (rust-lang/reference#1242) - tweaks - further tweak addr_of exposition - edits - Apply suggestions from code review - document raw-addr-of operators - update union field type rules (rust-lang/reference#1238) - clarify that references size_of_val can never exceed isize::MAX (rust-lang/reference#1186) - Describe what `windows_subsystem` does (rust-lang/reference#1232) ## book 9 commits in cf2653a5ca553cbbb4a17f1a7db1947820f6a775..36383b4da21dbd0a0781473bc8ad7ef0ed1b6751 2022-07-05 12:07:58 -0400 to 2022-07-19 21:03:20 -0400 - Update ch16-02-message-passing.md - Update snapshots with edits made to src that need to be checked - Remove inconsistent newline. Fixes rust-lang/book#3240. - add missing `b` in chapter 15.6 - Grammar: corrected 'as much' to 'as such' - grammar: add missing 'of' - Fix incorrect link for listing 13-06 - Correct method name - Remove unused theme directories. ## rust-by-example 2 commits in 83724ca387a2a1cd3e8d848f62820020760e358b..3155db49b0d57cd82c65456ac210b69ecec5ccb1 2022-07-05 10:38:07 -0300 to 2022-07-05 20:35:53 -0300 - fix-type (rust-lang/rust-by-example#1565) - add-examples-to-destructure-tuples (rust-lang/rust-by-example#1566) ## rustc-dev-guide 27 commits in eb83839e903a0a8f1406f7e941886273f189b26b..d5201cddace979b299ec1bf9fd8997338151aa9d 2022-07-03 15:17:39 +0900 to 2022-07-21 04:48:49 +0200 - Debuginfo tests now also support revisions. - Link to rendered book directly - Fix link to clippy sync docs - remove stray markup - renamed - sync with hackmd version - replace misleading name (rust-lang/rustc-dev-guide#1401) - Remove a mention to Steve on r? example - obey line length limit (part 3) - obey line length limit (part 2) - obey line length limit - sync with hackmd - add draft chapter - add mdbook-mermaid - use relative links - fix some typos (rust-lang/rustc-dev-guide#1398) - typo: monomorph docs - Rename debugging_opts to unstable_opts, use link - address review comment - update date reference on MIR inliner - remove outdated info on debugging - small fixes to ty chapter (rust-lang/rustc-dev-guide#1390) - Update the build instructions for the standard library - overview.md: Link to existing Macro Expansion and Name Resolution docs (rust-lang/rustc-dev-guide#1388) - Git-ignore `pulls.json` (rust-lang/rustc-dev-guide#1386) - Revert "Add the config needed to get rust-analyzer working on src/bootstrap (rust-lang/rustc-dev-guide#1381)" - Use `x.py check` instead of `cargo check` for build scripts (rust-lang/rustc-dev-guide#1384)
2022-07-22Auto merge of #98017 - RalfJung:dereferenceable, r=nikicbors-1/+19
do not mark interior mutable shared refs as dereferenceable My proposed solution to https://github.com/rust-lang/rust/issues/55005.
2022-07-22Update mdbookEric Huss-1/+1
2022-07-22Do not resolve associated const when there is no provided valueMichael Goulet-40/+33
2022-07-22do not mark interior mutable shared refs as dereferenceableRalf Jung-1/+19
2022-07-22Auto merge of #99598 - GuillaumeGomez:clean-trait-fields-on-demand, r=notriddlebors-22/+23
Make some clean::Trait fields computation on demand r? `@notriddle`
2022-07-22update MiriRalf Jung-8/+8
2022-07-22cargotest: do not run quickcheck tests in xsvRalf Jung-1/+28
2022-07-22Auto merge of #99521 - fee1-dead-contrib:const_fix_hax, r=oli-obkbors-16/+1
Fix hack that remaps env constness. WARNING: might have perf implications. Are there any more problems with having a constness in the `ParamEnv` now? :) r? `@oli-obk`
2022-07-22miri: make --stage 0 testing workRalf Jung-0/+8
2022-07-22Make some clean::Trait fields computation on demandGuillaume Gomez-22/+23
2022-07-22Auto merge of #99491 - workingjubilee:sync-psimd, r=workingjubileebors-8/+9
Sync in portable-simd subtree r? `@ghost`
2022-07-22Rollup merge of #99539 - compiler-errors:bidirectional-block-suggestions, ↵Dylan DPC-40/+107
r=fee1-dead Improve suggestions for returning binding Fixes #99525 Also reworks the cause codes for match and if a bit, I think cleaning them up in a positive way. We no longer need to call `could_remove_semicolon` in successful code, which might save a few cycles?
2022-07-22Rollup merge of #99423 - GuillaumeGomez:group-css-font-rule, r=notriddleDylan DPC-12/+9
Group CSS font rule Another CSS cleanup I came by when working on something else. r? ``@notriddle``
2022-07-22Rollup merge of #99393 - ↵Dylan DPC-179/+188
Logarithmus:feature/99255-omit-const-generic-suffixes, r=petrochenkov feat: omit suffixes in const generics (e.g. `1_i32`) Closes #99255
2022-07-22Rollup merge of #98868 - tmiasko:unreachable-coverage, r=wesleywiserDylan DPC-0/+41
Fix unreachable coverage generation for inlined functions To generate a function coverage we need at least one coverage counter, so a coverage from unreachable blocks is retained only when some live counters remain. The previous implementation incorrectly retained unreachable coverage, because it didn't account for the fact that those live counters can belong to another function due to inlining. Fixes #98833.
2022-07-21Update booksEric Huss-0/+0
2022-07-22Don't suggest unnameable generic argumentsLeón Orell Valerian Liehr-2/+23
2022-07-22Auto merge of #99420 - RalfJung:vtable, r=oli-obkbors-211/+266
make vtable pointers entirely opaque This implements the scheme discussed in https://github.com/rust-lang/unsafe-code-guidelines/issues/338: vtable pointers should be considered entirely opaque and not even readable by Rust code, similar to function pointers. - We have a new kind of `GlobalAlloc` that symbolically refers to a vtable. - Miri uses that kind of allocation when generating a vtable. - The codegen backends, upon encountering such an allocation, call `vtable_allocation` to obtain an actually dataful allocation for this vtable. - We need new intrinsics to obtain the size and align from a vtable (for some `ptr::metadata` APIs), since direct accesses are UB now. I had to touch quite a bit of code that I am not very familiar with, so some of this might not make much sense... r? `@oli-obk`
2022-07-21Auto merge of #99530 - RalfJung:miri, r=oli-obkbors-7/+9
update Miri Fixes https://github.com/rust-lang/rust/issues/99461 r? `@oli-obk` because of lockfile changes (seems like serde is getting implicitly bumped)
2022-07-21update MiriRalf Jung-7/+9
2022-07-21Auto merge of #99501 - lcnr:check-regions-infcx, r=oli-obkbors-2/+2
move `considering_regions` to the infcx it seems weird to prove some obligations which constrain inference vars while ignoring regions in a context which considers regions. This is especially weird because even for a fulfillment context with ignored regions, we still added region outlives bounds when directly relating regions. tbh our handling of regions is still very weird, but at least this is a step in the right direction imo. r? rust-lang/types
2022-07-21Rollup merge of #99559 - GuillaumeGomez:rm-unused-field-keyword, r=notriddleMatthias Krüger-15/+14
Remove unused field in ItemKind::KeywordItem For the keyword name, we use `Item::name` directly everywhere so there is no point into keeping it. r? ``@notriddle``
2022-07-21Rollup merge of #99552 - lcnr:orphan_check-rework, r=oli-obkMatthias Krüger-1/+1
Rewrite `orphan_check_trait_ref` to use a `TypeVisitor` The current impl is far more confusing than it has any right to be :sparkles: r? rust-lang/types
2022-07-21Rollup merge of #99549 - JohnTitor:issue-52304, r=compiler-errorsMatthias Krüger-0/+11
Add regression test for #52304 Closes #52304 r? ```@compiler-errors``` Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2022-07-21Rollup merge of #99526 - compiler-errors:normalize-arg-spans, r=oli-obkMatthias Krüger-15/+12
Normalize the arg spans to be within the call span Makes more sense to point out the arg's span, and not the expression inside the macro
2022-07-21Rollup merge of #99413 - steffahn:btree_dropck, r=m-ou-seMatthias Krüger-3/+50
Add `PhantomData` marker for dropck to `BTreeMap` closes #99408
2022-07-21Generalize same_type_modulo_inferMichael Goulet-2/+0
2022-07-21Remove unused field in ItemKind::KeywordItemGuillaume Gomez-15/+14
2022-07-21Auto merge of #99059 - Amanieu:fix-96797, r=Mark-Simulacrumbors-0/+26
Add test for #96797 This was fixed in LLVM which was updated in #98285. https://reviews.llvm.org/D127751 Fixes #96797