about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2023-01-08Auto merge of #106449 - GuillaumeGomez:rustdoc-gui-retry-mechanism, ↵bors-46/+76
r=Mark-Simulacrum Add retry mechanism for rustdoc GUI tests to reduce flakyness Part of #93784. I added 3 retries for failing GUI tests. An important note: if more than half of total tests fail, I don't retry because it's very likely not flakyness anymore at this point but a missing update after changes.
2023-01-08Rollup merge of #106581 - estebank:bad-suggestion, r=compiler-errorsYuki Okushi-0/+29
Do not emit wrong E0308 suggestion for closure mismatch Found in #76353.
2023-01-08Rollup merge of #106580 - Ezrashaw:remove-e0313, r=compiler-errorsYuki Okushi-2/+2
remove unreachable error code `E0313` Fixes #103742 Makes #103433 redundant Implements removal of `E0313`. I agree with the linked issue that this error code is unreachable but if someone could confirm that would be great, are crater runs done for this sort of thing? Also removed a redundant `// ignore-tidy-filelength` that I found while reading code. cc ``@GuillaumeGomez`` #61137
2023-01-08Rollup merge of #106557 - Ezrashaw:ui-test-fixups-1, r=GuillaumeGomezYuki Okushi-12/+49
Add some UI tests and reword error-code docs Added UI tests for `E0013` and `E0015`. Error code docs for `E0015` were a bit unclear (they referred to all non-const errors in const context, when only non-const functions applied), so I touched them up a bit. I also fixed up some issues in the new `error_codes.rs` tidy check (linked #106341), that I overlooked previously. r? ``@GuillaumeGomez``
2023-01-08Rollup merge of #106546 - aDotInTheVoid:jsondoclint-path-local-item, r=notriddleYuki Okushi-4/+125
jsondoclint: Check local items in `paths` are also in `index`. Would have caught #104064 (if core.json was linted in CI). Closes #106433. r? rustdoc
2023-01-08Rollup merge of #106457 - kadiwa4:no-bless, r=Mark-SimulacrumYuki Okushi-3/+3
Adjust comments about pre-push.sh hook Follow-up to #101175.
2023-01-08Rollup merge of #106410 - clubby789:borrow-mut-self-mut-self-diag, ↵Yuki Okushi-0/+27
r=compiler-errors Suggest `mut self: &mut Self` for `?Sized` impls Closes #106325 Closes #93078 The suggestion is _probably_ not what the user wants (hence `MaybeIncorrect`) but at least makes the problem in the above issues clearer. It might be better to add a note explaining why this is the case, but I'm not sure how best to word that so this is a start. ``@rustbot`` label +A-diagnostics
2023-01-08Do not emit wrong E0308 suggestion for closure mismatchEsteban Küber-4/+0
2023-01-08Add testEsteban Küber-0/+33
2023-01-08remove unreachable error code `E0313`Ezra Shaw-2/+2
2023-01-08Auto merge of #104658 - thomcc:rand-update-and-usable-no_std, r=Mark-Simulacrumbors-1/+0
Update `rand` in the stdlib tests, and remove the `getrandom` feature from it. The main goal is actually removing `getrandom`, so that eventually we can allow running the stdlib test suite on tier3 targets which don't have `getrandom` support. Currently those targets can only run the subset of stdlib tests that exist in uitests, and (generally speaking), we prefer not to test libstd functionality in uitests, which came up recently in https://github.com/rust-lang/rust/pull/104095 and https://github.com/rust-lang/rust/pull/104185. Additionally, the fact that we can't update `rand`/`getrandom` means we're stuck with the old set of tier3 targets, so can't test new ones. ~~Anyway, I haven't checked that this actually does allow use on tier3 targets (I think it does not, as some work is needed in stdlib submodules) but it moves us slightly closer to this, and seems to allow at least finally updating our `rand` dep, which definitely improves the status quo.~~ Checked and works now. For the most part, our tests and benchmarks are fine using hard-coded seeds. A couple tests seem to fail with this (stuff manipulating the environment expecting no collisions, for example), or become pointless (all inputs to a function become equivalent). In these cases I've done a (gross) dance (ab)using `RandomState` and `Location::caller()` for some extra "entropy". Trying to share that code seems *way* more painful than it's worth given that the duplication is a 7-line function, even if the lines are quite gross. (Keeping in mind that sharing it would require adding `rand` as a non-dev dep to std, and exposing a type from it publicly, all of which sounds truly awful, even if done behind a perma-unstable feature). See also some previous attempts: - https://github.com/rust-lang/rust/pull/86963 (in particular https://github.com/rust-lang/rust/pull/86963#issuecomment-885438936 which explains why this is non-trivial) - https://github.com/rust-lang/rust/pull/89131 - https://github.com/rust-lang/rust/pull/96626#issuecomment-1114562857 (I tried in that PR at the same time, but settled for just removing the usage of `thread_rng()` from the benchmarks, since that was the main goal). - https://github.com/rust-lang/rust/pull/104185 - Probably more. It's very tempting of a thing to "just update". r? `@Mark-Simulacrum`
2023-01-08doc/test: add UI test and reword docs for `E0013` and `E0015`Ezra Shaw-0/+34
2023-01-07Auto merge of #106573 - matthiaskrgr:rollup-zkgfsta, r=matthiaskrgrbors-64/+110
Rollup of 10 pull requests Successful merges: - #101936 (Migrating rustc_infer to session diagnostics (part 3)) - #104081 (PhantomData layout guarantees) - #104543 (Migrate `codegen_ssa` to diagnostics structs - [Part 3]) - #105128 (Add O(1) `Vec -> VecDeque` conversion guarantee) - #105517 (Fix process-panic-after-fork.rs to pass on newer versions of Android.) - #105859 (Point out span where we could introduce higher-ranked lifetime) - #106509 (Detect closures assigned to binding in block) - #106553 (docs: make `HashSet::retain` doctest more clear) - #106556 (rustdoc: remove no-op mobile CSS `.content { margin-left: 0 }`) - #106564 (Change to immutable borrow when cloning element of RepeatN) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-01-07Rollup merge of #106556 - notriddle:notriddle/margin-left-content-mobile, ↵Matthias Krüger-4/+0
r=GuillaumeGomez rustdoc: remove no-op mobile CSS `.content { margin-left: 0 }` This rule was added to override non-zero left margin on `.content`, which was removed in 135281ed1525db15edd8ebd092aa10aa40df2386 and the margin-left was put on the docblock.
2023-01-07Rollup merge of #106509 - estebank:closure-in-block, r=davidtwcoMatthias Krüger-24/+33
Detect closures assigned to binding in block Fix #58497.
2023-01-07Rollup merge of #105859 - compiler-errors:hr-lifetime-add, r=davidtwcoMatthias Krüger-0/+36
Point out span where we could introduce higher-ranked lifetime Somewhat addresses #105422, but not really. We don't have that much useful information here since we're still in resolution :^( Maybe this suggestion isn't worth it. If the reviewer has an idea how we can get a more succinct binder information for a structured suggestion, it would be appreciated.
2023-01-07Rollup merge of #105517 - pcc:process-panic-after-fork, r=davidtwcoMatthias Krüger-36/+41
Fix process-panic-after-fork.rs to pass on newer versions of Android. The test process-panic-after-fork.rs was checking that abort() resulted in SIGSEGV on Android. This non-standard behavior was fixed back in 2013, so let's fix the test to also accept the standard behavior on Android.
2023-01-07Auto merge of #106036 - JohnTitor:issue-86106, r=nikicbors-0/+62
Add regression test for #86106 Closes #86106 r? `@nikic` Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2023-01-07Auto merge of #105323 - cjgillot:simplify-const-prop, r=davidtwcobors-509/+362
Perform SimplifyLocals before ConstProp. MIR before `ConstProp` may have a lot of dead writes, this makes `ConstProp` do unnecessary work. r? `@ghost`
2023-01-07Auto merge of #106519 - estebank:tail-unit, r=cjgillotbors-0/+131
Detect bindings assigned blocks without tail expressions Fix #44173.
2023-01-07Auto merge of #106283 - JulianKnodt:enum_err, r=cjgillotbors-0/+51
Add help diag. for `const = Enum` missing braces around `Enum` Previously it was not clear why this errored or if it was even supported, as there was no diagnostic that suggested wrapping it in braces. Thus, add a simple diagnostic that suggests wrapping enum variants in braces. Fixes #105927
2023-01-07Apply `merge-functions=disabled`Yuki Okushi-2/+9
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2023-01-07Apply review suggestionsYuki Okushi-9/+8
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2023-01-07Add regression test for #86106Yuki Okushi-0/+56
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2023-01-07Auto merge of #106558 - compiler-errors:rollup-lkii3j3, r=compiler-errorsbors-71/+67
Rollup of 4 pull requests Successful merges: - #106525 (Report WF error for chalk *and* new solver) - #106533 (Use smaller spans for missing lifetime/generic args) - #106543 (rustdoc: remove no-op CSS `.rustdoc.source .sidebar { width: 0 }`) - #106554 (Fix a typo in the explanation of E0588) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-01-06Rollup merge of #106543 - notriddle:notriddle/source-sidebar-width-zero, ↵Michael Goulet-11/+7
r=GuillaumeGomez rustdoc: remove no-op CSS `.rustdoc.source .sidebar { width: 0 }` This CSS was added in dc2c9723343c985740be09919236a6e96c4e4433, before 6a5f8b1aef1417d7dc85b5d0a229d2db1930eb7c when the sidebars were merged. Now that they are merged, the source sidebar is being pushed off-screen anyway, so giving it zero width doesn't do much.
2023-01-06Rollup merge of #106533 - ↵Michael Goulet-56/+56
TaKO8Ki:use-smaller-span-for-missing-lifetime/generic-args, r=compiler-errors Use smaller spans for missing lifetime/generic args We can remove ident from suggestions.
2023-01-06Rollup merge of #106525 - compiler-errors:new-solver-wf, r=jackh726Michael Goulet-4/+4
Report WF error for chalk *and* new solver addressing this nit https://github.com/rust-lang/rust/pull/106385#discussion_r1062571070 No test yet because new solver is currently unusable, lol r? `@lcnr`
2023-01-07minor fixes for `error_codes.rs` tidy checkEzra Shaw-12/+15
2023-01-06rustdoc: remove no-op mobile CSS `.content { margin-left: 0 }`Michael Howell-4/+0
This rule was added to override non-zero left margin on `.content`, which was removed in 135281ed1525db15edd8ebd092aa10aa40df2386 and the margin-left was put on the docblock.
2023-01-07Auto merge of #106538 - aDotInTheVoid:strip-use-doc-hidden, r=notriddlebors-1/+29
rustdoc: Strip imports of items which are `#[doc(hidden)]` Closes #106379
2023-01-07Auto merge of #106544 - matthiaskrgr:rollup-e9prjed, r=matthiaskrgrbors-1019/+1067
Rollup of 7 pull requests Successful merges: - #106287 (Add some docs to `bug`, `span_bug` and `delay_span_bug`) - #106341 (refactor: clean up `errors.rs` and `error_codes_check.rs`) - #106453 (Improve include macro documentation) - #106466 (Fix rustdoc source code rendering for `#[path = "../path/to/mod.rs"]` links) - #106528 (Tiny formatting fix) - #106534 (rustdoc-gui: Use new block syntax for define-function in goml scripts) - #106542 (Add default and latest stable edition to --edition in rustc (attempt 2)) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-01-06jsondoclint: Check local items in `paths` are also in `index`.Nixon Enraght-Moony-4/+125
2023-01-06Auto merge of #106415 - Nilstrieb:where-is-my-master-branch, r=jyn514bors-75/+187
Handle non-existent upstream master branches in `x fmt` People who do have a remote for `rust-lang/rust` but don't have the master branch checked out there used to get this error when running `x fmt`: > fatal: ambiguous argument 'rust/master': unknown revision or path not in the working tree. > Use '--' to separate paths from revisions, like this: > 'git <command> [<revision>...] -- [<file>...]' > rust/master Which is not exactly helpful. Now, we fall back to `origin/master` (hoping that at least that remote exists) for that case. If there is still some error, we just fall back to `x fmt .` and print a warning. r? `@jyn514`
2023-01-06Rollup merge of #106534 - GuillaumeGomez:block-syntax, r=notriddleMatthias Krüger-592/+574
rustdoc-gui: Use new block syntax for define-function in goml scripts r? `@notriddle`
2023-01-06Rollup merge of #106466 - clubby789:relative-module-fix, r=notriddleMatthias Krüger-41/+109
Fix rustdoc source code rendering for `#[path = "../path/to/mod.rs"]` links Fixes #103517 While generating the location for modules source HTML to be saved at, a `..` path component appeared to be translated to `/up/`. Additionally, while generating the navigation sidebar, `..` path components were ignored. This means that (as in the issue above), a *real* directory structure of: ``` sys/ unix/ mod.rs <-- contains #![path = "../unix/mod.rs] cmath.rs ``` was rendered as: ``` sys/ unix/ mod.rs unix/ cmath.rs <-- links to sys/unix/unix/cmath.rs.html, 404 ``` While the *files* were stored as ``` sys/ unix/ mod.rs.html up/ unix/ cmath.rs.html ```
2023-01-06Rollup merge of #106341 - Ezrashaw:refactor-error-code-tidy-check, ↵Matthias Krüger-386/+384
r=mejrs,klensy,GuillaumeGomez refactor: clean up `errors.rs` and `error_codes_check.rs` `errors.rs` is basically unused now, `error_codes_check.rs` is useful but not well commented, etc. It also doesn't check certain things which are certainly not correct. For example, `E0505` has a UI test in `src/test/ui/error-codes/` but that test actually outputs `E0504`?! Other issues like these exist. I've implemented these with "warnings" which are a bit rough around the edges but should be removed eventually. r? `@GuillaumeGomez` (again not sure if you want to review but its relevant to you)
2023-01-06rustdoc: remove no-op CSS `.rustdoc.source .sidebar { width: 0 }`Michael Howell-11/+7
This CSS was added in dc2c9723343c985740be09919236a6e96c4e4433, before 6a5f8b1aef1417d7dc85b5d0a229d2db1930eb7c when the sidebars were merged. Now that they are merged, the source sidebar is being pushed off-screen anyway, so giving it zero width doesn't do much.
2023-01-06Handle non-existant upstream master branches in `x fmt`Nilstrieb-19/+99
2023-01-06rustdoc: Strip imports of items which are `#[doc(hidden)]`Nixon Enraght-Moony-1/+29
Closes #106379
2023-01-06Auto merge of #106501 - cjgillot:resolved-elided-apit, r=compiler-errorsbors-0/+5
Correct detection of elided lifetimes in impl-trait. Fixes https://github.com/rust-lang/rust/issues/106338 r? `@compiler-errors` cc `@pnkfelix`
2023-01-06Use new block syntax for define-function in goml scriptsGuillaume Gomez-591/+573
2023-01-06Update testsclubby789-0/+6
2023-01-06Correctly render sidebar for relative module pathsclubby789-41/+103
2023-01-06Auto merge of #106474 - erikdesjardins:noalias, r=bjorn3bors-0/+23
cleanup: handle -Zmutable-noalias like -Zbox-noalias r? `@bjorn3` cc `@RalfJung` this will conflict with #106180
2023-01-06Update browser-ui-test versionGuillaume Gomez-1/+1
2023-01-06use smaller spans for missing lifetime/generic argsTakayuki Maeda-56/+56
fix rustdoc ui test
2023-01-06Auto merge of #105805 - yanchen4791:issue-105227-fix, r=estebankbors-31/+102
Suggest adding named lifetime when the return contains value borrowed from more than one lifetimes of function inputs fix for #105227. The problem: The suggestion of adding an explicit `'_` lifetime bound is **incorrect** when the function's return type contains a value which could be borrowed from more than one lifetimes of the function's inputs. Instead, a named lifetime parameter can be introduced in such a case. The solution: Checking the number of elided lifetimes in the function signature. If more than one lifetimes found in the function inputs when the suggestion of adding explicit `'_` lifetime, change it to using named lifetime parameter `'a` instead.
2023-01-06Auto merge of #106529 - Dylan-DPC:rollup-mvncmrk, r=Dylan-DPCbors-16/+267
Rollup of 5 pull requests Successful merges: - #106400 (Point at expressions where inference refines an unexpected type) - #106491 (Fix error-index redirect to work with the back button.) - #106494 (Add regression test for #58355) - #106499 (fix [type error] for error E0029 and E0277) - #106502 (rustdoc: remove legacy user-select CSS) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-01-06Rollup merge of #106502 - notriddle:notriddle/user-select, r=GuillaumeGomezDylan DPC-2/+0
rustdoc: remove legacy user-select CSS According to [caniuse], the only supported browser that requires the vendor prefix, as defined in [RFC 1985], is Safari. * The last version of Chrome that required a vendor prefix was version 53. The current version is 108. * Firefox 68 is the last version that required a vendor prefix. The [current Firefox ESR] is version 102. * The current version of Safari for Mac and iOS still requires a prefix. * The last version of Edge that required a vendor frefix was 18. The current version of Edge is 108. * UCAndroid support is unknown, but if it still requires a vendor prefix, it's more likely to be `-webkit-` than `-moz-` or `-ms-`, since they would want to emulate iOS for compatibility. [caniuse]: https://caniuse.com/?search=user-select [RFC 1985]: https://rust-lang.github.io/rfcs/1985-tiered-browser-support.html [current Firefox ESR]: https://wiki.mozilla.org/Releases