about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2022-02-08remove typoStefan Lankes-1/+1
2022-02-08add missing linkStefan Lankes-0/+1
2022-02-08remove typosStefan Lankes-1/+1
2022-02-08add missing description of the target aarch64-unknown-none-hermitkernelStefan Lankes-3/+81
2022-02-08Auto merge of #93762 - matthiaskrgr:rollup-vdjpfmz, r=matthiaskrgrbors-77/+467
Rollup of 9 pull requests Successful merges: - #86497 (Add {floor,ceil}_char_boundary methods to str) - #92695 (Add `#[no_coverage]` tests for nested functions) - #93521 (Fix hover effects in sidebar) - #93568 (Include all contents of first line of scraped item in Rustdoc) - #93569 (rustdoc: correct unclosed HTML tags as generics) - #93672 (update comment wrt const param defaults) - #93715 (Fix horizontal trim for block doc comments) - #93721 (rustdoc: Special-case macro lookups less) - #93728 (Add in ValuePair::Term) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-02-08nitlcnr-3/+3
2022-02-07Bless use tree pretty print testDavid Tolnay-5/+11
2022-02-08Rollup merge of #93721 - jyn514:less-macro-special-casing, r=petrochenkovMatthias Krüger-19/+14
rustdoc: Special-case macro lookups less Previously, rustdoc had 3 fallbacks it used: 1. `resolve_macro_path` 2. `all_macros` 3. `resolve_str_path_error` Ideally, it would only use `resolve_str_path_error`, to be consistent with other namespaces. Unfortunately, that doesn't consider macros that aren't defined at module scope; consider for instance ```rust { struct S; macro_rules! mac { () => {} } // `mac`'s scope starts here /// `mac` <- `resolve_str_path_error` won't see this struct Z; //`mac`'s scope ends here } ``` This changes it to only use `all_macros` and `resolve_str_path_error`, and gives `resolve_str_path_error` precedence over `all_macros` in case there are two macros with the same name in the same module. This is a smaller version of https://github.com/rust-lang/rust/pull/91427. r? `@petrochenkov`
2022-02-08Rollup merge of #93715 - GuillaumeGomez:horizontal-trim, r=notriddleMatthias Krüger-1/+22
Fix horizontal trim for block doc comments Fixes #93662. r? `@notriddle`
2022-02-08Rollup merge of #93569 - notriddle:notriddle/rustdoc-html-tags-generics, ↵Matthias Krüger-9/+279
r=CraftSpider rustdoc: correct unclosed HTML tags as generics CC https://github.com/rust-lang/rust/issues/67799
2022-02-08Rollup merge of #93568 - willcrichton:scrape-examples-leading-whitespace, ↵Matthias Krüger-1/+20
r=CraftSpider Include all contents of first line of scraped item in Rustdoc This fixes #93528. When scraping examples, it extends the span of the enclosing item to include all characters up to the start of the first line of the span. r? `@camelid`
2022-02-08Rollup merge of #93521 - jsha:sidebar-hover, r=GuillaumeGomezMatthias Krüger-38/+23
Fix hover effects in sidebar The dark and ayu themes have a menu-like highlight on sidebar items. The light theme used to, but it was accidentally lost in the sidebar unification. The change brings back the hover effect in the light theme. It also makes the hover effect apply consistently to all links in the sidebar, including headings. It also simplifies the "In _path_" heading so it's one big link. The breadcrumbs are still readily available at the top of the page. Note that a small number of headings are not linkified and so don't get the hover effect. That will be fixed with #92957. Demo: https://rustdoc.crud.net/jsha/sidebar-hover/std/string/trait.ToString.html r? `@GuillaumeGomez` Fixes #93115
2022-02-08Rollup merge of #92695 - Swatinem:cover-nested, r=wesleywiserMatthias Krüger-9/+109
Add `#[no_coverage]` tests for nested functions I was playing around a bit trying to figure out how `#[no_coverage]` behaves for nested functions and thought I might as well add this as a testcase. The "nesting covered fn inside not covered fn" case looks pretty much as expected. The "nesting not covered fn inside a covered fn" case however seems a bit counterintuitive. Essentially the region of the outer function "covers" its whole lexical range. And the inner function does not generate any region at all. 🤷🏻‍♂️ r? `@richkadel`
2022-02-07Add pretty printer test for use treesDavid Tolnay-0/+17
2022-02-08Auto merge of #93561 - Amanieu:more-unwind-abi, r=nagisabors-5/+200
Add more *-unwind ABI variants The following *-unwind ABIs are now supported: - "C-unwind" - "cdecl-unwind" - "stdcall-unwind" - "fastcall-unwind" - "vectorcall-unwind" - "thiscall-unwind" - "aapcs-unwind" - "win64-unwind" - "sysv64-unwind" - "system-unwind" cc `@rust-lang/wg-ffi-unwind`
2022-02-08Remove obsolete no-op #[main] attribute from compiler.Jeremy Banks-0/+35
2022-02-07Drop tracking: improve break and continue handlingEric Holk-0/+19
This commit fixes two issues. One, sometimes break or continue have a block target instead of an expression target. This seems to mainly happen with try blocks. Since the drop tracking analysis only works on expressions, if we see a block target for break or continue, we substitute the last expression of the block as the target instead. Two, break and continue were incorrectly being treated as the same, so continue would also show up as an exit from the loop or block. This patch corrects the way continue is handled by keeping a stack of loop entry points and uses those to find the target of the continue.
2022-02-07Drop tracking: track borrows of projectionsEric Holk-0/+12
Previous efforts to ignore partially consumed values meant we were also not considering borrows of a projection. This led to cases where we'd miss borrowed types which MIR expected to be there, leading to ICEs.
2022-02-07Auto merge of #92007 - oli-obk:lazy_tait2, r=nikomatsakisbors-1611/+2157
Lazy type-alias-impl-trait Previously opaque types were processed by 1. replacing all mentions of them with inference variables 2. memorizing these inference variables in a side-table 3. at the end of typeck, resolve the inference variables in the side table and use the resolved type as the hidden type of the opaque type This worked okayish for `impl Trait` in return position, but required lots of roundabout type inference hacks and processing. This PR instead stops this process of replacing opaque types with inference variables, and just keeps the opaque types around. Whenever an opaque type `O` is compared with another type `T`, we make the comparison succeed and record `T` as the hidden type. If `O` is compared to `U` while there is a recorded hidden type for it, we grab the recorded type (`T`) and compare that against `U`. This makes implementing * https://github.com/rust-lang/rfcs/pull/2515 much simpler (previous attempts on the inference based scheme were very prone to ICEs and general misbehaviour that was not explainable except by random implementation defined oddities). r? `@nikomatsakis` fixes #93411 fixes #88236
2022-02-07Fix hover effects in sidebarJacob Hoffman-Andrews-38/+23
The dark and ayu themes have a menu-like highlight on sidebar items. The light theme used to, but it was accidentally lost in the sidebar unification. The change brings back the hover effect in the light theme. It also makes the hover effect apply consistently to all links in the sidebar, including headings. It also simplifies the "In _path_" heading so it's one big link. The breadcrumbs are still readily available at the top of the page.
2022-02-07Change inference var check to be in project_typeJack Huey-21/+16
2022-02-07Don't match any projection predicates when the obligation has inference ↵Jack Huey-0/+52
types or consts in GAT substs
2022-02-07Drop rustc-docs from complete profileMark Rousskov-1/+4
2022-02-07Update rustdoc testGuillaume Gomez-1/+1
2022-02-07Add test for block doc comments horizontal trimGuillaume Gomez-0/+21
2022-02-07Add a test showing that we don't infer across multiple uses of the same ↵Oli Scherer-0/+27
opaque type but with a different order of generic arguments
2022-02-07Print opaque types from type aliases via their pathOli Scherer-58/+138
2022-02-07Auto merge of #93738 - m-ou-se:rollup-zjyd2et, r=m-ou-sebors-228/+261
Rollup of 13 pull requests Successful merges: - #88313 (Make the pre-commit script pre-push instead) - #91530 (Suggest 1-tuple parentheses on exprs without existing parens) - #92724 (Cleanup c_str.rs) - #93208 (Impl {Add,Sub,Mul,Div,Rem,BitXor,BitOr,BitAnd}Assign<$t> for Wrapping<$t> for rust 1.60.0) - #93394 (Don't allow {} to refer to implicit captures in format_args.) - #93416 (remove `allow_fail` test flag) - #93487 (Fix linking stage1 toolchain in `./x.py setup`) - #93673 (Linkify sidebar headings for sibling items) - #93680 (Drop json::from_reader) - #93682 (Update tracking issue for `const_fn_trait_bound`) - #93722 (Use shallow clones for submodules managed by rustbuild, not just bootstrap.py) - #93723 (Rerun bootstrap's build script when RUSTC changes) - #93737 (bootstrap: prefer using '--config' over 'RUST_BOOTSTRAP_CONFIG') Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-02-07Drop time dependency from bootstrapMark Rousskov-45/+16
This was only used for the inclusion of 'current' dates into our manpages, but it is not clear that this is practically necessary. The manpage is essentially never updated, and so we can likely afford to keep a manual date in these files. It also seems possible to just omit it, but that may cause other tools trouble, so avoid doing that for now.
2022-02-07Rollup merge of #93737 - mfrw:mfrw/bootstrap-config, r=Mark-SimulacrumMara Bos-2/+2
bootstrap: prefer using '--config' over 'RUST_BOOTSTRAP_CONFIG' Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com> Closes: #93725 Rleated: #92260
2022-02-07Rollup merge of #93723 - jyn514:rerun-if-changed, r=Mark-SimulacrumMara Bos-0/+2
Rerun bootstrap's build script when RUSTC changes Previously, rustbuild would give strange errors if you tried to reuse the same build directory under two names: ``` $ mkdir tmp && cd tmp $ ../x.py check Building rustbuild Finished dev [unoptimized] target(s) in 35.27s Checking stage0 std artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu) ^C $ cd .. $ mv tmp/build build $ ./x.py check Building rustbuild Compiling bootstrap v0.0.0 (/home/jnelson/rust-lang/rust/src/bootstrap) Finished dev [unoptimized] target(s) in 11.18s failed to execute command: "/home/jnelson/rust-lang/rust/tmp/build/x86_64-unknown-linux-gnu/stage0/bin/rustc" "--target" "x86_64-unknown-linux-gnu" "--print" "target-libdir" error: No such file or directory (os error 2) ``` This fixes the error. Reusing the same build directory is useful if you want to test path-related things in bootstrap itself, without having to recompile it each time. For good measure, this also reruns the build script when PATH changes.
2022-02-07Rollup merge of #93722 - jyn514:less-submodule-cloning, r=Mark-SimulacrumMara Bos-1/+1
Use shallow clones for submodules managed by rustbuild, not just bootstrap.py I missed this in https://github.com/rust-lang/rust/pull/89757; it made `x.py test src/bootstrap` very slow.
2022-02-07Rollup merge of #93682 - ↵Mara Bos-18/+18
PatchMixolydic:where-in-the-world-is-const_fn_trait_bound, r=oli-obk Update tracking issue for `const_fn_trait_bound` It previously pointed to #57563, the conglomerate issue for `const fn` (presumably under the feature gate `const_fn`). This tracking issue doesn't mention anything about `const_fn_trait_bound`(the only occurrence of "trait bound" is for the now-removed `?const Trait` syntax), which can be confusing to people who want to find out more about trait bounds on `const fn`s. This pull request changes the tracking issue to one meant specifically for `const_fn_trait_bound`, #93706, which can help collect information on this feature's stabilization and point users towards `const_trait_impl` if they're looking for const-in-const-contexts trait bounds. Fixes #93679. `````@rustbot````` modify labels +A-const-fn +F-const_trait_impl
2022-02-07Rollup merge of #93673 - jsha:linkify-sidebar-headings, r=GuillaumeGomezMara Bos-19/+33
Linkify sidebar headings for sibling items Also adjust CSS so this doesn't produce excess padding/margin. Note: I tried and failed to write a test with browser-UI-test. First I tried to `assert-property: (".block.mod h3 a", {"href": "index.html#macros"})`. But the `href` that gets read out is the fully-quallified URL, starting with `file:///`. That URL will differ depending on what path the test is run from, so that doesn't work. Next I tried clicking on the appropriate sidebar link, and verifying that the appropriate heading on the next page is highlighted with the right background color. However, that also didn't work: according to browser-UI-test, the targeted heading was plain white. However, running with no-headless, I could see that it actually was yellow. I suspect this is a bug in the older version of Chromium used with browser-UI-test's bundled puppeteer, since it doesn't reproduce on latest Chrome. Fixes #92957 Demo: https://rustdoc.crud.net/jsha/linkify-sidebar-headings/std/string/trait.ToString.html r? ``@GuillaumeGomez``
2022-02-07Rollup merge of #93487 - yerke:yerke/fix-link-toolchain-in-setup, ↵Mara Bos-2/+39
r=Mark-Simulacrum Fix linking stage1 toolchain in `./x.py setup` Closes [92319](https://github.com/rust-lang/rust/issues/92319) Fix linking stage1 toolchain in `./x.py setup`. I guess this can be considered a follow up to https://github.com/rust-lang/rust/pull/89212 by `````@Sl1mb0.````` We create 2 directories and 1 file that are required by rustup to [link a custom toolchain from path](https://github.com/rust-lang/rustup/blob/5225e87a5d974ab5f1626bcb2a7b43f76ab883f0/src/toolchain.rs#L479-L497). cc `````@jyn514````` and `````@Mark-Simulacrum````` as they were active in https://github.com/rust-lang/rust/issues/89206
2022-02-07Rollup merge of #93416 - name1e5s:chore/remove_allow_fail, r=m-ou-seMara Bos-165/+22
remove `allow_fail` test flag close #93345
2022-02-07Rollup merge of #93394 - m-ou-se:fix-93378, r=estebankMara Bos-0/+41
Don't allow {} to refer to implicit captures in format_args. Fixes #93378
2022-02-07Rollup merge of #91530 - bobrippling:suggest-1-tuple-parens, r=camelidMara Bos-14/+82
Suggest 1-tuple parentheses on exprs without existing parens A follow-on from #86116, split out from #90677. This alters the suggestion to add a trailing comma to create a 1-tuple - previously we would only apply this if the relevant expression was parenthesised. We now make the suggestion regardless of parentheses, which reduces the fragility of the check (w.r.t formatting). e.g. ```rust let a: Option<(i32,)> = Some(3); ``` gets the below suggestion: ```rust let a: Option<(i32,)> = Some((3,)); // ^ ^^ ``` This change also improves the suggestion in other ways, such as by only making the suggestion if the types would match after the suggestion is applied and making the suggestion a multipart suggestion.
2022-02-07Rollup merge of #88313 - jyn514:pre-push, r=Mark-SimulacrumMara Bos-7/+21
Make the pre-commit script pre-push instead This should make it substantially less annoying, and hopefully more people will find it useful. In particular, it will no longer run tidy each time you run `git commit --amend` or rebase a branch. This also warns if you have the old script in pre-commit; see the HACK comment for details. r? ````@Mark-Simulacrum```` cc ````@caass````
2022-02-07bootstrap: prefer using '--config' over 'RUST_BOOTSTRAP_CONFIG'Muhammad Falak R Wani-2/+2
Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com>
2022-02-07Auto merge of #93719 - scottmcm:core-as-2021-everywhere, r=Mark-Simulacrumbors-9/+9
Build libcore as 2021 in a few more places The `Cargo.toml` has `edition = "2021"` (as of #92068), so that's what these command lines should use too.
2022-02-07Add `#[no_coverage]` tests for nested functionsArpad Borsos-9/+109
2022-02-07add fut/back compat tests for implied trait boundslcnr-0/+98
2022-02-06apply noundef explicitly in all cases instead of relying on dereferenceable ↵Erik Desjardins-14/+14
implying it
2022-02-06test that MaybeUninit<bool> is not noundefErik Desjardins-0/+8
2022-02-06Rerun bootstrap's build script when RUSTC changesJoshua Nelson-0/+2
Previously, rustbuild would give strange errors if you tried to reuse the same build directory under two names: ``` $ mkdir tmp && cd tmp $ ../x.py check Building rustbuild Finished dev [unoptimized] target(s) in 35.27s Checking stage0 std artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu) ^C $ cd .. $ mv tmp/build build $ ./x.py check Building rustbuild Compiling bootstrap v0.0.0 (/home/jnelson/rust-lang/rust/src/bootstrap) Finished dev [unoptimized] target(s) in 11.18s failed to execute command: "/home/jnelson/rust-lang/rust/tmp/build/x86_64-unknown-linux-gnu/stage0/bin/rustc" "--target" "x86_64-unknown-linux-gnu" "--print" "target-libdir" error: No such file or directory (os error 2) ``` This fixes the error. Reusing the same build directory is useful if you want to test path-things in bootstrap itself, without having to recompile it each time. For good measure, this also reruns the build script when PATH changes.
2022-02-06Use shallow clones for submodules managed by rustbuild, not just bootstrap.pyJoshua Nelson-1/+1
I missed this in https://github.com/rust-lang/rust/pull/89757; it made `x.py test src/bootstrap` very slow.
2022-02-06rustdoc: Special-case macro lookups lessJoshua Nelson-19/+14
Previously, rustdoc had 3 fallbacks it used: 1. `resolve_macro_path` 2. `all_macros` 3. `resolve_str_path_error` Ideally, it would only use `resolve_str_path_error`, to be consistent with other namespaces. Unfortunately, that doesn't consider macros that aren't defined at module scope; consider for instance ```rust { struct S; macro_rules! mac { () => {} } // `mac`'s scope starts here /// `mac` <- `resolve_str_path_error` won't see this struct Z; //`mac`'s scope ends here } ``` This changes it to only use `all_macros` and `resolve_str_path_error`, and gives `resolve_str_path_error` precedence over `all_macros` in case there are two macros with the same name in the same module. This also adds a failing test case which will catch trying to remove `all_macros`.
2022-02-07Auto merge of #93179 - Urgau:unreachable-2021, r=m-ou-se,oli-obkbors-43/+187
Fix invalid special casing of the unreachable! macro This pull-request fix an invalid special casing of the `unreachable!` macro in the same way the `panic!` macro was solved, by adding two new internal only macros `unreachable_2015` and `unreachable_2021` edition dependent and turn `unreachable!` into a built-in macro that do dispatching. This logic is stolen from the `panic!` macro. ~~This pull-request also adds an internal feature `format_args_capture_non_literal` that allows capturing arguments from formatted string that expanded from macros. The original RFC #2795 mentioned this as a future possibility. This feature is [required](https://github.com/rust-lang/rust/issues/92137#issuecomment-1018630522) because of concatenation that needs to be done inside the macro:~~ ```rust $crate::concat!("internal error: entered unreachable code: ", $fmt) ``` **In summary** the new behavior for the `unreachable!` macro with this pr is: Edition 2021: ```rust let x = 5; unreachable!("x is {x}"); ``` ``` internal error: entered unreachable code: x is 5 ``` Edition <= 2018: ```rust let x = 5; unreachable!("x is {x}"); ``` ``` internal error: entered unreachable code: x is {x} ``` Also note that the change in this PR are **insta-stable** and **breaking changes** but this a considered as being a [bug](https://github.com/rust-lang/rust/issues/92137#issuecomment-998441613). If someone could start a perf run and then a crater run this would be appreciated. Fixes https://github.com/rust-lang/rust/issues/92137
2022-02-07add tests and fix commentscynecx-0/+38