about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2022-09-16Auto merge of #101860 - oli-obk:information_throwing, r=compiler-errorsbors-26/+22
Don't throw away information just to recompute it again also allows making some functions private.
2022-09-16Auto merge of #101882 - Dylan-DPC:rollup-9lxwuwj, r=Dylan-DPCbors-263/+1069
Rollup of 7 pull requests Successful merges: - #101722 (Rustdoc-Json: Fix Type docs.) - #101738 (Fix `#[link kind="raw-dylib"]` to respect `#[link_name]`) - #101753 (Prefer explict closure sig types over expected ones) - #101787 (cache `collect_trait_impl_trait_tys`) - #101802 (Constify impl Fn* &(mut) Fn*) - #101809 (Replace `check_missing_items.py` with `jsondoclint`) - #101864 (rustdoc: remove no-op CSS `h1-4 { color: --main-color }`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-09-16Rollup merge of #101864 - notriddle:notriddle/h1-h2-h3-h4, r=GuillaumeGomezDylan DPC-1/+0
rustdoc: remove no-op CSS `h1-4 { color: --main-color }` Headers already inherit the font color they need from their parents. This rule dates back to earlier versions of the rustdoc theme, where headers and body had different text colors. https://github.com/rust-lang/rust/blob/68c15be8b5a28297ae58ea030adf49f265e41127/src/librustdoc/html/static/main.css#L72-L98 Nowadays, since the two have exactly the same color (specified by the `--main-color` variable), this rule does nothing.
2022-09-16Rollup merge of #101809 - aDotInTheVoid:jsondoclint, r=GuillaumeGomezDylan DPC-214/+816
Replace `check_missing_items.py` with `jsondoclint` [zulip discussion](https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/check_missing_items.2Epy.20Replacement.2E) check_missing_items.py was a python script that checked rustdoc json output to make sure all the Id's referenced existed in the JSON index. This PR replaces that with a rust binary (`jsondoclint`) that does the same thing. ### Motivation 1. Easier to change when `rustdoc-json-types` changes, as `jsondoclint` uses the types directly. 2. Better Errors: - Multiple Errors can be emited for a single crate - Errors can say where in JSON they occored ``` 2:2889:408 not in index or paths, but refered to at '.index."2:2888:104".inner.items[0]' 2:2890:410 not in index or paths, but refered to at '.index."2:2888:104".inner.items[1]' ``` 3. Catches more bugs. - Because matches are exaustive, all posible variants considered for enums - All Id's checked - Has already found #101770, #101199 and #100973 - Id type is also checked, so the Id's in a structs fields can only be field items. 4. Allows the possibility of running from `rustdoc::json`, which we should do in a crator run at some point. cc ``@CraftSpider`` r? ``@GuillaumeGomez``
2022-09-16Rollup merge of #101802 - chriss0612:const_fn_trait_ref_impls, r=fee1-deadDylan DPC-10/+15
Constify impl Fn* &(mut) Fn* Tracking Issue: [101803](https://github.com/rust-lang/rust/issues/101803) Feature gate: `#![feature(const_fn_trait_ref_impls)]` This feature allows using references to Fn* Items as Fn* Items themself in a const context.
2022-09-16Rollup merge of #101787 - compiler-errors:cache-rpitit, r=petrochenkovDylan DPC-2/+9
cache `collect_trait_impl_trait_tys` Micro-optimization for RPITITs
2022-09-16Rollup merge of #101753 - oli-obk:tait_closure_args, r=compiler-errorsDylan DPC-30/+87
Prefer explict closure sig types over expected ones fixes #100800 Previously we only checked that given closure arguments are equal to expected closure arguments, but now we choose the given closure arguments for the signature that is used when type checking the closure body, and keep the other signature for the type of the closure as seen outside of it.
2022-09-16Rollup merge of #101738 - dpaoliello:linkname, r=petrochenkovDylan DPC-4/+140
Fix `#[link kind="raw-dylib"]` to respect `#[link_name]` Issue Details: When using `#[link kind="raw-dylib"]` (#58713), the Rust compiler ignored any `#[link_name]` attributes when generating the import library and so the resulting binary would fail to link due to missing symbols. Fix Details: Use the name from `#[link_name]` if present when generating the `raw-dylib` import library, otherwise default back to the actual symbol name.
2022-09-16Rollup merge of #101722 - aDotInTheVoid:rdy-ty-prim-docs, r=CraftSpiderDylan DPC-2/+2
Rustdoc-Json: Fix Type docs. Primitive doesn't include Array/Slice/Tuple, as they are their own variants. ResolvedPath doesn't include Traits, as they appear in the DynTrait variant.
2022-09-16Auto merge of #101711 - chenyukang:fix-101691, r=jyn514bors-0/+37
Copy stage0 binaries into stage0-sysroot Fixes #101691
2022-09-15Auto merge of #101831 - compiler-errors:issue-75899, r=jackh726bors-3/+58
Normalize struct field types in `confirm_builtin_unsize_candidate` Fixes #75899 --- edited to move the normalization into `confirm_builtin_unsize_candidate` instead of the coercion code.
2022-09-15Auto merge of #101858 - oli-obk:lift_derive, r=lcnrbors-887/+90
derive various impls instead of hand-rolling them r? `@lcnr` This may not have been what you asked for in https://github.com/rust-lang/rust/commit/964b97e845d5dd18e09d5e045f5b376086714836#r84051418 but I got carried away while following the compiler team meeting today.
2022-09-15rustdoc: remove no-op CSS `h1-4 { color: --main-color }`Michael Howell-1/+0
Headers already inherit the font color they need from their parents. This rule dates back to earlier versions of the rustdoc theme, where headers and body had different text colors. https://github.com/rust-lang/rust/blob/68c15be8b5a28297ae58ea030adf49f265e41127/src/librustdoc/html/static/main.css#L72-L98 Nowadays, since the two have exactly the same color (specified by the `--main-color` variable), this rule does nothing.
2022-09-15Don't throw away information just to recompute it againOli Scherer-26/+22
2022-09-15Merge all `TypeVisitable for &List<T>` impls into one generic oneOli Scherer-41/+13
2022-09-15Auto merge of #101410 - dingxiangfei2009:fix-let-else-scoping, r=jackh726bors-65/+221
Reorder nesting scopes and declare bindings without drop schedule Fix #99228 Fix #99975 Storages are previously not declared before entering the `else` block of a `let .. else` statement. However, when breaking out of the pattern matching into the `else` block, those storages are recorded as scheduled for drops. This is not expected. This MR fixes this issue by not scheduling the drops for those storages. cc `@est31`
2022-09-15Replace more manual TypeFoldable and TypeVisitable impls with derivesOli Scherer-109/+15
2022-09-15derive TypeVisitable and TypeFoldable for mir typesOli Scherer-312/+25
2022-09-15Derive TypeFoldable and TypeVisitable for mir::PlaceElementOli Scherer-32/+1
2022-09-15Resolve a FIXMEOli Scherer-8/+4
2022-09-15derive various Lift impl instead of hand rolling themOli Scherer-385/+32
2022-09-15Auto merge of #101173 - jyn514:simplify-macro-arguments, r=cjgillotbors-52/+40
Further simplify the macros generated by `rustc_queries` This doesn't actually move anything outside the macros, but it makes them simpler to read. - Add a new `rustc_query_names` macro. This allows a much simpler syntax for the matchers in the macros passed to it as a callback. - Convert `define_dep_nodes` and `alloc_once` to use `rustc_query_names`. This is possible because they only use the names (despite the quite complicated matchers in `define_dep_nodes`, none of the other arguments are used). - Get rid of `rustc_dep_node_append`. r? `@cjgillot`
2022-09-15Auto merge of #101811 - flip1995:clippyup, r=flip1995bors-3/+2
Clippy pre beta branch fix Before beta is branched on Friday, I want to move the `unused_peekable` lint that was added in this release cycle (1.65) to `nursery`. This lint was already reported twice (https://github.com/rust-lang/rust-clippy/issues/9456, https://github.com/rust-lang/rust-clippy/issues/9462) in a short time, so it is probably a good idea to fix it before it hits beta and then stable. r? `@Manishearth`
2022-09-15Auto merge of #101838 - matthiaskrgr:rollup-d1nm6b3, r=matthiaskrgrbors-80/+184
Rollup of 9 pull requests Successful merges: - #100415 (Add BE8 support) - #101559 (Adding "backtrace off" option for fuchsia targets) - #101740 (Adding ignore-fuchsia arg to non-applicable compiler ui tests) - #101778 (rustdoc: clean up DOM by removing `.dockblock-short p`) - #101786 (Tidy will not check coding style in bootstrap/target) - #101810 (Constify `PartialEq` for `Ordering`) - #101812 (rustdoc: clean up CSS `#titles` using flexbox) - #101820 (rustdoc: remove no-op rule `a { background: transparent }`) - #101828 (Add test for #101743) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-09-15Rollup merge of #101828 - aDotInTheVoid:test-101743, r=jshaMatthias Krüger-0/+19
Add test for #101743 The issue was closes as we stopped rendering `const`s like this, but if we move back to doing that, make sure we don't accidently generate tags
2022-09-15Rollup merge of #101820 - notriddle:notriddle/a, r=GuillaumeGomezMatthias Krüger-1/+0
rustdoc: remove no-op rule `a { background: transparent }` The background is transparent by default. It was added in 5a01dbe67b43660bf1df96074f34a635aad50e56 to work around a bug in the JavaScript syntax highlighting engine that rustdoc used at the time.
2022-09-15Rollup merge of #101812 - notriddle:notriddle/titles-button, r=GuillaumeGomezMatthias Krüger-23/+6
rustdoc: clean up CSS `#titles` using flexbox This commit allows it to stop manually specifying pixel heights for the tabs on search result pages. There's less messing with manual breakpoints and less complex CSS selectors. # Before ![image](https://user-images.githubusercontent.com/1593513/190215034-253c0f58-07c6-41c9-8848-0442c0522070.png) # After ![image](https://user-images.githubusercontent.com/1593513/190215065-d2453dca-edf0-4353-8fc8-3a3b31f03892.png)
2022-09-15Rollup merge of #101810 - raldone01:feat/const_partial_eq_ordering, r=fee1-deadMatthias Krüger-1/+14
Constify `PartialEq` for `Ordering` Adds `impl const PartialEq for Ordering {}` to #92391.
2022-09-15Rollup merge of #101786 - chenyukang:fix-tidy-for-bootstrap, r=jyn514Matthias Krüger-0/+1
Tidy will not check coding style in bootstrap/target `bootstrap/target` may contains the files generated by `rust-analysis`, which we won't want to be checked.
2022-09-15Rollup merge of #101778 - notriddle:notriddle/docblock-short-p, r=GuillaumeGomezMatthias Krüger-38/+26
rustdoc: clean up DOM by removing `.dockblock-short p` On https://doc.rust-lang.org/nightly/std/ this reduces the number out of `document.querySelectorAll("*").length` from 1278 to 1103. Preview: https://notriddle.com/notriddle-rustdoc-test/docblock-short-p/std/index.html
2022-09-15Rollup merge of #101740 - andrewpollack:add-ignore-fuchsia-ui-tests, r=tmandryMatthias Krüger-0/+6
Adding ignore-fuchsia arg to non-applicable compiler ui tests Adding `ignore-fuchsia` flag to tests involving `std::process::Command` calls, and `execve` calls
2022-09-15Rollup merge of #101559 - andrewpollack:add-backtrace-off-fuchsia, r=tmandryMatthias Krüger-17/+16
Adding "backtrace off" option for fuchsia targets Used for improving compiler test suite results on Fuchsia targets
2022-09-15Rollup merge of #100415 - WorksButNotTested:be8, r=wesleywiserMatthias Krüger-0/+96
Add BE8 support Built using the following `/config.toml` ``` changelog-seen = 2 [llvm] download-ci-llvm = false skip-rebuild = true optimize = true ninja = true targets = "ARM;X86" clang = false [build] target = ["x86_64-unknown-linux-gnu", "armeb-linux-gnueabi"] docs = false docs-minification = false compiler-docs = false [install] prefix = "/home/user/x-tools/rust/" [rust] debug-logging=true backtrace = true incremental = true [target.x86_64-unknown-linux-gnu] [dist] [target.armeb-linux-gnueabi] cc = "/home/user/x-tools/armeb-linux-gnueabi/bin/armeb-linux-gnueabi-gcc" cxx = "/home/user/x-tools/armeb-linux-gnueabi/bin/armeb-linux-gnueabi-g++" ar = "/home/user/x-tools/armeb-linux-gnueabi/bin/armeb-linux-gnueabi-ar" ranlib = "/home/user/x-tools/armeb-linux-gnueabi/bin/armeb-linux-gnueabi-ranlib" linker = "/home/user/x-tools/armeb-linux-gnueabi/bin/armeb-linux-gnueabi-gcc" llvm-config = "/home/user/x-tools/clang/bin/llvm-config" llvm-filecheck = "/home/user/x-tools/clang/bin/FileCheck" ``` The following `.cargo/config` is needed inside any project directory: ``` [build] target = "armeb-linux-gnueabi" [target.armeb-linux-gnueabi] linker = "armeb-linux-gnueabi-gcc" ```
2022-09-15Auto merge of #101830 - nnethercote:streamline-register_res, r=jyn514bors-21/+5
Streamline `register_res`. Turns out it's only ever passed a `Res::Def`. r? `@jyn514`
2022-09-15add diagram to explain the MIR structureDing Xiang Fei-0/+53
2022-09-15add explanatory noteDing Xiang Fei-0/+15
2022-09-15enclose else block in terminating scopeDing Xiang Fei-2/+2
2022-09-15supplement for the missing or incomplete commentsDing Xiang Fei-2/+13
2022-09-15add test for #99975Ding Xiang Fei-0/+20
2022-09-15reorder nesting scopes and declare bindings without drop scheduleDing Xiang Fei-65/+122
2022-09-15Normalize struct types in confirm_builtin_unsize_candidateMichael Goulet-3/+58
2022-09-15Auto merge of #101620 - cjgillot:compute_lint_levels_by_def, r=oli-obkbors-488/+670
Compute lint levels by definition Lint levels are currently computed once for the whole crate. Any code that wants to emit a lint depends on this single `lint_levels(())` query. This query contains the `Span` for each attribute that participates in the lint level tree, so any code that wants to emit a lint basically depends on the spans in all files in the crate. Contrary to hard errors, we do not clear the incremental session on lints, so this implicit world dependency pessimizes incremental reuse. (And is furthermore invisible for allowed lints.) This PR completes https://github.com/rust-lang/rust/pull/99634 (thanks for the initial work `@fee1-dead)` and includes it in the dependency graph. The design is based on 2 queries: 1. `lint_levels_on(HirId) -> FxHashMap<LintId, LevelAndSource>` which accesses the attributes at the given `HirId` and processes them into lint levels. The `TyCtxt` is responsible for probing the HIR tree to find the user-visible level. 2. `lint_expectations(())` which lists all the `#[expect]` attributes in the crate. This PR also introduces the ability to reconstruct a `HirId` from a `DepNode` by encoding the local part of the `DefPathHash` and the `ItemLocalId` in the two `u64` of the fingerprint. This allows for the dep-graph to directly recompute `lint_levels_on` directly, without having to force the calling query. Closes https://github.com/rust-lang/rust/issues/95094. Supersedes https://github.com/rust-lang/rust/pull/99634.
2022-09-14Adding backtrace off option for fuchsia targetsAndrew Pollack-17/+16
2022-09-15Streamline `register_res`.Nicholas Nethercote-21/+5
Turns out it's only ever passed a `Res::Def`.
2022-09-14Add test for #101743Nixon Enraght-Moony-0/+19
2022-09-14Auto merge of #101313 - SparrowLii:mk_attr_id, r=cjgillotbors-27/+111
make `mk_attr_id` part of `ParseSess` Updates #48685 The current `mk_attr_id` uses the `AtomicU32` type, which is not very efficient and adds a lot of lock contention in a parallel environment. This PR refers to the task list in #48685, uses `mk_attr_id` as a method of the `AttrIdGenerator` struct, and adds a new field `attr_id_generator` to `ParseSess`. `AttrIdGenerator` uses the `WorkerLocal`, which has two advantages: 1. `Cell` is more efficient than `AtomicU32`, and does not increase any lock contention. 2. We put the index of the work thread in the first few bits of the generated `AttrId`, so that the `AttrId` generated in different threads can be easily guaranteed to be unique. cc `@cjgillot`
2022-09-14cache collect_trait_impl_trait_tysMichael Goulet-2/+9
2022-09-14rustdoc: remove no-op rule `a { background: transparent }`Michael Howell-1/+0
The background is transparent by default. It was added in 5a01dbe67b43660bf1df96074f34a635aad50e56 to work around a bug in the JavaScript syntax highlighting engine that rustdoc used at the time.
2022-09-14Temporarily move clippy::unused_peekable to nurseryPhilipp Krones-3/+2
2022-09-14Auto merge of #101212 - eholk:dyn-star, r=compiler-errorsbors-104/+617
Initial implementation of dyn* This PR adds extremely basic and incomplete support for [dyn*](https://smallcultfollowing.com/babysteps//blog/2022/03/29/dyn-can-we-make-dyn-sized/). The goal is to get something in tree behind a flag to make collaboration easier, and also to make sure the implementation so far is not unreasonable. This PR does quite a few things: * Introduce `dyn_star` feature flag * Adds parsing for `dyn* Trait` types * Defines `dyn* Trait` as a sized type * Adds support for explicit casts, like `42usize as dyn* Debug` * Including const evaluation of such casts * Adds codegen for drop glue so things are cleaned up properly when a `dyn* Trait` object goes out of scope * Adds codegen for method calls, at least for methods that take `&self` Quite a bit is still missing, but this gives us a starting point. Note that this is never intended to become stable surface syntax for Rust, but rather `dyn*` is planned to be used as an implementation detail for async functions in dyn traits. Joint work with `@nikomatsakis` and `@compiler-errors.` r? `@bjorn3`