about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2021-06-01Auto merge of #85886 - GuillaumeGomez:rollup-l3yr3np, r=GuillaumeGomezbors-56/+65
Rollup of 4 pull requests Successful merges: - #85473 (fix split-debuginfo error message) - #85622 (Remove toggle for "undocumented items.") - #85826 (Mention "null pointer optimization" in option docs.) - #85860 (Fix details rustdoc toggle for blanket impl) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-06-01Rollup merge of #85860 - pickfire:patch-5, r=GuillaumeGomezGuillaume Gomez-2/+1
Fix details rustdoc toggle for blanket impl In the meantime, allow all of the details to have the same top. Before ![image](https://user-images.githubusercontent.com/4687791/120214139-a673ed00-c266-11eb-9154-3a8148199c8f.png) ![image](https://user-images.githubusercontent.com/4687791/120214232-c5727f00-c266-11eb-8bda-871e6e04819e.png) After ![image](https://user-images.githubusercontent.com/4687791/120214121-9d831b80-c266-11eb-8c33-db1317c42375.png) ![image](https://user-images.githubusercontent.com/4687791/120214273-d4f1c800-c266-11eb-89ee-0f2b7c2e5bdb.png) I stumbled across this while wanting to do a details button for the layout.
2021-06-01Rollup merge of #85622 - jsha:untoggle-undocumented, r=GuillaumeGomezGuillaume Gomez-54/+64
Remove toggle for "undocumented items." Per discussion in #84326. For trait implementations, this was misleading: the items actually do have documentation (but it comes from the trait definition). For both trait implementations and trait implementors, this was redundant: in both of those cases, the items are default-hidden by different toggle at the level above. Update tests: Remove XPath selectors that over-specified on details tag, in cases that weren't testing toggles. Add an explicit test for toggles on methods. Rename item-hide-threshold to toggle-item-contents for consistency. Demo: https://hoffman-andrews.com/rust/untoggle-undocumented/std/string/struct.String.html https://hoffman-andrews.com/rust/untoggle-undocumented/std/io/trait.Read.html
2021-06-01Auto merge of #85884 - rust-lang:revert-85153-qresolve, r=michaelwoeristerbors-19/+18
Revert "Reduce the amount of untracked state in TyCtxt" Reverts rust-lang/rust#85153 Fixes https://github.com/rust-lang/rust/issues/85878 The performance hit is massive, and was not visible in the in-review perf run. r? `@Aaron1011`
2021-06-01Revert "Reduce the amount of untracked state in TyCtxt"Camille Gillot-19/+18
2021-06-01Auto merge of #85859 - pickfire:patch-3, r=CraftSpiderbors-1/+2
Add title for copy to clipboard button in rustdoc This button ![image](https://user-images.githubusercontent.com/4687791/120210874-da4d1380-c262-11eb-9987-9145c4354029.png)
2021-06-01Auto merge of #85856 - lnicola:rust-analyzer-2021-05-31, r=jonas-schievinkbors-0/+24
:arrow_up: rust-analyzer
2021-06-01Auto merge of #85153 - cjgillot:qresolve, r=Aaron1011bors-18/+19
Reduce the amount of untracked state in TyCtxt Access to untracked global state may generate instances of #84970. The GlobalCtxt contains the lowered HIR, the resolver outputs and interners. By wrapping the resolver inside a query, we make sure those accesses are properly tracked. As a no_hash query, all dependent queries essentially become `eval_always`, what they should have been from the beginning.
2021-05-31Auto merge of #85866 - Aaron1011:miriup-const-err, r=RalfJungbors-9/+7
Bump Miri for const_err changes Fixes https://github.com/rust-lang/rust/issues/85861 r? `@RalfJung`
2021-05-31Auto merge of #85702 - Aaron1011:no-vec-sort, r=michaelwoeristerbors-0/+15
Don't sort a `Vec` before computing its `DepTrackingHash` Previously, we sorted the vec prior to hashing, making the hash independent of the original (command-line argument) order. However, the original vec was still always kept in the original order, so we were relying on the rest of the compiler always working with it in an 'order-independent' way. This assumption was not being upheld by the `native_libraries` query - the order of the entires in its result depends on the order of entries in `Options.libs`. This lead to an 'unstable fingerprint' ICE when the `-l` arguments were re-ordered. This PR removes the sorting logic entirely. Re-ordering command-line arguments (without adding/removing/changing any arguments) seems like a really niche use case, and correctly optimizing for it would require additional work. By always hashing arguments in their original order, we can entirely avoid a cause of 'unstable fingerprint' errors.
2021-05-31Bump Miri for const_err changesAaron Hill-9/+7
r? @RalfJung
2021-05-31Fix details rustdoc toggle for blanket implIvan Tham-2/+1
In the meantime, allow all of the details to have the same top.
2021-05-31Add title for copy to clipboard button in rustdocIvan Tham-1/+2
2021-05-31:arrow_up: rust-analyzerLaurențiu Nicola-0/+24
2021-05-31Auto merge of #85704 - Aaron1011:const-panic-hard-err, r=RalfJungbors-128/+56
Emit a hard error when a panic occurs during const-eval Previous, a panic during const evaluation would go through the `const_err` lint. This PR ensures that such a panic always causes compilation to fail.
2021-05-31Auto merge of #85395 - 12101111:build-crt, r=petrochenkovbors-3/+107
Build crtbegin.o/crtend.o from source code Build crtbengin.o/crtend.o from source code instead of copying from gcc. The crtbegin and crtend implementation from llvm don't need `crtbeginS.o` for PIC. `crtbegin{,S,T}.o` is unified into one generic `crtbegin.o`. See the comments in https://reviews.llvm.org/D28791#1419436 and https://reviews.llvm.org/D28791#1420914 fix: https://github.com/rust-lang/rust/issues/85310 , fix: https://github.com/rust-lang/rust/issues/47551 , fix: https://github.com/rust-lang/rust/issues/84033
2021-05-30Remove toggle for "undocumented items."Jacob Hoffman-Andrews-54/+64
Per discussion in #84326. For trait implementations, this was misleading: the items actually do have documentation (but it comes from the trait definition). For both trait implementations and trait implementors, this was redundant: in both of those cases, the items are default-hidden by different toggle at the level above. Update tests: Remove XPath selectors that over-specified on details tag, in cases that weren't testing toggles. Add an explicit test for toggles on methods. Rename item-hide-threshold to toggle-item-contents for consistency.
2021-05-31Build crtbengin.o/crtend.o from source code12101111-3/+107
2021-05-31Auto merge of #85597 - 0yoyoyo:fix-issue-71563-remove-redundant-args, ↵bors-93/+237
r=petrochenkov Fix span of redundant generic arguments Fixes #71563 Above issue is about lifetime arguments, but generic arguments also have same problem. This PR fixes both help messages.
2021-05-30Auto merge of #85559 - 12101111:sanitizer-crt-static, r=nagisabors-0/+9
Diagnose use sanitizers with crt-static Fix: https://github.com/rust-lang/rust/issues/85459
2021-05-30Auto merge of #85838 - GuillaumeGomez:rollup-rk2rh7m, r=GuillaumeGomezbors-38/+131
Rollup of 8 pull requests Successful merges: - #85285 (Add eslint checks to CI) - #85709 (Use correct edition when parsing `:pat` matchers) - #85762 (Do not try to build LLVM with Zlib on Windows) - #85770 (Remove `--print unversioned-files` from rustdoc ) - #85781 (Add documentation for aarch64-apple-ios-sim target) - #85801 (Add `String::extend_from_within`) - #85817 (Fix a typo) - #85818 (Don't drop `PResult` without handling the error) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-05-30Rollup merge of #85818 - LeSeulArtichaut:85794-diag-drop-ice, r=petrochenkovGuillaume Gomez-0/+34
Don't drop `PResult` without handling the error Fixes #85794.
2021-05-30Rollup merge of #85781 - badboy:document-aarch-ios-sim-support, r=AmanieuGuillaume Gomez-2/+59
Add documentation for aarch64-apple-ios-sim target Documentation as requested for [MCP 428](https://github.com/rust-lang/compiler-team/issues/428) to promote this target to Tier 2. Currently it calls out that it's Tier 3. That should be changed if this target is promoted, but this PR could also land before that. Note: probably should get signoff from the compiler team based on that MCP.
2021-05-30Rollup merge of #85770 - Bobo1239:set_locale_for_sort, r=jyn514Guillaume Gomez-34/+1
Remove `--print unversioned-files` from rustdoc This flag isn't needed anymore. See #83784.
2021-05-30Rollup merge of #85762 - mati865:disable-zlib-on-windows, r=Mark-SimulacrumGuillaume Gomez-1/+1
Do not try to build LLVM with Zlib on Windows Fixes https://github.com/rust-lang/rust/issues/85422 Fixes https://github.com/rust-lang/rust/issues/85624 We do not install Zlib on the CI but recent builds somehow started picking it's shared version. To avoid relying on CI binaries so let's explicitly disable it.
2021-05-30Rollup merge of #85709 - Aaron1011:fix-pat-crate-edition, r=petrochenkovGuillaume Gomez-0/+32
Use correct edition when parsing `:pat` matchers As described in issue #85708, we currently do not properly decode `SyntaxContext::root()` and `ExpnId::root()` from foreign crates. As a result, when we decode a span from a foreign crate with `SyntaxContext::root()`, we end up up considering it to have the edition of the *current* crate, instead of the foreign crate where it was originally created. A full fix for this issue will be a fairly significant undertaking. Fortunately, it's possible to implement a partial fix, which gives us the correct edition-dependent behavior for `:pat` matchers when the macro is loaded from another crate. Since we have the edition of the macro's defining crate available, we can 'recover' from seeing a `SyntaxContext::root()` and use the edition of the macro's defining crate. Any solution to issue #85708 must reproduce the behavior of this targeted fix - properly preserving a foreign `SyntaxContext::root()` means (among other things) preserving its edition, which by definition is the edition of the foreign crate itself. Therefore, this fix moves us closer to the correct overall solution, and does not expose any new incorrect behavior to macros.
2021-05-30Rollup merge of #85285 - GuillaumeGomez:eslint-check, r=jsha,Mark-SimulacrumGuillaume Gomez-1/+4
Add eslint checks to CI It also allowed me to fix some potential issues that went unnoticed. Having this process automated will hopefully prevent us to add more errors. :) cc `@Mark-Simulacrum` (for the add in the CI). r? `@jsha`
2021-05-30Fix eslint error in sidebar-items.jsGuillaume Gomez-0/+1
2021-05-30Add eslint checks in CIGuillaume Gomez-1/+3
2021-05-30Bless tests.Camille GILLOT-16/+16
2021-05-30Restrict access to crate_name.Camille GILLOT-2/+3
Also remove original_crate_name, which had the exact same implementation
2021-05-30Auto merge of #85362 - jsgf:fix-emit-metadata, r=estebankbors-0/+34
Use command line metadata path if provided If the command-line has `--emit metadata=some/path/libfoo.rmeta` then use that. Closes #85356 I couldn't find any existing tests for the `--emit TYPE=PATH` command line syntax, so I wasn't sure how to test this aside from ad-hoc manual testing. Is there a ui test type for "generated output file with expected name"?
2021-05-30Emit a hard error when a panic occurs during const-evalAaron Hill-128/+56
Previous, a panic during const evaluation would go through the `const_err` lint. This PR ensures that such a panic always causes compilation to fail.
2021-05-30Auto merge of #85804 - bjorn3:merge_crate_disambiguator, r=cjgillotbors-92/+92
Merge CrateDisambiguator into StableCrateId This simplifies the code and potentially improves performance by reducing the amount of hashed data. Fixes https://github.com/rust-lang/rust/issues/85795
2021-05-30Fix span of redundant generic arguments0yoyoyo-93/+237
2021-05-30Auto merge of #84586 - GuillaumeGomez:enforce-rustdoc-gui-test-suite-run, ↵bors-77/+135
r=Mark-Simulacrum Enforce rustdoc-gui test-suite run Part of https://github.com/rust-lang/rust/issues/84550
2021-05-30Update mir opt testsbjorn3-24/+24
2021-05-30Update testsbjorn3-68/+68
2021-05-30Auto merge of #85786 - GuillaumeGomez:error-code-checker-improvement, ↵bors-9/+18
r=Mark-Simulacrum Error code checker improvement Just realized that some error codes shouldn't be ignored anymore. So I updated the script to ensure that if an error code is tested and ignored, it will trigger an error.
2021-05-30Auto merge of #83772 - jhpratt:revamp-step-trait, r=Mark-Simulacrumbors-11/+17
Make `Step` trait safe to implement This PR makes a few modifications to the `Step` trait that I believe better position it for stabilization in the short term. In particular, 1. `unsafe trait TrustedStep` is introduced, indicating that the implementation of `Step` for a given type upholds all stated invariants (which have remained unchanged). This is gated behind a new `trusted_step` feature, as stabilization is realistically blocked on min_specialization. 2. The `Step` trait is internally specialized on the `TrustedStep` trait, which avoids a serious performance regression. 3. `TrustedLen` is implemented for `T: TrustedStep` as the latter's invariants subsume the former's. 4. The `Step` trait is no longer `unsafe`, as the invariants must not be relied upon by unsafe code (unless the type implements `TrustedStep`). 5. `TrustedStep` is implemented for all types that implement `Step` in the standard library and compiler. 6. The `step_trait_ext` feature is merged into the `step_trait` feature. I was unable to find any reasoning for the features being split; the `_unchecked` methods need not necessarily be stabilized at the same time, but I think it is useful to have them under the same feature flag. All existing implementations of `Step` will be broken, as it is not possible to `unsafe impl` a safe trait. Given this trait only exists on nightly, I feel this breakage is acceptable. The blanket `impl<T: Step> TrustedLen for T` will likely cause some minor breakage, but this should be covered by the equivalent impl for `TrustedStep`. Hopefully these changes are sufficient to place `Step` in decent position for stabilization, which would allow user-defined types to be used with `a..b` syntax.
2021-05-30Don't drop `PResult` without handling the errorLeSeulArtichaut-0/+34
2021-05-29Auto merge of #85698 - ehuss:incremental-session-panic, r=estebankbors-0/+15
Don't panic when failing to initialize incremental directory. This removes a panic when rustc fails to initialize the incremental directory. This can commonly happen on various filesystems that don't support locking (often various network filesystems). Panics can be confusing and scary, and there are already plenty of issues reporting this. This has been panicking since 1.22 due to I think #44502 which was a major rework of how things work. Previously, things were simpler and the [`load_dep_graph`](https://github.com/rust-lang/rust/blob/1.21.0/src/librustc_incremental/persist/load.rs#L43-L65) function would emit an error and then continue on without panicking. With 1.22, [`load_dep_graph`](https://github.com/rust-lang/rust/blob/1.22.0/src/librustc_incremental/persist/load.rs#L44) was changed so that it assumes it can load the data without errors. Today, the problem is that it calls [`prepare_session_directory`](https://github.com/rust-lang/rust/blob/fbf1b1a7193cda17008ab590e06ad28d9924023b/compiler/rustc_interface/src/passes.rs#L175-L179) and then immediately calls `garbage_collect_session_directories` which will panic since the session is `IncrCompSession::NotInitialized`. The solution here is to have `prepare_session_directory` return an error that must be handled so that compilation stops if it fails. Some other options: * Ignore directory lock failures. * Print a warning on directory lock failure, but otherwise continue with incremental enabled. * Print a warning on directory lock failure, and disable incremental. * Provide a different locking mechanism. Cargo ignores lock errors if locking is not supported, so that would be a precedent for the first option. These options would require quite a bit more changes, but I'm happy to entertain any of them, as I think they all have valid justifications. There is more discussion on the many issues where this is reported: #49773, #59224, #66513, #76251. I'm not sure if this can be considered closing any of those, though, since I think there is some value in discussing if there is a way to avoid the error altogether. But I think it would make sense to at least close all but one to consolidate them.
2021-05-29Use correct edition when parsing `:pat` matchersAaron Hill-0/+32
As described in issue #85708, we currently do not properly decode `SyntaxContext::root()` and `ExpnId::root()` from foreign crates. As a result, when we decode a span from a foreign crate with `SyntaxContext::root()`, we end up up considering it to have the edition of the *current* crate, instead of the foreign crate where it was originally created. A full fix for this issue will be a fairly significant undertaking. Fortunately, it's possible to implement a partial fix, which gives us the correct edition-dependent behavior for `:pat` matchers when the macro is loaded from another crate. Since we have the edition of the macro's defining crate available, we can 'recover' from seeing a `SyntaxContext::root()` and use the edition of the macro's defining crate. Any solution to issue #85708 must reproduce the behavior of this targeted fix - properly preserving a foreign `SyntaxContext::root()` means (among other things) preserving its edition, which by definition is the edition of the foreign crate itself. Therefore, this fix moves us closer to the correct overall solution, and does not expose any new incorrect behavior to macros.
2021-05-29Auto merge of #85540 - GuillaumeGomez:better-result-dom-generation, r=jshabors-22/+70
Better result dom generation First commit is from https://github.com/rust-lang/rust/pull/85506. We realized in https://github.com/rust-lang/rust/pull/85506#issuecomment-844984162 thanks to `@dns2utf8` that in some cases, the generated search result DOM was invalid. This was not strict enough and the DOM was inserted as a big string, which wasn't great. r? `@jsha`
2021-05-29Fix incremental-session-fail to work when run as root.Eric Huss-2/+1
2021-05-29Auto merge of #85767 - lqd:stackless_span_stacks, r=oli-obkbors-14/+15
A bit more polish on const eval errors This PR adds a bit more polish to the const eval errors: - a slight improvement to the PME messages from #85633: I mentioned there that the erroneous item's paths were dependent on the environment, and could be displayed fully qualified or not. This can obscure the items when they come from a dependency. This PR uses the pretty-printing code ensuring the items' paths are not trimmed. - whenever there are generics involved in an item where const evaluation errors out, the error message now displays the instance and its const arguments, so that we can see which instantiated item and compile-time values lead to the error. So we get this slight improvement for our beloved `stdarch` example, on nightly: ``` error[E0080]: evaluation of constant value failed --> ./stdarch/crates/core_arch/src/macros.rs:8:9 | 8 | assert!(IMM >= MIN && IMM <= MAX, "IMM value not in expected range"); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the evaluated program panicked at 'IMM value not in expected range', /rustc/9111b8ae9793f18179a1336417618fc07a9cac85/library/core/src/../../stdarch/crates/core_arch/src/macros.rs:8:9 | ``` to this PR's: ``` error[E0080]: evaluation of `core::core_arch::macros::ValidateConstImm::<51_i32, 0_i32, 15_i32>::VALID` failed --> ./stdarch/crates/core_arch/src/macros.rs:8:9 | 8 | assert!(IMM >= MIN && IMM <= MAX, "IMM value not in expected range"); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the evaluated program panicked at 'IMM value not in expected range', ./stdarch/crates/core_arch/src/macros.rs:8:9 | ``` with this PR. Of course this is an idea from Oli, so maybe r? `@oli-obk` if they have the time.
2021-05-29tier-check: Check for lines with '[' such as those containing linksJan-Erik Rediger-1/+1
2021-05-29Add documentation for aarch64-apple-ios-sim targetJan-Erik Rediger-1/+58
2021-05-29Auto merge of #85798 - hyd-dev:miri, r=RalfJungbors-8/+8
Update Miri Fixes #85780.
2021-05-28Add test for --emit TYPE=pathJeremy Fitzhardinge-0/+34