about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2022-05-05Auto merge of #96520 - lcnr:general-incoherent-impls, r=petrochenkovbors-0/+226
generalize "incoherent impls" impl for user defined types To allow the move of `trait Error` into core. continues the work from #94963, finishes https://github.com/rust-lang/compiler-team/issues/487 r? `@petrochenkov` cc `@yaahc`
2022-05-06Fix an ICE on #96738Yuki Okushi-0/+14
2022-05-05Allow unused rules in the testsuite where the lint triggersest31-3/+14
2022-05-05Add testsest31-43/+195
Also rename the test files for the unused_macros lint to avoid confusion. The test files now follow a <lint_name><-maybe-decl>.rs scheme.
2022-05-05Auto merge of #96734 - matthiaskrgr:rollup-hng33tb, r=matthiaskrgrbors-64/+163
Rollup of 7 pull requests Successful merges: - #95359 (Update `int_roundings` methods from feedback) - #95843 (Improve Rc::new_cyclic and Arc::new_cyclic documentation) - #96507 (Suggest calling `Self::associated_function()`) - #96635 (Use "strict" mode in JS scripts) - #96673 (Report that opaque types are not allowed in impls even in the presence of other errors) - #96682 (Show invisible delimeters (within comments) when pretty printing.) - #96714 (interpret/validity: debug-check ScalarPair layout information) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-05-05 make `compare_generic_param_kinds` errors consistentEllen-48/+94
2022-05-05rustdoc: add test case assertions for ArrowDown highlight first resultMichael Howell-0/+4
2022-05-05rustdoc: fix keyboard shortcuts and console log on search pageMichael Howell-0/+20
2022-05-05rustdoc: change the "In Function Signatures" to context-sensitiveMichael Howell-4/+12
* If it's just `-> a`, use "In Function Return Types" * If it's just `a b`, use "In Function Parameters" * Otherwise, still use "In Function Signatures"
2022-05-05Use STARTS_WITH, since it's more specificMichael Howell-4/+4
Co-Authored-By: Guillaume Gomez <guillaume1.gomez@gmail.com>
2022-05-05rustdoc: when running a function-signature search, tweak the tab barMichael Howell-23/+32
2022-05-05Rollup merge of #96682 - nnethercote:show-invisible-delims, r=petrochenkovMatthias Krüger-59/+86
Show invisible delimeters (within comments) when pretty printing. Because invisible syntax is really hard to work with! r? `@petrochenkov`
2022-05-05Rollup merge of #96673 - oli-obk:tait_impl_diagnostic, r=petrochenkovMatthias Krüger-5/+10
Report that opaque types are not allowed in impls even in the presence of other errors fixes #96569 before this PR those useful errors were hidden because either `unused parameter` or `only traits defined in the current crate can be implemented for arbitrary types` got emitted first.
2022-05-05Rollup merge of #96507 - TaKO8Ki:suggest-calling-associated-function, r=lcnrMatthias Krüger-0/+67
Suggest calling `Self::associated_function()` closes #96453
2022-05-05update error messages and explicitly mention them in testslcnr-32/+52
2022-05-05Auto merge of #91779 - ridwanabdillahi:natvis, r=michaelwoeristerbors-0/+124
Add a new Rust attribute to support embedding debugger visualizers Implemented [this RFC](https://github.com/rust-lang/rfcs/pull/3191) to add support for embedding debugger visualizers into a PDB. Added a new attribute `#[debugger_visualizer]` and updated the `CrateMetadata` to store debugger visualizers for crate dependencies. RFC: https://github.com/rust-lang/rfcs/pull/3191
2022-05-05exit out of `compare_number_of_generics` earlyEllen-31/+18
2022-05-05 handle mismatched generic parameter kindsEllen-0/+104
2022-05-05Add a regression test for #64173 and #66152Yuki Okushi-0/+54
2022-05-05Add known bug casesOli Scherer-0/+79
2022-05-05forbid empty impls for types with incoherent implslcnr-0/+206
2022-05-05Add regression testsOli Scherer-0/+24
2022-05-05suggest calling `Self::associated_function()`Takayuki Maeda-0/+67
do not suggest when trait_ref is some Update compiler/rustc_resolve/src/late/diagnostics.rs Co-authored-by: lcnr <rust@lcnr.de> use helper struct add a test for functions with some params refactor debug log
2022-05-05Auto merge of #96720 - JohnTitor:rollup-9jaaekr, r=JohnTitorbors-72/+499
Rollup of 7 pull requests Successful merges: - #96603 (Enable full revision in const generics ui tests) - #96616 (Relax memory ordering used in `min_stack`) - #96619 (Relax memory ordering used in SameMutexCheck) - #96628 (Stabilize `bool::then_some`) - #96658 (Move callback to the () => {} syntax.) - #96677 (Add more tests for label-break-value) - #96697 (Enable tracing for all queries) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-05-05Rollup merge of #96677 - jyn514:label-break-value-tests, r=petrochenkovYuki Okushi-1/+208
Add more tests for label-break-value Helps with https://github.com/rust-lang/rust/issues/48594. The tests are adapted from https://github.com/rust-lang/rust/issues/48594#issuecomment-421625182.
2022-05-05Rollup merge of #96603 - Alexendoo:const-generics-tests, r=Mark-SimulacrumYuki Okushi-71/+291
Enable full revision in const generics ui tests The ICEs no longer occur since https://github.com/rust-lang/rust/pull/95776 so the revisions can be reenabled Also adds some regression tests for issues that no longer ICE because of it closes #77357 closes #78180 closes #83993
2022-05-05Auto merge of #96593 - jackh726:issue-93262, r=compiler-errorsbors-1/+56
Revert "Prefer projection candidates instead of param_env candidates for Sized predicates" Fixes #93262 Reopens #89352 This was a hack that seemed to have no negative side-effects at the time. Given that the latter has a workaround and likely less common than the former, it makes sense to revert this change. r? `@compiler-errors`
2022-05-04Auto merge of #96546 - nnethercote:overhaul-MacArgs, r=petrochenkovbors-21/+21
Overhaul `MacArgs` Motivation: - Clarify some code that I found hard to understand. - Eliminate one use of three places where `TokenKind::Interpolated` values are created. r? `@petrochenkov`
2022-05-05Overhaul `MacArgs::Eq`.Nicholas Nethercote-21/+21
The value in `MacArgs::Eq` is currently represented as a `Token`. Because of `TokenKind::Interpolated`, `Token` can be either a token or an arbitrary AST fragment. In practice, a `MacArgs::Eq` starts out as a literal or macro call AST fragment, and then is later lowered to a literal token. But this is very non-obvious. `Token` is a much more general type than what is needed. This commit restricts things, by introducing a new type `MacArgsEqKind` that is either an AST expression (pre-lowering) or an AST literal (post-lowering). The downside is that the code is a bit more verbose in a few places. The benefit is that makes it much clearer what the possibilities are (though also shorter in some other places). Also, it removes one use of `TokenKind::Interpolated`, taking us a step closer to removing that variant, which will let us make `Token` impl `Copy` and remove many "handle Interpolated" code paths in the parser. Things to note: - Error messages have improved. Messages like this: ``` unexpected token: `"bug" + "found"` ``` now say "unexpected expression", which makes more sense. Although arbitrary expressions can exist within tokens thanks to `TokenKind::Interpolated`, that's not obvious to anyone who doesn't know compiler internals. - In `parse_mac_args_common`, we no longer need to collect tokens for the value expression.
2022-05-04Exit before fetching bounds on associated items.Camille GILLOT-0/+16
2022-05-04Only keep predicates on `Self` when checking `dyn TraitAlias`.Camille GILLOT-11/+20
2022-05-04rustdoc-json: Add tests for all three HRTB fieldsMartin Nordholts-4/+42
2022-05-04Auto merge of #94775 - oli-obk:operand_order, r=davidtwcobors-4/+43
Fix constants not getting dropped if part of a diverging expression fixes https://github.com/rust-lang/rust/issues/90762 cc `@RalfJung`
2022-05-04Generate an intermediate temporary for `Drop` constants.Oli Scherer-8/+21
To limit the fallout from this, don't do this for the last (or only) operand in an rvalue.
2022-05-04Rollup merge of #96686 - JohnTitor:impl-trait-tests, r=oli-obkYuki Okushi-0/+123
Add some TAIT-related tests Closes #53398 Closes #58662 Closes #89952 Closes #94429 r? `@oli-obk` as you're familiar with it
2022-05-04Rollup merge of #96679 - ricked-twice:issue-96223-fix, r=jackh726Yuki Okushi-0/+80
Quick fix for #96223. This PR is a quick fix regarding #96223. As mentioned in the issue, others modification could be added to not elide types with bound vars from suggestions. Special thanks to ``@jackh726`` for mentoring and ``@Manishearth`` for minimal test case. r? ``@jackh726``
2022-05-04Rollup merge of #96668 - GuillaumeGomez:fix-rustdoc-ui-flaky-test, ↵Yuki Okushi-1/+2
r=petrochenkov Fix flaky rustdoc-ui test because it did not replace time result As mentioned in https://github.com/rust-lang/rust/pull/93715: a test is flaky because I forgot to replace the time value. This PR fixes it. r? ``@petrochenkov``
2022-05-04Add regression testOli Scherer-0/+26
2022-05-04Revert #92191 Prefer projection candidates instead of param_env candidates ↵Jack Huey-1/+56
for Sized predicates
2022-05-04Auto merge of #96447 - petrochenkov:docregr, r=GuillaumeGomezbors-0/+44
rustdoc: Resolve doc links on fields during early resolution Another subset of https://github.com/rust-lang/rust/pull/94857 which fixes https://github.com/rust-lang/rust/issues/96429. This case regressed in https://github.com/rust-lang/rust/pull/96135 when `may_have_doc_links`-based filtering was introduced. Before that filtering structs could collect traits in scope for their fields, but after the filtering structs won't collect anything if they don't have doc comments on them, so we have to visit fields too.
2022-05-04Auto merge of #96353 - estebank:issue-95413, r=compiler-errorsbors-0/+114
When suggesting to import an item, also suggest changing the path if appropriate When we don't find an item we search all of them for an appropriate import and suggest `use`ing it. This is sometimes done for expressions that have paths with more than one segment. We now also suggest changing that path to work with the `use`. Fix #95413
2022-05-04Add some TAIT-related testsYuki Okushi-0/+123
2022-05-04Show invisible delimeters (within comments) when pretty printing.Nicholas Nethercote-59/+86
2022-05-03Auto merge of #95380 - compiler-errors:unit-destructure-assign, r=nikomatsakisbors-0/+34
Fix unit struct/enum variant in destructuring assignment See https://github.com/rust-lang/rfcs/blob/master/text/2909-destructuring-assignment.md#guide-level-explanation, "including **unit** and tuple structs" Fixes #94319
2022-05-03Taking review hints into account.ricked-twice-8/+7
2022-05-03Quick fix for #96223.ricked-twice-0/+81
2022-05-03Add more tests for label-break-valueJoshua Nelson-1/+208
2022-05-03Fix flaky rustdoc-ui test because it did not replace time resultGuillaume Gomez-1/+2
2022-05-03Add support for a new attribute `#[debugger_visualizer]` to support ↵ridwanabdillahi-0/+124
embedding debugger visualizers into a generated PDB. Cleanup `DebuggerVisualizerFile` type and other minor cleanup of queries. Merge the queries for debugger visualizers into a single query. Revert move of `resolve_path` to `rustc_builtin_macros`. Update dependencies in Cargo.toml for `rustc_passes`. Respond to PR comments. Load visualizer files into opaque bytes `Vec<u8>`. Debugger visualizers for dynamically linked crates should not be embedded in the current crate. Update the unstable book with the new feature. Add the tracking issue for the debugger_visualizer feature. Respond to PR comments and minor cleanups.
2022-05-03Allow inline consts to reference generic paramsGary Guo-5/+83