about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2022-04-23Auto merge of #90602 - mbartlett21:const-intoiterator, r=oli-obkbors-6/+6
Unstably constify `impl<I: Iterator> IntoIterator for I` This constifies the default `IntoIterator` implementation under the `const_intoiterator_identity` feature. Tracking Issue: #90603
2022-04-23Auto merge of #95971 - workingjubilee:no-weird-fp-in-const, r=oli-obkbors-30/+181
No "weird" floats in const fn {from,to}_bits I suspect this code is subtly incorrect and that we don't even e.g. use x87-style floats in CTFE, so I don't have to guard against that case. A future PR will be hopefully removing them from concern entirely, anyways. But at the moment I wanted to get this rolling because small questions like that one seem best answered by review. r? `@oli-obk` cc `@eddyb` `@thomcc`
2022-04-23Bless incremental tests.Camille GILLOT-24/+20
2022-04-23Auto merge of #96316 - michaelwoerister:debuginfo-fix-unit-msvc, r=wesleywiserbors-0/+71
debuginfo: Emit ZST struct debuginfo for unit type when CPP-like debuginfo is enabled As already discovered in https://github.com/rust-lang/rust/commit/24a728a8eb4832568509eb757c2374934a76cb98, PDB does not play well with custom basic types. This PR extends to the fix to `()`: Instead of a custom basic type, we treat it like an empty tuple (i.e. it is described as a struct which happens to have no fields). Before this change anything with a `()` in it would cause trouble, which is especially bad for `*const ()` and `*mut ()` which are often used for opaque pointers. E.g. the test case added in this PR would look like: ``` 0:000> dx _ref Error: Unable to bind name '_ref' 0:000> dx _ptr Error: Unable to bind name '_ptr' 0:000> dx _local Error: Unable to bind name '_local' 0:000> dx _field,d _field,d [Type: unit_type::_TypeContainingUnitField] [+0x008] _a : 123 [Type: unsigned int] [+0x000] _unit : Unexpected failure to dereference object [+0x000] _b : 456 [Type: unsigned __int64] 0:000> dx ((__int64 *)_ptr),x Error: Unable to bind name '_ptr' ``` With the PR it produces the expected output: ``` 0:000> dx _ref _ref : 0x7ff6f2012230 : () [Type: tuple$<> *] 0:000> dx _ptr _ptr : 0x7e8ddffc20 : () [Type: tuple$<> *] 0:000> dx _local _local : () [Type: tuple$<>] 0:000> dx _field,d _field,d [Type: unit_type::_TypeContainingUnitField] [+0x008] _a : 123 [Type: unsigned int] [+0x000] _unit : () [Type: tuple$<>] [+0x000] _b : 456 [Type: unsigned __int64] 0:000> dx ((__int64 *)_ptr),x ((__int64 *)_ptr),x : 0x7e8ddffc20 : 0x1122334455667788 [Type: __int64 *] ``` r? `@wesleywiser`
2022-04-23Add a couple tests for #90887 fixesAli MJ Al-Nasrawy-0/+48
2022-04-22Rollup merge of #96273 - TaKO8Ki:make-E0117-error-clear, r=davidtwcoMatthias Krüger-28/+28
Make `E0117` error clear closes #96227
2022-04-22Rollup merge of #96272 - tmiasko:validate-uninhabited, r=RalfJungMatthias Krüger-34/+55
Update `validate_uninhabited_zsts.rs` test after MIR building changes to ensure that it still tests validation, instead of failing earlier on during evaluation. r? `@RalfJung`
2022-04-22debuginfo: Emit ZST struct debuginfo for unit type when CPP-like debuginfo ↵Michael Woerister-0/+71
is enabled (instead of custom basic type).
2022-04-22Auto merge of #96197 - erikdesjardins:scalarpairenum, r=oli-obkbors-0/+774
Mark payload fields of ScalarPair enums as Scalar::Union when they're not always initialized Fixes #96158 r? `@RalfJung`
2022-04-22normalize out pref_align (copied from another test)Erik Desjardins-56/+23
2022-04-22Auto merge of #96144 - c410-f3r:z-errors, r=petrochenkovbors-0/+0
Move some tests to more reasonable places cc #73494 r? `@petrochenkov`
2022-04-21Update `validate_uninhabited_zsts.rs` test after MIR building changesTomasz Miąsko-34/+55
to ensure that it still tests validation, instead of failing earlier on during evaluation.
2022-04-21Move some tests to more reasonable directoriesCaio-0/+0
2022-04-21rustdoc: Unindent doc fragments on `Attributes` constructionVadim Petrochenkov-2/+0
2022-04-21Update run-make test front-files from .woff to .woff2Guillaume Gomez-3/+3
2022-04-21make `E0117` error clearTakayuki Maeda-28/+28
2022-04-20Remove mutable_borrow_reservation_conflict lintJack Huey-276/+76
2022-04-21Rollup merge of #96236 - Aaron1011:constraint-debug, r=jackh726Dylan DPC-58/+30
Add an explicit `Span` field to `OutlivesConstraint` Previously, we would retrieve the span from the `Body` using the `locations` field. However, we may end up changing the `locations` field when moving a constraint from a promoted to a different body. We now store the original `Span` in a dedication field, so that changes to the `locations` do not affect the quality of our diagnostics.
2022-04-21Rollup merge of #90630 - GuillaumeGomez:improve-rustdoc-search, r=notriddleDylan DPC-11/+1140
Create real parser for search queries You can test it [here](https://rustdoc.crud.net/imperio/improve-rustdoc-search/std/index.html). This PR adds a real parser for the query engine in rustdoc. The parser is quite simple but it allows to makes query handling much easier. I added a new testsuite to ensure it works as expected and ran fuzzing checks on it for a few hours without problems. So about the parser: as you can see in the screenshot, it handles recursive generics parsing. It also allows to set which item should use exact matching by adding double-quotes around it (look for `exact_search` in the screenshot). Now about the query engine itself: I simplified it a lot thanks to the parsed query. It behaves mostly the same when there is only one argument, but is much more powerful when there are more than one. When making this change, we also removed the support for multi-query. PS: A big part of the PR is tests and test-related code. :) r? `@camelid`
2022-04-20Rollup merge of #93313 - tmiasko:uninhabited, r=tmandryDylan DPC-93/+154
Check if call return type is visibly uninhabited when building MIR The main motivation behind the change is to expose information about diverging calls to the generator transform and match the precision of drop range tracking which already understands that call expressions with visibly uninhabited types diverges. This change should also accept strictly more programs than before. That is programs that were previously rejected due to errors raised by control-flow sensitive checks in a code that is no longer considered reachable. Fixes #93161.
2022-04-20Auto merge of #96135 - petrochenkov:doclink6, r=GuillaumeGomezbors-17/+27
rustdoc: Optimize and refactor doc link resolution One more subset of https://github.com/rust-lang/rust/pull/94857 that should bring perf improvements rather than regressions + a couple more optimizations on top of it. It's better to read individual commits and their descriptions to understand the changes. The `may_have_doc_links` optimization is not *very* useful here, but it's much more important for https://github.com/rust-lang/rust/pull/94857. Closes https://github.com/rust-lang/rust/issues/96079
2022-04-20Drop inaccurate commentNikita Popov-5/+1
The linked issue has an accurate description of the situation, drop the inaccurate comment.
2022-04-19Add an explicit `Span` field to `OutlivesConstraint`Aaron Hill-58/+30
Previously, we would retrieve the span from the `Body` using the `locations` field. However, we may end up changing the `locations` field when moving a constraint from a promoted to a different body. We now store the original `Span` in a dedication field, so that changes to the `locations` do not affect the quality of our diagnostics.
2022-04-19Update line numbers in the expected output.Dan Gohman-2/+2
2022-04-19Add ignore-windows to a test.Dan Gohman-0/+1
This test has an expected stderr containing text like this: ``` help: the following other types implement trait `std::error::Error`: ... and 43 others ``` However, the number 43 is platform-specific; on Windows, there are two additional types, `InvalidHandleError` and `NullHandleError`, and the number of 45. So for now, disable this test on Windows.
2022-04-19Rollup merge of #95813 - Urgau:rustdoc-where-clause-space, r=GuillaumeGomezDylan DPC-0/+17
Remove extra space before a where clause Remove extra space before where clause in the generated documentation. The fix is to move the space before the break-line so that it doesn't appear visually but is still here. Removing it completely would create things like this `impl<D> Delta<D>where D: MyTrait` (missing a space before the where) which I don't think we want. Added two regression test, first one test that the `<br>` is after the space and the second check that the `<br>` is before the spaces. Before: ![image](https://user-images.githubusercontent.com/3616612/162475212-d4bb6727-ed66-4a55-a4a2-4f55189bf8bd.png) After: ![image](https://user-images.githubusercontent.com/3616612/162475467-508fd082-60a7-4a8c-b693-8b188e8843e6.png) r? ``@GuillaumeGomez``
2022-04-19Rollup merge of #95740 - Amanieu:kreg0, r=nagisaDylan DPC-14/+14
asm: Add a kreg0 register class on x86 which includes k0 Previously we only exposed a kreg register class which excludes the k0 register since it can't be used in many instructions. However k0 is a valid register and we need to have a way of marking it as clobbered for clobber_abi. Fixes #94977
2022-04-19Add regression test for #96079Guillaume Gomez-0/+26
2022-04-19rustc_metadata: Store a flag telling whether an item may have doc links in ↵Vadim Petrochenkov-17/+1
its attributes This should be cheap on rustc side, but it's significant optimization for rustdoc that won't need to decode and process attributes unnecessarily
2022-04-19asm: Add a kreg0 register class on x86 which includes k0Amanieu d'Antras-14/+14
Previously we only exposed a kreg register class which excludes the k0 register since it can't be used in many instructions. However k0 is a valid register and we need to have a way of marking it as clobbered for clobber_abi. Fixes #94977
2022-04-19Don't use new-llvm-pass-manager=no in testNikita Popov-3/+5
2022-04-19Rollup merge of #96122 - ↵Dylan DPC-0/+50
TaKO8Ki:fix-invalid-error-for-suggestion-to-add-slice-in-pattern-matching, r=nagisa Fix an invalid error for a suggestion to add a slice in pattern-matching closes #96103
2022-04-19Rollup merge of #96086 - jsgf:remove-extern-location, r=davidtwcoDylan DPC-186/+0
Remove `--extern-location` and all associated code `--extern-location` was an experiment to investigate the best way to generate useful diagnostics for unused dependency warnings by enabling a build system to identify the corresponding build config. While I did successfully use this, I've since been convinced the alternative `--json unused-externs` mechanism is the way to go, and there's no point in having two mechanisms with basically the same functionality. This effectively reverts https://github.com/rust-lang/rust/pull/72603
2022-04-19Rollup merge of #94493 - ↵Dylan DPC-3/+15
oribenshir:feature/ISSUE-78543_async_fn_in_foreign_crate_diag_2, r=davidtwco Improved diagnostic on failure to meet send bound on future in a foreign crate Provide a better diagnostic on failure to meet send bound on futures in a foreign crate. fixes #78543
2022-04-19Auto merge of #95379 - icewind1991:suggest-associated-type-more, r=jackh726bors-10/+33
show suggestion to replace generic bounds with associated types in more cases Moves the hint to replace generic parameters with associated type bounds from the "not all associated type bounds are specified"(`E0191`) to "to many generic type parameters provided"(`E0107`). Since `E0191` is only emitted in places where all associated types must be specified (when creating `dyn` types), the suggesting is currently not shown for other generic type uses (such as in generic type bounds). With this change the suggesting is always emitted when the number of excess generic parameters matches the number of unbound associated types. Main motivation for the change was a lack of useful suggesting when doing ```rust fn foo<I: Iterator<usize>>(i: I) {} ```
2022-04-18mark payload fields of ScalarPair enums as Scalar::Union when they're not ↵Erik Desjardins-0/+807
always initialized
2022-04-18Update the expected stderr for coerce-issue-49593-box-never.Dan Gohman-2/+2
2022-04-18Update the expected stderr for coerce-issue-49593-box-never.Dan Gohman-2/+2
This test's expected stderr now includes a count of the number of types that implment `Error`. This PR introduces two new types, so increment the number by two.
2022-04-18Correctly handle single `:`Guillaume Gomez-0/+10
2022-04-18Skip broken symbol visibility test in MinGWGary Guo-0/+5
2022-04-18Ignore paths in temporary dir in reproducible build testGary Guo-0/+6
2022-04-18Add a test for issue 47384Gary Guo-0/+32
2022-04-18Add test to ensure that keywords in path are workingGuillaume Gomez-1/+16
2022-04-18Add an extra check over filter typeGuillaume Gomez-0/+60
2022-04-18Fix some corner casesGuillaume Gomez-1/+26
2022-04-18Add more tests for quote errorsGuillaume Gomez-3/+61
2022-04-18Add tests for pathsGuillaume Gomez-0/+20
2022-04-18Handle separators in their own functions and fix missing handling of tabsGuillaume Gomez-0/+216
2022-04-18Improve the BNF description a bit and fix some issuesGuillaume Gomez-22/+157
2022-04-18Forbid rustdoc search query to end with ->Guillaume Gomez-0/+10