about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2022-07-05Auto merge of #98925 - Dylan-DPC:rollup-9185c9y, r=Dylan-DPCbors-125/+142
Rollup of 5 pull requests Successful merges: - #97712 (ptr::copy and ptr::swap are doing untyped copies) - #98624 (lints: mostly translatable diagnostics) - #98776 (rustdoc: improve click behavior of the source code mobile full-screen "sidebar") - #98856 (Remove FIXME from rustdoc intra-doc test) - #98913 (:arrow_up: rust-analyzer) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-07-05adjust dangling-int-ptr error messageRalf Jung-32/+32
2022-07-05Rollup merge of #98856 - GuillaumeGomez:rustdoc-test-rm-fixme, r=Dylan-DPCDylan DPC-12/+2
Remove FIXME from rustdoc intra-doc test Removed the FIXME. For the `extern crate`, even if `pub` exported, its documentation wasn't rendered so there is no point in keeping it. r? ``@notriddle``
2022-07-05Rollup merge of #98776 - notriddle:notriddle/mobile-sidebar-auto-close, ↵Dylan DPC-0/+31
r=GuillaumeGomez rustdoc: improve click behavior of the source code mobile full-screen "sidebar" On desktop, if you open the source code sidebar, it stays open even when you move from page to page. It used to do the same thing on mobile, but I think that's stupid. Since the file list fills the entire screen on mobile, and you can't really do anything with the currently selected file other than dismiss the "sidebar" to look at it, it's safe to assume that anybody who clicks a file in that list probably wants the list to go away so they can see it. Split out separately from #98772
2022-07-05Rollup merge of #98624 - davidtwco:translation-on-lints, r=compiler-errorsDylan DPC-113/+109
lints: mostly translatable diagnostics As lints are created slightly differently than other diagnostics, intended to try make them translatable first and then look into the applicability of diagnostic structs but ended up just making most of the diagnostics in the crate translatable (which will still be useful if I do make a lot of them structs later anyway). r? ``@compiler-errors``
2022-07-05adapt issue-37945 codegen test to accept any order of opsKrasimir Georgiev-2/+6
2022-07-05Auto merge of #96862 - oli-obk:enum_cast_mir, r=RalfJungbors-8/+158
Change enum->int casts to not go through MIR casts. follow-up to https://github.com/rust-lang/rust/pull/96814 this simplifies all backends and even gives LLVM more information about the return value of `Rvalue::Discriminant`, enabling optimizations in more cases.
2022-07-04rustdoc: filter '_ lifetimes from ty::GenericsMichael Howell-0/+12
Fixes a weirdly-rendered section of the std::string::String docs.
2022-07-05Rollup merge of #98873 - ↵Dylan DPC-0/+22
TaKO8Ki:suggest-default-derive-to-enum-with-default-attribute, r=fee1-dead Suggest `#[derive(Default)]` to enums with `#[default]` fixes #95226
2022-07-05Rollup merge of #98761 - lcnr:need_type_info-cont, r=estebankDylan DPC-24/+86
more `need_type_info` improvements this now deals with macros in suggestions and the source cost computation does what I want for `channel` :tada: r? ``@estebank``
2022-07-05Avoid the unnecessary innermost match in `partial_cmp`/`cmp`.Nicholas Nethercote-105/+23
We currently do a match on the comparison of every field in a struct or enum variant. But the last field has a degenerate match like this: ``` match ::core::cmp::Ord::cmp(&self.y, &other.y) { ::core::cmp::Ordering::Equal => ::core::cmp::Ordering::Equal, cmp => cmp, }, ``` This commit changes it to this: ``` ::core::cmp::Ord::cmp(&self.y, &other.y), ``` This is fairly straightforward thanks to the existing `cs_fold1` function. The commit also removes the `cs_fold` function which is no longer used. (Note: there is some repetition now in `cs_cmp` and `cs_partial_cmp`. I will remove that in a follow-up PR.)
2022-07-04Rollup merge of #98886 - michaelwoerister:tracked-split-dwarf-kind, r=davidtwcoMatthias Krüger-0/+33
incr.comp.: Make split-dwarf commandline options [TRACKED]. This commandline options have an influence on the contents of object files (and .dwo files), so they need to be `[TRACKED]`. r? `@davidtwco`
2022-07-04Rollup merge of #98879 - compiler-errors:async-closure-wrap-parens, r=oli-obkMatthias Krüger-2/+22
Fix "wrap closure in parenthesis" suggestion for `async` closure Fixes #98023
2022-07-04Rollup merge of #98814 - fmease:minimal-fix-for-issue-97933, r=GuillaumeGomezMatthias Krüger-3/+160
rustdoc: Censor certain complex unevaluated const exprs Fixes #97933. This is more of a hotfix for the aforementioned issue. By that, I mean that my proposed patch is not the best solution but one that does not change as much existing code. It treats symptoms rather than the root cause. This PR “censors” certain complex unevaluated constant expressions like `match`es, blocks, function calls, struct literals etc. by pretty-printing them as `_` / `{ _ }` (number and string literals, paths and `()` are still printed as one would expect). Resorting to this placeholder is preferable to printing the full expression verbatim since they can be quite large and verbose resulting in an unreadable mess in the generated documentation. Further, mindlessly printing the const would leak private and `doc(hidden)` struct fields (#97933), at least in the current stable & nightly implementations which rely on `span_to_snippet` (!) and `rustc_hir_pretty::id_to_string`. The censoring of _verbose_ expressions is probably going to stay longer term. However, in regards to private and `doc(hidden)` struct fields, I have a more proper fix in mind which I have already partially implemented locally and for which I am going to open a separate PR sometime soon. For that, I was already in contact with `@GuillaumeGomez.` The proper fix involves rustdoc not falling back on pretty-printing unevaluated consts so easily (what this PR is concerned about) and instead preferring to print evaluated consts which contain more information allowing it to selectively hide private and `doc(hidden)` fields, create hyperlinks etc. generally making the output more granular and precise (compared to the brutal `_` placeholder). Unfortunately, I was a bit too late and the issue just hit stable (1.62). Should this be backported to beta or even a potential 1.62.1? r? `@GuillaumeGomez`
2022-07-04Rollup merge of #98782 - compiler-errors:specialization-error-span, r=oli-obkMatthias Krüger-11/+11
Improve spans for specialization error Fixes #98777
2022-07-04rustdoc: censor certain complex unevaluated const exprsLeón Orell Valerian Liehr-3/+160
2022-07-04Auto merge of #98573 - krasimirgg:nlmb-llvm-nm, r=nikicbors-10/+14
adapt native-link-modifier-bundle test to use llvm-nm No functional changes intended. This updates the test case to use `llvm-nm` as an alternative to https://github.com/rust-lang/rust/pull/98424. This fixes a test failure over at the experimental build of rustc with HEAD LLVM: https://buildkite.com/llvm-project/rust-llvm-integrate-prototype/builds/11144#01814d0f-a46a-4c19-91cf-41e720edb6f9/684-691. The issue is that this test uses the system nm, which may not be recent enough to understand the bitcode produced by rustc when compiled against HEAD LLVM. Similar to what we did for another test in https://github.com/rust-lang/rust/pull/94023.
2022-07-04add regression test for #79467Takayuki Maeda-0/+17
2022-07-04adapt native-link-modifier-bundle test to use llvm-nmKrasimir Georgiev-10/+14
2022-07-04incr.comp.: Make split-dwarf commandline options [TRACKED].Michael Woerister-0/+33
2022-07-04`InferSource::GenericArg`, check for containslcnr-13/+22
2022-07-04resolve vars in node substslcnr-2/+11
2022-07-04stop suggesting things inside of macroslcnr-8/+6
2022-07-04update infer cost computation for typeslcnr-15/+61
2022-07-04suggest `#[derive(Default)]` to enums with `#[default]`Takayuki Maeda-0/+22
2022-07-04Auto merge of #98641 - lcnr:mir-dropck, r=oli-obkbors-76/+18
fully move dropck to mir r? `@oli-obk`
2022-07-04Avoid unnecessary 1-tuples in derived code.Nicholas Nethercote-32/+32
2022-07-04Don't repeat `AssertParamIs{Clone,Eq}` assertions.Nicholas Nethercote-13/+0
It's common to see repeated assertions like this in derived `clone` and `eq` methods: ``` let _: ::core::clone::AssertParamIsClone<u32>; let _: ::core::clone::AssertParamIsClone<u32>; ``` This commit avoids them.
2022-07-04Avoid unnecessary blocks in derive output.Nicholas Nethercote-316/+260
By not committing to either block form or expression form until necessary, we can avoid lots of unnecessary blocks.
2022-07-04Add 0-variant and 1-variant enums to the `deriving-all-codegen.rs` test.Nicholas Nethercote-0/+176
Because they are interesting cases with their own code generation paths.
2022-07-04Add a union to the `deriving-all-codegen.rs` test.Nicholas Nethercote-0/+26
Because `derive(Clone)` on unions triggers special behaviour.
2022-07-04fully move dropck to mirlcnr-76/+18
2022-07-04Fix wrap parenthesis suggestion for async closureMichael Goulet-2/+22
2022-07-04Rollup merge of #98870 - TaKO8Ki:add-regression-test-for-86784, ↵Matthias Krüger-0/+2597
r=compiler-errors Add regression test for #86784 closes #86784
2022-07-04Rollup merge of #98823 - compiler-errors:rust-call-mir-inline, r=cjgillotMatthias Krüger-0/+3
Fix rust-call ICE in mir-inliner Fixes #98821 r? ``@cjgillot``
2022-07-04Rollup merge of #98806 - GuillaumeGomez:decl-trailing-whitespace, r=notriddleMatthias Krüger-1/+38
Fix long declaration trailing whitespace Fixes https://github.com/rust-lang/rust/issues/98803. Interestingly enough, it even simplifies the code a bit. r? `@notriddle`
2022-07-04Rollup merge of #98774 - notriddle:notriddle/source-code-sidebar-button, ↵Matthias Krüger-0/+27
r=GuillaumeGomez rustdoc: make source sidebar toggle a real button This fixes tab focus, so that you can open and close the sidebar from keyboard. This should cause no visible change in appearance at all. The only way you'd know anything different is if you tried to use keyboard controls to open the source code file navigation sidebar. Separated out from #98772
2022-07-04add regression test for #86784Takayuki Maeda-0/+2597
2022-07-04Auto merge of #98446 - nnethercote:derive-no-match-destructuring, r=scottmcmbors-393/+300
Don't use match-destructuring for derived ops on structs. r? `@scottmcm`
2022-07-04Don't use match-destructuring for derived ops on structs.Nicholas Nethercote-426/+221
All derive ops currently use match-destructuring to access fields. This is reasonable for enums, but sub-optimal for structs. E.g.: ``` fn eq(&self, other: &Point) -> bool { match *other { Self { x: ref __self_1_0, y: ref __self_1_1 } => match *self { Self { x: ref __self_0_0, y: ref __self_0_1 } => (*__self_0_0) == (*__self_1_0) && (*__self_0_1) == (*__self_1_1), }, } } ``` This commit changes derive ops on structs to use field access instead, e.g.: ``` fn eq(&self, other: &Point) -> bool { self.x == other.x && self.y == other.y } ``` This is faster to compile, results in smaller binaries, and is simpler to generate. Unfortunately, we have to keep the old pattern generating code around for `repr(packed)` structs because something like `&self.x` (which doesn't show up in `PartialEq` ops, but does show up in `Debug` and `Hash` ops) isn't allowed. But this commit at least changes those cases to use let-destructuring instead of match-destructuring, e.g.: ``` fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) -> () { { let Self(ref __self_0_0) = *self; { ::core::hash::Hash::hash(&(*__self_0_0), state) } } } ``` There are some unnecessary blocks remaining in the generated code, but I will fix them in a follow-up PR.
2022-07-04Add an interesting case to the `deriving-all-codegen.rs` test.Nicholas Nethercote-2/+114
2022-07-03Rollup merge of #98799 - jyn514:rustdoc-lint-help, r=GuillaumeGomezRalf Jung-392/+26
Fix bug in `rustdoc -Whelp` Previously, this printed the debugging options, not the lint options, and only handled `-Whelp`, not `-A/-D/-F`. This also fixes a few other misc issues: - Fix `// check-stdout` for UI tests; previously it only worked for run-fail and compile-fail tests - Add lint headers for tool lints, not just builtin lints https://github.com/rust-lang/rust/pull/98533#issuecomment-1172004197 r? ```@GuillaumeGomez```
2022-07-03Rollup merge of #98773 - notriddle:notriddle/source-sidebar-details, ↵Ralf Jung-34/+73
r=GuillaumeGomez rustdoc: use <details> tag for the source code sidebar This fixes the extremely poor accessibility of the old system, making it possible to navigate the sidebar by keyboard, and also implicitly gives the sidebar items the correct ARIA roles. Split out separately from #98772
2022-07-03Add test for trailing whitespace in long declarationGuillaume Gomez-1/+38
2022-07-03Remove FIXME from rustdoc intra-doc testGuillaume Gomez-12/+2
2022-07-03ensure rustc does not panic by the test for issue-26092Yoshiki Matsuda-1/+3
2022-07-02Fix rust-call ICE in mir-inlinerMichael Goulet-0/+3
2022-07-02Rollup merge of #98715 - matthiaskrgr:test_97047, r=Mark-SimulacrumRalf Jung-0/+86
add ice test for #97047 Fixes #97047
2022-07-02Rollup merge of #98701 - TaKO8Ki:add-regression-test-for-50439, ↵Ralf Jung-0/+39
r=Mark-Simulacrum Add regression test for #50439 closes #50439
2022-07-02rustdoc: add gui test case ensuring source sidebar doesn't spontaneously openMichael Howell-1/+10