Commit graph

153918 commits

Author SHA1 Message Date
Mara Bos
78a7d1c652 Add and update tests. 2021-08-30 19:02:29 +02:00
Mara Bos
e2abf06890 Fix lifetime generics in <T<..> as Trait>::try_from suggestion. 2021-08-30 19:02:06 +02:00
Mara Bos
a4f6d3e5c2 Fix lifetime generics in <T as Trait<..>>::try_from suggestion. 2021-08-30 19:01:34 +02:00
est31
403b80d32e Use MaybeUninit::write in functor.rs
MaybeUninit::write is stable as of 1.55.0.
2021-08-30 17:23:49 +02:00
Ralf Jung
3e61c53917 update miri 2021-08-30 11:12:39 -04:00
Mara Bos
6adbbb6be7 Update LATEST_STABLE_EDITION to 2021. 2021-08-30 15:33:09 +02:00
HTG-YT
4bed11a109 update rustc cmdargs markdown section 2021-08-30 15:27:00 +02:00
HTG-YT
388d90ac4c make edition 2021 stable 2021-08-30 15:27:00 +02:00
bjorn3
1a2fe87b09 Remove unused arena macro args 2021-08-30 13:09:38 +02:00
Simonas Kazlauskas
748a089acd Disallow the aapcs CC on Aarch64
This never really worked and makes LLVM assert.
2021-08-30 13:46:07 +03:00
bors
6cfa773583 Auto merge of #87680 - mati865:stacker-psm-update, r=Mark-Simulacrum,nagisa
Update stacker and psm crates

Primarily to include https://github.com/rust-lang/stacker/pull/54
2021-08-30 10:42:53 +00:00
lcnr
87e781799a feature(const_param_types) -> feature(adt_const_params) 2021-08-30 12:07:36 +02:00
lcnr
4747cbb3bb allow unordered const/ty params if any cg feature is active 2021-08-30 11:00:21 +02:00
lcnr
0c28e028b6 feature(const_generics) -> feature(const_param_types) 2021-08-30 11:00:21 +02:00
Ellen
c0e853f274 remove lazy_normalization_consts 2021-08-30 11:00:21 +02:00
Ellen
fcc2badf9b rename const_evaluatable_checked to generic_const_exprs
2021-08-30 11:00:21 +02:00
bors
13edc17f65 Auto merge of #88281 - asquared31415:asm-docs, r=Amanieu
Update unstable docs for `asm!` macro

This adds documentation that SPIR-V is supported, expands on the restrictions for labels, and has some minor cleanups or clarifications.

r? `@joshtriplett`
2021-08-30 07:54:11 +00:00
bors
dbb0fe9d80 Auto merge of #88456 - inquisitivecrystal:private-macro, r=jyn514
Fix: don't document private macros by default

As part of #88019, I made it so private macros are documented in `--document-private-items` mode. Unfortunately, it appears that I also accidentally made them be documented when *not* in `--document-private-items` mode. This PR fixes that and adds a regression test.

