about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2022-06-23Rollup merge of #98390 - GuillaumeGomez:keyword-rustdoc-json, r=notriddleMichael Goulet-0/+21
Fixes handling of keywords in rustdoc json output Fixes #98002. Instead of panicking, we just filter them out. cc ```@matthiaskrgr``` r? ```@notriddle```
2022-06-23Rollup merge of #98365 - jyn514:improve-obligation-errors-review-comments, ↵Michael Goulet-8/+8
r=eholk Address review comments from #98259 It got approved so fast I didn't have time to make changes xD r? ``@eholk``
2022-06-23Rollup merge of #98353 - beetrees:builtin-macros-cfg-diag, r=davidtwcoMichael Goulet-1/+10
Migrate two diagnostics from the `rustc_builtin_macros` crate Migrate two diagnostics to use the struct derive and be translatable. r? ```@davidtwco```
2022-06-23Rollup merge of #98310 - jsha:defer-source-sidebar, r=GuillaumeGomezMichael Goulet-6/+6
rustdoc: optimize loading of source sidebar The source sidebar has a setting to remember whether it should be open or closed. Previously, this setting was handled in source-script.js, which is loaded with `defer`, meaning it is often run after the document is rendered. Since CSS renders the source sidebar as closed by default, changing this after the initial render results in a relayout. Instead, handle the setting in storage.js, which is the first script to load and is the only script that blocks render. This avoids a relayout and means navigating between files with the sidebar open is faster. Demo: https://rustdoc.crud.net/jsha/defer-source-sidebar/src/alloc/ffi/c_str.rs.html r? ````@GuillaumeGomez````
2022-06-23Rollup merge of #98283 - TaKO8Ki:point-at-private-fields-in-struct-literal, ↵Michael Goulet-6/+45
r=compiler-errors Point at private fields in struct literal closes #95872
2022-06-23Rollup merge of #98269 - compiler-errors:provide-more-segment-res, ↵Michael Goulet-115/+115
r=petrochenkov Provide a `PathSegment.res` in more cases I find that in many cases, the `res` associated with a `PathSegment` is `Res::Err` even though the path was fully resolved. A few diagnostics use this `res` and their error messages suffer because of the lack of resolved segment. This fixes it a bit, but it's obviously not complete and I'm not exactly sure if it's correct.
2022-06-23Rollup merge of #98259 - jyn514:improve-obligation-errors, r=estebankMichael Goulet-60/+296
Greatly improve error reporting for futures and generators in `note_obligation_cause_code` Most futures don't go through this code path, because they're caught by `maybe_note_obligation_cause_for_async_await`. But all generators do, and `maybe_note` is imperfect and doesn't catch all futures. Improve the error message for those it misses. At some point, we may want to consider unifying this with the code for `maybe_note_async_await`, so that `async_await` notes all parent constraints, and `note_obligation` can point to yield points. But both functions are quite complicated, and it's not clear to me how to combine them; this seems like a good incremental improvement. Helps with https://github.com/rust-lang/rust/issues/97332. r? ``@estebank`` cc ``@eholk`` ``@compiler-errors``
2022-06-23Rollup merge of #98184 - compiler-errors:elided-lifetime-in-impl-nll, r=cjgillotMichael Goulet-0/+69
Give name if anonymous region appears in impl signature Fixes #98170 We probably should remove the two unwraps in [`report_general_error`](https://doc.rust-lang.org/nightly/nightly-rustc/src/rustc_borrowck/diagnostics/region_errors.rs.html#683-685), but I have no idea what to provide if those regions are missing, so I've kept those in. Let me know if I should try harder to remove those.
2022-06-23add regression tests found in craterNiko Matsakis-1/+69
2022-06-23normalize if-eq bounds before testingNiko Matsakis-0/+37
Hat-tip: aliemjay
2022-06-23Suggest defining variable as mutable on `&mut _` type mismatch in patsMaybe Waffle-1/+122
2022-06-23Add/update GUI tests for help pocket menuGuillaume Gomez-15/+74
2022-06-22Perform coherence checking per impl.Camille GILLOT-148/+138
2022-06-22Rewrite dead-code pass to avoid fetching HIR.Camille GILLOT-30/+53
2022-06-22Uniform spans in dead code lint.Camille GILLOT-70/+66
2022-06-22Slightly tweak invalid atomic ordering lint messages.Mara Bos-180/+180
Co-authored-by: Esteban Kuber <estebank@users.noreply.github.com>
2022-06-22Remove (transitive) reliance on sorting by DefId in pretty-printerAaron Hill-16/+16
This moves us a step closer to removing the `PartialOrd/`Ord` impls for `DefId`. See #90317
2022-06-22Add test for keywords in rustdoc JSON outputGuillaume Gomez-0/+21
2022-06-22use `-Cstrip=debuginfo` with ui tests to reduce disk space usageklensy-4/+18
2022-06-22Auto merge of #98279 - cjgillot:all-fresh-nofn, r=petrochenkovbors-36/+46
Create elided lifetime parameters for function-like types Split from https://github.com/rust-lang/rust/pull/97720 This PR refactor lifetime generic parameters in bare function types and parenthesized traits to introduce the additional required lifetimes as fresh parameters in a `for<>` bound. This PR does the same to lifetimes appearing in closure signatures, and as-if introducing `for<>` bounds on closures (without the associated change in semantics). r? `@petrochenkov`
2022-06-22Fix debug info testRobin Raymond-5/+2
2022-06-22Rollup merge of #98005 - compiler-errors:impossible-bounds, r=Mark-SimulacrumYuki Okushi-18/+151
Add some tests for impossible bounds Adds test for #93008 Adds test for #94680 Closes #94999 Closes #95640
2022-06-22Rollup merge of #97818 - compiler-errors:rpit-error-spanned, r=oli-obkYuki Okushi-0/+27
Point at return expression for RPIT-related error Certainly this needs some diagnostic refining, but I wanted to show that it was possible first and foremost. Not sure if this is the right approach. Open to feedback. Fixes #80583
2022-06-22add "was" to pluralize macro and use itTakayuki Maeda-3/+3
2022-06-22point to type param definition when not finding variant, method and assoc typeTakayuki Maeda-110/+147
use `def_ident_span` , `body_owner_def_id` instead of `in_progress_typeck_results`, `guess_head_span` use `body_id.owner` directly add description to label
2022-06-22stop pointing at definitions of missing fieldsTakayuki Maeda-24/+4
2022-06-22Auto merge of #97853 - TaKO8Ki:emit-only-one-note-per-unused-struct-field, ↵bors-244/+403
r=estebank Collapse multiple dead code warnings into a single diagnostic closes #97643
2022-06-21Add some tests for impossible boundsMichael Goulet-18/+151
2022-06-21Point at return expression for RPIT-related errorMichael Goulet-0/+27
2022-06-21Improve suggestion for calling closure on type mismatchMichael Goulet-11/+66
2022-06-21Address review comments from #98259Joshua Nelson-8/+8
It got merged so fast I didn't have time to make changes xD
2022-06-22Rollup merge of #98336 - fmease:remove-faulty-doc-hidden-lint, r=GuillaumeGomezYuki Okushi-177/+0
Remove the unused-`#[doc(hidden)]` logic from the `unused_attributes` lint Fixes #96890. It was found out that `#[doc(hidden)]` on trait impl items does indeed have an effect on the generated documentation (see the linked issue). In my opinion and the one of [others](https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/Validy.20checks.20for.20.60.23.5Bdoc.28hidden.29.5D.60/near/281846219), rustdoc's output is actually a bit flawed in that regard but that should be tracked in a new issue I suppose (I will open an issue for that in the near future). The check was introduced in #96008 which is marked to be part of version `1.62` (current `beta`). As far as I understand, this means that **this PR needs to be backported** to `beta` to fix #96890 on time. Correct me if I am wrong. CC `@dtolnay` (in case you would like to agree or disagree with my decision to fully remove this check) `@rustbot` label A-lint T-compiler T-rustdoc r? `@rust-lang/compiler`
2022-06-22Rollup merge of #98334 - JohnTitor:issue-73727, r=compiler-errorsYuki Okushi-7/+15
Add a full regression test for #73727 Closes #73727 This also moves a test to the `issues` directory as it's also tested on the adt_const_params feature. r? ```@compiler-errors``` Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2022-06-22Rollup merge of #98199 - c410-f3r:z-errors, r=petrochenkovYuki Okushi-0/+0
Move some tests to more reasonable directories r? `@petrochenkov`
2022-06-22Rollup merge of #97867 - lcnr:lub-binder, r=oli-obkYuki Okushi-0/+181
lub: don't bail out due to empty binders allows for the following to compile. The equivalent code using `struct Wrapper<'upper>(fn(&'upper ());` already compiles on stable. ```rust let _: fn(&'upper ()) = match v { true => lt_in_fn::<'a>(), false => lt_in_fn::<'b>(), }; ``` see https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=7034a677190110941223cafac6632f70 for a complete example r? ```@rust-lang/types```
2022-06-21Perform wf checking per module.Camille GILLOT-3/+3
2022-06-21Only keep a single well-formed query.Camille GILLOT-262/+146
2022-06-21Always create parameters for functions-like types.Camille GILLOT-36/+46
2022-06-21Add UI test for `cfg!(foo, bar)`beetrees-1/+10
2022-06-21[RFC 2011] Optimize non-consuming operatorsCaio-38/+179
2022-06-21Auto merge of #98335 - JohnTitor:rollup-j2zudxv, r=JohnTitorbors-6/+69
Rollup of 11 pull requests Successful merges: - #94033 (Improve docs for `is_running` to explain use case) - #97269 (adjust transmute const stabilization version) - #97805 (Add proper tracing spans to rustc_trait_selection::traits::error_reporting) - #98022 (Fix erroneous span for borrowck error) - #98124 (Improve loading of crates.js and sidebar-items.js) - #98278 (Some token stream cleanups) - #98306 (`try_fold_unevaluated` for infallible folders) - #98313 (Remove lies in comments.) - #98323 (:arrow_up: rust-analyzer) - #98329 (Avoid an ICE and instead let the compiler report a useful error) - #98330 (update ioslice docs to use shared slices) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-06-21Move some tests to more reasonable directoriesCaio-0/+0
2022-06-21Remove `#[doc(hidden)]` logic from `unused_attributes` lintLeón Orell Valerian Liehr-177/+0
2022-06-21Rollup merge of #98329 - oli-obk:fast_path_ice, r=cjgillotYuki Okushi-0/+27
Avoid an ICE and instead let the compiler report a useful error Fixes #98299
2022-06-21Rollup merge of #98124 - jsha:defer-crates, r=GuillaumeGomezYuki Okushi-5/+5
Improve loading of crates.js and sidebar-items.js Now that the "All Crates" dropdown is only rendered on the search results page, there is no need to load crates.js on most pages. Load it only on crate pages. Also, add the `defer` attribute so it does not block HTML parsing. For sidebar-items.js, move the script tag to `<head>`. Since it already has the defer attribute it won't block loading. The defer attribute does preserve ordering between scripts, so instead of the callback on load, it can set a global variable on load, which is slightly simpler. Also, since it is required to finish rendering the page, beginning its load earlier is better. Remove generation and handling of sidebar-vars. Everything there can be computed with information available in JS via other means. Remove the extra_scripts fields of the `Page` template. They were only used by source-script.js and source-files.js, which are now linked by the template based on whether it is rendering a source page. Remove the "other" wrapper in the sidebar. It was unnecessary. r? ```@GuillaumeGomez``` Demo: https://rustdoc.crud.net/jsha/defer-crates/std/index.html
2022-06-21Rollup merge of #98022 - compiler-errors:erroneous-borrowck-span, r=oli-obkYuki Okushi-1/+37
Fix erroneous span for borrowck error I am not confident that this is the correct fix, but it does the job. Open to suggestions for a real fix instead. Fixes #97997 The issue is that we pass a [dummy location](https://doc.rust-lang.org/nightly/nightly-rustc/src/rustc_middle/mir/visit.rs.html#302) when type-checking the ["required consts"](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/mir/struct.Body.html#structfield.required_consts) that are needed by the MIR body during borrowck. This means that when we fail to evaluate the constant, we use the span of `bb0[0]`, instead of the actual span of the constant. There are quite a few other places that use `START_BLOCK.start_location()`, `Location::START`, etc. when calling for a random/unspecified `Location` value. This is because, unlike (for example) `Span`, we don't have a dummy/miscellaneous value to use instead. I would appreciate guidance (either in this PR, or a follow-up) on what needs to be done to clean this up in general.
2022-06-21Auto merge of #95576 - DrMeepster:box_erasure, r=oli-obkbors-70/+102
Remove dereferencing of Box from codegen Through #94043, #94414, #94873, and #95328, I've been fixing issues caused by Box being treated like a pointer when it is not a pointer. However, these PRs just introduced special cases for Box. This PR removes those special cases and instead transforms a deref of Box into a deref of the pointer it contains. Hopefully, this is the end of the Box<T, A> ICEs.
2022-06-21Add a full regression test for #73727Yuki Okushi-7/+15
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2022-06-21Avoid an ICE and instead let the compiler report a useful errorOli Scherer-0/+27
2022-06-20Provide a segment res in more casesMichael Goulet-115/+115