about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2022-08-11Rollup merge of #100307 - nnethercote:fix-96847, r=cjgillotMatthias Krüger-2/+16
Fix #96847 r? `@petrochenkov`
2022-08-11Rollup merge of #93896 - jsha:dark-colors, r=GuillaumeGomezMatthias Krüger-4/+4
rustdoc: make item-infos dimmer on dark theme Previously the item-info background colors were too bright for a dark theme, making a bright rectangle that draws the attention. Demo: https://rustdoc.crud.net/jsha/dark-colors/std/os/linux/process/struct.PidFd.html https://rustdoc.crud.net/jsha/dark-colors/std/error/trait.Error.html#method.description Before: <img width=300 src="https://user-images.githubusercontent.com/220205/153565049-f35ee83e-181d-491c-b2af-7cce1baa4912.png"> After: <img width=300 src="https://user-images.githubusercontent.com/220205/181166727-b4218e96-daf1-46cd-a2df-5fd870eaa857.png"> r? `@GuillaumeGomez`
2022-08-11Rollup merge of #100398 - nnethercote:improve-Zhir-stats, r=michaelwoeristerDylan DPC-0/+192
Improve `-Zhir-stats` Add testing, improve coverage, avoid some double counting, and add more detail. r? `@michaelwoerister`
2022-08-11Rollup merge of #100232 - cjgillot:no-desugar-methodcall, r=nagisaDylan DPC-2/+48
Do not consider method call receiver as an argument in AST. Fixes https://github.com/rust-lang/rust/issues/73663
2022-08-11Rollup merge of #100192 - tmiasko:rm-duplicated-locals, r=nagisaDylan DPC-26/+22
Remove duplicated temporaries creating during box derefs elaboration Temporaries created with `MirPatch::new_temp` will be declared after patch application. Remove manually created duplicate declarations. Removing duplicates exposes another issue. Visitor elaborates terminator twice and attempts to access new, but not yet available, local declarations. Remove duplicated call to `visit_terminator`. Extracted from #99946.
2022-08-11Rollup merge of #92744 - lambinoo:I-91161-non-exhaustive-foreign-variants, ↵Dylan DPC-7/+12
r=scottmcm Check if enum from foreign crate has any non exhaustive variants when attempting a cast Fixes #91161 As stated in the issue, this will require a crater run as it might break other people's stuff.
2022-08-11suggest const or static for global variablechenyukang-0/+14
2022-08-11Avoid lowering a `MacArgs::Eq` twice.Nicholas Nethercote-0/+14
Fixes #96847.
2022-08-11Auto merge of #100315 - compiler-errors:norm-ct-in-proj, r=lcnrbors-0/+279
Keep going if normalized projection has unevaluated consts in `QueryNormalizer` #100312 was the wrong approach, I think this is the right one. When normalizing a type, if we see that it's a projection, we currently defer to `tcx.normalize_projection_ty`, which normalizes the projections away but doesn't touch the unevaluated constants. So now we just continue to fold the type if it has unevaluated constants so we make sure to evaluate those too, if we can. Fixes #100217 Fixes #83972 Fixes #84669 Fixes #86710 Fixes #82268 Fixes #73298
2022-08-11Add a second level to the AST size reporting.Nicholas Nethercote-2/+62
This tells you which variants of the enums are most common, which is very useful. I've only done it for the AST for now, HIR can be done later.
2022-08-11Add percentages to `-Zhir-stats` output.Nicholas Nethercote-70/+70
2022-08-11Change how `AssocItem` is reported.Nicholas Nethercote-4/+2
Currently it's reported as either `TraitItem` or `ImplItem`. This commit changes it to `AssocItem`, because having the report match the type name is (a) consistent with other types, and (b) the trait/impl split isn't that important here.
2022-08-11Improve AST stat collector.Nicholas Nethercote-5/+15
This commit: - Adds a comment explaining which `visit_*` methods should be implemented. - Adds and removes some `visit_*` methods accordingly, improving coverage, and avoiding some double counting.
2022-08-11Add a test for `-Zhir-stats` output.Nicholas Nethercote-0/+124
This will be very useful in subsequent commits where I will improve the output.
2022-08-10Auto merge of #99174 - scottmcm:reoptimize-layout-array, r=joshtriplettbors-0/+31
Reoptimize layout array This way it's one check instead of two, so hopefully (cc #99117) it'll be simpler for rustc perf too 🤞 Quick demonstration: ```rust pub fn demo(n: usize) -> Option<Layout> { Layout::array::<i32>(n).ok() } ``` Nightly: <https://play.rust-lang.org/?version=nightly&mode=release&edition=2021&gist=e97bf33508aa03f38968101cdeb5322d> ```nasm mov rax, rdi mov ecx, 4 mul rcx seto cl movabs rdx, 9223372036854775805 xor esi, esi cmp rax, rdx setb sil shl rsi, 2 xor edx, edx test cl, cl cmove rdx, rsi ret ``` This PR (note no `mul`, in addition to being much shorter): ```nasm xor edx, edx lea rax, [4*rcx] shr rcx, 61 sete dl shl rdx, 2 ret ``` This is built atop `@CAD97` 's #99136; the new changes are cb8aba66ef6a0e17f08a0574e4820653e31b45a0. I added a bunch more tests for `Layout::from_size_align` and `Layout::array` too.
2022-08-10Update error message to clarify that it's not the enum itself that's ↵Scott McMurray-1/+1
non_exhaustive
2022-08-10Check if extern crate enum has non exhaustive variant when castLamb-7/+12
2022-08-10Adapt ui-fulldeps test.Camille GILLOT-2/+2
2022-08-10Do not consider method call receiver as an argument in AST.Camille GILLOT-0/+46
2022-08-10Ban indirect references to `Self` too.Camille GILLOT-0/+19
2022-08-10Generalize trait object generic param check to aliases.Camille GILLOT-53/+82
2022-08-10Refuse to codegen an upstream static.Camille GILLOT-0/+28
2022-08-10Rollup merge of #100359 - b-naber:valtrees-pretty-print-ice, r=lcnrMichael Goulet-0/+36
Special-case references to leafs in valtree pretty-printing Fixes https://github.com/rust-lang/rust/issues/100313
2022-08-10Rollup merge of #100349 - TaKO8Ki:remove-type-string-comparison, r=lcnrMichael Goulet-1/+68
Refactor: remove a type string comparison
2022-08-10Rollup merge of #100348 - camelid:test-93205, r=jyn514Michael Goulet-0/+20
Add regression test for #93205 Closes #93205. This issue was most likely fixed by #93805.
2022-08-10rustdoc: make item-infos dimmer on dark theme #93896Jacob Hoffman-Andrews-4/+4
Previously the item-info background colors were too bright for a dark theme, making a bright rectangle that draws the attention.
2022-08-10Update GUI testGuillaume Gomez-32/+14
2022-08-10Improve crate selection on rustdoc search results pageFrank Steffahn-26/+36
Resolves all of issue #93240 Reproduces a similar change as #99086, but with improvements In particular, this PR inlcludes: * redesigning the crate-search selector so the background color matches its surroundings * decrease the font of the dropdown menu to a reaonable size * add a hover effect * make the color of the arrow theme-dependent, using a surrounding div, with :after pseudo-element that can then be transformed using CSS filters to approximate the desired color * fix the text "in" to match the title font * remove the "for xyz" in the "Results for xyz in [All crates]" title when searching for search term "xyz"; you can already see what you're searching for as it's typed in the search bar! * in line with #99086, handle super-long crate names appropriately without a long <select> element escaping the screen area; the improvement is that we also keep the title within a single line now; uses some flex layout shenanigans... * the margins / paddings are adjusted so the selected label of the <select> fits within the rest of that title nicely; also some inconsistency in the way that Firefox renders a <select> with "appearance: none" (roughly 4px more padding left and right of the text than e.g. Chrome) is worked around, and it now produces a result that looks (essentially) identical to Chrome * the color of the help menu and settings menu border in light theme is made to match with the color of the corresponding buttons, like they do (match) in the ayu theme * the casing of "All crates" changes to "all crates" * the new tests from #99086 are temporarily disabled, until they can be adapted later
2022-08-10errors: don't fail on broken primary translationsDavid Wood-6/+25
If a primary bundle doesn't contain a message then the fallback bundle is used. However, if the primary bundle's message is broken (e.g. it refers to a interpolated variable that the compiler isn't providing) then this would just result in a compiler panic. While there aren't any primary bundles right now, this is the type of issue that could come up once translation is further along. Signed-off-by: David Wood <david.wood@huawei.com>
2022-08-10Rustdoc-Json: Add `Path` type for traits.Nixon Enraght-Moony-28/+27
Closes #100106
2022-08-10add testb-naber-0/+36
2022-08-10Auto merge of #100356 - matthiaskrgr:rollup-he0vkjc, r=matthiaskrgrbors-193/+275
Rollup of 8 pull requests Successful merges: - #99573 (Stabilize backtrace) - #100069 (Add error if link_ordinal used with unsupported link kind) - #100086 (Add more `// unit-test`s to MIR opt tests) - #100332 (Rename integer log* methods to ilog*) - #100334 (Suggest a missing semicolon before an array) - #100340 (Iterate generics_def_id_map in reverse order to fix P-critical issue) - #100345 (docs: remove repetition in `is_numeric` function docs) - #100352 (Update cargo) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-08-10Rollup merge of #100340 - spastorino:fix-100187, r=compiler-errorsMatthias Krüger-0/+12
Iterate generics_def_id_map in reverse order to fix P-critical issue Closes #100187 Fixes a `P-critical` beta regression.
2022-08-10Rollup merge of #100334 - TaKO8Ki:suggest-missing-semicolon-before-array, ↵Matthias Krüger-0/+53
r=fee1-dead Suggest a missing semicolon before an array fixes #99658
2022-08-10Rollup merge of #100332 - eholk:stabilize-ilog, r=scottmcmMatthias Krüger-2/+2
Rename integer log* methods to ilog* This reflects the concensus from the libs team as reported at https://github.com/rust-lang/rust/issues/70887#issuecomment-1209513261. Joint work with `@yoshuawuyts.`
2022-08-10Rollup merge of #100086 - JakobDegen:better-tests, r=wesleyweiserMatthias Krüger-186/+167
Add more `// unit-test`s to MIR opt tests I only changed things which are hopefully completely uninteresting. I plan to submit more PRs that cover more files, but those cases will need some more complicated (and hence possibly controversial) changes, so I'll try and submit those in reasonably sized batches. r? rust-lang/wg-mir-opt
2022-08-10Rollup merge of #100069 - dpaoliello:linkordinal, r=michaelwoeristerMatthias Krüger-0/+41
Add error if link_ordinal used with unsupported link kind The `link_ordinal` attribute only has an affect if the `raw-dylib` link kind is used, so add an error if it is used with any other link kind.
2022-08-10Rollup merge of #99573 - tbodt:stabilize-backtrace, r=yaahcMatthias Krüger-5/+0
Stabilize backtrace This PR stabilizes the std::backtrace module. As of #99431, the std::Error::backtrace item has been removed, and so the rest of the backtrace feature is set to be stabilized. Previous discussion can be found in #72981, #3156. Stabilized API summary: ```rust pub mod std { pub mod backtrace { pub struct Backtrace { } pub enum BacktraceStatus { Unsupported, Disabled, Captured, } impl fmt::Debug for Backtrace {} impl Backtrace { pub fn capture() -> Backtrace; pub fn force_capture() -> Backtrace; pub const fn disabled() -> Backtrace; pub fn status(&self) -> BacktraceStatus; } impl fmt::Display for Backtrace {} } } ``` `@yaahc`
2022-08-09Fix failing testNoah Lev-1/+1
For some reason, adding some text to match against makes this test pass. Before, when it was *more* general, it was failing! This seems very likely to be a bug in htmldocck, which I'm going to investigate.
2022-08-09Stringify non-shorthand visibility correctlyJacob Pratt-2/+3
2022-08-10Fall back when relating two opaques by substs in MIR typeckMichael Goulet-0/+65
2022-08-09Add regression test for #93205Noah Lev-0/+20
This issue was most likely fixed by #93805.
2022-08-10remove a type string comparisonTakayuki Maeda-1/+68
2022-08-09Add more `// unit-test`s to MIR opt testsJakob Degen-186/+167
2022-08-09Make the GATS self outlives error take into GATs in the inputsJack Huey-1/+25
2022-08-10Rollup merge of #100323 - GuillaumeGomez:impl-blocks-only-private, r=notriddleMatthias Krüger-0/+84
[rustdoc] Don't render impl blocks with doc comment if they only contain private items by default Fixes #100001. cc `@jhpratt` r? `@notriddle`
2022-08-10Rollup merge of #100314 - JakobDegen:test-docs, r=RalfJungMatthias Krüger-0/+12
Mention `unit-test` in MIR opt test README r? `@RalfJung`
2022-08-10Rollup merge of #100261 - luqmana:suggestions-overflow, r=lcnrMatthias Krüger-0/+43
Set tainted errors bit before emitting coerce suggestions. Fixes #100246. #89576 basically got 99% of the way there but the match typechecking code (which calls `coerce_inner`) also needed a similar fix.
2022-08-10Rollup merge of #100240 - cjgillot:noice-structural-match, r=davidtwcoMatthias Krüger-0/+41
Fail gracefully when const pattern is not structural match. Fixes https://github.com/rust-lang/rust/issues/82909
2022-08-10Rollup merge of #100226 - cjgillot:noice-multibyte, r=davidtwcoMatthias Krüger-0/+54
Do not manually craft a span pointing inside a multibyte character. Fixes https://github.com/rust-lang/rust/issues/92462