about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2021-10-30Rollup merge of #90412 - jyn514:macro-use, r=camelidMatthias Krüger-7/+6
Remove unnecessary `macro_use`s in rustdoc
2021-10-30Rollup merge of #90396 - b-naber:type_flags_ices_default_anon_consts, r=lcnrMatthias Krüger-0/+47
Prevent type flags assertions being thrown in default_anon_const_substs if errors occurred Fixes https://github.com/rust-lang/rust/issues/90364 Fixes https://github.com/rust-lang/rust/issues/88997 r? ``@lcnr``
2021-10-30Rollup merge of #90395 - b-naber:const-expr-type-relation, r=oli-obkMatthias Krüger-0/+20
Restrict liveness of mutable borrow of inner infcx in ConstInferUnifier::consts Fixes https://github.com/rust-lang/rust/issues/89304 r? ``@oli-obk``
2021-10-30Rollup merge of #90374 - GuillaumeGomez:unify-rustdoc-book-titles, r=camelidMatthias Krüger-6/+10
Unify titles in rustdoc book doc attributes chapter As discussed in https://github.com/rust-lang/rust/pull/90339. I wasn't able to find out where the link to the titles was used so let's see if the CI fails. :) r? ``@camelid``
2021-10-30Auto merge of #88268 - GuillaumeGomez:generics-search-index, ↵bors-93/+147
r=notriddle,camelid,jyn514 rustdoc: Fix generics generation in search index The generics were not added to the search index as they should, instead they were added as arguments. I used this opportunity to allow generics to have generics themselves (will come in very handy for my current rewrite of the search engine!). r? `@jyn514`
2021-10-30Remove unnecessary `macro_use`s in rustdocJoshua Nelson-7/+6
2021-10-29Unify titles in rustdoc book doc attributes chapterGuillaume Gomez-6/+10
2021-10-29Fix invalid handling of genericsGuillaume Gomez-93/+147
2021-10-29Auto merge of #90390 - umanwizard:update-miri, r=RalfJungbors-9/+7
Update miri Fixes https://github.com/rust-lang/rust/issues/90298
2021-10-29Auto merge of #90389 - camelid:rustdoc-rayon, r=jyn514bors-11/+2
rustdoc: Switch to mainline rayon The rustc fork of rayon integrates with Cargo's jobserver to limit the amount of parallelism. However, rustdoc's use case is concurrent I/O, which is not CPU-heavy, so it should be able to use mainline rayon. See [this discussion][1] for more details. [1]: https://github.com/rust-lang/rust/issues/90227#issuecomment-952468618 Note: I chose rayon 1.3.1 so that the rayon version used elsewhere in the workspace does not change. r? `@Mark-Simulacrum` cc `@jyn514`
2021-10-29Auto merge of #90373 - tmiasko:union-qualification, r=oli-obkbors-0/+89
Use type based qualification for unions Union field access is currently qualified based on the qualification of a value previously assigned to the union. At the same time, every union access transmutes the content of the union, which might result in a different qualification. For example, consider constants A and B as defined below, under the current rules neither contains interior mutability, since a value used in the initial assignment did not contain `UnsafeCell` constructor. ```rust #![feature(untagged_unions)] union U { i: u32, c: std::cell::Cell<u32> } const A: U = U { i: 0 }; const B: std::cell::Cell<u32> = unsafe { U { i: 0 }.c }; ``` To avoid the issue, the changes here propose to consider the content of a union as opaque and use type based qualification for union types. Fixes #90268. `@rust-lang/wg-const-eval`
2021-10-29ignore type flags insertion in default_anon_const_substs if error occurredb-naber-0/+47
2021-10-29add testb-naber-0/+20
2021-10-29Auto merge of #90214 - tmiasko:indirect-mutation-qualif, ↵bors-0/+93
r=ecstatic-morse,oli-obk Consider indirect mutation during const qualification dataflow Previously a local would be qualified if either one of two separate data flow computations indicated so. First determined if a local could contain the qualif, but ignored any forms of indirect mutation. Second determined if a local could be mutably borrowed (and so indirectly mutated), but which in turn ignored the qualif. The end result was incorrect because the effect of indirect mutation was effectivelly ignored in the all but the final stage of computation. In the new implementation the indirect mutation is directly incorporated into the qualif data flow. The local variable becomes immediately qualified once it is mutably borrowed and borrowed place type can contain the qualif. In general we will now reject additional programs, program that were prevously unintentionally accepted. There are also some cases which are now accepted but were previously rejected, because previous implementation didn't consider whether borrowed place could have the qualif under the consideration. Fixes #90124. r? `@ecstatic-morse`
2021-10-29Auto merge of #90380 - Mark-Simulacrum:revert-89558-query-stable-lint, r=lcnrbors-95/+0
Revert "Add rustc lint, warning when iterating over hashmaps" Fixes perf regressions introduced in https://github.com/rust-lang/rust/pull/90235 by temporarily reverting the relevant PR.
2021-10-29Auto merge of #90363 - camelid:build-impl-perf, r=jyn514bors-3/+3
Improve perf measurements of `build_extern_trait_impl` Before, it was only measuring one callsite of `build_impl`, and it incremented the call count even if `build_impl` returned early because the `did` was already inlined. Now, it measures all calls, minus calls that return early.
2021-10-28rustdoc: Remove a single-use macroNoah Lev-10/+1
I think the new code is simpler and easier to understand.
2021-10-28Update miriBrennan Vincent-9/+7
2021-10-28rustdoc: Switch to mainline rayonNoah Lev-1/+1
The rustc fork of rayon integrates with Cargo's jobserver to limit the amount of parallelism. However, rustdoc's use case is concurrent I/O, which is not CPU-heavy, so it should be able to use mainline rayon. See this discussion [1] for more details. [1]: https://github.com/rust-lang/rust/issues/90227#issuecomment-952468618 Note: I chose rayon 1.3.1 so that the rayon version used elsewhere in the workspace does not change.
2021-10-29Rollup merge of #90082 - noncombatant:patch-1, r=GuillaumeGomezMatthias Krüger-2/+2
Fix minor typos
2021-10-28Auto merge of #90218 - JakobDegen:adt_significant_drop_fix, r=nikomatsakisbors-0/+37
Fixes incorrect handling of ADT's drop requirements Fixes #90024 and a bunch of duplicates. The main issue was just that the contract of `NeedsDropTypes::adt_components` was inconsistent; the list of types it might return were the generic parameters themselves or the fields of the ADT, depending on the nature of the drop impl. This meant that the caller could not determine whether a `.subst()` call was still needed on those types; it called `.subst()` in all cases, and this led to ICEs when the returned types were the generic params. First contribution of more than a few lines, so feedback definitely appreciated.
2021-10-28Revert "Add rustc lint, warning when iterating over hashmaps"Mark Rousskov-95/+0
2021-10-28Auto merge of #90339 - GuillaumeGomez:doc-alias-doc, r=GuillaumeGomezbors-2/+49
Add missing documentation for doc alias
2021-10-28Add missing documentation for doc aliasGuillaume Gomez-2/+49
2021-10-27Improve perf measurements of `build_extern_trait_impl`Noah Lev-3/+3
Before, it was only measuring one callsite of `build_impl`, and it incremented the call count even if `build_impl` returned early because the `did` was already inlined. Now, it measures all calls, minus calls that return early.
2021-10-28Use type based qualification for unionsTomasz Miąsko-0/+89
Union field access is currently qualified based on the qualification of a value previously assigned to the union. At the same time, every union access transmutes the content of the union, which might result in a different qualification. For example, consider constants A and B as defined below, under the current rules neither contains interior mutability, since a value used in the initial assignment did not contain `UnsafeCell` constructor. ```rust #![feature(untagged_unions)] union U { i: u32, c: std::cell::Cell<u32> } const A: U = U { i: 0 }; const B: std::cell::Cell<u32> = unsafe { U { i: 0 }.c }; ``` To avoid the issue, the changes here propose to consider the content of a union as opaque and use type based qualification for union types.
2021-10-27Rollup merge of #90304 - vandenheuvel:test_issue_75961, r=Mark-SimulacrumMatthias Krüger-0/+7
Add regression test for #75961 Closes #75961. Closes #21203.
2021-10-27Rollup merge of #90288 - JakobDegen:import_diagnostics, r=davidtwcoMatthias Krüger-0/+108
Add hint for people missing `TryFrom`, `TryInto`, `FromIterator` import pre-2021 Adds a hint anytime a `TryFrom`, `TryInto`, `FromIterator` import is suggested noting that these traits are automatically imported in Edition 2021.
2021-10-27Rollup merge of #90267 - EliseZeroTwo:elisezerotwo/fix_invalid_attrs_ice, ↵Matthias Krüger-0/+46
r=Aaron1011 fix: inner attribute followed by outer attribute causing ICE Fixes #87936, #88938, and #89971. This removes the assertion that validates that there are no outer attributes following inner attributes. Where the inner attribute is invalid you get an actual error.
2021-10-27Auto merge of #90186 - jsha:fix-header-sizes, r=GuillaumeGomezbors-6/+232
Fix documentation header sizes And add a rustdoc-gui test confirming various header sizes. Split off from #90156. This fixes a regression in #89506 where the heading level of titles within Markdown was too high (h2) for docblocks under structs, unions, and enum impls. r? `@camelid` Demo: https://jacob.hoffman-andrews.com/rust/fix-header-sizes/std/string/struct.String.html#impl-Add%3C%26%27_%20str%3E Stable: https://doc.rust-lang.org/stable/std/string/struct.String.html#impl-Add%3C%26%27_%20str%3E Beta: https://doc.rust-lang.org/beta/std/string/struct.String.html#impl-Add%3C%26%27_%20str%3E
2021-10-27Auto merge of #89652 - rcvalle:rust-cfi, r=nagisabors-19/+271
Add LLVM CFI support to the Rust compiler This PR adds LLVM Control Flow Integrity (CFI) support to the Rust compiler. It initially provides forward-edge control flow protection for Rust-compiled code only by aggregating function pointers in groups identified by their number of arguments. 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 defining and using compatible type identifiers (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). Thank you, `@eddyb` and `@pcc,` for all the help!
2021-10-27test: add test for inner attribute followed by outer attribute causing ICEEliseZeroTwo-0/+46
2021-10-26Add documentation for LLVM CFI supportRamon de C Valle-19/+202
This commit adds initial documentation for LLVM Control Flow Integrity (CFI) support to the Rust compiler (see #89652 and #89653).
2021-10-27Auto merge of #90337 - matthiaskrgr:rollup-azkr158, r=matthiaskrgrbors-136/+148
Rollup of 3 pull requests Successful merges: - #90154 (rustdoc: Remove `GetDefId`) - #90232 (rustdoc: Use TTF based font instead of OTF for CJK glyphs to improve readability) - #90278 (rustdoc: use better highlighting for *const, *mut, and &mut) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-10-27Add regression test for #75961Bram van den Heuvel-0/+7
2021-10-27Rollup merge of #90278 - notriddle:notriddle/highlight-ptr, ↵Matthias Krüger-8/+23
r=jyn541,GuillaumeGomez rustdoc: use better highlighting for *const, *mut, and &mut This generates more consistent HTML for these RefKeyWord combinations. Before: ![image](https://user-images.githubusercontent.com/1593513/138742752-7e00a3f7-4621-4c62-82d1-3e4c2ef503d1.png) After: ![image](https://user-images.githubusercontent.com/1593513/138743955-90abcdcd-fc88-4e2f-95bb-c1b1635c0001.png)
2021-10-27Rollup merge of #90232 - konan8205:master, r=GuillaumeGomezMatthias Krüger-35/+61
rustdoc: Use TTF based font instead of OTF for CJK glyphs to improve readability Due to Windows' implementation of font rendering, OpenType fonts can be distorted. So the existing font, Noto Sans KR, is not very readable on Windows. This PR improves readability of Korean glyphs on Windows. ## Before ![원1](https://user-images.githubusercontent.com/11029378/138592394-16b15787-532d-4421-a5eb-ed85675290fa.png) ## After ![원2](https://user-images.githubusercontent.com/11029378/138592409-f3a440ee-f0fc-40e4-9561-42c479439c9f.png) The fonts included in this PR are licensed under the SIL Open Font License and generated with these commands: ```sh pyftsubset NanumBarunGothic.ttf \ --unicodes=U+AC00-D7AF,U+1100-11FF,U+3130-318F,U+A960-A97F,U+D7B0-D7FF \ --output-file=NanumBarunGothic.ttf.woff --flavor=woff ``` ```sh pyftsubset NanumBarunGothic.ttf \ --unicodes=U+AC00-D7AF,U+1100-11FF,U+3130-318F,U+A960-A97F,U+D7B0-D7FF \ --output-file=NanumBarunGothic.ttf.woff2 --flavor=woff2 ``` r? ``@GuillaumeGomez``
2021-10-27Rollup merge of #90154 - camelid:remove-getdefid, r=jyn514Matthias Krüger-93/+64
rustdoc: Remove `GetDefId` See the individual commit messages for details. r? `@jyn514`
2021-10-27Auto merge of #89937 - JohnTitor:fix-89875, r=Amanieubors-0/+14
Properly check `target_features` not to trigger an assertion Fixes #89875 I think it should be a condition instead of an assertion to check if it's a register as it's possible that `reg` is a register class. Also, this isn't related to the issue directly, but `is_target_supported` doesn't check `target_features` attributes. Is there any way to check it on rustc_codegen_llvm? r? `@Amanieu`
2021-10-26Reverting switching test to no_std and adjust output after rebase.Jakob Degen-30/+41
2021-10-26Fix line numbers in testJakob Degen-4/+4
2021-10-26Make `ui/suggestions/suggest-tryinto-edition-change.rs` no_std to avoid ↵Jakob Degen-41/+30
getting inconsistent output between local and CI.
2021-10-26Adds hint if a trait fails to resolve and a newly added one in Edition 2021 ↵Jakob Degen-8/+83
is suggested
2021-10-26Add test checking that Edition 2021 is suggested for .try_into() and fix ↵Jakob Degen-0/+33
other test
2021-10-26Rollup merge of #90305 - vandenheuvel:test_issue_87258, r=Mark-SimulacrumMatthias Krüger-0/+72
Add regression test for #87258 Closes #87258.
2021-10-26Rollup merge of #90303 - WaffleLapkin:regression_test_90164, r=JohnTitorMatthias Krüger-0/+31
Add regression test for issue 90164 Closes #90164 (previously fixed by #90181)
2021-10-26Rollup merge of #90302 - GuillaumeGomez:rm-unneeded-into_iter, r=jyn514Matthias Krüger-1/+1
Remove unneeded into_iter As ``@camelid`` mentionned [here](https://github.com/rust-lang/rust/pull/89430#discussion_r735889324), the `into_iter` was unneeded. r? ``@camelid``
2021-10-26Add regression test for #87258Bram van den Heuvel-0/+72
2021-10-26Add regression test for issue 90164Maybe Waffle-0/+31
2021-10-26Remove unneeded into_iterGuillaume Gomez-1/+1