about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2022-06-27Auto merge of #98221 - cjgillot:single-coh, r=lcnrbors-148/+138
Perform coherence checking per impl. r? `@ghost`
2022-06-26proc_macro: stop using a remote object handle for PunctNika Layzell-1/+1
This greatly reduces round-trips to fetch relevant extra information about the token in proc macro code, and avoids RPC messages to create Punct tokens.
2022-06-27add regression test for #85907Takayuki Maeda-0/+17
2022-06-27Improve derived discriminant testing.Nicholas Nethercote-11/+11
Currently the generated code for methods like `eq`, `ne`, and `partial_cmp` includes stuff like this: ``` let __self_vi = ::core::intrinsics::discriminant_value(&*self); let __arg_1_vi = ::core::intrinsics::discriminant_value(&*other); if true && __self_vi == __arg_1_vi { ... } ``` This commit removes the unnecessary `true &&`, and makes the generating code a little easier to read in the process. It also fixes some errors in comments.
2022-06-27Add a test checking the output of builtin derives.Nicholas Nethercote-0/+1163
2022-06-26compiletest: add issue number param to `known-bug`David Knaack-16/+16
2022-06-26Rollup merge of #98540 - TaKO8Ki:add-regression-test-for-87558, ↵Matthias Krüger-0/+33
r=Mark-Simulacrum Add regression test for #87558 Fixes #87558
2022-06-26Rollup merge of #98538 - TaKO8Ki:add-test-for-issue-91883, r=Mark-SimulacrumMatthias Krüger-0/+68
Add a ui test for issue #91883 closes #91883
2022-06-26Rollup merge of #98535 - GuillaumeGomez:regression-test-92859, r=lcnrMatthias Krüger-0/+24
Add regression test for generic const in rustdoc Fixes #92859. r? ```@lcnr```
2022-06-26Rollup merge of #98428 - davidtwco:translation-derive-typed-identifiers, ↵Matthias Krüger-394/+504
r=oli-obk macros: use typed identifiers in diag and subdiag derive Using typed identifiers instead of strings with the Fluent identifiers in the diagnostic and subdiagnostic derives - this enables the diagnostic derive to benefit from the compile-time validation that comes with typed identifiers, namely that use of a non-existent Fluent identifier will not compile. r? `````@oli-obk`````
2022-06-26Rollup merge of #98297 - GuillaumeGomez:help-pocket-menu, r=notriddleMatthias Krüger-15/+74
Transform help popup into a pocket menu Just like we moved the settings menu into a "pocket menu", it's doing the same to the help popup. You can test it [here](https://rustdoc.crud.net/imperio/help-pocket-menu/doc/foo/index.html) and here is a screenshot: ![Screenshot from 2022-06-20 20-58-29](https://user-images.githubusercontent.com/3050060/174663718-538e9d11-3bf9-48b2-8909-f9bfe75af135.png) r? ``````````@jsha``````````
2022-06-26Rollup merge of #97743 - RalfJung:const-err-future-breakage, r=estebankMatthias Krüger-0/+2838
make const_err show up in future breakage reports As tracked in https://github.com/rust-lang/rust/issues/71800, const_err should become a hard error Any Day Now (TM). I'd love to move forward with that sooner rather than later; it has been deny-by-default for many years and a future incompat lint since https://github.com/rust-lang/rust/pull/80394 (landed more than a year ago). Some CTFE errors are already hard errors since https://github.com/rust-lang/rust/pull/86194. But before we truly make it a hard error in all cases, we now have one more intermediate step we can take -- to make it show up in future breakage reports. Cc `````@rust-lang/wg-const-eval`````
2022-06-26Rollup merge of #97295 - c410-f3r:yet-another-let-chain, r=compiler-errorsMatthias Krüger-192/+436
[rustc_parse] Forbid `let`s in certain places Currently only forbids in locals to resolve https://github.com/rust-lang/rust/pull/94927#issuecomment-1099605024 but feel free to point any other places.
2022-06-26add a ui test for issue #91883Takayuki Maeda-0/+68
2022-06-26add regression test for #87558Takayuki Maeda-0/+33
2022-06-26Add regression test for #92859Guillaume Gomez-0/+24
2022-06-26Add regression test for #79224Yuki Okushi-0/+53
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2022-06-26Rollup merge of #98509 - rust-lang:notriddle/precise-pin-diag, r=compiler-errorsYuki Okushi-0/+24
diagnostics: consider parameter count when suggesting smart pointers Fixes #96834
2022-06-26Rollup merge of #98502 - GuillaumeGomez:source-sidebar-hover, r=notriddleYuki Okushi-0/+99
Fix source sidebar hover in ayu theme In the screenshot below, `rc.rs` should be orange: ![Screenshot from 2022-06-25 22-24-06](https://user-images.githubusercontent.com/3050060/175789532-99e8781d-2e62-43f7-bbd9-1b1151e1f8c1.png) It's because the CSS selector was not precise enough and was "overloaded" with another one. This PR fixes it and adds a test for the colors in the source sidebar. cc `@jsha` r? `@notriddle`
2022-06-26Rollup merge of #98491 - antoyo:fix/ui-test-backtrace-panic-abort, r=Dylan-DPCYuki Okushi-0/+1
Fix backtrace UI test when panic=abort is used The function `contains_verbose_expected` is only used when the panic strategy is not abort, so it caused a warning when it was abort, which made the UI test failed on stderr comparison.
2022-06-26Rollup merge of #98371 - compiler-errors:better-opaque-printing, r=oli-obkYuki Okushi-1/+46
Fix printing `impl trait` under binders Before, we would render `impl for<'a> Trait<'a>` like `impl Trait<for<'a> 'a>`, lol.
2022-06-26Auto merge of #98140 - klensy:compiletest-strip, r=Mark-Simulacrumbors-4/+18
compiletest: strip debuginfo by default for mode=ui This reduces occupied disk space, for example for src/test/ui it drops from 1972mb to 132mb (x86_64-pc-windows-msvc). Individual tests that require debuginfo/symbols should turn this option off (as in fixed tests).
2022-06-25diagnostics: consider parameter count when suggesting smart pointersMichael Howell-0/+24
2022-06-25Fix span issues in object safety suggestionsMichael Goulet-3/+47
2022-06-25Add test for source sidebar elements colorsGuillaume Gomez-0/+99
2022-06-25bless after rebaseRalf Jung-23/+750
2022-06-25Fix backtrace UI test when panic=abort is usedAntoni Boucher-0/+1
2022-06-25Auto merge of #98486 - matthiaskrgr:rollup-u7m508x, r=matthiaskrgrbors-111/+279
Rollup of 9 pull requests Successful merges: - #96412 (Windows: Iterative `remove_dir_all`) - #98126 (Mitigate MMIO stale data vulnerability) - #98149 (Set relocation_model to Pic on emscripten target) - #98194 (Leak pthread_{mutex,rwlock}_t if it's dropped while locked.) - #98298 (Point to type parameter definition when not finding variant, method and associated item) - #98311 (Reverse folder hierarchy) - #98401 (Add tracking issues to `--extern` option docs.) - #98429 (Use correct substs in enum discriminant cast) - #98431 (Suggest defining variable as mutable on `&mut _` type mismatch in pats) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-06-25Added test for const arg lifetimes suggested by erikdesjardins.David Venhoek-0/+27
2022-06-25bless remaining testsRalf Jung-0/+104
2022-06-25make const_err show up in future breakage reportsRalf Jung-0/+2007
2022-06-25Rollup merge of #98431 - WaffleLapkin:mut_pat_suggestions, r=compiler-errorsMatthias Krüger-1/+122
Suggest defining variable as mutable on `&mut _` type mismatch in pats Suggest writing `mut a` where `&mut a` was written but a non-ref type provided. Since we still don't have "apply either one of the suggestions but not both" kind of thing, the interaction with the suggestion of removing `&[mut]` or moving it to the type is weird, and idk how to make it better.. r? ``@compiler-errors``
2022-06-25Rollup merge of #98429 - b-naber:use-correct-substs-discriminant-cast, r=lcnrMatthias Krüger-0/+10
Use correct substs in enum discriminant cast Fixes https://github.com/rust-lang/rust/issues/97634 r? ```@lcnr```
2022-06-25Rollup merge of #98298 - TaKO8Ki:point-to-type-param-definition, ↵Matthias Krüger-110/+147
r=compiler-errors Point to type parameter definition when not finding variant, method and associated item fixes #77391
2022-06-25Auto merge of #96820 - r-raymond:master, r=cuviperbors-5/+16
Make RwLockReadGuard covariant Hi, first time contributor here, if anything is not as expected, please let me know. `RwLockReadGoard`'s type constructor is invariant. Since it behaves like a smart pointer to an immutable reference, there is no reason that it should not be covariant. Take e.g. ``` fn test_read_guard_covariance() { fn do_stuff<'a>(_: RwLockReadGuard<'_, &'a i32>, _: &'a i32) {} let j: i32 = 5; let lock = RwLock::new(&j); { let i = 6; do_stuff(lock.read().unwrap(), &i); } drop(lock); } ``` where the compiler complains that &i doesn't live long enough. If `RwLockReadGuard` is covariant, then the above code is accepted because the lifetime can be shorter than `'a`. In order for `RwLockReadGuard` to be covariant, it can't contain a full reference to the `RwLock`, which can never be covariant (because it exposes a mutable reference to the underlying data structure). By reducing the data structure to the required pieces of `RwLock`, the rest falls in place. If there is a better way to do a test that tests successful compilation, please let me know. Fixes #80392
2022-06-25[rustc_parse] Forbid lets in certain placesCaio-192/+436
2022-06-24Use write! instead of p! to avoid having to use weird scopingMichael Goulet-1/+1
2022-06-24Fix printing impl trait under bindersMichael Goulet-0/+45
2022-06-24proc_macro: Fix expand_expr expansion of bool literalsNika Layzell-1/+70
Previously, the expand_expr method would expand bool literals as a `Literal` token containing a `LitKind::Bool`, rather than as an `Ident`. This is not a valid token, and the `LitKind::Bool` case needs to be handled seperately. Tests were added to more deeply compare the streams in the expand-expr test suite to catch mistakes like this in the future.
2022-06-24improve wording of a suggestionMaybe Waffle-8/+8
2022-06-24Bless ui tests.Camille GILLOT-19/+16
2022-06-24fmtb-naber-1/+1
2022-06-24Auto merge of #98447 - JohnTitor:rollup-pponoo3, r=JohnTitorbors-27/+107
Rollup of 9 pull requests Successful merges: - #91264 (Add macro support in jump to definition feature) - #96955 (Remove (transitive) reliance on sorting by DefId in pretty-printer) - #97633 (Session object: Set OS/ABI) - #98039 (Fix `panic` message for `BTreeSet`'s `range` API and document `panic` cases) - #98214 (rustc_target: Remove some redundant target properties) - #98280 (Improve suggestion for calling fn-like expr on type mismatch) - #98394 (Fixup missing renames from `#[main]` to `#[rustc_main]`) - #98411 (Update tendril) - #98419 (Remove excess rib while resolving closures) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-06-24add testb-naber-0/+10
2022-06-24macros: use typed identifiers in subdiag deriveDavid Wood-175/+195
As in the diagnostic derive, using typed identifiers in the subdiagnostic derive improves the diagnostics of using the subdiagnostic derive as Fluent messages will be confirmed to exist at compile-time. Signed-off-by: David Wood <david.wood@huawei.com>
2022-06-24macros: use typed identifiers in diag deriveDavid Wood-219/+309
Using typed identifiers instead of strings with the Fluent identifier enables the diagnostic derive to benefit from the compile-time validation that comes with typed identifiers - use of a non-existent Fluent identifier will not compile. Signed-off-by: David Wood <david.wood@huawei.com>
2022-06-24Rollup merge of #98280 - compiler-errors:better-call-closure-on-type-err, ↵Yuki Okushi-11/+66
r=estebank Improve suggestion for calling fn-like expr on type mismatch 1.) Suggest calling values of with RPIT types (and probably TAIT) when we expect `Ty` and have `impl Fn() -> Ty` 2.) Suggest calling closures even when they're not assigned to a local variable first 3.) Drive-by fix of a pretty-printing bug (`impl Fn()-> Ty` => `impl Fn() -> Ty`) r? ```@estebank```
2022-06-24Rollup merge of #96955 - Aaron1011:pretty-print-sort, r=petrochenkovYuki Okushi-16/+16
Remove (transitive) reliance on sorting by DefId in pretty-printer This moves us a step closer to removing the `PartialOrd/`Ord` impls for `DefId`. See #90317
2022-06-24Rollup merge of #91264 - GuillaumeGomez:macro-jump-to-def, r=jshaYuki Okushi-0/+25
Add macro support in jump to definition feature Fixes #91174. To do so, I check if the span comes from an expansion, and if so, I infer the original macro `DefId` or `Span` depending if it's a defined in the current crate or not. There is one limitation due to macro expansion though: ```rust macro_rules! yolo { () => {}} fn foo() { yolo!(); } ``` In `foo`, `yolo!` won't be linked because after expansion, it is replaced by nothing (which seems logical). So I can't get an item from the `Visitor` from which I could tell if its `Span` comes from an expansion. I added a test for this specific limitation alongside others. Demo: https://rustdoc.crud.net/imperio/macro-jump-to-def/src/foo/check-source-code-urls-to-def-std.rs.html As for the empty macro issue that cannot create a jump to definition, you can see it [here](https://rustdoc.crud.net/imperio/macro-jump-to-def/src/foo/check-source-code-urls-to-def-std.rs.html#35). r? ```@jyn514```
2022-06-24Auto merge of #98109 - nikomatsakis:issue-98095, r=jackh726bors-146/+280
fix universes in the NLL type tests In the NLL code, we were not accommodating universes in the `type_test` logic. Fixes #98095. r? `@compiler-errors` This breaks some tests, however, so the purpose of this branch is more explanatory and perhaps to do a crater run.