Commit Graph

172756 Commits

Author SHA1 Message Date
Yuki Okushi
bf9ed99496
Rollup merge of #98387 - NobodyXu:feature/std_io_Error_try_downgrade_inner, r=yaahc
Add new unstable API `downcast` to `std::io::Error`

https://github.com/rust-lang/libs-team/issues/57

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-16 17:52:59 +09:00
Yuki Okushi
64659804fc
Add regression test for #64401
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2022-07-16 10:25:00 +09:00
Will Crichton
2f15dfab0b Fix suggestion regression with incorrect syntactic combination of trait bounds 2022-07-15 18:06:20 -07:00
Will Crichton
e5bb7d80d6 Propagate Expectation around binop typeck code to construct more precise trait obligations for binops. 2022-07-15 18:06:18 -07:00
Yuki Okushi
084ad59622
Stabilize future_poll_fn
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2022-07-16 10:04:14 +09:00
bors
e6c43cf8b9 Auto merge of #95685 - oxidecomputer:restore-static-dwarf, r=pnkfelix
Revert "Work around invalid DWARF bugs for fat LTO"

Since September, the toolchain has not been generating reliable DWARF
information for static variables when LTO is on. This has affected
projects in the embedded space where the use of LTO is typical. In our
case, it has kept us from bumping past the 2021-09-22 nightly toolchain
lest our debugger break. This has been a pretty dramatic regression for
people using debuggers and static variables. See #90357 for more info
and a repro case.

This commit is a mechanical revert of
d5de680e20 from PR #89041, which caused
the issue. (Note on that PR that the commit's author has requested it be
reverted.)

I have locally verified that this fixes #90357 by restoring the
functionality of both the repro case I posted on that bug, and debugger
behavior on real programs. There do not appear to be test cases for this
in the toolchain; if I've missed them, point me at 'em and I'll update
them.
2022-07-16 00:18:54 +00:00
Jane Losare-Lusby
a9d2ed2ab1 add tracking issue to generic member access APIs 2022-07-15 22:13:43 +00:00
bors
8c1cc82a82 Auto merge of #99288 - Aaron1011:stable-intrinsics, r=yaahc
Mark stabilized intrinsics with `rustc_allowed_through_unstable_modules`

Fixes #99286

PR #95956 accidentally made these intrinsics unstable when
accessed through the unstable path segment 'std::intrinsics'
2022-07-15 21:38:02 +00:00
Luqman Aden
2085d6ac42 Set minimum GDB version needed for basic-types-globals* tests. 2022-07-15 13:46:14 -07:00
Jane Losare-Lusby
8e8a3be22f
Apply suggestions from code review 2022-07-15 13:17:44 -07:00
Esteban Küber
3ee4e5f704 Fix rebase 2022-07-15 11:14:06 -07:00
Esteban Küber
3e5809d94f Move tests to fit in limit 2022-07-15 11:04:45 -07:00
Esteban Küber
635c38187b Avoid incorrect suggestion
We check that there's a single level of block nesting to ensure always
correct suggestions. If we don't, then we only provide a free-form
message to avoid misleading users in cases like
`src/test/ui/nll/borrowed-temporary-error.rs`.

We could expand the analysis to suggest hoising all of the relevant
parts of the users' code to make the code compile, but that could be
too much.
2022-07-15 11:04:45 -07:00
Esteban Küber
20b5aaf111 Provide structured suggestion for dropped temp value 2022-07-15 11:04:45 -07:00
Michael Goulet
2902b92769 Only suggest if span is not erroneous 2022-07-15 17:32:34 +00:00
Michael Goulet
b71a09fda0 Fix ICE in named_arguments_used_positionally lint 2022-07-15 17:32:34 +00:00
Michael Goulet
1c8f87e907 Revert "Highlight conflicting param-env candidates"
This reverts commit 08135254dc.
2022-07-15 17:21:55 +00:00
bors
23e21bdd25 Auto merge of #99015 - lcnr:fn-ctxt-no-more, r=compiler-errors
stop using `FnCtxt` outside of hir typeck

