Commit Graph

214234 Commits

Author SHA1 Message Date
Rejyr
ca7df9a2a9 migrate: for_loops_over_fallibles.rs 2023-01-09 17:07:25 -05:00
Rejyr
3c1a1f3643 migrate: expect.rs 2023-01-09 17:07:25 -05:00
Rejyr
6ffecd2059 migrate(wip): builtin.rs 2023-01-09 17:07:25 -05:00
Rejyr
0b19227524 migrate: internal.rs 2023-01-09 17:07:25 -05:00
Rejyr
5ffaae758e migrate: ImproperCTypes 2023-01-09 17:07:25 -05:00
Rejyr
e610047940 migrate: let_underscore.rs
fix: NonBindingLetSub
2023-01-09 17:07:25 -05:00
Rejyr
80df25e160 migrate: levels.rs 2023-01-09 17:07:25 -05:00
Rejyr
ab66ea61cf add: emit{,_spanned}_lint for LintLevelsBuilder
add: `emit_spanned_lint` and `emit_lint` for `LintLevelsBuilder`
migrate: `DeprecatedLintName`
2023-01-09 17:07:25 -05:00
Rejyr
f9289c35fb refactor: comment about lint location 2023-01-09 17:07:25 -05:00
Rejyr
a0614ec2c3 fix: merge conflict 2023-01-09 17:07:25 -05:00
Rejyr
dc00aa3114 update: lints.rs for renamed traits
update: `lints.rs` for renamed `SessionSubdiagnostic` and `AddSubdiagnostic`

fix: NonSnakeCaseDiagSub

fix: OverflowingBinHexSign
2023-01-09 17:07:25 -05:00
Rejyr
e3bb2ebfbf add: lints for errors.rs 2023-01-09 17:07:25 -05:00
Rejyr
8b897bbce6 migrate: early.rs and enum_intrinsics_non_enums.rs 2023-01-09 17:07:25 -05:00
Rejyr
c63ba52562 migrate: array_into_iter.rs 2023-01-09 17:07:25 -05:00
Rejyr
95d3e0cb78 migrate: methods.rs 2023-01-09 17:07:25 -05:00
Rejyr
3f69c1b523 migrate: non_ascii_idents.rs 2023-01-09 17:07:25 -05:00
Rejyr
384010b9f4 migrate: non_fmt_panic.rs 2023-01-09 17:07:25 -05:00
Rejyr
a9bbe31519 migrate: nonstandard_style.rs 2023-01-09 17:07:25 -05:00
Rejyr
56fc66d196 migrate: noop_method_call.rs 2023-01-09 17:07:25 -05:00
Rejyr
6fb3a38f9b migrate: pass_by_value.rs 2023-01-09 17:07:25 -05:00
Rejyr
c3a6801f8e migrate: redundant_semicolon.rs 2023-01-09 17:07:25 -05:00
Rejyr
a42afa0444 migrate: traits.rs 2023-01-09 17:07:25 -05:00
Rejyr
e5ae9d019c migrate: unused.rs 2023-01-09 17:07:25 -05:00
Rejyr
d44ccaa56f migrate: types.rs 2023-01-09 17:07:25 -05:00
Rejyr
5a90537b62 add: lints.rs
add: `lints.rs`
refactor: move `InvalidAtomicOrderingDiag` to `lints.rs`
2023-01-09 17:07:25 -05:00
bors
3020239de9 Auto merge of #106637 - fee1-dead-contrib:rollup-ticvmsd, r=fee1-dead
Rollup of 10 pull requests

Successful merges:

 - #105292 (Change a commit_if_ok call to probe)
 - #105655 (Remove invalid case for mutable borrow suggestion)
 - #106047 (Fix ui constant tests for big-endian platforms)
 - #106061 (Enable Shadow Call Stack for Fuchsia on AArch64)
 - #106164 (Move `check_region_obligations_and_report_errors` to `TypeErrCtxt`)
 - #106291 (Fix incorrect suggestion for extra `&` in pattern)
 - #106389 (Simplify some canonical type alias names)
 - #106468 (Use FxIndexSet when updating obligation causes in `adjust_fulfillment_errors_for_expr_obligation`)
 - #106549 (Use fmt named parameters in rustc_borrowck)
 - #106614 (error-code docs improvements (No. 2))

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2023-01-09 18:20:00 +00:00
fee1-dead
77f529bb0a
Rollup merge of #106614 - Ezrashaw:ui-test-fixups-2, r=GuillaumeGomez
error-code docs improvements (No. 2)

- Added empty error-code docs for `E0208`, `E0640` and `E0717` with the "internal" header as discussed on Discord.
- Wrote docs and UI test for `E0711`, again with the header.
- `tidy` changes are common-sense and make everything pass, `style.rs` hack is annoying though.

r? ```@GuillaumeGomez```
2023-01-09 23:35:32 +08:00
fee1-dead
99529b0cd2
Rollup merge of #106549 - wcampbell0x2a:use-fmt-named-parameters-borrowck, r=estebank
Use fmt named parameters in rustc_borrowck
2023-01-09 23:35:31 +08:00
fee1-dead
357128ad23
Rollup merge of #106468 - compiler-errors:err-instability, r=lcnr
Use FxIndexSet when updating obligation causes in `adjust_fulfillment_errors_for_expr_obligation`

I have no idea how to test this reliably, but I've **manually** verified it fixes the instability in #106417 that isn't due to dtolnay/trybuild#212.

