about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2023-01-09Rollup merge of #106291 - obeis:issue-106182, r=oli-obkfee1-dead-3/+48
Fix incorrect suggestion for extra `&` in pattern Closes #106182
2023-01-09Rollup merge of #106047 - uweigand:s390x-test-bigendian-ui, r=oli-obkfee1-dead-1130/+1716
Fix ui constant tests for big-endian platforms A number of tests under ui/const-ptr and ui/consts are currently failing on big-endian platforms as the binary encoding of some constants is hard-coded in the stderr test files. Fix this by a combination of two types of changes: - Where possible (i.e. where the particular value of a constant does not affect the purpose of the test), choose constant values that have the same encoding on big- and little-endian platforms. - Where this is not possible, provide a normalize-stderr-test rule that transforms the printed big-endian encoding of such constants into the corresponding little-endian form. Fixes part of https://github.com/rust-lang/rust/issues/105383.
2023-01-09Rollup merge of #105655 - RedDocMD:bug-105645, r=oli-obkfee1-dead-0/+26
Remove invalid case for mutable borrow suggestion If we have a call such as `foo(&mut buf)` and after reference collapsing the type is inferred as `&T` where-as the required type is `&mut T`, don't suggest `foo(&mut mut buf)`. This is wrong syntactically and the issue lies elsewhere, not in the borrow. Fixes #105645
2023-01-09Rollup merge of #105292 - JulianKnodt:no_eager_commit, r=BoxyUwUfee1-dead-0/+195
Change a commit_if_ok call to probe Removes an over-eager `commit_if_ok` which makes inference worse. I'm not entirely sure whether it's ok to remove the check that types are the same, because casting seems to cause equality checks with incorrect types? Fixes #105037 r? ```@BoxyUwU```
2023-01-09add dtors_in_dtors_in_dtorsRalf Jung-0/+57
2023-01-09Auto merge of #101947 - aliemjay:astconv-normalize, r=lcnrbors-189/+814
Don't normalize in AstConv See individual commits. Fixes #101350 Fixes #54940
2023-01-09Auto merge of #2753 - RalfJung:rustup, r=RalfJungbors-2601/+5054
Rustup Pulls in https://github.com/rust-lang/rust/pull/104658
2023-01-09Merge from rustcRalf Jung-2600/+5053
2023-01-09Preparing for merge from rustcRalf Jung-1/+1
2023-01-09Auto merge of #2752 - RalfJung:win-env-current-exe, r=RalfJungbors-13/+85
make env::current_exe work on Windows
2023-01-09make env::current_exe work on WindowsRalf Jung-13/+85
2023-01-09Auto merge of #106340 - saethlin:propagate-operands, r=oli-obkbors-0/+46
Always permit ConstProp to exploit arithmetic identities Fixes https://github.com/rust-lang/rust/issues/72751 Initially, I thought I would need to enable operand propagation then do something else, but actually https://github.com/rust-lang/rust/pull/74491 already has the fix for the issue in question! It looks like this optimization was put under MIR opt level 3 due to possible soundness/stability implications, then demoted further to MIR opt level 4 when MIR opt level 2 became associated with `--release`. Perhaps in the past we were doing CTFE on optimized MIR? We aren't anymore, so this optimization has no stability implications. r? `@oli-obk`
2023-01-09Clean upkadmin-2/+124
Simplify match statement Add multiple tests - 1 test for checking `N + 1 + 1` does not unify with `N+1` - 2 tests for checking that a function that uses two parameters only returns the parameter that is actually used. - Check exact repeat predicates
2023-01-09Set !const_evaluatable if ambig. and not inferredkadmin-0/+38
This prevents an ICE due to a value not actually being evaluatable later.
2023-01-09Change based on commentskadmin-1/+12
Instead of just switching to a probe, check for different matches, and see how many there are. If one, unify it, otherwise return true and let it be unified later.
2023-01-09Change commit_if_ok to probekadmin-13/+37
2023-01-09Auto merge of #106582 - compiler-errors:better-spans-on-bad-tys, r=lcnrbors-87/+64
Improve spans of non-WF implied bound types Fixes #60980
2023-01-09fix: fix CI errorsEzra Shaw-2/+18
2023-01-08Rollup merge of #106606 - estebank:bad-nested-turbofish, r=compiler-errorsMichael Goulet-0/+14
Do not emit structured suggestion for turbofish with wrong span Fix #79161.
2023-01-08Rollup merge of #106602 - GuillaumeGomez:tidy-goml-scripts, r=Mark-SimulacrumMichael Goulet-16/+45
Add goml scripts to tidy checks r? ``@notriddle``
2023-01-08Rollup merge of #106600 - compiler-errors:no-private-field-ty-err, r=estebankMichael Goulet-8/+35
Suppress type errors that come from private fields Fixes #57320 There was some discussion here (https://github.com/rust-lang/rust/issues/57320#issuecomment-451308420), but I honestly think the second error is worth suppressing regardless. I would be open to feedback though -- perhaps we can suppress the `.len()` suggestion if there's type error (since we have access to [`Expectation`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir_typeck/enum.Expectation.html), we can determine that). r? ``@estebank``
2023-01-08Rollup merge of #106497 - chenyukang:yukang/fix-106443-sugg-clone, r=estebankMichael Goulet-0/+107
Suggest using clone when we have &T and T implemented Clone Fixes #106443
2023-01-08Rollup merge of #106363 - estebank:mutability-mismatch-arg, r=NilstriebMichael Goulet-23/+46
Structured suggestion for `&mut dyn Iterator` when possible Fix #37914.
2023-01-08Rollup merge of #106131 - compiler-errors:not-ptrs, r=davidtwcoMichael Goulet-102/+102
Mention "signature" rather than "fn pointer" when impl/trait methods are incompatible Fixes #80929 Fixes #67296
2023-01-09docs/test: add error-docs and UI test for `E0711`Ezra Shaw-0/+33
2023-01-09Add regression test for #100772Yuki Okushi-0/+11
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2023-01-08Make translate_message return result and add testsmejrs-1/+3
2023-01-08Do not emit structured suggestion for turbofish with wrong spanEsteban Küber-0/+14
Fix #79161.
2023-01-08rustdoc: fix outdated lint section of the bookMichael Howell-1/+1
2023-01-08Fix tidy issues in goml scriptsGuillaume Gomez-14/+34
2023-01-08Add goml scripts to tidy checksGuillaume Gomez-2/+11
2023-01-08Suppress type errors that come from private fieldsMichael Goulet-8/+35
2023-01-08Don't store spans in assumed_wf_types actuallyMichael Goulet-2/+29
2023-01-08Normalize assumed_wf_types after wfchecking is complete, for better spansMichael Goulet-14/+14
2023-01-08Improve spans of non-WF implied bound typesMichael Goulet-102/+52
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-08Remove extra spaceYukang-1/+1
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-08Mention signature rather than fn pointers when comparing impl/trait methodsMichael Goulet-102/+102
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