the requirements between **hir typeck**™, and **not hir typeck**™ are different enough to warrant a full split. with this PR `FnCtxt` is now only used for hir typeck (and for one clippy lint which seems to be emulating hir typeck).

Once this PR has landed I intend to move `FnCtxt` into a new crate. This should also allow some further general improvements here.

r? rust-lang/types
2022-07-15 17:11:07 +00:00
Aaron Hill
ef8e322b14
Mark stabilized intrinsics with rustc_allowed_through_unstable_modules
Fixes #99286

PR #95956 accidentally made these intrinsics unstable when
accessed through the unstable path segment 'std::intrinsics'
2022-07-15 11:18:40 -05:00
bors
b1e2578f83 Auto merge of #9172 - Guilherme-Vasconcelos:master, r=flip1995
Rename rustcSource in contributing documentation

According to [rust-analyzer docs](https://rust-analyzer.github.io/manual.html#toolchain:~:text=rust%2Danalyzer.rustc.source), rustcSource has been renamed to rustc.source.

changelog: none
2022-07-15 16:04:30 +00:00
Oli Scherer
57e9f7a556 Infer wildcard type from other patterns at every pattern level 2022-07-15 15:56:17 +00:00
Oli Scherer
92e470a1de Move constructor into the branch that actually uses it 2022-07-15 15:56:17 +00:00
Oli Scherer
ea68ce7fac Revert a hack that only ever worked on level deep 2022-07-15 15:56:17 +00:00
Oli Scherer
6b33d5bfa9 Make destructuring a defining use 2022-07-15 15:56:17 +00:00
Oli Scherer
728c7e8bda Allow destructuring opaque types, since the patterns constrain the opaque types 2022-07-15 15:56:17 +00:00
Oli Scherer
12457f814c Some tracing helpers 2022-07-15 15:56:16 +00:00
Oli Scherer
0c6918fe21 Reuse a helper method instead of manually rolling it 2022-07-15 15:56:16 +00:00
Oli Scherer
7a8a048b58 Remove early return that would likely have caused miscompilations if it ever happened 2022-07-15 15:56:16 +00:00
Oli Scherer
eeb10335ce Pass one argument instead of fetching two fields of it at every call site 2022-07-15 15:56:16 +00:00
Oli Scherer
a034446fae Add some tracing instrumentation 2022-07-15 15:56:16 +00:00
Ralf Jung
c4cb043f06 interpret/visitor: support visiting with a PlaceTy 2022-07-15 11:54:20 -04:00
Oli Scherer
84a444a1f4 Introduce opaque type to hidden type projection 2022-07-15 15:49:22 +00:00
Guilherme-Vasconcelos
b707a23814 Rename rustcSource in contributing docs 2022-07-15 12:36:57 -03:00
David Wood
78b19a90b7 passes: migrate half of check_attr
Migrate half of the `rustc_passes::check_attr` diagnostics to using
diagnostic derives and being translatable.
2022-07-15 16:13:49 +01:00
David Wood
81cf2294b4 macros: support adding warnings to diags
Both diagnostic and subdiagnostic derives were missing the ability to
add warnings to diagnostics - this is made more difficult by the `warn`
attribute already existing, so this name being unavailable for the
derives to use. `#[warn_]` is used instead, which requires
special-casing so that `{span_,}warn` is called instead of
`{span_,}warn_`.

Signed-off-by: David Wood <david.wood@huawei.com>
2022-07-15 16:13:49 +01:00
David Wood
88c11c5bff macros: support MultiSpan in diag derives
Add support for `MultiSpan` with any of the attributes that work on a
`Span` - requires that diagnostic logic generated for these attributes
are emitted in the by-move block rather than the by-ref block that they
would normally have been generated in.

Signed-off-by: David Wood <david.wood@huawei.com>
2022-07-15 16:13:49 +01:00
David Wood
c3fdf74885 errors: lint on LintDiagnosticBuilder::build
Apply the `#[rustc_lint_diagnostics]` attribute to
`LintDiagnosticBuilder::build` so that diagnostic migration lints will
trigger for it.

Signed-off-by: David Wood <david.wood@huawei.com>
2022-07-15 16:13:47 +01:00
David Wood
06f480661f errors: impl IntoDiagnosticArg for char
Implements `IntoDiagnosticArg` for `char` using its `Debug`
implementation and introduces a macro for those types which just
delegate the implementation to `ToString`.

Signed-off-by: David Wood <david.wood@huawei.com>
2022-07-15 16:12:46 +01:00
lcnr
16b2acc7c0 hir typeck: fulfillment_cx ignore regions 2022-07-15 17:01:32 +02:00
lcnr
5bd8c960f5 provide generic_param_scope for region errors 2022-07-15 16:53:20 +02:00
lcnr
b955fa7dd0 don't require FnCtxt to check global asm 2022-07-15 16:53:20 +02:00
lcnr
4b56fd9341 try to avoid FnCtxt during wf 2022-07-15 16:53:18 +02:00
lcnr
29d0390b97 remove unnecessary select_obligations_where_possible
this was previously used for opaque types but became unnecessary
after #89024
2022-07-15 16:40:39 +02:00
lcnr
2b730a3610 remove impl_implied_bounds from FnCtxt 2022-07-15 16:40:39 +02:00
lcnr
7808f69ad7 QueryNormalizer bug on ambiguity 2022-07-15 16:40:39 +02:00
bors
0fe5390a88 Auto merge of #99046 - nnethercote:final-derive-output-improvements, r=Mark-Simulacrum
Final derive output improvements

With all these changes, the derive output in `deriving-all-codegen.stdout` is pretty close to optimal, i.e. very similar to what you'd write by hand.

r? `@ghost`
2022-07-15 14:30:14 +00:00
bors
aa0706bf20 Auto merge of #9178 - alex-semenyuk:match_like_matches_macro_fix, r=Jarcho
match_like_matches_macro does not trigger when one arm contains conta…

Close #9163
changelog: none
2022-07-15 13:57:46 +00:00
bors
fe6814508f Auto merge of #9174 - flip1995:rustup, r=Jarcho
Rustup

r? `@ghost`

changelog: none
2022-07-15 13:38:01 +00:00
bors
c9f0d1aca7 Auto merge of #9103 - i509VCB:std-instead-of-core, r=Manishearth
Add `std_instead_of_core`, `std_instead_of_alloc`, `alloc_instead_of_core`

Closes #7724

Introduces 3 new lints:
- `std_instead_of_core` - lints items resolved through `std` which are available in `core`
- `std_instead_of_alloc` - lints items resolved through `std` which are available in `alloc`
- `alloc_instead_of_core` - lints items resolved through `alloc` which are available in `core`

Though the original issue only mentions `std_instead_of_alloc`, the other two lints could be useful as well.

questions:
- what do I call the file the lints live in? I was thinking `std_reexports`?

changelog: new lint's: [`std_instead_of_core`], [`std_instead_of_alloc`], [`alloc_instead_of_core`]
2022-07-15 11:46:24 +00:00
bors
116819f54f Auto merge of #99278 - Dylan-DPC:rollup-fcln6st, r=Dylan-DPC
Rollup of 5 pull requests

Successful merges:

 - #88991 (Add Nintendo Switch as tier 3 target)
 - #98869 (Remove some usages of `guess_head_span`)
 - #99119 (Refactor: remove a string matching about methods)
 - #99209 (Correctly handle crate level page on docs.rs as well)
 - #99246 (Update RLS)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-07-15 11:44:20 +00:00