about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2022-05-08Auto merge of #96155 - jackh726:param-heuristics-followup, r=estebankbors-225/+192
Followups for method call error change Each commit is self-contained. Fixes most of the followup reviews from that PR. r? `@estebank`
2022-05-07Rollup merge of #96777 - JohnTitor:do-not-run-pass-save-analysis, ↵Matthias Krüger-1/+1
r=Mark-Simulacrum Make the test `check-pass` not to produce a JSON file `run-pass` produces a JSON file when enabling save analysis. The original ICE happened on `cargo check`, moreover **without** the `generic_const_exprs` feature, so `check-pass` should be enough.
2022-05-07Rollup merge of #96726 - oli-obk:no_cross_inference, r=Mark-SimulacrumMatthias Krüger-0/+103
Add regression and bug tests this tracks the behaviour from https://github.com/rust-lang/rust/issues/96572 in our test suite
2022-05-07Rollup merge of #96667 - oli-obk:collect_hidden_types, r=Mark-SimulacrumMatthias Krüger-0/+43
Add regression test fixes #69785 This issue seems to have been fixed in the meantime.
2022-05-07Rollup merge of #96760 - davidtwco:diagnostic-translation-vec, r=oli-obkGuillaume Gomez-0/+8
diagnostics: port more diagnostics to derive + add support for `Vec` fields - Port "unconstrained opaque type" diagnostic to using the derive. - Allow `Vec` fields in diagnostic derive - enables support for diagnostics that have multiple primary spans, or have subdiagnostics repeated at multiple locations. `Vec<..>` fields in the diagnostic derive become loops in the generated code. - Add `create_{err,warning}` - there wasn't a way to create a diagnostic from a struct and not emit it straight away. - Port "explicit generic args w/ impl trait" diagnostic to using the derive. r? `````@oli-obk````` cc `````@pvdrz`````
2022-05-07Rollup merge of #96636 - GuillaumeGomez:fix-jump-to-def-regression, r=notriddleGuillaume Gomez-0/+18
Fix jump to def regression https://github.com/rust-lang/rust/pull/93803 introduced a regression in the "jump to def" feature. This fixes it. Nice side-effect: it adds a new regression test. :) I also used this opportunity to add documentation about this unstable feature in the rustdoc book. cc ``@cjgillot`` r? ``@notriddle``
2022-05-07Rollup merge of #96581 - RalfJung:debug-size-align, r=oli-obkGuillaume Gomez-551/+220
make Size and Align debug-printing a bit more compact In particular in `{:#?}`-mode, these take up a lot of space, so I think this is the better alternative (even though it is a bit longer in `{:?}` mode, I think it is still more readable). We could make it even smaller by deviating further from what the actual code looks like, e.g. via something like `Size(4 bytes)`. Not sure what people would think about that? Cc `````@oli-obk`````
2022-05-07Auto merge of #96804 - compiler-errors:rollup-1mc6aw3, r=compiler-errorsbors-0/+55
Rollup of 8 pull requests Successful merges: - #96660 ([bootstrap] Give a better error when trying to run a path with no registered step) - #96701 (update `jemallocator` example to use 2018 edition import syntax) - #96746 (Fix an ICE on #96738) - #96758 (bootstrap: bsd platform flags for split debuginfo) - #96778 (Remove closures on `expect_local` to apply `#[track_caller]`) - #96781 (Fix an incorrect link in The Unstable Book) - #96783 (Link to correct issue in issue-95034 known-bug) - #96801 (Add regression test for #96319) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-05-06Rollup merge of #96801 - Aaron1011:coinductive-cycle-test, r=compiler-errorsMichael Goulet-0/+34
Add regression test for #96319
2022-05-06Rollup merge of #96783 - aliemjay:typo-issue-95034, r=compiler-errorsMichael Goulet-0/+2
Link to correct issue in issue-95034 known-bug fix a typo is issue number: 94034 -> 95034
2022-05-06Rollup merge of #96746 - JohnTitor:issue-96738, r=petrochenkovMichael Goulet-0/+19
Fix an ICE on #96738 In the block we don't know if the method actually exists thus `expect_local` panics. Fixes #96738 Fixes #96583
2022-05-06Resolve vars before emitting coerce suggestions tooJack Huey-0/+16
2022-05-06Resolve vars in note_type_errJack Huey-129/+134
2022-05-06Add regression test for #96319Aaron Hill-0/+34
2022-05-07Auto merge of #96531 - kckeiks:remove-item-like-visitor-from-rustc-typeck, ↵bors-2/+2
r=cjgillot Remove ItemLikeVisitor impls from rustc_typeck Issue #95004 cc `@cjgillot`
2022-05-06Point at closure args tooJack Huey-3/+42
2022-05-06Remove previously deleted test filesJack Huey-93/+0
2022-05-06Add regression test for jump-to-defGuillaume Gomez-0/+18
2022-05-06Rollup merge of #96772 - ↵Guillaume Gomez-0/+85
TaKO8Ki:suggest-fully-qualified-path-with-appropriate-params, r=compiler-errors Suggest fully qualified path with appropriate params closes #96291
2022-05-06Rollup merge of #96754 - notriddle:notriddle/impl-dups, r=GuillaumeGomezGuillaume Gomez-1/+24
rustdoc: ensure HTML/JS side implementors don't have dups Fixes #94641 Rendered: - https://notriddle.com/notriddle-rustdoc-test/impl-dups/std/iter/trait.Iterator.html - https://notriddle.com/notriddle-rustdoc-test/impl-dups/core/iter/trait.Iterator.html
2022-05-06Rollup merge of #96752 - scottmcm:error-sorting, r=compiler-errorsGuillaume Gomez-3/+3
Put the incompatible_closure_captures lint messages in alphabetical order Looks like they were in hash order before, which was causing me trouble in #94598, so this PR sorts the errors by trait name.
2022-05-06Rollup merge of #96748 - GuillaumeGomez:reexports-in-search, r=notriddleGuillaume Gomez-9/+42
Fixes reexports in search Fixes #96681. At some point we stopped reexporting items in search so this PR fixes it. It also adds a regression test. r? ```@notriddle```
2022-05-06Rollup merge of #96650 - tmiasko:global-asm-sym-fn, r=AmanieuGuillaume Gomez-0/+5
Collect function instance used in `global_asm!` sym operand The constants used in SymFn operands have FnDef type, so the type of the constant identifies the function. Fixes #96623.
2022-05-06Rollup merge of #96590 - notriddle:notriddle/tab-bar-fn-search, ↵Guillaume Gomez-23/+64
r=GuillaumeGomez,jsha rustdoc: when running a function-signature search, tweak the tab bar # Before ![In Names (7) / In Parameters (0) / In Return types (0)](https://user-images.githubusercontent.com/1593513/166122875-ffdeafe6-8d4d-4e61-84a6-f5986b50ac35.png) # After ![In Function Signature (7)](https://user-images.githubusercontent.com/1593513/166122883-9a3d7515-3235-4ee3-8c4b-5401d109e099.png)
2022-05-06Rollup merge of #96557 - nbdd0121:const, r=oli-obkGuillaume Gomez-5/+83
Allow inline consts to reference generic params Tracking issue: #76001 The RFC says that inline consts cannot reference to generic parameters (for now), same as array length expressions. And expresses that it's desirable for it to reference in-scope generics, when array length expressions gain that feature as well. However it is possible to implement this for inline consts before doing this for all anon consts, because inline consts are only used as values and they won't be used in the type system. So we can have: ```rust fn foo<T>() { let x = [4i32; std::mem::size_of::<T>()]; // NOT ALLOWED (for now) let x = const { std::mem::size_of::<T>() }; // ALLOWED with this PR! let x = [4i32; const { std::mem::size_of::<T>() }]; // NOT ALLOWED (for now) } ``` This would make inline consts super useful for compile-time checks and assertions: ```rust fn assert_zst<T>() { const { assert!(std::mem::size_of::<T>() == 0) }; } ``` This would create an error during monomorphization when `assert_zst` is instantiated with non-ZST `T`s. A error during mono might sound scary, but this is exactly what a "desugared" inline const would do: ```rust fn assert_zst<T>() { struct F<T>(T); impl<T> F<T> { const V: () = assert!(std::mem::size_of::<T>() == 0); } let _ = F::<T>::V; } ``` It should also be noted that the current inline const implementation can already reference the type params via type inference, so this resolver-level restriction is not any useful either: ```rust fn foo<T>() -> usize { let (_, size): (PhantomData<T>, usize) = const { const fn my_size_of<T>() -> (PhantomData<T>, usize) { (PhantomData, std::mem::size_of::<T>()) } my_size_of() }; size } ``` ```@rustbot``` label: F-inline_const
2022-05-06Link to correct issue in issue-95034 testAli MJ Al-Nasrawy-0/+2
2022-05-06remove ItemLikeVisitor impl for InherentCollectMiguel Guarniz-2/+2
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-05-07Make the test `check-pass` not to produce a JSON fileYuki Okushi-1/+1
`run-pass` produces a JSON file when enabling save analysis.
2022-05-07Also suggest calling constructors for external DefIdsYuki Okushi-1/+6
2022-05-06suggest fully qualified path with appropriate paramsTakayuki Maeda-0/+85
2022-05-06Auto merge of #96268 - ↵bors-276/+76
jackh726:remove-mutable_borrow_reservation_conflict-lint, r=nikomatsakis Remove mutable_borrow_reservation_conflict lint and allow the code pattern This was the only breaking issue with the NLL stabilization PR. Lang team decided to go ahead and allow this. r? `@nikomatsakis` Closes #59159 Closes #56254
2022-05-06Add missing newlineMichael Howell-1/+1
2022-05-06Add GUI test for search reexportsGuillaume Gomez-9/+42
2022-05-06bless mir-optRalf Jung-30/+30
2022-05-06make Size and Align debug-printing a bit more compactRalf Jung-521/+190
2022-05-06macros: allow `Vec` fields in diagnostic deriveDavid Wood-0/+8
Diagnostics can have multiple primary spans, or have subdiagnostics repeated at multiple locations, so support `Vec<..>` fields in the diagnostic derive which become loops in the generated code. Signed-off-by: David Wood <david.wood@huawei.com>
2022-05-05Rollup merge of #96730 - JohnTitor:unused-lifetimes-tests, r=compiler-errorsMichael Goulet-0/+54
Add a regression test for #64173 and #66152 Closes #64173 Closes #66152 Mixed the code as the root cause seems the same.
2022-05-05Fix test case checking for where the JS goesMichael Howell-1/+1
2022-05-05rustdoc: ensure HTML/JS side implementors don't have dupsMichael Howell-0/+23
2022-05-05Put the 2229 migration errors in alphabetical orderScott McMurray-3/+3
Looks like they were in FxHash order before, so it might just be luck that this used to be consistent across different word lengths.
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-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-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.