Commit Graph

168286 Commits

Author SHA1 Message Date
Yuki Okushi
7361b22b4c
Rollup merge of #97097 - chorman0773:add_tmm_clobers, r=joshtriplett
Add tmm_reg clobbers

This adds support for naming the 8 tile registers from intel AMX as clobbers from `asm!` invocations on x86_64 (only). It does not add the registers as input or output operands.
2022-05-18 07:40:59 +09:00
Yuki Okushi
f597846826
Rollup merge of #97096 - tmiasko:reachable-constructor, r=petrochenkov
Types with reachable constructors are reachable

Fixes #96934.

r? `@petrochenkov`
2022-05-18 07:40:58 +09:00
Yuki Okushi
e9f3733b03
Rollup merge of #96761 - klensy:no-rayon-here, r=CraftSpider
rustdoc: don't build `rayon` for non-windows targets

`rayon` used only on windows targets, so no need to build it otherwise.
2022-05-18 07:40:57 +09:00
Yuki Okushi
78c709ca9b
Rollup merge of #96651 - ken-matsui:omit-unnecessary-help-to-add-cfg-test, r=cjgillot
Omit unnecessary help to add `#[cfg(test)]` when already annotated

Closes: https://github.com/rust-lang/rust/issues/96611

The related PR is: https://github.com/rust-lang/rust/pull/91770
2022-05-18 07:40:56 +09:00
Yuki Okushi
ce49ce2f7e
Rollup merge of #96647 - Enselic:fix-hrtb-for-wherepredicate, r=CraftSpider
rustdoc-json: Fix HRTBs for WherePredicate::BoundPredicate

Information about HRTBs are already present for `GenericBound:: TraitBound` and `FunctionPointer`. This PR adds HRTB info also to `WherePredicate::BoundPredicate`.

