about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2021-05-07Rollup merge of #84779 - jyn514:cargotest-args, r=Mark-SimulacrumYuki Okushi-1/+4
Add support for --test-args to cargotest This allows running a single test without having to wait for all tests to complete. Closes https://github.com/rust-lang/rust/issues/77260.
2021-05-07Auto merge of #85014 - Dylan-DPC:rollup-jzpbkdu, r=Dylan-DPCbors-258/+763
Rollup of 11 pull requests Successful merges: - #84409 (Ensure TLS destructors run before thread joins in SGX) - #84500 (Add --run flag to compiletest) - #84728 (Add test for suggestion to borrow unsized function parameters) - #84734 (Add `needs-unwind` and beginning of support for testing `panic=abort` std to compiletest) - #84755 (Allow using `core::` in intra-doc links within core itself) - #84871 (Disallows `#![feature(no_coverage)]` on stable and beta (using standard crate-level gating)) - #84872 (Wire up tidy dependency checks for cg_clif) - #84896 (Handle incorrect placement of parentheses in trait bounds more gracefully) - #84905 (CTFE engine: rename copy → copy_intrinsic, move to intrinsics.rs) - #84953 (Remove unneeded call to with_default_session_globals in rustdoc highlight) - #84987 (small nits) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-05-07Rollup merge of #84987 - lcnr:nits, r=Mark-SimulacrumDylan DPC-8/+0
small nits
2021-05-07Rollup merge of #84953 - ↵Dylan DPC-31/+33
GuillaumeGomez:remove-unneeded-with_default_session_globals, r=jyn514 Remove unneeded call to with_default_session_globals in rustdoc highlight This was the origin of the `Span` bug in https://github.com/rust-lang/rust/pull/84176. cc `````@Aaron1011````` r? `````@jyn514`````
2021-05-07Rollup merge of #84905 - RalfJung:copy, r=oli-obkDylan DPC-34/+34
CTFE engine: rename copy → copy_intrinsic, move to intrinsics.rs The `copy` name is confusing for this function because we also have `copy_op` which is pretty different. I hope `copy_intrinsic` is clearer. Also `step.rs` should really just contain the main loop and opcode dispatch, so move this helper function to a more appropriate place. r? ``````@oli-obk``````
2021-05-07Rollup merge of #84896 - estebank:issue-84772, r=jackh726Dylan DPC-3/+130
Handle incorrect placement of parentheses in trait bounds more gracefully Fix #84772. CC ``````@jonhoo``````
2021-05-07Rollup merge of #84872 - bjorn3:cg_clif_tidy, r=Mark-SimulacrumDylan DPC-47/+136
Wire up tidy dependency checks for cg_clif Also contains a fix and improvement to tidy. Required for https://github.com/rust-lang/rust/pull/81746.
2021-05-07Rollup merge of #84871 - richkadel:no-coverage-unstable-only, r=nagisaDylan DPC-91/+18
Disallows `#![feature(no_coverage)]` on stable and beta (using standard crate-level gating) Fixes: #84836 Removes the function-level feature gating solution originally implemented, and solves the same problem using `allow_internal_unstable`, so normal crate-level feature gating mechanism can still be used (which disallows the feature on stable and beta). I tested this, building the compiler with and without `CFG_DISABLE_UNSTABLE_FEATURES=1` With unstable features disabled, I get the expected result as shown here: ```shell $ ./build/x86_64-unknown-linux-gnu/stage1/bin/rustc src/test/run-make-fulldeps/coverage/no_cov_crate.rs error[E0554]: `#![feature]` may not be used on the dev release channel --> src/test/run-make-fulldeps/coverage/no_cov_crate.rs:2:1 | 2 | #![feature(no_coverage)] | ^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error For more information about this error, try `rustc --explain E0554`. ``` r? ````@Mark-Simulacrum```` cc: ````@tmandry```` ````@wesleywiser````
2021-05-07Rollup merge of #84755 - jyn514:core-links, r=kennytmDylan DPC-10/+14
Allow using `core::` in intra-doc links within core itself I came up with this idea ages ago, but rustdoc used to ICE on it. Now it doesn't. Helps with https://github.com/rust-lang/rust/issues/73445. Doesn't fix it completely since `extern crate self as std;` in std still gives strange errors.
2021-05-07Rollup merge of #84734 - tmandry:compiletest-needs-unwind, r=Mark-SimulacrumDylan DPC-8/+44
Add `needs-unwind` and beginning of support for testing `panic=abort` std to compiletest For the Fuchsia platform we build libstd with `panic=abort` and would like a way to run tests with that enabled. This adds low-level support for this directly to compiletest. In the future I'd like to add high-level support in rustbuild, e.g. having target-specific flags that allow configuring a panic strategy. (Side note: It would be nice if we could also build multiple configurations for the same target, but I'm getting ahead of myself.) This plus #84500 have everything that's needed to get ui tests passing on fuchsia targets. Part of #84766. Note that this change only includes the header on tests which need an unwinder to _build_, not those which need it to _run_. r? ````@Mark-Simulacrum````
2021-05-07Rollup merge of #84728 - camelid:sized-param-sugg-test, r=Mark-SimulacrumDylan DPC-0/+88
Add test for suggestion to borrow unsized function parameters Closes #82820. This is a regression test for #82820. This test case is included in more general tests, but I think the error regressed because there were a bunch of other diagnostic changes in the test that obscured this regression. Hopefully, having a test specific to the suggestion, and running rustfix for the test, will prevent this error from regressing in the future.
2021-05-07Rollup merge of #84500 - tmandry:compiletest-run-flag, r=Mark-SimulacrumDylan DPC-16/+93
Add --run flag to compiletest This controls whether run-* tests actually get run. r? ```@Mark-Simulacrum```
2021-05-07Rollup merge of #84409 - mzohreva:mz/tls-dtors-before-join, r=jethrogbDylan DPC-10/+173
Ensure TLS destructors run before thread joins in SGX The excellent test is from ```@jethrogb``` For context see: https://github.com/rust-lang/rust/pull/83416#discussion_r617282907
2021-05-06Auto merge of #84806 - Mark-Simulacrum:try-start-entry, r=cjgillotbors-101/+111
Streamline try_start code This shifts some branches around and avoids interleaving parallel and non-parallel versions of the function too much.
2021-05-06Auto merge of #79930 - tgnottingham:bufwriter_performance, r=m-ou-sebors-39/+178
Optimize BufWriter
2021-05-06Add test for suggestion to borrow unsized function parametersCamelid-0/+88
This is a regression test for #82820. This test case is included in more general tests, but I think the error regressed because there were a bunch of other diagnostic changes in the test that obscured this regression. Hopefully, having a test specific to the suggestion, and running rustfix for the test, will prevent this error from regressing in the future.
2021-05-06Auto merge of #84559 - jackh726:issue-84398, r=nikomatsakisbors-1/+31
Deduplicate ParamCandidates with the same value except for bound vars Fixes #84398 This is kind of a hack. I wonder if we can get other types of candidates that are the same except for bound vars. This won't be a problem with Chalk, since we don't really need to know that there are two different "candidates" if they both give the same final substitution. r? `@nikomatsakis`
2021-05-06join_orders_after_tls_destructors: ensure thread 2 is launched before thread ↵Mohsen Zohrevandi-8/+9
1 enters TLS destructors
2021-05-06Auto merge of #84982 - Dylan-DPC:rollup-q4cbec2, r=Dylan-DPCbors-293/+899
Rollup of 8 pull requests Successful merges: - #83507 (Implement RFC 2951: Native link modifiers) - #84328 (Stablize {HashMap,BTreeMap}::into_{keys,values}) - #84712 (Simplify chdir implementation and minimize unsafe block) - #84851 (:arrow_up: rust-analyzer) - #84923 (Only compute Obligation `cache_key` once in `register_obligation_at`) - #84945 (E0583: Include secondary path in error message) - #84949 (Fix typo in `MaybeUninit::array_assume_init` safety comment) - #84950 (Revert PR 83866) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-05-06outdated commentlcnr-2/+0
2021-05-06Pick candidate with fewer bound varsJack Huey-5/+5
2021-05-06remove unused variantlcnr-6/+0
2021-05-06Rollup merge of #84950 - pietroalbini:revert-3478f83c0, r=Mark-SimulacrumDylan DPC-47/+8
Revert PR 83866 https://github.com/rust-lang/rust/pull/83866 caused multiple test failures when Rust's channel is changed from nightly to anything else. The PR will have to be landed again after the test suite is fixed. The two kinds of test failures were: * Rustdoc tests failed because the links in the generated HTML didn't point at nightly anymore, see https://github.com/rust-lang/rust/pull/84909#issuecomment-832028701 * Rustdoc UI tests failed because the links included in error messages didn't point at nightly anymore, see https://github.com/rust-lang/rust/pull/84909#issuecomment-832517722 r? ``@Mark-Simulacrum`` cc ``@jyn514``
2021-05-06Rollup merge of #84949 - sdroege:maybe-unint-typo, r=m-ou-seDylan DPC-1/+1
Fix typo in `MaybeUninit::array_assume_init` safety comment And also add backticks around `MaybeUninit`.
2021-05-06Rollup merge of #84945 - fee1-dead:E0583-better-message, r=petrochenkovDylan DPC-12/+13
E0583: Include secondary path in error message Fixes #84819.
2021-05-06Rollup merge of #84923 - estebank:as_cache_key-once, r=petrochenkovDylan DPC-3/+4
Only compute Obligation `cache_key` once in `register_obligation_at`
2021-05-06Rollup merge of #84851 - lnicola:rust-analyzer-2021-05-03, r=jonas-schievinkDylan DPC-21/+15
:arrow_up: rust-analyzer
2021-05-06Rollup merge of #84712 - joshtriplett:simplify-chdir, r=yaahcDylan DPC-5/+3
Simplify chdir implementation and minimize unsafe block
2021-05-06Rollup merge of #84328 - Folyd:stablize_map_into_keys_values, r=m-ou-seDylan DPC-34/+26
Stablize {HashMap,BTreeMap}::into_{keys,values} I would propose to stabilize `{HashMap,BTreeMap}::into_{keys,values}`( aka. `map_into_keys_values`). Closes #75294.
2021-05-06Rollup merge of #83507 - luqmana:native-link-modifiers, r=petrochenkovDylan DPC-170/+829
Implement RFC 2951: Native link modifiers A first attempt at implementing https://github.com/rust-lang/rfcs/pull/2951 / https://github.com/rust-lang/compiler-team/issues/356. Tracking Issue: https://github.com/rust-lang/rust/issues/81490 Introduces feature flags for the general syntax (`native_link_modifiers`) and each modifier (`native_link_modifiers_{as_needed,bundle,verbatim,whole_archive}`). r? `@petrochenkov`
2021-05-06Auto merge of #84965 - the8472:lazy-delayed-diagnostics, r=Mark-Simulacrumbors-5/+22
lazify backtrace formatting for delayed diagnostics Formatting backtraces causes debug info to be parsed, which is superfluous work if the delayed bugs get cleared later. Lazifying them results in these speedups for the UI testsuite: | | debuginfo = 0 | debuginfo = 1 | debuginfo = 2 | |-------|---------------|---------------|---------------| | eager | 31.59s | 37.55s | 42.64s | | lazy | 30.44s | 30.86s | 34.07s |
2021-05-06Auto merge of #84468 - iladin:iladin/fix-84467, r=petrochenkovbors-2/+4
Fix#84467 linker_args with --target=sparcv9-sun-solaris Trying to cross-compile for sparcv9-sun-solaris getting a error message for -zignore Introduced when -z -ignore was seperated here 22d0ab0 No formatting done Reproduce ``` bash rustup target add sparcv9-sun-solaris cargo new --bin hello && cd hello && cargo run --target=sparcv9-sun-solaris ``` config.toml [target.sparcv9-sun-solaris] linker = "gcc"
2021-05-06Auto merge of #84266 - QuiltOS:statically-disallow-global-oom-handling, ↵bors-57/+326
r=Mark-Simulacrum alloc: Add unstable Cfg feature `no-global_oom_handling For certain sorts of systems, programming, it's deemed essential that all allocation failures be explicitly handled where they occur. For example, see Linus Torvald's opinion in [1]. Merely not calling global panic handlers, or always `try_reserving` first (for vectors), is not deemed good enough, because the mere presence of the global OOM handlers is burdens static analysis. One option for these projects to use rust would just be to skip `alloc`, rolling their own allocation abstractions. But this would, in my opinion be a real shame. `alloc` has a few `try_*` methods already, and we could easily have more. Features like custom allocator support also demonstrate and existing to support diverse use-cases with the same abstractions. A natural way to add such a feature flag would a Cargo feature, but there are currently uncertainties around how std library crate's Cargo features may or not be stable, so to avoid any risk of stabilizing by mistake we are going with a more low-level "raw cfg" token, which cannot be interacted with via Cargo alone. Note also that since there is no notion of "default cfg tokens" outside of Cargo features, we have to invert the condition from `global_oom_handling` to to `not(no_global_oom_handling)`. This breaks the monotonicity that would be important for a Cargo feature (i.e. turning on more features should never break compatibility), but it doesn't matter for raw cfg tokens which are not intended to be "constraint solved" by Cargo or anything else. To support this use-case we create a new feature, "global-oom-handling", on by default, and put the global OOM handler infra and everything else it that depends on it behind it. By default, nothing is changed, but users concerned about global handling can make sure it is disabled, and be confident that all OOM handling is local and explicit. For this first iteration, non-flat collections are outright disabled. `Vec` and `String` don't yet have `try_*` allocation methods, but are kept anyways since they can be oom-safely created "from parts", and we hope to add those `try_` methods in the future. [1]: https://lore.kernel.org/lkml/CAHk-=wh_sNLoz84AUUzuqXEsYH35u=8HV3vK-jbRbJ_B-JjGrg@mail.gmail.com/
2021-05-06Fix up/ignore failing ui tests on fuchsiaTyler Mandry-0/+4
2021-05-06Support multi target-rustcflags for -Zpanic-abort-testsTyler Mandry-5/+5
I just need this until rustbuild supports -Cpanic=abort std directly.
2021-05-06Add needs-unwind to testsTyler Mandry-1/+9
2021-05-06compiletest: Add --target-panic, needs-unwindTyler Mandry-2/+26
2021-05-06E0583: Include secondary path in error messageDeadbeef-12/+13
2021-05-05Implement RFC 2951: Native link modifiersLuqman Aden-170/+829
This commit implements both the native linking modifiers infrastructure as well as an initial attempt at the individual modifiers from the RFC. It also introduces a feature flag for the general syntax along with individual feature flags for each modifier.
2021-05-05lazify backtrace formatting for delayed diagnosticsThe8472-5/+22
This defers backtrace formatting to the point where we actually want to flush delayed diagnostics. If they are discarded before that point then we can avoid invoking the backtrace formatting machinery which will parse debug info and symbol tables. for debuginfo=2 this leads to a 20% walltime reduction of the UI testsuite
2021-05-05alloc: Add unstable Cfg feature `no-global_oom_handling`John Ericson-27/+326
For certain sorts of systems, programming, it's deemed essential that all allocation failures be explicitly handled where they occur. For example, see Linus Torvald's opinion in [1]. Merely not calling global panic handlers, or always `try_reserving` first (for vectors), is not deemed good enough, because the mere presence of the global OOM handlers is burdens static analysis. One option for these projects to use rust would just be to skip `alloc`, rolling their own allocation abstractions. But this would, in my opinion be a real shame. `alloc` has a few `try_*` methods already, and we could easily have more. Features like custom allocator support also demonstrate and existing to support diverse use-cases with the same abstractions. A natural way to add such a feature flag would a Cargo feature, but there are currently uncertainties around how std library crate's Cargo features may or not be stable, so to avoid any risk of stabilizing by mistake we are going with a more low-level "raw cfg" token, which cannot be interacted with via Cargo alone. Note also that since there is no notion of "default cfg tokens" outside of Cargo features, we have to invert the condition from `global_oom_handling` to to `not(no_global_oom_handling)`. This breaks the monotonicity that would be important for a Cargo feature (i.e. turning on more features should never break compatibility), but it doesn't matter for raw cfg tokens which are not intended to be "constraint solved" by Cargo or anything else. To support this use-case we create a new feature, "global-oom-handling", on by default, and put the global OOM handler infra and everything else it that depends on it behind it. By default, nothing is changed, but users concerned about global handling can make sure it is disabled, and be confident that all OOM handling is local and explicit. For this first iteration, non-flat collections are outright disabled. `Vec` and `String` don't yet have `try_*` allocation methods, but are kept anyways since they can be oom-safely created "from parts", and we hope to add those `try_` methods in the future. [1]: https://lore.kernel.org/lkml/CAHk-=wh_sNLoz84AUUzuqXEsYH35u=8HV3vK-jbRbJ_B-JjGrg@mail.gmail.com/
2021-05-05Remote test for alloc `extern_crate` feature.John Ericson-30/+0
This functionality was removed in 45bf1ed1a1123122ded05ae2eedaf0f190e52726, but the test was left by mistake.
2021-05-05Auto merge of #84956 - RalfJung:rollup-m70mx2n, r=RalfJungbors-123/+362
Rollup of 11 pull requests Successful merges: - #83553 (Update `ptr` docs with regards to `ptr::addr_of!`) - #84183 (Update RELEASES.md for 1.52.0) - #84709 (Add doc alias for `chdir` to `std::env::set_current_dir`) - #84803 (Reduce duplication in `impl_dep_tracking_hash` macros) - #84808 (Account for unsatisfied bounds in E0599) - #84843 (use else if in std library ) - #84865 (rustbuild: Pass a `threads` flag that works to windows-gnu lld) - #84878 (Clarify documentation for `[T]::contains`) - #84882 (platform-support: Center the contents of the `std` and `host` columns) - #84903 (Remove `rustc_middle::mir::interpret::CheckInAllocMsg::NullPointerTest`) - #84913 (Do not ICE on invalid const param) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-05-05Update highlight testsGuillaume Gomez-11/+16
2021-05-05Rollup merge of #84913 - estebank:issue-84831, r=varkorRalf Jung-1/+54
Do not ICE on invalid const param When encountering a path that can't have generics, do not call `generics_of`. This would happen when writing something like `path::this_is_a_mod<const_val>`. Fix #84831.
2021-05-05Rollup merge of #84903 - hyd-dev:dead-check-in-alloc-msg, r=RalfJungRalf Jung-5/+0
Remove `rustc_middle::mir::interpret::CheckInAllocMsg::NullPointerTest` Removing it per https://github.com/rust-lang/rust/pull/84842#discussion_r625589674: it's a dead enum variant. Note that `PointerArithmeticTest` also seems dead: ``` $ rg -F PointerArithmeticTest -C5 compiler/rustc_middle/src/mir/interpret/error.rs 169- 170-/// Details of why a pointer had to be in-bounds. 171-#[derive(Debug, Copy, Clone, TyEncodable, TyDecodable, HashStable)] 172-pub enum CheckInAllocMsg { 173- MemoryAccessTest, 174: PointerArithmeticTest, 175- InboundsTest, 176-} 177- 178-impl fmt::Display for CheckInAllocMsg { 179- /// When this is printed as an error the context looks like this -- 182- write!( 183- f, 184- "{}", 185- match *self { 186- CheckInAllocMsg::MemoryAccessTest => "memory access", 187: CheckInAllocMsg::PointerArithmeticTest => "pointer arithmetic", 188- CheckInAllocMsg::InboundsTest => "inbounds test", 189- } 190- ) 191- } 192-} ``` Not sure if that is also desirable to be removed, however.
2021-05-05Rollup merge of #84882 - joshtriplett:platform-support-formatting, r=Dylan-DPCRalf Jung-2/+2
platform-support: Center the contents of the `std` and `host` columns Minor formatting improvement.
2021-05-05Rollup merge of #84878 - jimblandy:contains-doc-fix, r=joshtriplettRalf Jung-2/+3
Clarify documentation for `[T]::contains` Change the documentation to correctly characterize when the suggested alternative to `contains` applies, and correctly explain why it works. Fixes #84877
2021-05-05Rollup merge of #84865 - petrochenkov:llthread, r=Mark-SimulacrumRalf Jung-8/+15
rustbuild: Pass a `threads` flag that works to windows-gnu lld MinGW driver for COFF LLD doesn't currently translate GNU-style `--threads=N` to native `/threads:N`, so we have to pass the option in its native form to avoid an error. Also pass the `threads` flag to lld-link (windows-msvc lld) as well.
2021-05-05Rollup merge of #84843 - wcampbell0x2a:use-else-if-let, r=dtolnayRalf Jung-6/+4
use else if in std library Decreases indentation and improves readability