Fixes #106417
2023-01-09 23:35:31 +08:00
fee1-dead
f8319bb403
Rollup merge of #106389 - compiler-errors:no-canonicalized, r=lcnr
Simplify some canonical type alias names

* delete the `Canonicalized<'tcx>` type alias in favor for `Canonical<'tcx>`
* `CanonicalizedQueryResponse` -> `CanonicalQueryResponse`

I don't particularly care about the latter, but it should be consistent. We could alternatively delete the first alias and rename the struct to `Canonicalized`, and then keep the name of `CanonicalizedQueryResponse` untouched.
2023-01-09 23:35:30 +08:00
fee1-dead
37c1d6dc09
Rollup merge of #106291 - obeis:issue-106182, r=oli-obk
Fix incorrect suggestion for extra `&` in pattern

Closes #106182
2023-01-09 23:35:29 +08:00
fee1-dead
7779386a3a
Rollup merge of #106164 - compiler-errors:check-region-tweak, r=oli-obk
Move `check_region_obligations_and_report_errors` to `TypeErrCtxt`

Makes sense for this function to live with its sibling `resolve_regions_and_report_errors`, around which it's basically just a wrapper.
2023-01-09 23:35:29 +08:00
fee1-dead
fd75cfef66
Rollup merge of #106061 - ilovepi:fuchsia-scs, r=oli-obk
Enable Shadow Call Stack for Fuchsia on AArch64

Fuchsia already uses SCS by default for C/C++ code on ARM hardware. This patch allows SCS to be used for Rust code as well.
2023-01-09 23:35:28 +08:00
fee1-dead
63f2a13855
Rollup merge of #106047 - uweigand:s390x-test-bigendian-ui, r=oli-obk
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-09 23:35:27 +08:00
fee1-dead
c1f8a3ffb2
Rollup merge of #105655 - RedDocMD:bug-105645, r=oli-obk
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-09 23:35:27 +08:00
fee1-dead
b7587f1867
Rollup merge of #105292 - JulianKnodt:no_eager_commit, r=BoxyUwU
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-09 23:35:26 +08:00
bors
af58fc8699 Auto merge of #101947 - aliemjay:astconv-normalize, r=lcnr
Don't normalize in AstConv

See individual commits.

Fixes #101350
Fixes #54940
2023-01-09 15:29:59 +00:00
bors
89e0576bd3 Auto merge of #106340 - saethlin:propagate-operands, r=oli-obk
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-09 11:59:51 +00:00
kadmin
21c5ffe008 Clean up
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-09 08:41:21 +00:00
kadmin
7c5cb73735 Check for duplicates 2023-01-09 08:41:21 +00:00
kadmin
b79a9a0900 Set !const_evaluatable if ambig. and not inferred
This prevents an ICE due to a value not actually being evaluatable later.
2023-01-09 08:41:21 +00:00
kadmin
77b61379b6 Change based on comments
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-09 08:41:21 +00:00
kadmin
abe040d876 Change commit_if_ok to probe 2023-01-09 08:41:21 +00:00
bors
c54c8cbac8 Auto merge of #106582 - compiler-errors:better-spans-on-bad-tys, r=lcnr
Improve spans of non-WF implied bound types

Fixes #60980
2023-01-09 08:40:08 +00:00
bors
2e677c0645 Auto merge of #106616 - compiler-errors:rollup-emcj0o3, r=compiler-errors
Rollup of 8 pull requests

Successful merges:

 - #104163 (Don't derive Debug for `OnceWith` & `RepeatWith`)
 - #106131 (Mention "signature" rather than "fn pointer" when impl/trait methods are incompatible)
 - #106363 (Structured suggestion for `&mut dyn Iterator` when possible)
 - #106497 (Suggest using clone when we have &T and T implemented Clone)
 - #106584 (Document that `Vec::from_raw_parts[_in]` must be given a pointer from the correct allocator.)
 - #106600 (Suppress type errors that come from private fields)
 - #106602 (Add goml scripts to tidy checks)
 - #106606 (Do not emit structured suggestion for turbofish with wrong span)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2023-01-09 05:09:45 +00:00
Ezra Shaw
2c92c72c46
fix: fix CI errors 2023-01-09 17:05:56 +13:00
Michael Goulet
5e8e97f981
Rollup merge of #106606 - estebank:bad-nested-turbofish, r=compiler-errors
Do not emit structured suggestion for turbofish with wrong span

Fix #79161.
2023-01-08 19:57:56 -08:00
Michael Goulet
bb6a88ad5e
Rollup merge of #106602 - GuillaumeGomez:tidy-goml-scripts, r=Mark-Simulacrum
Add goml scripts to tidy checks

r? ``@notriddle``
2023-01-08 19:57:56 -08:00
Michael Goulet
29420a8e7a
Rollup merge of #106600 - compiler-errors:no-private-field-ty-err, r=estebank
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-08 19:57:55 -08:00
Michael Goulet
70f1566b2b
Rollup merge of #106584 - kpreid:vec-allocator, r=JohnTitor
Document that `Vec::from_raw_parts[_in]` must be given a pointer from the correct allocator.

Currently, the documentation of `Vec::from_raw_parts` and `Vec::from_raw_parts_in` says nothing about what allocator the pointer must come from. This PR adds that missing information explicitly.
2023-01-08 19:57:54 -08:00