about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2020-10-05Auto merge of #77557 - Dylan-DPC:rollup-aib9ptp, r=Dylan-DPCbors-442/+1154
Rollup of 11 pull requests Successful merges: - #75853 (Use more intra-doc-links in `core::fmt`) - #75928 (Remove trait_selection error message in specific case) - #76329 (Add check for doc alias attribute at crate level) - #77219 (core::global_allocator docs link to std::alloc::GlobalAlloc) - #77395 (BTreeMap: admit the existence of leaf edges in comments) - #77407 (Improve build-manifest to work with the improved promote-release) - #77426 (Include scope id in SocketAddrV6::Display) - #77439 (Fix missing diagnostic span for `impl Trait` with const generics, and add various tests for `min_const_generics` and `const_generics`) - #77471 (BTreeMap: refactoring around edges, missed spots) - #77512 (Allow `Abort` terminators in all const-contexts) - #77514 (Replace some once(x).chain(once(y)) with [x, y] IntoIter) Failed merges: r? `@ghost`
2020-10-05Auto merge of #77466 - Aaron1011:reland-drop-tree, r=matthewjasperbors-1979/+1710
Re-land PR #71840 (Rework MIR drop tree lowering) PR https://github.com/rust-lang/rust/pull/71840 was reverted in https://github.com/rust-lang/rust/pull/72989 to fix an LLVM error (https://github.com/rust-lang/rust/issues/72470). That LLVM error no longer occurs with the recent upgrade to LLVM 11 (https://github.com/rust-lang/rust/pull/73526), so let's try re-landing this PR. I've cherry-picked the commits from the original PR (with the exception of the commit blessing test output), making as few modifications as possible. I addressed the rebase fallout in separate commits on top of those. r? `@matthewjasper`
2020-10-05Rollup merge of #77512 - ecstatic-morse:const-checking-allow-abort, r=RalfJungDylan DPC-0/+51
Allow `Abort` terminators in all const-contexts We never unwind during const-eval, so we basically have these semantics already. Also I just figured out that these only appear along the cleanup path, which doesn't get const-checked. In other words, this doesn't actually change behavior: the `check-pass` test I added compiles just fine on nightly. r? @RalfJung cc @rust-lang/wg-const-eval
2020-10-05Rollup merge of #77439 - varkor:min_const_generics-tests, r=lcnr,estebankDylan DPC-62/+623
Fix missing diagnostic span for `impl Trait` with const generics, and add various tests for `min_const_generics` and `const_generics` Closes https://github.com/rust-lang/rust/issues/61410. Adds `min_const_generics` tests for: - https://github.com/rust-lang/rust/issues/73727 - https://github.com/rust-lang/rust/issues/72293 - https://github.com/rust-lang/rust/issues/67375 - https://github.com/rust-lang/rust/issues/75153 - https://github.com/rust-lang/rust/issues/71922 - https://github.com/rust-lang/rust/issues/69913 - https://github.com/rust-lang/rust/issues/67945 - https://github.com/rust-lang/rust/issues/69239 Adds `const_generics` tests for: - https://github.com/rust-lang/rust/issues/67375 - https://github.com/rust-lang/rust/issues/75153 - https://github.com/rust-lang/rust/issues/71922 - https://github.com/rust-lang/rust/issues/69913 - https://github.com/rust-lang/rust/issues/67945 - https://github.com/rust-lang/rust/issues/69239 (I only added separate `min_const_generics` and `const_generics` tests if they were handled differently by the two features.) We need to figure out how to deduplicate when `const_generics` is stabilised, but we can discuss that later. For now, we should be checking neither feature breaks, so require regression tests for both. I've given them identical names when I've added both, which should make it easier to spot them later. r? @lcnr
2020-10-05Rollup merge of #76329 - GuillaumeGomez:doc-alias-crate-level, r=matthewjasperDylan DPC-380/+465
Add check for doc alias attribute at crate level Fixes #76298, #64734, #69365. r? @ollie27
2020-10-05Rollup merge of #75928 - JulianKnodt:non_utf8, r=estebankDylan DPC-0/+15
Remove trait_selection error message in specific case In the case that a trait is not implemented for an ADT with type errors, cancel the error. Fixes #75627
2020-10-04Auto merge of #77023 - HeroicKatora:len-missed-optimization, r=Mark-Simulacrumbors-0/+24
Hint the maximum length permitted by invariant of slices One of the safety invariants of references, and in particular of references to slices, is that they may not cover more than `isize::MAX` bytes. The unsafe `from_raw_parts` constructors of slices explicitly requires the caller to guarantee this fact. Violating it would also be UB with regards to the semantics of generated llvm code. This effectively bounds the length of a (non-ZST) slice from above by a compile time constant. But when the length is loaded from a function argument it appears llvm is not aware of this requirement. The additional value range assertions allow some further elision of code branches, including overflow checks, especially in the presence of artithmetic on the indices. This may have a performance impact, adding more code to a common method but allowing more optimization. I'm not quite sure, is the Rust side of const-prop strong enough to elide the irrelevant match branches? Fixes: #67186
2020-10-04But whateverecstatic-morse-0/+1
2020-10-04Bless more test outputAaron Hill-973/+639
2020-10-04Assume slice len is bounded by allocation sizeAndreas Molzer-0/+24
Uses assume to check the length against a constant upper bound. The inlined result then informs the optimizer of the sound value range. This was tried with unreachable_unchecked before which introduces a branch. This has the advantage of not being executed in sound code but complicates basic blocks. It resulted in ~2% increased compile time in some worst cases. Add a codegen test for the assumption, testing the issue from #67186
2020-10-04Rollup merge of #77504 - Amanieu:select_simd_bitmask, r=ecstatic-morseJonas Schievink-5/+30
Support vectors with fewer than 8 elements for simd_select_bitmask Resolves the issue raised here: https://github.com/rust-lang/stdarch/issues/310#issuecomment-693730094
2020-10-04Rollup merge of #77368 - est31:apfloat_fix, r=varkorJonas Schievink-0/+24
Backport LLVM apfloat commit to rustc_apfloat Backports LLVM commit: https://github.com/llvm/llvm-project/commit/e34bd1e0b03d20a506ada156d87e1b3a96d82fa2 Fixes #69532
2020-10-04Apply suggestions from reviewAaron Hill-1/+1
Co-authored-by: matthewjasper <20113453+matthewjasper@users.noreply.github.com>
2020-10-04Bless mir-opt testsAaron Hill-1003/+827
2020-10-04Add regression test for issue #72470Aaron Hill-0/+241
This was fixed with the upgrade to LLVM 11 in #73526. It seems extremely unlikey that this exact issue will ever reoccur, since slight modifications to the code caused the crash to stop happening. However, it can't hurt to have a test for it.
2020-10-04Defer creating drop trees in MIR lowering until leaving that scopeMatthew Jasper-3/+3
2020-10-04Enforce crate level attributes checksGuillaume Gomez-350/+319
2020-10-04Auto merge of #76448 - haraldh:default_alloc_error_handler_reduced, r=Amanieubors-2/+187
Implement Make `handle_alloc_error` default to panic (for no_std + liballoc) Related: https://github.com/rust-lang/rust/issues/66741 Guarded with `#![feature(default_alloc_error_handler)]` a default `alloc_error_handler` is called, if a custom allocator is used and no other custom `#[alloc_error_handler]` is defined.
2020-10-04Rollup merge of #77469 - camelid:rustdoc-better-failed-res-error, r=jyn514Yuki Okushi-35/+35
Improve rustdoc error for failed intra-doc link resolution The previous error was confusing since it made it sound like you can't link to items that are defined outside the current module. Also suggested importing the item. r? @jyn514
2020-10-04Rollup merge of #77468 - camelid:fix-test-name, r=Dylan-DPCYuki Okushi-0/+0
Fix test name Remove trailing `-`.
2020-10-04Rollup merge of #77419 - GuillaumeGomez:create-e0777, r=jyn514Yuki Okushi-0/+28
Create E0777 error code for invalid argument in derive The second commit is to fix a nit reported by @jyn514 [here](https://github.com/rust-lang/rust/pull/76406/files#r485186592).
2020-10-04Rollup merge of #77388 - JohnTitor:add-tests, r=Dylan-DPCYuki Okushi-0/+77
Add some regression tests Closes #66501 Closes #68951 Closes #72565 Closes #74244 Closes #75299 The first issue is fixed in 1.43.0, other issues are fixed in the recent nightly.
2020-10-04Rollup merge of #76768 - workingjubilee:reject-oob-shuffles, r=ralfjungYuki Okushi-0/+267
Test and reject out-of-bounds shuffle vectors Fixes #73542.
2020-10-04Rollup merge of #75699 - notriddle:drop-bounds-lint, r=petrochenkovYuki Okushi-0/+83
Uplift drop-bounds lint from clippy Bounds on `T: Drop` do nothing, so they should warn.
2020-10-03Ensure that the const-eval engine handles `#[unwind(aborts)]`Dylan MacKenzie-0/+33
2020-10-03Add check-pass test for `#[unwind(aborts)]` on a `const fn`Dylan MacKenzie-0/+17
2020-10-03Support vectors with fewer than 8 elements for simd_select_bitmaskAmanieu d'Antras-5/+30
2020-10-03Strenghten tests for crate-level attributes checkGuillaume Gomez-18/+107
2020-10-03Run attributes check at crate levelGuillaume Gomez-294/+295
2020-10-03Ensure that the error isn't displayed more than onceGuillaume Gomez-1/+3
2020-10-03Add test for #[doc(alias = "...")] at crate levelGuillaume Gomez-0/+24
2020-10-03Flatten arrows with further commentJubilee Young-5/+6
2020-10-03Add `const_generics` test for `impl-trait-with-const-arguments`varkor-2/+14
2020-10-03Move testsvarkor-148/+0
2020-10-03Add tests for `const_generics`varkor-21/+392
2020-10-03Replace "non trivial" with "non-trivial"varkor-82/+82
2020-10-02Improve error messagesCamelid-35/+35
2020-10-02Macro-expand test to cover all possible lanesJubilee Young-15/+249
2020-10-02Use old error when there's partial resolutionCamelid-4/+4
The new error was confusing when there was partial resolution (something like `std::io::nonexistent`); the old one is better for those cases.
2020-10-03Rollup merge of #77452 - Mark-Simulacrum:fix-symbol-v0, r=eddybJonas Schievink-0/+18
Permit ty::Bool in const generics for v0 mangling This should unbreak using new-symbol-mangling = true in config.toml (once it lands in beta anyway). Fixes #76365 (well, it will, but seems fine to close as soon as we have support) r? @eddyb (for mangling) but I'm okay with some other reviewer too :)
2020-10-03Rollup merge of #77421 - petrochenkov:globtravel, r=nagisaJonas Schievink-5/+39
Revert "resolve: Avoid "self-confirming" import resolutions in one more case" And remove the assert that https://github.com/rust-lang/rust/pull/70236 tried to avoid instead. Closes https://github.com/rust-lang/rust/issues/74556.
2020-10-03Rollup merge of #77251 - dtolnay:drop, r=Aaron1011Jonas Schievink-13/+72
Bypass const_item_mutation if const's type has Drop impl Follow-up to #75573. This PR disables the const_item_mutation lint in cases that the const has a Drop impl which observes the mutation. ```rust struct Log { msg: &'static str } const LOG: Log = Log { msg: "" }; impl Drop for Log { fn drop(&mut self) { println!("{}", self.msg); } } LOG.msg = "wow"; // prints "wow" ``` r? @Aaron1011
2020-10-03Rollup merge of #76745 - workingjubilee:move-wrapping-tests, r=matkladJonas Schievink-77/+0
Move Wrapping<T> ui tests into library Part of #76268 r? @matklad
2020-10-02Remove unhelpful help messageCamelid-63/+19
2020-10-02Improve rustdoc error for failed intra-doc link resolutionCamelid-54/+98
The previous error was confusing since it made it sound like you can't link to items that are defined outside the current module. Also suggested importing the item.
2020-10-02Fix test nameCamelid-0/+0
Remove trailing `-`.
2020-10-02Auto merge of #77462 - jonas-schievink:rollup-m0rqdh5, r=jonas-schievinkbors-8/+156
Rollup of 12 pull requests Successful merges: - #76101 (Update RELEASES.md for 1.47.0) - #76739 (resolve: prohibit anon const non-static lifetimes) - #76811 (Doc alias name restriction) - #77405 (Add tracking issue of iter_advance_by feature) - #77409 (Add example for iter chain struct) - #77415 (Better error message for `async` blocks in a const-context) - #77423 (Add `-Zprecise-enum-drop-elaboration`) - #77432 (Use posix_spawn on musl targets) - #77441 (Fix AVR stack corruption bug) - #77442 (Clean up on example doc fixes for ptr::copy) - #77444 (Fix span for incorrect pattern field and add label) - #77453 (Stop running macOS builds on Azure Pipelines) Failed merges: r? `@ghost`
2020-10-02Rollup merge of #77444 - estebank:pat-field-label, r=davidtwcoJonas Schievink-6/+14
Fix span for incorrect pattern field and add label Address #73750.
2020-10-02Rollup merge of #77415 - ecstatic-morse:const-checking-async-block, r=oli-obkJonas Schievink-0/+16
Better error message for `async` blocks in a const-context Improves the error message for the case in #77361. r? @oli-obk
2020-10-02Rollup merge of #76811 - GuillaumeGomez:doc-alias-name-restriction, ↵Jonas Schievink-2/+78
r=oli-obk,ollie27 Doc alias name restriction Fixes #76705.