Use the same field name and type as for the other ones (`generic_params: Vec<GenericParamDef>`). I have verified that this gives rustdoc JSON clients the data they need and in a format that is easy to work with (see https://github.com/Enselic/public-api/pull/92).

I will be happy to add tests for this change (and bump `FORMAT_VERSION` which I just realized I forgot), but it is always nice to get one round of feedback first, so that I don't put a lot of effort into tests that then have to be discarded.

`@rustbot` modify labels: +T-rustdoc +A-rustdoc-json
2022-05-18 07:40:55 +09:00
bors
4c5f6e6277 Auto merge of #92570 - jsha:rustdoc-search-refactor, r=GuillaumeGomez
Simplify rustdoc search test

Previously, rustdoc search attempted to parse search.js and extract out only certain methods and variables.

This change makes search.js and search-index.js loadable as [CommonJS modules](https://nodejs.org/api/modules.html#modules-commonjs-modules), so they can be loaded directly.

As part of that change, I had to separate execSearch from interacting with the DOM. This wound up being a nice cleanup that made more explicit what inputs it was taking.

I removed search.js' dependency on storage.js by moving hasOwnPropertyRustdoc directly into search.js, and replacing onEach with forEach in a path that is called by the tester.

r? `@GuillaumeGomez`

Demo: https://rustdoc.crud.net/jsha/rustdoc-search-refactor/std/?search=foo
2022-05-17 19:50:44 +00:00
Jacob Hoffman-Andrews
453979462a rustdoc: make search.js a module
Previously, search.js relied on the DOM and the `window` object. It can now be
loaded in the absence of the DOM, for instance by Node. The same is true of
search-index.js.

This allows removing a lot of code from src/tools/rustdoc-js/tester.js that
tried to parse search.js and extract specific functions that were needed for
testing.
2022-05-17 09:26:18 -07:00
bors
00755e4ca6 Auto merge of #96959 - nbdd0121:unwind, r=Amanieu
Prevent unwinding when `-C panic=abort` is used regardless declared ABI

Ensures that Rust code will abort with `-C panic=abort` regardless ABI used.
```rust
extern "C-unwind" {
    fn may_unwind();
}

// Will be nounwind with `-C panic=abort`, despite `C-unwind` ABI.
pub unsafe extern "C-unwind" fn rust_item_that_can_unwind() {
    may_unwind();
}
```

Current behaviour is that unwind will propagate through. While the current behaviour won't cause unsoundness it is inconsistent with the text reading of [RFC2945](https://rust-lang.github.io/rfcs/2945-c-unwind-abi.html).

I tweaked `fn_can_unwind` instead of tweaking `AbortUnwindingCalls` because this approach would allow Rust (non-direct) callers to also see that this function is nounwind, so it can prevent excessive landing pads generation.

For more discussions: https://rust-lang.zulipchat.com/#narrow/stream/210922-project-ffi-unwind/topic/soundness.20in.20mixed.20panic.20mode.

cc `@alexcrichton,` `@BatmanAoD`
r? `@Amanieu`

`@rustbot` label: T-compiler T-lang F-c_unwind
2022-05-17 15:04:50 +00:00
bors
3655175a75 Auto merge of #97111 - JohnTitor:rollup-x3vjf6u, r=JohnTitor
Rollup of 7 pull requests

Successful merges:

 - #96329 (Add a couple tests for #90887 fixes)
 - #97009 (Allow `unused_macro_rules` in path tests)
 - #97075 (Add regression test for #81804)
 - #97079 (Change `Successors` to `impl Iterator<Item = BasicBlock>`)
 - #97080 (remove the `RelateResultCompare` trait)
 - #97093 (Migrate `maybe_recover_from_bad_type_plus` diagnostic)
 - #97102 (Update function pointer call error message)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-05-17 12:01:12 +00:00
Connor Horman
eabe851a5c fix clobber_abi tests 2022-05-17 07:11:29 -04:00
Connor Horman
6354bfc152 Add ABI clobbers 2022-05-17 06:48:03 -04:00
Connor Horman
89ab77b3cb Handle tmm_reg in rustc_codegen_gcc 2022-05-17 06:34:58 -04:00
Yuki Okushi
5fdc849bdc
Rollup merge of #97102 - mbartlett21:fn-pointer-error, r=lcnr
Update function pointer call error message

It now uses the type of context. (fixes #97082)
2022-05-17 19:01:35 +09:00
Yuki Okushi
519b6b4c77
Rollup merge of #97093 - pvdrz:migrate-maybe-recover-from-bad-type-plus, r=davidtwco
Migrate `maybe_recover_from_bad_type_plus` diagnostic

r? `@davidtwco`
2022-05-17 19:01:34 +09:00
Yuki Okushi
13ee094260
Rollup merge of #97080 - lcnr:relate-sus, r=oli-obk
remove the `RelateResultCompare` trait

it's unused
2022-05-17 19:01:33 +09:00
Yuki Okushi
70cd85f5e3
Rollup merge of #97079 - SparrowLii:successors, r=lcnr
Change `Successors` to `impl Iterator<Item = BasicBlock>`

This PR fixes the FIXME in `compiler\rustc_middle\src\mir\mod.rs`.
This can omit several `&`, `*` or `cloned` operations on Successros' generated elements
2022-05-17 19:01:32 +09:00
Yuki Okushi
aaa0c014e2
Rollup merge of #97075 - JohnTitor:issue-81804, r=compiler-errors
Add regression test for #81804

Closes #81804
r? ``@compiler-errors``
2022-05-17 19:01:31 +09:00
Yuki Okushi
17eebcd4c3
Rollup merge of #97009 - fortanix:raoul/unused_macro_sgx, r=thomcc
Allow `unused_macro_rules` in path tests

PR #96150 adds a new lint to warn about unused macro rules (arms/matchers). This causes errors in `library/std/src/path/tests.rs` on the `x86_64-fortanix-unknown-sgx` platform. This PR fixes compilation errors on that platform by allowing unused macro rules.
2022-05-17 19:01:30 +09:00
Yuki Okushi
15aa2d6189
Rollup merge of #96329 - aliemjay:fixed-by-90887, r=jackh726
Add a couple tests for #90887 fixes

closes #56556
closes #90875

These are confirmed fixes by #90887, so
r? ``@jackh726``
2022-05-17 19:01:29 +09:00
bors
735efc0c70 Auto merge of #97012 - oli-obk:🦀_intrinsics, r=davidtwco
Add a query for checking whether a function is an intrinsic.

work towards #93145

This will reduce churn when we add more ways to declare intrinsics

r? `@scottmcm`
2022-05-17 09:39:26 +00:00
mbartlett21
cdc12edb4c Add a test for fn pointer calls in consts 2022-05-17 07:24:47 +00:00
bors
7355d971a9 Auto merge of #96825 - kckeiks:remove-item-like-visitor-trait, r=cjgillot
Retire `ItemLikeVisitor` trait

Issue #95004
cc `@cjgillot`
2022-05-17 06:51:45 +00:00
bors
1e8cd63d60 Auto merge of #96907 - sunfishcode:sunfishcode/update-wasi, r=Mark-Simulacrum
Update the wasi toolchain.

Update the WASI build to LLVM 14.0 and the wasi-libc version from wasi-sdk-15.

This will require a ci-mirrors.rust-lang.org file load. Specifically, we
need [this LLVM release tarball] uploaded to be downloadable from
[this URL].

[this LLVM release tarball]: https://github.com/llvm/llvm-project/releases/download/llvmorg-14.0.0/clang+llvm-14.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz
[this URL]: https://ci-mirrors.rust-lang.org/rustc/2022-05-10-clang%2Bllvm-14.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz
2022-05-17 04:37:47 +00:00
mbartlett21
56649bb844 Update function pointer call error message
It now uses the type of context. (issue 97082)
2022-05-17 04:13:20 +00:00
Christian Poveda
7cafefec4a
keep bounds where they were 2022-05-16 22:23:32 -05:00
bors
c1d65eaa45 Auto merge of #96892 - oli-obk:🐌_obligation_cause_code_🐌, r=estebank
Clean up derived obligation creation

r? `@estebank`

working on fixing the perf regression from https://github.com/rust-lang/rust/pull/91030#issuecomment-1083360210
2022-05-17 01:46:25 +00:00
SparrowLii
38bf1158bd Change Successors to impl Iterator<Item = BasicBlock> 2022-05-17 08:41:01 +08:00
Connor Horman
50ce367880 add clobbers 2022-05-16 20:40:19 -04:00
Connor Horman
658be0d1cf Add tmm_reg clobbers 2022-05-16 20:15:06 -04:00
Tomasz Miąsko
17f2893455 Types with reachable constructors are reachable 2022-05-17 00:00:00 +00:00
bors
c1cfdd1fb2 Auto merge of #96713 - petrochenkov:doclink8, r=notriddle
rustdoc: Resolve some more doc links early 2

The subset of https://github.com/rust-lang/rust/pull/94857 that shouldn't be too expensive.
2022-05-16 23:01:28 +00:00
Christian Poveda
7e8517df61
migrate maybe_recover_from_bad_type_plus diagnostic 2022-05-16 17:16:27 -05:00
Ken Matsui
03007dee79
Omit unnecessary help to add #[cfg(test)] when already annotated 2022-05-17 06:50:07 +09:00
Vadim Petrochenkov
159b56f288 rustdoc: Resolve some more doc links early 2022-05-16 19:26:01 +03:00
bors
c52b9c10bf Auto merge of #96676 - petrochenkov:docrules, r=GuillaumeGomez
rustdoc: Remove doc link resolution fallback to all `macro_rules` in the crate

This is a deny-by-default lint detecting such fallback for crater run, as discussed in https://github.com/rust-lang/rust/pull/96521.
2022-05-16 13:53:40 +00:00
lcnr
0ea7301fa3 remove the RelateResultCompare trait 2022-05-16 15:41:05 +02:00
Oli Scherer
0cefa5fa18 Force inline InternedObligationCauseCode creation 2022-05-16 13:34:03 +00:00
Dan Gohman
4cc0cc7eb3 Update how CC etc. are set in the wasi-libc Makefile.
wasi-libc's Makefile changed how it detects the compiler to use; update
Rust's script to set `CC` directly to the compiler it installs.
2022-05-16 05:07:28 -07:00
Yuki Okushi
a3bc2e5293
Add regression test for #81804 2022-05-16 19:34:30 +09:00
Oli Scherer
0a6b69106e Add a query for checking whether a function is an intrinsic. 2022-05-16 07:07:44 +00:00
Raoul Strackx
3e252a7ffc Allow unused_macro_rules in path tests 2022-05-16 08:55:05 +02:00
bors
56d540e057 Auto merge of #97053 - CAD97:realloc-clarification, r=dtolnay
Remove potentially misleading realloc parenthetical

This parenthetical is problematic, because it suggests that the following is sound:

```rust
let layout = Layout:🆕:<[u8; 32]>();
let p1 = alloc(layout);
let p2 = realloc(p1, layout, 32);
if p1 == p2 {
    p1.write([0; 32]);
    dealloc(p1, layout);
} else {
    dealloc(p2, layout);
}
```

At the very least, this isn't the case for [ANSI `realloc`](https://en.cppreference.com/w/c/memory/realloc)

> The original pointer `ptr` is invalidated and any access to it is undefined behavior (even if reallocation was in-place).

and [Windows `HeapReAlloc`](https://docs.microsoft.com/en-us/windows/win32/api/heapapi/nf-heapapi-heaprealloc) is unclear at best (`HEAP_REALLOC_IN_PLACE_ONLY`'s description may imply that the old pointer may be used if `HEAP_REALLOC_IN_PLACE_ONLY` is provided).

The conservative position is to just remove the parenthetical.

cc `@rust-lang/wg-unsafe-code-guidelines` `@rust-lang/wg-allocators`
2022-05-16 02:33:34 +00:00
bors
cdd74fc7b1 Auto merge of #97065 - gabriel-doriath-dohler:master, r=joshtriplett
Rename `eq_ignore_case` to `starts_with_ignore_case`

The method doesn't test for equality. It tests if the object starts with
a given byte array, so its name is confusing.
2022-05-16 00:12:06 +00:00
gabriel-doriath-dohler
26265319c7 Rename eq_ignore_case to starts_with_ignore_case
The method doesn't test for equality. It tests if the object starts with
a given byte array, so its name is confusing.
2022-05-15 23:59:59 +00:00
bors
42e1761c70 Auto merge of #97057 - bjorn3:sync_cg_clif-2022-05-15, r=bjorn3
Sync rustc_codegen_cranelift

Since the last sync there have mostly been fixes of various sorts. I also changed cg_clif from using a custom driver to `-Zcodegen-backend` when built as separate project. When built as part of rust it was already using `-Zcodegen-backend`.

r? `@ghost`

`@rustbot` label +A-codegen +A-cranelift +T-compiler
2022-05-15 21:17:46 +00:00
bors
29e972dc60 Auto merge of #97063 - Dylan-DPC:rollup-u5el7hb, r=Dylan-DPC
Rollup of 4 pull requests

Successful merges:

 - #96947 (Add rustc_nonnull_optimization_guaranteed to Owned/Borrowed Fd/Socket)
 - #97021 (Added note in documentation)
 - #97042 (Add new eslint rule about brace style)
 - #97060 (Fix use of SetHandleInformation on UWP)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-05-15 18:52:28 +00:00
Vadim Petrochenkov
b4019ded77 rustdoc: Remove doc link resolution fallback to all macro_rules in the crate 2022-05-15 21:08:32 +03:00
Dylan DPC
d56c59efdc
Rollup merge of #97060 - bdbai:fix/uwphandle, r=ChrisDenton
Fix use of SetHandleInformation on UWP

The use of `SetHandleInformation` (introduced in #96441 to make `HANDLE` inheritable) breaks UWP builds because it is not available for UWP targets.

Proposed workaround: duplicate the `HANDLE` with `inherit = true` and immediately close the old one. Traditional Windows Desktop programs are not affected.

cc `@ChrisDenton`
2022-05-15 18:41:27 +02:00
Dylan DPC
ede4f0ef68
Rollup merge of #97042 - GuillaumeGomez:eslint-brace-style, r=notriddle
Add new eslint rule about brace style

It also prevents one liners.

r? `@notriddle`
2022-05-15 18:41:26 +02:00
Dylan DPC
e8e7555c34
Rollup merge of #97021 - Volker-Weissmann:patch-1, r=Dylan-DPC
Added note in documentation

I added this note, because if you forget the `--target` flags, you get a really ugly error message.
https://github.com/rust-lang/cargo/issues/10666
2022-05-15 18:41:26 +02:00