r? `@jyn514` (I hope you don't mind that I keep sending PRs your way)

Fixes #88453.
2021-08-30 05:23:54 +00:00
inquisitivecrystal
147f74a3c3 Clean up the lowering of AST items 2021-08-29 20:05:34 -07:00
João M. Bezerra
faf59853f9 Adding examples to docs of std::time module
And adding missing link to Duration from Instant
2021-08-29 23:59:35 -03:00
Noah Lev
d96234bed7 Retrieve DefKind from HIR map to reduce chance of cycles
`tcx.def_kind()` could theoretically invoke another query, which could
cause an infinite query loop. Accessing the HIR map directly makes that
less likely to happen.

I also changed it to use `as_local()` (`tcx.def_kind()` seems to
implicitly call `expect_local()`) and `opt_def_kind()` to reduce the
chance of panicking on valid code.
2021-08-29 19:38:47 -07:00
asquared31415
fc125a52ec emit specific warning to clarify that foreign items can't have no_mangle
remove extra commented code
Deduplicate some diagnostics code
add code symbols, machine applicable suggestion
clarify error message
2021-08-29 20:22:19 -04:00
bors
9556d7a09a Auto merge of #88337 - eddyb:field-failure-is-not-an-option, r=nagisa
rustc_target: `TyAndLayout::field` should never error.

This refactor (making `TyAndLayout::field` return `TyAndLayout` without any `Result` around it) is based on a simple observation, regarding `TyAndLayout::field`:

If `cx.layout_of(ty)` succeeds (for some `cx` and `ty`), then `.field(cx, i)` on the resulting `TyAndLayout` should *always* succeed in computing `cx.layout_of(field_ty)` (where `field_ty` is the type of the `i`th field of `ty`).

The reason for this is that no matter which field is chosen, `cx.layout_of(field_ty)` *will have already been computed*, as part of computing `cx.layout_of(ty)`, as we cannot determine the layout of *any* type without considering the layouts of *all* of its fields.

And so it should be fine to turn any errors into ICEs, since they likely indicate a `cx` mismatch, or some other edge case that is due to a compiler bug (as opposed to ever being an user-facing error).

<hr/>

Each commit should probably be reviewed separately, though note that there's some `where` clauses (in `rustc_target::abi::call::*`) that change in most commits.

cc `@nagisa` `@oli-obk`
2021-08-29 22:54:26 +00:00
Eduard-Mihai Burtescu
78778fc6aa rustc_target: remove LayoutOf bound from TyAbiInterface. 2021-08-30 00:44:12 +03:00
Eduard-Mihai Burtescu
8e6d126b7d rustc_target: TyAndLayout::field should never error. 2021-08-30 00:44:09 +03:00
Aman Arora
793fbc73e8 2229: Drop any deref in move closure 2021-08-29 16:28:58 -04:00
bors
2f662b1403 Auto merge of #88280 - sexxi-goose:non-exhaustive, r=nikomatsakis
Handle match statements with non exhaustive variants in closures

This PR ensures that the behavior for match statements with non exhaustive variants is the same inside and outside closures.

If we have a non-exhaustive SingleVariant which is defined in a different crate, then we should handle the case the same way we would handle a MultiVariant: borrow the match discriminant.

Closes https://github.com/rust-lang/project-rfc-2229/issues/59
r? `@nikomatsakis`
2021-08-29 20:27:14 +00:00
Aman Arora
fbd775ff29 2229: Handle update to capture kind properly 2021-08-29 15:37:03 -04:00
bors
ae0b03bc6b Auto merge of #88262 - klensy:pprust-cow, r=nagisa
Cow'ify some pprust methods

Reduce number of potential needless de/allocations by using `Cow<'static, str>` instead of explicit `String` type.
2021-08-29 17:46:29 +00:00
Vadim Petrochenkov
b8728e773f rustdoc: Stop using resolver for macro loading 2021-08-29 18:30:16 +03:00
bors
daa4dc997c Auto merge of #88461 - GuillaumeGomez:rollup-khgu0eb, r=GuillaumeGomez
Rollup of 13 pull requests

Successful merges:

 - #80543 (Notify when an `I-prioritize` issue is closed or reopened)
 - #83251 (Suggestion for call on immutable binding of mutable type)
 - #85534 (add rustc-demangle assertion on mangled symbol)
 - #88173 (Refactor Markdown length-limited summary implementation)
 - #88349 (Add const and static TAIT tests)
 - #88357 (add unsized coercion test)
 - #88381 (Handle stack_t.ss_sp type change for DragonFlyBSD)
 - #88387 (Remove vestigial rustfix tests.)
 - #88396 (Bump vulnerable crates)
 - #88407 (Fix formatting in release notes from 52a988344b)
 - #88411 (Remove `Session.if_let_suggestions`)
 - #88417 (RELEASES.md: fix broken link)
 - #88419 (Fix code blocks color in Ayu theme)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2021-08-29 15:18:58 +00:00
Guillaume Gomez
26feefddc7
Rollup merge of #88419 - GuillaumeGomez:code-blocks-colors, r=camelid,notriddle
Fix code blocks color in Ayu theme

Fixes #88415.

cc `@camelid`
r? `@notriddle`
2021-08-29 16:25:37 +02:00
Guillaume Gomez
7248ff2760
Rollup merge of #88417 - xu-cheng:rel-fix-link, r=jyn514
RELEASES.md: fix broken link
2021-08-29 16:25:36 +02:00
Guillaume Gomez
b7388024eb
Rollup merge of #88411 - Aaron1011:remove-session-if-let, r=estebank
Remove `Session.if_let_suggestions`

We can instead if either the LHS or RHS types contain
`TyKind::Error`. In addition to covering the case where
we would have previously updated `if_let_suggestions`, this might
also prevent redundant errors in other cases as well.
2021-08-29 16:25:35 +02:00
Guillaume Gomez
9ffbd50294
Rollup merge of #88407 - nebkor:release-note-1.55x2, r=Mark-Simulacrum
Fix formatting in release notes from 52a988344b

I neglected to add a line that allowed the `[cargo/9663]` short-hand to resolve to an actual link in the rendered markdown on github.
2021-08-29 16:25:34 +02:00
Guillaume Gomez
efed604c26
Rollup merge of #88396 - klensy:bump-deps-vuln, r=Mark-Simulacrum
Bump vulnerable crates

crossbeam-deque v0.7.3 -> v0.7.4:
    https://rustsec.org/advisories/RUSTSEC-2021-0093
    https://github.com/crossbeam-rs/crossbeam/pull/728/files

openssl-src v111.15.0+1.1.1k -> v111.16.0+1.1.1l:
    https://rustsec.org/advisories/RUSTSEC-2021-0097
    https://rustsec.org/advisories/RUSTSEC-2021-0098
    https://www.openssl.org/news/vulnerabilities-1.1.1.html

tar v0.4.35 -> v0.4.37:
    https://rustsec.org/advisories/RUSTSEC-2021-0080
    updated to 0.4.37 as there breaking change in 0.4.36: https://github.com/alexcrichton/tar-rs/pull/260
2021-08-29 16:25:33 +02:00
Guillaume Gomez
1a6e8d769a
Rollup merge of #88387 - ehuss:remove-rustfix-tests, r=Mark-Simulacrum
Remove vestigial rustfix tests.

The directory `src/test/rustfix` is not actually tested. It looks like a mistake was made when rustfix tests were originally introduced in #50084.  In commit 6f2d023028 they were moved to `src/test/ui`, but the tests in the original directory weren't deleted.
2021-08-29 16:25:32 +02:00
Guillaume Gomez
281dfac12f
Rollup merge of #88381 - rtzoeller:dfly_stack_t_ss_sp_void, r=dtolnay
Handle stack_t.ss_sp type change for DragonFlyBSD

stack_t.ss_sp is now c_void on DragonFlyBSD, like the rest of the BSDs.

Changed in 02922ef750.
2021-08-29 16:25:31 +02:00
Guillaume Gomez
fdb4b7c462
Rollup merge of #88357 - lcnr:stabilize-relaxed_struct_unsize, r=Mark-Simulacrum
add unsized coercion test

we had no tests in our test suite for this case
2021-08-29 16:25:30 +02:00
Guillaume Gomez
3e1a15bb12
Rollup merge of #88349 - spastorino:const-static-types-tait-test, r=oli-obk
Add const and static TAIT tests

r? ``@oli-obk``

Related to #86727
2021-08-29 16:25:29 +02:00
Guillaume Gomez
aa61575499
Rollup merge of #88173 - camelid:refactor-markdown-length-limit, r=GuillaumeGomez
Refactor Markdown length-limited summary implementation

This PR is a new approach to #79749.

This PR refactors the implementation of `markdown_summary_with_limit()`,
separating the logic of determining when the limit has been reached from
the actual rendering process.

The main advantage of the new approach is that it guarantees that all
HTML tags are closed, whereas the previous implementation could generate
tags that were never closed. It also ensures that no empty tags are
generated (e.g., `<em></em>`).

The new implementation consists of a general-purpose struct
`HtmlWithLimit` that manages the length-limiting logic and a function
`markdown_summary_with_limit()` that renders Markdown to HTML using the
struct.

r? `@GuillaumeGomez`
2021-08-29 16:25:28 +02:00
Guillaume Gomez
63cfbf5d9f
Rollup merge of #85534 - csmoe:demagnle-assert, r=michaelwoerister
add rustc-demangle assertion on mangled symbol

cc https://github.com/rust-lang/rust/issues/60705#issuecomment-844880365
r? `@michaelwoerister`
2021-08-29 16:25:28 +02:00
Guillaume Gomez
22973a8844
Rollup merge of #83251 - estebank:issue-83241, r=oli-obk
Suggestion for call on immutable binding of mutable type

When calling a method requiring a mutable self borrow on an inmutable
to a mutable borrow of the type, suggest making the binding mutable.

Fix #83241.
2021-08-29 16:25:26 +02:00
Guillaume Gomez
8eb50ce1f4
Rollup merge of #80543 - LeSeulArtichaut:notify-close, r=spastorino
Notify when an `I-prioritize` issue is closed or reopened

Companion PR to rust-lang/triagebot#1078, blocked on that PR.
r? ``@spastorino`` cc ``@rust-lang/wg-prioritization``
2021-08-29 16:25:26 +02:00
Guillaume Gomez
a5213888e0 Add rustdonc-json tests for enum variants 2021-08-29 16:00:48 +02:00
Guillaume Gomez
ed30993456 Use the correct type for Enum variant tuples 2021-08-29 16:00:48 +02:00
bors
ef52471066 Auto merge of #88208 - petrochenkov:lowspan, r=Aaron1011
ast_lowering: Introduce `lower_span` for catching all spans entering HIR

This PR cherry-picks the `fn lower_span` change from https://github.com/rust-lang/rust/pull/84373.
I also introduced `fn lower_ident` for lowering spans in identifiers, and audited places where HIR structures with spans or identifiers are constructed and added a few missing `lower_span`s/`lower_ident`s.

Having a hook for spans entering HIR can be useful for things other than https://github.com/rust-lang/rust/pull/84373, e.g. https://github.com/rust-lang/rust/issues/35148.
I also want to check whether this change causes perf regressions due to some accidental inlining issues.

r? `@cjgillot`
2021-08-29 12:38:05 +00:00
bors
59ce765484 Auto merge of #88312 - jackh726:issue-87748, r=nikomatsakis
Treat types in unnormalized function signatures as well-formed

Fixes #87748

r? `@nikomatsakis`
2021-08-29 10:12:54 +00:00
Esteban Kuber
5b6f4b94c5 rebase: fix test output 2021-08-29 08:48:36 +00:00
Esteban Kuber
a6af6d6506 Provide structured suggestion for removal of &mut 2021-08-29 08:34:53 +00:00