about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2022-08-10Rollup merge of #100098 - compiler-errors:field-suggestion-fixups, r=davidtwcoMatthias Krüger-8/+65
Some "this expression has a field"-related fixes Each commit does something different and is worth reviewing, but the final diff from `master..HEAD` contains the sum of the changes to the UI tests, since some commits added UI tests "regressions" which were later removed in other commits. The only change I could see adding on top of this is suppressing `Clone::clone` from the "this expression has a field that has this method" suggestion, since it's so commonly implemented by types that it's not worthwhile suggesting in general.
2022-08-10Rollup merge of #99479 - Enselic:import-can-be-without-id, r=camelidMatthias Krüger-0/+6
rustdoc-json: Remove doc FIXME for Import::id and explain Also add some test and refactor related code a bit. ``@rustbot`` labels +A-rustdoc-json +T-rustdoc
2022-08-10Rollup merge of #98775 - notriddle:notriddle/mobile-sidebar-scroll-lock, r=jshaMatthias Krüger-0/+42
rustdoc: improve scroll locking in the rustdoc mobile sidebars This PR prevents the main content area from scrolling while the mobile sidebar is open on documentation pages (porting the scroll locking behavior from the source sidebar to the regular sidebar), and also fixes some bad behavior where opening a "mobile" sidebar, and growing the viewport so that the "desktop" mode without scroll locking is activated, could potentially leave the page stuck. This does not affect the behavior on larger screens. Only small ones, where the sidebar covers up the main content. Split out from #98772
2022-08-09Update rustdoc-json testEric Holk-2/+2
2022-08-09Add regression test for issue 100187Santiago Pastorino-0/+12
2022-08-09Add error if link_ordinal used without raw-dylibDaniel Paoliello-0/+41
2022-08-10suggest a missing semicolon before an arrayTakayuki Maeda-0/+53
2022-08-09Mention `unit-test` in MIR opt test READMEJakob Degen-0/+12
2022-08-09Auto merge of #99217 - lcnr:implied-bounds-pre-norm, r=lcnrbors-76/+178
consider unnormalized types for implied bounds extracted, and slightly modified, from #98900 The idea here is that generally, rustc is split into things which can assume its inputs are well formed[^1], and things which have verify that themselves. Generally most predicates should only deal with well formed inputs, e.g. a `&'a &'b (): Trait` predicate should be able to assume that `'b: 'a` holds. Normalization can loosen wf requirements (see #91068) and must therefore not be used in places which still have to check well formedness. The only such place should hopefully be `WellFormed` predicates fixes #87748 and #98543 r? `@jackh726` cc `@rust-lang/types` [^1]: These places may still encounter non-wf inputs and have to deal with them without causing an ICE as we may check for well formedness out of order.
2022-08-09Add test for impl blocks containing only private itemsGuillaume Gomez-0/+84
2022-08-09compare with-flag to without-flagRalf Jung-19/+21
2022-08-09test implied bounds + nested proj obliglcnr-0/+42
2022-08-09Rollup merge of #100305 - ↵Dylan DPC-0/+43
TaKO8Ki:suggest-adding-appropriate-missing-pattern-excluding-comments, r=compiler-errors Suggest adding an appropriate missing pattern excluding comments fixes #100272
2022-08-09Rollup merge of #100228 - luqmana:suggestion-ice, r=estebankDylan DPC-0/+49
Don't ICE while suggesting updating item path. When an item isn't found, we may suggest an appropriate import to `use`. Along with that, we also suggest updating the path to work with the `use`. Unfortunately, if the code in question originates from a macro, the span used to indicate which part of the path needs updating may not be suitable and cause an ICE (*). Since, such code is not adjustable directly by the user without modifying the macro, just skip the suggestion in such cases. (*) The ICE happens because the emitter want to indicate to the user what code to delete by referencing a certain span. But in this case, said span has `lo == hi == 0` which means it thinks it's a dummy span. Adding a space before the proc macro attribute is enough to stop it from ICE'ing but even then the suggestion doesn't really make any sense: ``` help: if you import `DataStore`, refer to it directly | 1 - #[dbstruct::dbstruct] 1 + #[dbstruct::dbstruct] ``` Since suggestions are best-effort, I just gated this one on `can_be_used_for_suggestions` which catches cases like this. Fixes #100199
2022-08-09Rollup merge of #100221 - compiler-errors:impossible-trait-items, ↵Dylan DPC-0/+20
r=lcnr,notriddle,camelid Don't document impossible to call default trait items on impls Closes #100176 This only skips documenting _default_ trait items on impls, not ones that are written inside the impl block. This is a conservative approach, since I think we should document all items written in an impl block (I guess unless hidden or whatever), but the existence of this new query I added makes this easy to extend to other rustdoc cases.
2022-08-09Rollup merge of #99787 - aDotInTheVoid:rdj-dyn, ↵Dylan DPC-10/+64
r=camelid,notriddle,GuillaumeGomez Rustdoc-Json: Document HRTB's on DynTrait Closes https://github.com/rust-lang/rust/issues/99118 Probably best reviewed commit by commit. `@rustbot` modify labels: +A-rustdoc-json cc `@Enselic` r? `@CraftSpider`
2022-08-09Rollup merge of #96478 - WaffleLapkin:rustc_default_body_unstable, r=Aaron1011Dylan DPC-0/+125
Implement `#[rustc_default_body_unstable]` This PR implements a new stability attribute — `#[rustc_default_body_unstable]`. `#[rustc_default_body_unstable]` controls the stability of default bodies in traits. For example: ```rust pub trait Trait { #[rustc_default_body_unstable(feature = "feat", isssue = "none")] fn item() {} } ``` In order to implement `Trait` user needs to either - implement `item` (even though it has a default implementation) - enable `#![feature(feat)]` This is useful in conjunction with [`#[rustc_must_implement_one_of]`](https://github.com/rust-lang/rust/pull/92164), we may want to relax requirements for a trait, for example allowing implementing either of `PartialEq::{eq, ne}`, but do so in a safe way — making implementation of only `PartialEq::ne` unstable. r? `@Aaron1011` cc `@nrc` (iirc you were interested in this wrt `read_buf`), `@danielhenrymantilla` (you were interested in the related `#[rustc_must_implement_one_of]`) P.S. This is my first time working with stability attributes, so I'm not sure if I did everything right 😅
2022-08-09don't normalize wf predicateslcnr-76/+136
this allows us to soundly use unnormalized projections for wf
2022-08-09Fix coverage-llvmir test on WindowsNikita Popov-1/+1
@__llvm_profile_runtime is how an external hidden global.
2022-08-09Keep going if normalized projection has unevaluated consts in QueryNormalizerMichael Goulet-0/+279
2022-08-09Auto merge of #100304 - matthiaskrgr:rollup-gs56vlw, r=matthiaskrgrbors-104/+129
Rollup of 6 pull requests Successful merges: - #100163 (Refactor: remove an unnecessary string search) - #100212 (Remove more Clean trait implementations) - #100238 (Further improve error message for E0081) - #100268 (Add regression test for #79148) - #100294 (Update Duration::as_secs doc to point to as_secs_f64/32 for including fractional part) - #100303 (:arrow_up: rust-analyzer) Failed merges: - #100281 (Remove more Clean trait implementations) r? `@ghost` `@rustbot` modify labels: rollup
2022-08-09Extend comma suggestion to cases where fields arent missingMichael Goulet-11/+60
2022-08-09Move JSON tests into a directory.Nicholas Nethercote-2/+2
To get around the "following path contains more than 968 entries, you should move the test to some relevant subdirectory" tidy error.
2022-08-09suggest adding an appropriate missing pattern excluding commentsTakayuki Maeda-0/+43
2022-08-09Rollup merge of #100268 - TaKO8Ki:add-regression-test-for-79148, ↵Matthias Krüger-0/+45
r=Mark-Simulacrum Add regression test for #79148 closes #79148
2022-08-09Rollup merge of #100238 - Bryysen:master, r=cjgillotMatthias Krüger-101/+78
Further improve error message for E0081 Closes #97533
2022-08-09Rollup merge of #100163 - TaKO8Ki:remove-unnecessary-string-search, ↵Matthias Krüger-3/+6
r=wesleywiser Refactor: remove an unnecessary string search
2022-08-09Auto merge of #100205 - cjgillot:noice-doc, r=camelidbors-0/+21
Avoid ICE in rustdoc when using `Fn` bounds Fixes https://github.com/rust-lang/rust/issues/100143
2022-08-09Add ui test for #100197Obei Sideg-0/+20
Recover from mutable variable declaration where `mut` is placed before `let`
2022-08-08Add regression test commentNoah Lev-0/+2
2022-08-08Fix plural form of `variant` in error message not formatting correctlyBryysen-32/+26
due to ordering, added/improved comments and removed redundant test already caught by `E0081.rs`
2022-08-08Synthetize a trait ref when none is available.Camille GILLOT-1/+3
2022-08-08Add test for #100246.Luqman Aden-0/+43
2022-08-08add regression test for #79148Takayuki Maeda-0/+45
2022-08-08Auto merge of #98863 - compiler-errors:projection-msg, r=estebankbors-65/+75
Implement special-cased projection error message for some common traits Not sure what the best phrasing is, but I feel like these are more clear than the plain `<Type as Iterator>::Output == Type` messages. If this is actually a good idea, are there any other traits this could benefit?
2022-08-08Auto merge of #98489 - cjgillot:naked-nohir, r=davidtwco,tmiaskobors-58/+45
Only fetch HIR for naked functions that have the attribute.
2022-08-08Auto merge of #100207 - notriddle:notriddle/skipped-inline-module, r=Manishearthbors-0/+27
rustdoc: do not mark the contents of a skipped module as inlined Fixes #100204
2022-08-08Adjust wordingMichael Goulet-65/+74
2022-08-07Implement special-cased projection error message for some common traitsMichael Goulet-30/+31
2022-08-07Add tuple trait testsMichael Goulet-3/+97
2022-08-07Don't document impossible to call default trait items on implsMichael Goulet-0/+20
2022-08-07Add UI test for #100199Luqman Aden-0/+49
2022-08-07Rollup merge of #100230 - cjgillot:noice-multibyte-amp, r=compiler-errorsMatthias Krüger-0/+33
Use start_point instead of next_point to point to elided lifetime amp… Using `next_point` creates a span which points inside the multibyte token, ICEing. Fixes https://github.com/rust-lang/rust/issues/100224
2022-08-07Rollup merge of #100194 - est31:box_syntax_tests, r=Mark-SimulacrumMatthias Krüger-212/+154
Remove even more box syntax uses from src/test Prior work, notably #88316 has removed box syntax from most of the testsuite. However, some tests were left out. This commit removes box_syntax uses from more locations in src/test. This migrates the tests where `box` is mostly an "implementation detail" and not the primary thing being tested by the test. Furthermore, some tests from the mir-opt test suite are not being migrated.
2022-08-07Rollup merge of #100019 - ↵Matthias Krüger-0/+181
TaKO8Ki:suggest-boxed-trait-objects-instead-of-impl-trait, r=compiler-errors Revive suggestions for boxed trait objects instead of impl Trait The suggestion implemented in #75608 was not working properly, so I fixed it.
2022-08-07Fail gracefully when const pattern is not structural match.Camille GILLOT-0/+41
2022-08-07Further improve error message for E0081Bryysen-77/+60
Multiple duplicate assignments of the same discriminant are now reported in the samme error. We now point out the incrementation start point for discriminants that are not explicitly assigned that are also duplicates. Removed old test related to E0081 that is now covered by error-codes/E0081.rs. Also refactored parts of the `check_enum` function.
2022-08-07add -Zextra-const-ub-checks to enable more UB checking in const-evalRalf Jung-0/+115
2022-08-07Use start_point instead of next_point to point to elided lifetime ampersand.Camille GILLOT-0/+33
2022-08-07Do not manually craft a span pointing inside a multibyte character.Camille GILLOT-0/+54