Commit graph

5469 commits

Author SHA1 Message Date
Mark Rousskov
5065144d6d Use new thread-local const-init
Let's see if this gives us any speedup - some of the TLS state modified in this
commit *is* pretty heavily accessed, so we can hope!
2021-05-02 14:06:07 -04:00
Mark Rousskov
981135ae8e Streamline try_start code
This shifts some branches around and avoids interleaving parallel and
non-parallel versions of the function too much.
2021-05-02 12:25:48 -04:00
bjorn3
b71cd56e48 Move queries.crate_name() 2021-05-02 18:12:48 +02:00
bjorn3
b25292473a Simplify make_input 2021-05-02 18:12:48 +02:00
bjorn3
4a6cfc6788 Don't arena allocate Definitions 2021-05-02 18:00:20 +02:00
bjorn3
0447f91e10 Let load_query_result_cache take a &DefPathTable
This allows removing a confusing mem::replace in create_global_ctxt
2021-05-02 18:00:20 +02:00
bjorn3
c47eeac612 Move wasm_import_module_map provider to cg_ssa 2021-05-02 18:00:20 +02:00
bjorn3
808090eb07 Pass target_cpu to LinkerInfo::new instead of link_binary
This is one step towards separating the linking code from codegen backends
2021-05-02 18:00:20 +02:00
bjorn3
673c1b6e49 Remove unnecessary argument 2021-05-02 18:00:20 +02:00
bjorn3
c752ee53ae Tiny cleanup 2021-05-02 18:00:20 +02:00
bjorn3
2acdc87700 Inline process_rlink into try_process_rlink 2021-05-02 18:00:20 +02:00
bjorn3
2fa7175293 Document a few things 2021-05-02 18:00:20 +02:00
bjorn3
b5e049de08 Remove dummy_config 2021-05-02 17:59:48 +02:00
Dylan DPC
0bc9727e29
Rollup merge of #84821 - jyn514:fix-nit, r=Mark-Simulacrum
Fix nit in rustc_session::options

Addresses https://github.com/rust-lang/rust/pull/84802#discussion_r624578203 - I never actually pushed the commit before that PR got merged.

r? `@Mark-Simulacrum`
2021-05-02 17:00:25 +02:00
Dylan DPC
2553053828
Rollup merge of #84752 - lrh2000:generator-debuginfo, r=tmandry
Fix debuginfo for generators

First, all fields except the discriminant (including `outer_fields`) should be put into structures inside the variant part, which gives an equivalent layout but offers us much better integration with debuggers.

Second, artificial flags in generator variants should be removed.
 - Literally, variants are not artificial. We have `yield` statements, upvars and inner variables in the source code.
 - Functionally, we don't want debuggers to suppress the variants. It contains the state of the generator, which is useful when debugging. So they shouldn't be marked artificial.
 - Debuggers may use artificial flags to find the active variant. In this case, marking variants artificial will make debuggers not work properly.

Fixes #62572.
Fixes #79009.

And refer https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/Debuginfo.20for.20generators.
2021-05-02 17:00:23 +02:00
Dylan DPC
4198d0a87c
Rollup merge of #84392 - dario23:fmt-assert-args-pub, r=varkor,RalfJung
Make AssertKind::fmt_assert_args public
2021-05-02 17:00:22 +02:00
Dylan DPC
a00edce017
Rollup merge of #84358 - sexxi-goose:print_captures_borrowck_rebased, r=nikomatsakis
Update closure capture error logging for disjoint captures for disjoint captures

Improved error logging when `#![feature(capture_disjoint_fields)]` is used.

Closes https://github.com/rust-lang/project-rfc-2229/issues/8
Closes https://github.com/rust-lang/project-rfc-2229/issues/36
Closes https://github.com/rust-lang/project-rfc-2229/issues/39
Closes #76005
2021-05-02 17:00:21 +02:00
Joshua Nelson
d5bda3c4fe Fix nit in rustc_session::options 2021-05-02 10:08:08 -04:00
Aliénore Bouttefeux
5cc21d9051 add suggestion for unit enum variant when matched with a patern 2021-05-02 13:58:38 +02:00
bors
89ebad52a8 Auto merge of #84802 - jyn514:option-dead-code, r=Mark-Simulacrum
Remove dead code in `rustc_session::Options`

- Don't recompile the same functions for each debugging option
  This reduces the amount of items in the crate by quite a lot.
- Remove unused `parse_opt_list` and `parse_pathbuf_push` functions
- Remove unused macro parameters
- Remove `allow(dead_code)`.
2021-05-02 11:43:39 +00:00
bors
3a1cd0ed36 Auto merge of #84805 - Mark-Simulacrum:no-dup-extend, r=cjgillot
Avoid generating QueryMap::extend for each key type

Should be a small win on compile times for rustc_query_impl, where this ends up getting codegen'd.
2021-05-02 09:22:13 +00:00
Esteban Küber
1e89b583c3 Account for unsatisfied bounds in E0599
Fix #84769, follow up to #84499, #83667.
2021-05-01 17:18:04 -07:00
Mark Rousskov
61fd56fdb9 Avoid generating QueryMap::extend for each key type 2021-05-01 20:13:18 -04:00
Joshua Nelson
dd43d13325 Reduce duplication in impl_dep_tracking_hash macros 2021-05-01 19:12:36 -04:00
Joshua Nelson
b19c02cce0 Remove unused macro parameters 2021-05-01 19:01:49 -04:00
Joshua Nelson
5cf4499181 Remove unused parse_pathbuf_push function
This also remove the `allow(dead_code)`.
2021-05-01 19:01:45 -04:00
Joshua Nelson
a88a94e8aa Don't recompile the same functions for each debugging option
This reduces the amount of items in the crate by quite a lot.
2021-05-01 19:01:10 -04:00
Chris Pardy
d19c46870f add docstrings and add issue to FIXMEs 2021-05-01 19:01:06 -04:00
ChrisPardy
e612f7abfc Update compiler/rustc_mir/src/borrow_check/diagnostics/explain_borrow.rs
Co-authored-by: Niko Matsakis <niko@alum.mit.edu>
2021-05-01 19:01:06 -04:00
ChrisPardy
20a1315cbb Update compiler/rustc_mir/src/borrow_check/diagnostics/explain_borrow.rs
Co-authored-by: Niko Matsakis <niko@alum.mit.edu>
2021-05-01 19:01:06 -04:00
ChrisPardy
25beade8df Update compiler/rustc_mir/src/borrow_check/diagnostics/explain_borrow.rs
Co-authored-by: Niko Matsakis <niko@alum.mit.edu>
2021-05-01 19:01:05 -04:00
Chris Pardy
08c4fbcea7 Closure capture borrow diagnostics for disjoint captures 2021-05-01 19:01:05 -04:00
Joshua Nelson
85ee3d0f23 Remove unused parse_opt_list function 2021-05-01 18:58:05 -04:00
Rich Kadel
0b0d293c7c Report coverage 0 of dead blocks
Fixes: #84018

With `-Z instrument-coverage`, coverage reporting of dead blocks
(for example, blocks dropped because a conditional branch is dropped,
based on const evaluation) is now supported.

If `instrument-coverage` is enabled, `simplify::remove_dead_blocks()`
finds all dropped coverage `Statement`s and adds their `code_region`s as
`Unreachable` coverage `Statement`s to the `START_BLOCK`, so they are
still included in the coverage map.

Check out the resulting changes in the test coverage reports in this PR.
2021-05-01 15:04:48 -07:00
kadmin
50c86db4fa Add help message for unused type param 2021-05-01 21:58:06 +00:00
bors
4de7572097 Auto merge of #84410 - BoxyUwU:blue, r=varkor
Fix generic arg mismatch errors being ignored with explicit late bound lifetimes

Fixes #83466

r? `@varkor`
2021-05-01 21:07:10 +00:00
Aaron Hill
91daf705b4
Make TypeFoldable::is_global() false when fresh tys/consts are present
This ensures that `ParamEnv::and` preserves the original `caller_bounds`
when we have a value containing fresh tys/consts. This ensures that when
we cache a `SelectionCandidate`, the cache key (a `ParamEnvAnd`)
contains all of the information that influenced the computation of our
result (e.g. we may end up choosing a `ParamCandidate`)
2021-05-01 16:58:33 -04:00
Chris Denton
e40faeffa2
Deduplicate native libs before they are passed to the linker 2021-05-01 21:30:26 +01:00
bors
6e2a34474b Auto merge of #83114 - cjgillot:hop, r=eddyb
Move HIR parenting information out of hir_owner

Split out of #82681.

The parent of a HIR node and its content are currently bundled together, but are rarely used together.
This PR separates both information in two distinct queries for HIR owners.
This reduces incremental invalidation for HIR items that appear within a function body when this body (and the local ids) changes.
2021-05-01 18:03:25 +00:00
Ellen
39054339c1 test: *sneezes* 2021-05-01 18:36:05 +01:00
bors
603a42ec54 Auto merge of #84658 - Amanieu:reserved_regs, r=petrochenkov
Be stricter about rejecting LLVM reserved registers in asm!

LLVM will silently produce incorrect code if these registers are used as operands.

cc `@rust-lang/wg-inline-asm`
2021-05-01 13:01:24 +00:00
Amanieu d'Antras
ea310d9253 Reserve x18 on AArch64 and un-reserve x16 2021-05-01 13:25:56 +01:00
bors
fed59d669c Auto merge of #84786 - JohnTitor:rollup-j5omx6f, r=JohnTitor
Rollup of 8 pull requests

Successful merges:

 - #84601 (rustdoc: Only store locations in Cache::extern_locations and calculate the other info on-demand)
 - #84704 (platform-support.md: Update for consistency with Target Tier Policy)
 - #84724 (Replace llvm::sys::fs::F_None with llvm::sys::fs::OF_None)
 - #84740 (Reset the docs' copy path button after 1 second)
 - #84749 (Sync `rustc_codegen_cranelift`)
 - #84756 (Add a ToC to the Target Tier Policy documentation)
 - #84765 (Update cargo)
 - #84774 (Fix misspelling)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2021-05-01 09:59:54 +00:00
Yuki Okushi
fc850b6c60
Rollup merge of #84749 - XAMPPRocky:cranelift-rebase, r=bjorn3
Sync `rustc_codegen_cranelift`

Retrying #84746

r? ``@bjorn3``

---

Edit(bjorn3): Since the last sync there have been some refactorings around the driver code in preparation for a planned new feature. In addition ``@mominul`` implemented `-Ctarget-cpu` support and ``@XAMPPRocky`` fixed compilation of cg_clif itself for Windows with the MSVC toolchain.
2021-05-01 18:32:35 +09:00
Yuki Okushi
4d6d26ec6d
Rollup merge of #84724 - MaskRay:sys-fs, r=petrochenkov
Replace llvm::sys::fs::F_None with llvm::sys::fs::OF_None

The former is deprecated.
OF_None has been available in LLVM since 2018-06.

-----

OF_None (https://reviews.llvm.org/rG1f67a3cba9b09636c56e2109d8a35ae96dc15782) exists in LLVM 9.
https://reviews.llvm.org/D101506 may drop `F_None` support.
2021-05-01 18:32:34 +09:00
bors
1c2c6b6700 Auto merge of #84582 - richkadel:issue-84561, r=tmandry
Vastly improves coverage spans for macros

Fixes: #84561

This resolves problems where macros like `trace!(...)` would show zero coverage if tracing was disabled, and `assert_eq!(...)` would show zero coverage if the assertion did not fail, because only one coverage span was generated, for the branch.

This PR started with an idea that I could just drop branching blocks with same span as expanded macro. (See the fixed issue for more details.)

That did help, but it didn't resolve everything.

I also needed to add a span specifically for the macro name (plus `!`) to ensure the macro gets coverage even if it's internal expansion adds conditional branching blocks that are retained, and would otherwise drop the outer span. Now that outer span is _only_ the `(argument, list)`, which can safely be dropped now), because the macro name has its own span.

While testing, I also noticed the spanview debug output can cause an ICE on a function with no body. The
workaround for this is included in this PR (separate commit).

r? `@tmandry`
cc? `@wesleywiser`
2021-05-01 07:48:24 +00:00
Joshua Nelson
1da4445109 Apply --cfg parallel_compiler when documenting
This also reverts commit 9823c2cc70
working around the bug.
2021-05-01 00:25:11 -04:00
Daniel Silverman
fe68b1ab32 Fix linker_args with --target=sparcv9-sun-solaris
Moved -z ignore to add_as_needed

Trying to cross-compile for sparcv9-sun-solaris
getting an error message for -zignore

Introduced when -z -ignore was separated here
22d0ab0

No formatting done

Reproduce

``` bash
rustup target add sparcv9-sun-solaris
cargo new --bin hello && cd hello && cargo run --target=sparcv9-sun-solaris
```

config.toml

[target.sparcv9-sun-solaris]
linker = "gcc"
2021-04-30 15:53:14 -07:00
bors
8a9fa3682d Auto merge of #84719 - Mark-Simulacrum:reduce-query-impl, r=davidtwco
Move iter_results to dyn FnMut rather than a generic

This means that we're no longer generating the iteration/locking code for each invocation site of iter_results, rather just once per query (roughly), which seems much better: this is a 15% win in instruction counts when compiling the rustc_query_impl crate. The code where this is used also is pretty cold, I suspect; the old solution didn't fully monomorphize either.
2021-04-30 22:21:07 +00:00
Erin Power
ef53ebc5da Merge commit '15c8d31392b9fbab3b3368b67acc4bbe5983115a' into cranelift-rebase 2021-04-30 18:46:59 +02:00
lrh2000
5bf989ece9 Remove artificial flag from generator variants
- Literally, variants are not artificial. We have `yield` statements,
   upvars and inner variables in the source code.
 - Functionally, we don't want debuggers to suppress the variants. It
   contains the state of the generator, which is useful when debugging.
   So they shouldn't be marked artificial.
 - Debuggers may use artificial flags to find the active variant. In
   this case, marking variants artificial will make debuggers not work
   properly.

Fixes #79009.
2021-04-30 22:36:08 +08:00
Erin Power
9d07b92990 [cg_clif] Fix run_jit from sync 2021-04-30 15:37:19 +02:00
Erin Power
505aa48f24 Sync rustc_codegen_cranelift 'ddd4ce25535cf71203ba3700896131ce55fde795' 2021-04-30 14:49:58 +02:00
lrh2000
060deec4b1 Move outer fields of enums into variant parts in debuginfo
All fields except the discriminant (including `outer_fields`)
should be put into structures inside the variant part, which gives
an equivalent layout but offers us much better integration with
debuggers.
2021-04-30 16:30:25 +08:00
Rich Kadel
0312bf5fb9 Rebuilt out of date tests and fixed an old bug now exposed 2021-04-30 01:10:48 -07:00
bors
bcd696d722 Auto merge of #84401 - crlf0710:impl_main_by_path, r=petrochenkov
Implement RFC 1260 with feature_name `imported_main`.

This is the second extraction part of #84062 plus additional adjustments.
This (mostly) implements RFC 1260.

However there's still one test case failure in the extern crate case. Maybe `LocalDefId` doesn't work here? I'm not sure.

cc https://github.com/rust-lang/rust/issues/28937
r? `@petrochenkov`
2021-04-30 06:59:37 +00:00
Jack Huey
e6d8683239
Rollup merge of #84705 - lcnr:const_generics-rec, r=joshtriplett
make feature recommendations optional

this is what we're already doing for other feature gates, so it's better to be consistent
2021-04-29 19:27:26 -04:00
Jack Huey
26a4f461d7
Rollup merge of #84682 - jackh726:transitive_bounds_rebind, r=nikomatsakis
Don't rebind in `transitive_bounds_that_define_assoc_type`

Fixes #83737
Fixes #84604

Also fixes another issue that I don't have a test for, popped up in [zulip](https://rust-lang.zulipchat.com/#narrow/stream/144729-wg-traits/topic/Duplicate.20symbol.20error.20.2384604/near/236570445)

r? `````@nikomatsakis`````
2021-04-29 19:27:22 -04:00
Fangrui Song
0142d1cb97 Replace llvm::sys::fs::F_None with llvm::sys::fs::OF_None
The former is deprecated.
OF_None has been available in LLVM since 2018-06.
2021-04-29 15:25:17 -07:00
Mark Rousskov
a1d7367429 Move iter_results to dyn FnMut rather than a generic
This means that we're no longer generating the iteration/locking code for each
invocation site of iter_results, rather just once per query.

This is a 15% win in instruction counts when compiling the rustc_query_impl crate.
2021-04-29 17:26:46 -04:00
bors
478a07df05 Auto merge of #84708 - pnkfelix:revert-77885-everywhere, r=Mark-Simulacrum
Revert PR 77885 everywhere

Change to probe-stack=call (instead of inline-or-call) everywhere again, for now.

We had already reverted the change on stable back in PR #83412.

Since then, we've had some movement on issue #83139, but not a 100% fix.

But also since then, we had bug reported, issue #84667, that looks like outright codegen breakage, rather than problems confined to debuginfo issues.    So we are reverting PR #77885 on stable and beta. We'll reland PR #77885 (or some    variant) switching back to an LLVM-dependent selection of out-of-line call vs    inline-asm, after these other issues have been resolved.
2021-04-29 20:06:07 +00:00
Camille GILLOT
d794cb0d4f Introduce a hir_owner_parent query. 2021-04-29 21:36:56 +02:00
Camille GILLOT
18bffdb10e Move parenting info to index_hir. 2021-04-29 21:36:55 +02:00
Camille GILLOT
99d3798b6c Do not compute entry parent when not required. 2021-04-29 21:36:55 +02:00
Camille GILLOT
2d341e1e28 Remove parent_node. 2021-04-29 21:36:55 +02:00
Camille GILLOT
323f5b2ac9 Split crate_hash from index_hir. 2021-04-29 21:36:48 +02:00
Camille GILLOT
553004539e Make current_hir_id_owner a simple tuple. 2021-04-29 21:26:15 +02:00
Felix S. Klock II
8d1083e319 Change to probe-stack=call (instead of inline-or-call) everywhere again, for now.
We had already reverted the change on stable back in PR #83412.

Since then, we've had some movement on issue #83139, but not a 100% fix.

But also since then, we had bug reported, issue #84667, that looks like outright
codegen breakage, rather than problems confined to debuginfo issues.

So we are reverting PR #77885 on stable and beta. We'll reland PR #77885 (or some
variant) switching back to an LLVM-dependent selection of out-of-line call vs
inline-asm, after these other issues have been resolved.
2021-04-29 15:13:21 -04:00
lcnr
da6261e07f make feature recommendations optional 2021-04-29 20:44:19 +02:00
bors
18587b14d1 Auto merge of #84556 - RalfJung:const-fn-trait-bound, r=oli-obk
use correct feature flag for impl-block-level trait bounds on const fn

I am not sure what that special hack was needed for, but it doesn't seem needed any more...

This removes the last use of the `const_fn` feature flag -- Cc https://github.com/rust-lang/rust/issues/84510
r? `@oli-obk`
2021-04-29 17:38:37 +00:00
bors
814a560072 Auto merge of #84233 - jyn514:track-path-prefix, r=michaelwoerister
Add TRACKED_NO_CRATE_HASH and use it for `--remap-path-prefix`

I verified locally that this fixes https://github.com/rust-lang/rust/issues/66955.

r? `@Aaron1011` (feel free to reassign)
2021-04-29 14:57:17 +00:00
Joshua Nelson
bfa74c270f Use doc-comment instad of comments consistently
This makes the comments show up in the generated docs.

- Fix markdown formatting
2021-04-29 12:53:49 +00:00
Ralf Jung
9a852776f4 don't let const_fn feature flag affect impl-block-level trait bounds 2021-04-29 09:27:45 +02:00
bors
d337cec9af Auto merge of #84684 - jackh726:rollup-qxc5cos, r=jackh726
Rollup of 11 pull requests

Successful merges:

 - #84484 (Don't rebuild rustdoc and clippy after checking bootstrap)
 - #84530 (`test tidy` should ignore alternative `build` dir patterns)
 - #84531 (Ignore commented out lines when finding features)
 - #84540 (Build sanitizers for x86_64-unknown-linux-musl)
 - #84555 (Set `backtrace-on-ice` by default for compiler and codegen profiles)
 - #84585 (Add `x.py check src/librustdoc` as an alias for `x.py check src/tools/rustdoc`)
 - #84636 (rustdoc: change aliases attribute to data-aliases)
 - #84646 (Add some regression tests related to #82494)
 - #84661 (Remove extra word in `rustc_mir` docs)
 - #84663 (Remove `DropGuard` in `sys::windows::process` and use `StaticMutex` instead)
 - #84668 (Update books)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2021-04-29 05:24:45 +00:00
Rich Kadel
eef546abb6 addressed review feedback 2021-04-28 20:27:27 -07:00
Rich Kadel
c97d8992ae spanview debug output caused ICE when a function had no body 2021-04-28 20:27:27 -07:00
Rich Kadel
f12795f8a0 More improvements to macro coverage 2021-04-28 20:27:27 -07:00
Rich Kadel
c26afb765c Drop branching blocks with same span as expanded macro
Fixes: #84561
2021-04-28 20:27:27 -07:00
Jack Huey
096375451d
Rollup merge of #84661 - pierwill:patch-1, r=jackh726
Remove extra word in `rustc_mir` docs

Changes "is includes" to "includes" in `rustc_mir::borrow_check::type_check::type_check`.
2021-04-28 22:59:30 -04:00
bors
ada102456d Auto merge of #84614 - RalfJung:daily, r=Mark-Simulacrum
don't enable parking_lot nightly features

Having the compiler itself depend on external libraries that use nightly features can lead to "fun" bootstrap situations. Within the rustc repo we use `cfg(bootstrap)` to resolve those, but that is not a reasonable option for external dependencies.

So I propose we stop enabling the "nightly" feature of `parking_lot` here. In my experiments, this then indeed leads to the feature not being enabled (i.e., nothing else enables it), and everything still builds. However, this means parking_lot's `RwLock` will no longer have hardware lock elision for readers -- I hope that is okay to lose in exchange for less bootstrap brain twisting. ;)

Cc `@Amanieu`
2021-04-29 02:53:52 +00:00
Charles Lew
d261df4a72 Implement RFC 1260 with feature_name imported_main. 2021-04-29 08:35:08 +08:00
Jack Huey
5f82e22ba4 Don't rebind in transitive_bounds_that_define_assoc_type 2021-04-28 18:10:44 -04:00
bors
ca075d268d Auto merge of #83386 - mark-i-m:stabilize-pat2015, r=nikomatsakis
Stabilize `:pat_param` and remove `:pat2021`

Blocked on #83384

cc `@rust-lang/lang` #79278

If I understand `@nikomatsakis` in  https://rust-lang.zulipchat.com/#narrow/stream/213817-t-lang/topic/or.20patterns/near/231133873, another FCP is not needed.

r? `@nikomatsakis`
2021-04-28 20:35:17 +00:00
Amanieu d'Antras
e6a731eb90 Be stricter about rejecting LLVM reserved registers in asm! 2021-04-28 18:30:36 +01:00
pierwill
8b806bcd41
Remove extra word in rustc_mir docs
Changes "is includes" to "includes" in `rustc_mir::borrow_check::type_check::type_check`.
2021-04-28 09:53:32 -07:00
Jack Huey
31ae3b2bdb Add HAS_RE_LATE_BOUND if there are bound vars 2021-04-28 10:18:52 -04:00
bors
20040fa332 Auto merge of #84562 - richkadel:issue-83601, r=tmandry
Adds feature-gated `#[no_coverage]` function attribute, to fix derived Eq `0` coverage issue #83601

Derived Eq no longer shows uncovered

The Eq trait has a special hidden function. MIR `InstrumentCoverage`
would add this function to the coverage map, but it is never called, so
the `Eq` trait would always appear uncovered.

Fixes: #83601

The fix required creating a new function attribute `no_coverage` to mark
functions that should be ignored by `InstrumentCoverage` and the
coverage `mapgen` (during codegen).

Adding a `no_coverage` feature gate with tracking issue #84605.

r? `@tmandry`
cc: `@wesleywiser`
2021-04-28 13:05:16 +00:00
bors
237eab1156 Auto merge of #83401 - fee1-dead:master, r=davidtwco
Fix ICE of for-loop mut borrowck where no suggestions are available

Fixes #83309.
2021-04-28 10:46:02 +00:00
bors
76a04dd3f8 Auto merge of #84644 - JohnTitor:rollup-nzq9rjz, r=JohnTitor
Rollup of 5 pull requests

Successful merges:

 - #84529 (Improve coverage spans for chained function calls)
 - #84616 (Fix empty dom toggle)
 - #84622 (Make traits with GATs not object safe)
 - #84624 (Make sentence in env::args_os' docs plain and simple)
 - #84642 (Stabilize vec_extend_from_within)

Failed merges:

 - #84636 (rustdoc: change aliases attribute to data-aliases)

r? `@ghost`
`@rustbot` modify labels: rollup
2021-04-28 08:20:19 +00:00
Yuki Okushi
35eac429f6
Rollup merge of #84622 - jackh726:gats-trait-object, r=nikomatsakis
Make traits with GATs not object safe

Closes #81823

r? `@nikomatsakis`
2021-04-28 16:59:08 +09:00
Yuki Okushi
3f89ca1a32
Rollup merge of #84529 - richkadel:issue-84180, r=tmandry
Improve coverage spans for chained function calls

Fixes: #84180

For chained function calls separated by the `?` try operator, the
function call following the try operator produced a MIR `Call` span that
matched the span of the first call. The `?` try operator started a new
span, so the second call got no span.

It turns out the MIR `Call` terminator has a `func` `Operand`
for the `Constant` representing the function name, and the function
name's Span can be used to reset the starting position of the span.

r? `@tmandry`
cc: `@wesleywiser`
2021-04-28 16:59:06 +09:00
bors
855c2d130f Auto merge of #83713 - spastorino:revert-pub-macro-rules, r=nikomatsakis
Revert "Rollup merge of #82296 - spastorino:pubrules, r=nikomatsakis"

This reverts commit e2561c58a4, reversing
changes made to 2982ba50fc.

As discussed in #83641 this feature is not complete and in particular doesn't work cross macros and given that this is not going to be included in edition 2021 nobody seems to be trying to fix the underlying problem. When can add this again I guess, whenever somebody has the time to make it work cross crates.

r? `@nikomatsakis`
2021-04-28 05:52:47 +00:00
bors
537544b106 Auto merge of #84498 - workingjubilee:update-grab-bag, r=Mark-Simulacrum
Update grab bag

This PR slides a bunch of crate versions forward until suddenly a bunch of deps fall out of the tree!
In doing so this mostly picks up a version bump in the `redox_users` crate which makes most of the features default to optional.

crossbeam-utils 0.7 => 0.8.3 (where applicable)
https://github.com/crossbeam-rs/crossbeam/blob/master/crossbeam-utils/CHANGELOG.md
directories 3.0.1 => 3.0.2
ignore 0.4.16 => 0.4.17
tempfile 3.0.5 => tempfile 3.2

Removes constant_time_eq from deps exceptions
Removes arrayref from deps exceptions
And also removes:
- blake2b_simd
- const_fn (the package, not the feature)
- constant_time_eq
- redox_users 0.3.4
- rust-argon2
2021-04-28 02:45:03 +00:00
mark
2a9db919ff remove pat2021 2021-04-27 21:15:59 -05:00
Rich Kadel
3a5df48021 adds feature gating of no_coverage at either crate- or function-level 2021-04-27 17:12:51 -07:00
Jack Huey
857cb4de20 Make traits with GATs not object safe 2021-04-27 14:34:23 -04:00
Rich Kadel
888d0b4c96 Derived Eq no longer shows uncovered
The Eq trait has a special hidden function. MIR `InstrumentCoverage`
would add this function to the coverage map, but it is never called, so
the `Eq` trait would always appear uncovered.

Fixes: #83601

The fix required creating a new function attribute `no_coverage` to mark
functions that should be ignored by `InstrumentCoverage` and the
coverage `mapgen` (during codegen).

While testing, I also noticed two other issues:

* spanview debug file output ICEd on a function with no body. The
workaround for this is included in this PR.
* `assert_*!()` macro coverage can appear covered if followed by another
`assert_*!()` macro. Normally they appear uncovered. I submitted a new
Issue #84561, and added a coverage test to demonstrate this issue.
2021-04-27 11:11:56 -07:00
Dylan DPC
24782c7f82
Rollup merge of #84613 - lcnr:recursive-types, r=jackh726
move representability checks to rustc_ty_utils
2021-04-27 19:08:50 +02:00
Joshua Nelson
39648ea467 Make real_rust_path_dir a TRACKED_NO_CRATE_HASH option
This also adds support for doc-comments to Options.
2021-04-27 16:48:25 +00:00
Joshua Nelson
272015190d Add [TRACKED_NO_CRATE_HASH] and [SUBSTRUCT] directives
This is necessary for options that should invalidate the incremental
hash but *not* affect the crate hash (e.g. --remap-path-prefix).

This doesn't add `for_crate_hash` to the trait directly because it's not
relevant for *types*, only for *options*, which are fields on a larger
struct. Instead, it adds a new `SUBSTRUCT` directive for options, which
does take a `for_crate_hash` parameter.

- Use TRACKED_NO_CRATE_HASH for --remap-path-prefix
- Add test that `remap_path_prefix` is tracked
- Reduce duplication in the test suite to avoid future churn
2021-04-27 16:46:33 +00:00
Joshua Nelson
fb7018b41e Test that non_default_option is not the default option
Otherwise the test is useless and does nothing. This caught 2 bugs in
the test suite.
2021-04-27 16:30:39 +00:00
Ralf Jung
170a10b2dd don't enable parking_lot nightly features 2021-04-27 15:05:55 +02:00
lcnr
b3629d21ba move representability out of rustc_middle 2021-04-27 15:01:37 +02:00
bors
e1886935b7 Auto merge of #84532 - richkadel:issue-83792, r=tmandry
Fix coverage ICE because fn_sig can have a span that crosses file bou…

Fixes: #83792

MIR `InstrumentCoverage` assumed the `FnSig` span was contained within a
single file, but this is not always the case. Some macro constructions
can result in a span that starts in one `SourceFile` and ends in a
different one.

The `FnSig` span is included in coverage results as long as that span is
in the same `SourceFile` and the same macro context, but by assuming the
`FnSig` span's `hi()` and `lo()` were in the same file, I took this for
granted, and checked only that the `FnSig` `hi()` was in the same
`SourceFile` as the `body_span`.

I actually drop the `hi()` though, and extend the `FnSig` span to the
`body_span.lo()`, so I really should have simply checked that the
`FnSig` span's `lo()` was in the `SourceFile` of the `body_span`.

r? `@tmandry`
cc: `@wesleywiser`
2021-04-27 07:29:26 +00:00
bors
22b686ad99 Auto merge of #77246 - yaahc:typeof-errors, r=oli-obk
try enabling typeof for fun error messages
2021-04-27 04:46:45 +00:00
bors
8212de8eb1 Auto merge of #84546 - CohenArthur:fix-liveness-typo, r=jyn514
Fix typo  in report_unsed_assign

The function was called `report_unsed_assign`, which I assume is a typo, considering the rest of the file.
This replaces `report_unsed_assign` with `report_unused_assign`.
2021-04-26 11:18:25 +00:00
bors
ee8382f297 Auto merge of #84544 - RalfJung:const_fn_in_trait, r=oli-obk
Always reject `const fn` in `trait` during parsing.

'const fn' in trait are rejected in the AST:
b78c0d8a4d/compiler/rustc_ast_passes/src/ast_validation.rs (L1411)
So this feature gate check is a NOP and we can just remove it.

The src/test/ui/feature-gates/feature-gate-min_const_fn.rs and src/test/ui/feature-gates/feature-gate-const_fn.rs tests ensure that we still reject `const fn` in `trait`

Cc https://github.com/rust-lang/rust/issues/84510
r? `@oli-obk`
2021-04-26 02:56:25 +00:00
Dylan DPC
000a630110
Rollup merge of #84547 - RalfJung:max_const_fn, r=oli-obk
Get rid of is_min_const_fn

This removes the last trace of the min_const_fn mechanism by making the unsafety checker agnostic about whether something is a min or "non-min" const fn. It seems this distinction was used to disallow some features inside `const fn`, but that is the responsibility of the const checker, not of the unsafety checker. No test seems to even notice this change in the unsafety checker so I guess we are good...

r? `@oli-obk`
Cc https://github.com/rust-lang/rust/issues/84510
2021-04-25 23:15:18 +02:00
Dylan DPC
139749934b
Rollup merge of #84520 - hameerabbasi:fn-as-ty, r=lcnr
Improve diagnostics for function passed when a type was expected.

This PR improves diagnostics, it provides more information when a function is passed where a type is expected.

r? `@lcnr`
2021-04-25 23:15:16 +02:00
Dylan DPC
ad3389a6df
Rollup merge of #84516 - torhovland:issue-84114, r=estebank
Add suggestion to "use break" when attempting to implicit-break a loop

Fixes #84114
2021-04-25 23:15:14 +02:00
Dylan DPC
ae316d6603
Rollup merge of #84499 - estebank:issue-84272, r=jackh726
Tweak trait not `use`d suggestion

Fix #84272. Follow up to #83667.
2021-04-25 23:15:13 +02:00
Dylan DPC
a0dcbdf7fd
Rollup merge of #84486 - Smittyvb:else-if-let-hir-pretty-print, r=petrochenkov
Handle pretty printing of `else if let` clauses without ICEing

When pretty printing the HIR of `if ... {} else if let ... {}` clauses, this displays it the `else if let` part as `match` it gets desugared to, the same way normal `if let` statements are currently displayed, instead of ICEing.

```rust
pub fn main() {
    if true {
        // 1
    } else if let a = 1 {
        // 2
    } else {
        // 3
    }
}
```

now gets desugared (via `rustc -Zunpretty=hir,typed src/x.rs`) to:

```rust
#[prelude_import]
use ::std::prelude::rust_2015::*;
#[macro_use]
extern crate std;
pub fn main() ({
                   (if (true as bool)
                       ({
                            // 1
                        } as
                           ()) else {match (1 as i32) {
                                         a => {
                                             // 2
                                         }
                                         _ => {
                                             // 3
                                         }
                                     }} as ())
                    } as ())
```

For comparison, this code gets HIR prettyprinted the same way before and after this change:

```rust
pub fn main() {
    if let a = 1 {
        // 2
    } else {
        // 3
    }
}
```
turns into
```rust
#[prelude_import]
use ::std::prelude::rust_2015::*;
#[macro_use]
extern crate std;
pub fn main() ({
                   (match (1 as i32) {
                        a => {
                            // 2
                        }
                        _ => {
                            // 3
                        }
                    } as ())
               } as ())
```

This closes #82329. It closes #84434 as well, due to having the same root cause.
2021-04-25 23:15:12 +02:00
Dylan DPC
379a55c64e
Rollup merge of #84450 - jyn514:missing-std, r=petrochenkov
Give a better error when `std` or `core` are missing

- Suggest using `rustup target add` if `RUSTUP_HOME` is set. I don't know if there's any precedent for doing this, but it seems harmless enough and it will be a big help.
- On nightly, suggest using `cargo build -Z build-std` if `CARGO` is set
- Add a note about `#![no_std]` if `std` is missing but not core
- Add a note that std may be unsupported if `std` is missing but not core

Fixes https://github.com/rust-lang/rust/issues/84418.

r? `@petrochenkov`
2021-04-25 23:15:11 +02:00
Dylan DPC
e7e22b47ad
Rollup merge of #84235 - klensy:styled-buffer, r=lcnr
refactor StyledBuffer

Refactors StyledBuffer `text` and `styles` fields content into StyledChar and touches some other stuff.
2021-04-25 23:15:10 +02:00
Jack Huey
9f0693969a Deduplicate ParamCandidates with the same value except for bound vars 2021-04-25 15:11:49 -04:00
Joshua Nelson
d326a4b4c9 Give a better error when std or core are missing
- Suggest using `rustup target add` if `RUSTUP_HOME` is set. I don't know if there's any precedent for doing this, but it seems harmless enough and it will be a big help.
- Add a note about `#![no_std]` if `std` is missing but not core
- On nightly, suggest using `cargo build -Z build-std` if `CARGO` is set
- Add a note that std may be unsupported if `std` is missing but not core
- Don't suggest `#![no_std]` when the load isn't injected by the
  compiler
2021-04-25 16:45:31 +00:00
Ralf Jung
588530d096
fix typography 2021-04-25 18:41:14 +02:00
bors
58bdb08947 Auto merge of #84299 - lcnr:const-generics-defaults-name-res, r=varkor
various const parameter defaults improvements

Actually resolve names in const parameter defaults, fixing `struct Foo<const N: usize = { usize::MAX }>`.

---
Split generic parameter ban rib for types and consts, allowing
```rust
#![feature(const_generics_defaults)]
struct Q;
struct Foo<T = Q, const Q: usize = 3>(T);
```

---
Remove the type/const ordering restriction if `const_generics_defaults` is active, even if `const_generics` is not. allowing us to stabilize and test const param defaults separately.

---
Check well formedness of const parameter defaults, eagerly emitting an error for `struct Foo<const N: usize = { 0 - 1 }>`

---
Do not forbid const parameters in param defaults, allowing `struct Foo<const N: usize, T = [u8; N]>(T)` and `struct Foo<const N: usize, const M: usize = N>`. Note that this should not change anything which is stabilized, as on stable, type parameters must be in front of const parameters, which means that type parameter defaults are only allowed if no const parameters exist.

We still forbid generic parameters inside of const param types.

r? `@varkor` `@petrochenkov`
2021-04-25 14:00:49 +00:00
CohenArthur
ba9d143118 liveness: Fix typo report_unsed_assign -> report_unused_assign 2021-04-25 14:10:57 +02:00
Ralf Jung
1ecdaa29f9 remove now-unused 'is_min_const_fn' 2021-04-25 12:54:34 +02:00
Ralf Jung
9082078a26 unsafety checking: no longer care about is_min_const_fn
Rejecting the forbidden unsafe ops is done by const checking, not by unsafety checking
2021-04-25 12:53:05 +02:00
bors
06f0adb345 Auto merge of #84216 - RalfJung:black-box, r=Mark-Simulacrum
move core::hint::black_box under its own feature gate

The `black_box` function had its own RFC and is tracked separately from the `test` feature at https://github.com/rust-lang/rust/issues/64102. Let's reflect this in the feature gate.

To avoid breaking all the benchmarks, libtest's `test::black_box` is a wrapping definition, not a reexport -- this means it is still under the `test` feature gate.
2021-04-25 10:35:24 +00:00
Ralf Jung
8a961a5b33 remove const_fn from some error_code descriptions 2021-04-25 12:19:06 +02:00
Ralf Jung
3d16e156ae fix sanitizer tests 2021-04-25 11:08:33 +02:00
Ralf Jung
23d54ad96f move core::hint::black_box under its own feature gate 2021-04-25 11:08:12 +02:00
Ralf Jung
75bab0782a 'const fn' in trait are rejected in the AST, this feature gate check is a NOP 2021-04-25 11:03:03 +02:00
bors
13a2615883 Auto merge of #84147 - cuviper:array-method-dispatch, r=nikomatsakis,m-ou-se
Cautiously add IntoIterator for arrays by value

Add the attribute described in #84133, `#[rustc_skip_array_during_method_dispatch]`, which effectively hides a trait from method dispatch when the receiver type is an array.

Then cherry-pick `IntoIterator for [T; N]` from #65819 and gate it with that attribute. Arrays can now be used as `IntoIterator` normally, but `array.into_iter()` has edition-dependent behavior, returning `slice::Iter` for 2015 and 2018 editions, or `array::IntoIter` for 2021 and later.

r? `@nikomatsakis`
cc `@LukasKalbertodt` `@rust-lang/libs`
2021-04-25 07:26:49 +00:00
Hameer Abbasi
e558ddbb3a Improve diagnostics for function passed when a type was expected. 2021-04-25 08:56:50 +02:00
Rich Kadel
41667e8534 Improve spans for chained function calls
Fixes: #84180

For chained function calls separated by the `?` try operator, the
function call following the try operator produced a MIR `Call` span that
matched the span of the first call. The `?` try operator started a new
span, so the second call got no span.

It turns out the MIR `Call` terminator has a `func` `Operand`
for the `Constant` representing the function name, and the function
name's Span can be used to reset the starting position of the span.
2021-04-24 17:27:24 -07:00
bors
b56b175c6c Auto merge of #84310 - RalfJung:const-fn-feature-flags, r=oli-obk
further split up const_fn feature flag

This continues the work on splitting up `const_fn` into separate feature flags:
* `const_fn_trait_bound` for `const fn` with trait bounds
* `const_fn_unsize` for unsizing coercions in `const fn` (looks like only `dyn` unsizing is still guarded here)

I don't know if there are even any things left that `const_fn` guards... at least libcore and liballoc do not need it any more.

`@oli-obk` are you currently able to do reviews?
2021-04-24 23:16:03 +00:00
Rich Kadel
31cba57ea5 Fix coverage ICE because fn_sig can have a span that crosses file boundaries
Fixes: #83792

MIR `InstrumentCoverage` assumed the `FnSig` span was contained within a
single file, but this is not always the case. Some macro constructions
can result in a span that starts in one `SourceFile` and ends in a
different one.

The `FnSig` span is included in coverage results as long as that span is
in the same `SourceFile` and the same macro context, but by assuming the
`FnSig` span's `hi()` and `lo()` were in the same file, I took this for
granted, and checked only that the `FnSig` `hi()` was in the same
`SourceFile` as the `body_span`.

I actually drop the `hi()` though, and extend the `FnSig` span to the
`body_span.lo()`, so I really should have simply checked that the
`FnSig` span's `lo()` was in the `SourceFile` of the `body_span`.
2021-04-24 15:41:56 -07:00
klensy
8ebd811b32 review 2021-04-24 22:37:42 +03:00
Yuki Okushi
e109aa3613
Rollup merge of #83519 - oli-obk:assign_shrink_your_normal_code, r=pnkfelix
Implement a lint that highlights all moves larger than a configured limit

Tracking issue: #83518
[MCP 420](https://github.com/rust-lang/compiler-team/issues/420) still ~blazing~ in progress

r? ```@pnkfelix```

The main open issue I see with this minimal impl of the feature is that the lint is immediately "stable" (so it can be named on stable), even if it is never executed on stable. I don't think we have the concept of unstable lint names or hiding lint names without an active feature gate, so that would be a bigger change.
2021-04-25 01:53:09 +09:00
Tor Hovland
8bc81a0e4d Refactor. 2021-04-24 18:49:21 +02:00
Sean Cross
f9d390d14a Merge remote-tracking branch 'upstream/master' into impl-16351-nightly
Signed-off-by: Sean Cross <sean@xobs.io>
2021-04-25 00:35:25 +08:00
Tor Hovland
ad78b50a86 Implemented suggestion. 2021-04-24 13:57:41 +02:00
bors
e11a9fa52a Auto merge of #84501 - JohnTitor:rollup-wxu1thu, r=JohnTitor
Rollup of 10 pull requests

Successful merges:

 - #83990 (implement `TrustedRandomAccess` for `Take` iterator adapter)
 - #84250 (bootstrap: use bash on illumos to run install scripts)
 - #84320 (Use details tag for trait implementors.)
 - #84436 (Make a few functions private)
 - #84453 (Document From implementations for Waker and RawWaker)
 - #84458 (Remove unnecessary fields and parameters in rustdoc)
 - #84485 (Add some associated type bounds tests)
 - #84489 (Mention FusedIterator case in Iterator::fuse doc)
 - #84492 (rustdoc: Remove unnecessary dummy span)
 - #84496 (Add some specialization tests)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2021-04-24 04:54:10 +00:00
Yuki Okushi
570eed71ef
Rollup merge of #84436 - jyn514:private, r=petrochenkov
Make a few functions private

These were made public in 3105bcfdc1. This
is so long ago I doubt anyone remembers why they're public. No one outside rustc_session uses
them, including in-tree tools.
2021-04-24 12:17:04 +09:00
bors
a7aba58e96 Auto merge of #83722 - jyn514:stable-help, r=estebank
On stable, suggest removing `#![feature]` for features that have been stabilized

I don't know how to test this (https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/Run.20tests.20without.20enabling.20nightly.20features.3F). I confirmed locally that this gives the
appropriate help with `channel = "beta"`:

```
error[E0554]: `#![feature]` may not be used on the beta release channel
 --> src/lib.rs:2:1
  |
2 | #![feature(min_const_generics)]
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove the attribute
  |
  = help: the feature `min_const_generics` has been stable since 1.51.0 and no longer requires an attribute to enable

error[E0554]: `#![feature]` may not be used on the beta release channel
 --> src/lib.rs:3:1
  |
3 | #![feature(min_const_generics, min_specialization)]
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = help: the feature `min_const_generics` has been stable since 1.51.0 and no longer requires an attribute to enable

error[E0554]: `#![feature]` may not be used on the beta release channel
 --> src/lib.rs:4:1
  |
4 | #![feature(box_patterns)]
  | ^^^^^^^^^^^^^^^^^^^^^^^^^
```

Closes https://github.com/rust-lang/rust/issues/83715.
2021-04-24 02:25:54 +00:00
Esteban Küber
fb1fb7d2ef Tweak suggestion output 2021-04-23 18:57:52 -07:00
Esteban Küber
64ee9cc28c Recover trait import suggestion 2021-04-23 18:12:54 -07:00
bors
8ad0821b03 Auto merge of #83729 - JohnTitor:issue-43913, r=estebank
Add a suggestion when using a type alias instead of trait alias

Fixes #43913

r? `@estebank`
2021-04-23 23:44:49 +00:00
Jubilee Young
1f5e1c5efa Use latest crossbeam 2021-04-23 16:27:08 -07:00
Jubilee Young
b2c1dbbd33 Use tempfile 2021-04-23 15:33:57 -07:00
bors
bb491ed239 Auto merge of #84490 - JohnTitor:rollup-wrdj4ko, r=JohnTitor
Rollup of 11 pull requests

Successful merges:

 - #80805 (Improve `Iterator::by_ref` example)
 - #84248 (Remove duplicated fn(Box<[T]>) -> Vec<T>)
 - #84321 (rustdoc: Convert sub-variant toggle to HTML)
 - #84359 (⬆️ rust-analyzer)
 - #84374 (Clean up .gitignore)
 - #84387 (Move `sys_common::poison` to `sync::poison`)
 - #84430 (doc/platform-support: clarify UEFI support)
 - #84433 (Prevent control, shift and alt keys to make search input lose focus)
 - #84444 (doc: Get rid of "[+] show undocumented items" toggle on numeric From impls)
 - #84456 (Fix ICE if original_span(fn_sig) returns a span not in body sourcefile)
 - #84469 (Update comment on `PrimTy::name_str`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2021-04-23 21:03:57 +00:00
Jane Lusby
81e4d5f96c add special case for typeof fallback 2021-04-23 13:28:17 -07:00
Yuki Okushi
62db03cd62
Rollup merge of #84469 - jyn514:dead-code, r=Mark-Simulacrum
Update comment on `PrimTy::name_str`

It's no longer used by rustdoc.
2021-04-24 03:44:15 +09:00
Yuki Okushi
e07c7b5641
Rollup merge of #84456 - richkadel:issue-84421, r=tmandry
Fix ICE if original_span(fn_sig) returns a span not in body sourcefile

Fixes: #84421

r? ````@tmandry````

fyi: ````@wesleywiser```` ````@sdroege```` ````@rajivshah3````
2021-04-24 03:44:13 +09:00
bors
481ba16439 Auto merge of #84339 - alexcrichton:llvm-fptoint-sat, r=nagisa
rustc: Use LLVM's new saturating float-to-int intrinsics

This commit updates rustc, with an applicable LLVM version, to use
LLVM's new `llvm.fpto{u,s}i.sat.*.*` intrinsics to implement saturating
floating-point-to-int conversions. This results in a little bit tighter
codegen for x86/x86_64, but the main purpose of this is to prepare for
upcoming changes to the WebAssembly backend in LLVM where wasm's
saturating float-to-int instructions will now be implemented with these
intrinsics.

This change allows simplifying a good deal of surrounding code, namely
removing a lot of wasm-specific behavior. WebAssembly no longer has any
special-casing of saturating arithmetic instructions and the need for
`fptoint_may_trap` is gone and all handling code for that is now
removed. This means that the only wasm-specific logic is in the
`fpto{s,u}i` instructions which only get used for "out of bounds is
undefined behavior". This does mean that for the WebAssembly target
specifically the Rust compiler will no longer be 100% compatible with
pre-LLVM 12 versions, but it seems like that's unlikely to be relied on
by too many folks.

Note that this change does immediately regress the codegen of saturating
float-to-int casts on WebAssembly due to the specialization of the LLVM
intrinsic not being present in our LLVM fork just yet. I'll be following
up with an LLVM update to pull in those patches, but affects a few other
SIMD things in flight for WebAssembly so I wanted to separate this change.

Eventually the entire `cast_float_to_int` function can be removed when
LLVM 12 is the minimum version, but that will require sinking the
complexity of it into other backends such as Cranelfit.
2021-04-23 18:35:49 +00:00
Jane Lusby
a49b746da4 cyclesss 2021-04-23 11:07:15 -07:00
Jane Lusby
2ac171f94c try enabling typeof for fun error messages 2021-04-23 11:07:15 -07:00
Smitty
e4ce655cbf Handle pretty printing of else if let clauses
Closes #84434. Closes #82329.
2021-04-23 13:29:18 -04:00
Alex Crichton
35ae752231 Disable LLVM's new fptoint intrinsics on riscv64
Looks like this platform still isn't quite working yet due to
https://bugs.llvm.org/show_bug.cgi?id=50083
2021-04-23 07:45:23 -07:00
Santiago Pastorino
83767d97f0
Add pub_macro_rules to the list of removed features 2021-04-23 10:58:07 -03:00
Santiago Pastorino
0e4d2fd447
Revert "Rollup merge of #82296 - spastorino:pubrules, r=nikomatsakis"
This reverts commit e2561c58a4, reversing
changes made to 2982ba50fc.
2021-04-23 10:40:32 -03:00
bors
236580bc5b Auto merge of #83425 - durin42:llvm-update, r=nagisa
RustWrapper: work around unification of diagnostic handlers

This lets me build against llvm/main as of March 23rd, 2021. I'm not
entirely sure this is _correct_, but it appears to be functionally
identical to what was done in LLVM: existing callsites of
setInlineAsmDiagnosticHandler were moved to SetDiagnosticHandler() on
the context object, which we already set up in both places that we
called setInlineAsmDiagnosticHandler().
2021-04-23 05:29:12 +00:00
Joshua Nelson
2b026782d8 Update comment on PrimTy::name_str 2021-04-22 23:32:48 -04:00
Rich Kadel
a07bf2e174 Fix ICE if original_span(fn_sig) returns a span not in body sourcefile
Fixes: #84421
2021-04-22 15:49:13 -07:00
bors
7f4afdf025 Auto merge of #84420 - workingjubilee:microvec, r=Mark-Simulacrum
Use arrayvec 0.7, drop smallvec 0.6

With the arrival of min const generics, many alt-vec libraries have
updated to use it in some way and arrayvec is no exception. Use the
latest with minor refactoring.

Also, rustc_workspace_hack is the only user of smallvec 0.6 in the
entire tree, so drop it.
2021-04-22 21:01:24 +00:00
Augie Fackler
fc2a74c640 RustWrapper: work around unification of diagnostic handlers
This lets me build against llvm/main as of March 23rd, 2021. I'm not
entirely sure this is _correct_, but it appears to be functionally
identical to what was done in LLVM: existing callsites of
setInlineAsmDiagnosticHandler were moved to SetDiagnosticHandler() on
the context object, which we already set up in both places that we
called setInlineAsmDiagnosticHandler().
2021-04-22 15:46:47 -04:00
Dylan DPC
f180c1e05d
Rollup merge of #84404 - tmiasko:intrinsics-in-coercion-lub, r=Mark-Simulacrum
Check for intrinsics before coercing to a function pointer

Return an error if coercing function items / non-capturing closures
to a common function pointer type would require reifying an intrinsic.

Turns ICE reported in #84297 into a proper error.
2021-04-22 18:14:42 +02:00
Dylan DPC
9b432e0234
Rollup merge of #84377 - jackh726:binder-refactor-fix, r=nikomatsakis
Followup to #83944

Some cleanups requested by ``@nikomatsakis``

r? ``@nikomatsakis``
2021-04-22 18:14:39 +02:00
Dylan DPC
2f438e31f5
Rollup merge of #84343 - camsteffen:closure-tree, r=varkor
Remove `ScopeTree::closure_tree`

Seems to be dead code since #50649.
2021-04-22 18:14:32 +02:00
Joshua Nelson
1a46b26422 Make a few functions private
These were made public in 3105bcfdc1. This
is so long ago I doubt anyone remembers why they're public. No one uses
them, including in-tree tools.
2021-04-22 09:22:30 -04:00
bors
25c15cdbe0 Auto merge of #71511 - hi-rustin:rustin-patch-rename-assoc, r=eddyb,varkor
Rename AssociatedItems to AssocItems

Signed-off-by: Rustin-Liu <rustin.liu@gmail.com>

Part of https://github.com/rust-lang/rust/issues/60163#issuecomment-605308641
2021-04-22 11:32:50 +00:00
Jubilee Young
e8eb691c1f Use arrayvec 0.7, drop smallvec 0.6
With the arrival of min const generics, many alt-vec libraries have
updated to use it in some way and arrayvec is no exception. Use the
latest with minor refactoring.

Also, rustc_workspace_hack is the only user of smallvec 0.6 in the
entire tree, so drop it.
2021-04-21 22:39:08 -07:00
bors
71965ab4d0 Auto merge of #84411 - m-ou-se:rollup-9btsp2t, r=m-ou-se
Rollup of 12 pull requests

Successful merges:

 - #84013 (Replace all `fmt.pad` with `debug_struct`)
 - #84119 (Move `sys::vxworks` code to `sys::unix`)
 - #84212 (Replace `Void` in `sys` with never type)
 - #84251 (fix 'const-stable since' for NonZeroU*::new_unchecked)
 - #84301 (Document that `index` and `index_mut` can panic)
 - #84365 (Improve the docstrings of the `Lto` struct.)
 - #84378 (Fix broken doc link)
 - #84379 (Add GAT related tests)
 - #84380 (Write Rustdoc titles like "x in crate::mod - Rust")
 - #84390 (Format `Struct { .. }` on one line even with `{:#?}`.)
 - #84393 (Support `x.py doc std --open`)
 - #84406 (Remove `delete` alias from `mem::drop`.)

Failed merges:

 - #84387 (Move `sys_common::poison` to `sync::poison`)

r? `@ghost`
`@rustbot` modify labels: rollup
2021-04-22 05:01:30 +00:00
Mara Bos
6967b68667
Rollup merge of #84365 - vext01:improve-lto-docstrings, r=petrochenkov
Improve the docstrings of the `Lto` struct.

This change is the result of [this zulip discussion](https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/Making.20sense.20of.20LTO.20modes.20in.20rustc).

Hopefully it makes things a little clearer. What do you think?
2021-04-21 23:06:17 +02:00
Josh Stone
2a97c690bc Note array.into_iter() specifically in method probing 2021-04-21 13:04:59 -07:00
The8472
7f45cdb090 bump jobserver dependency
the newest jobserver version should slightly reduce context switches
in highly parallel build environments on linux kernels >= 5.6
2021-04-21 22:02:54 +02:00
Jack Huey
c78724f869 More review changes 2021-04-21 12:26:19 -04:00
Jack Huey
b78c0d8a4d Review comments 2021-04-21 11:49:59 -04:00
Alex Crichton
de2a4601ab rustc: Use LLVM's new saturating float-to-int intrinsics
This commit updates rustc, with an applicable LLVM version, to use
LLVM's new `llvm.fpto{u,s}i.sat.*.*` intrinsics to implement saturating
floating-point-to-int conversions. This results in a little bit tighter
codegen for x86/x86_64, but the main purpose of this is to prepare for
upcoming changes to the WebAssembly backend in LLVM where wasm's
saturating float-to-int instructions will now be implemented with these
intrinsics.

This change allows simplifying a good deal of surrounding code, namely
removing a lot of wasm-specific behavior. WebAssembly no longer has any
special-casing of saturating arithmetic instructions and the need for
`fptoint_may_trap` is gone and all handling code for that is now
removed. This means that the only wasm-specific logic is in the
`fpto{s,u}i` instructions which only get used for "out of bounds is
undefined behavior". This does mean that for the WebAssembly target
specifically the Rust compiler will no longer be 100% compatible with
pre-LLVM 12 versions, but it seems like that's unlikely to be relied on
by too many folks.

Note that this change does immediately regress the codegen of saturating
float-to-int casts on WebAssembly due to the specialization of the LLVM
intrinsic not being present in our LLVM fork just yet. I'll be following
up with an LLVM update to pull in those patches, but affects a few other
SIMD things in flight for WebAssembly so I wanted to separate this change.

Eventually the entire `cast_float_to_int` function can be removed when
LLVM 12 is the minimum version, but that will require sinking the
complexity of it into other backends such as Cranelfit.
2021-04-21 07:15:53 -07:00
lcnr
d3e0d2f53d supply substs to anon consts in defaults 2021-04-21 15:25:58 +02:00
lcnr
312b4fdfd2 improve wf check for const param defaults 2021-04-21 15:25:58 +02:00
lcnr
7cb1dcd488 loosen ordering restricts for const_generics_defaults 2021-04-21 15:25:58 +02:00
lcnr
259a368e9e fix name resolution for param defaults 2021-04-21 15:25:32 +02:00
Johannes Schilling
b9a1e693a7 Make AssertKind::fmt_assert_args public 2021-04-21 14:09:15 +02:00
Jack Huey
4568e7d62e Move nested quantification check to ast_validation 2021-04-21 03:12:04 -04:00
Tomasz Miąsko
75732dd00e Check for intrinsics before coercing to a function pointer
Return an error if coercing function items / non-capturing closures
to a common function pointer type would require reifying an intrinsic.
2021-04-21 00:00:00 +00:00
Jack Huey
9891582897 Remove TraitRefHackInner and use the concatenating functionality instead of trait_ref_hack 2021-04-20 16:43:04 -04:00
Jack Huey
457c4c133a Add BinderScopeType to replace binder_depth and from_poly_trait_ref 2021-04-20 16:42:46 -04:00
Jack Huey
32942ab807 A non-minimal set of TraitRefBoundarys to work on removing from_poly_trait_ref 2021-04-20 16:41:54 -04:00
Jack Huey
ba3d22ed66 Precompute inverse binder depth 2021-04-20 16:41:54 -04:00
bors
6df26f897c Auto merge of #84353 - estebank:as-ref-mir, r=davidtwco
Suggest `.as_ref()` on borrow error involving `Option`/`Result`

When encountering a E0382 borrow error involving an `Option` or `Result`
provide a suggestion to use `.as_ref()` on the prior move location to
avoid the move.

Fix #84165.
2021-04-20 14:05:12 +00:00
Oli Scherer
6e988c0613 Typo 2021-04-20 09:30:28 -04:00
Oli Scherer
a46bc5664a Tidy 2021-04-20 09:30:28 -04:00
Oli Scherer
a2f2179026 Add an attribute to be able to configure the limit 2021-04-20 09:30:28 -04:00
Oli Scherer
e9696c8b62 Implement a lint that highlights all moves larger than 1000 bytes 2021-04-20 09:30:21 -04:00
Edd Barrett
8cc918a3dc Improve the docstrings of the Lto struct. 2021-04-20 10:28:17 +01:00
bors
6af1e632a9 Auto merge of #84323 - richkadel:uncovered-functions, r=tmandry
coverage of async function bodies should match non-async

This fixes some missing coverage within async function bodies.

Commit 1 demonstrates the problem in the fixed issue, and commit 2 corrects it.

Fixes: #83985
2021-04-20 08:33:51 +00:00
bors
b2c20b51ed Auto merge of #84295 - richkadel:continue-coverage, r=tmandry
Add coverage to continue statements

`continue` statements were missing coverage. This was particularly
noticeable in a match pattern that contained only a `continue`
statement, leaving the branch appear uncounted. This PR addresses the
problem and adds tests to prove it.

r? `@tmandry`
cc: `@wesleywiser`
2021-04-20 03:08:24 +00:00
bors
e888a57da8 Auto merge of #84334 - klensy:typo-compiler, r=jyn514
fix few typos in comments
2021-04-20 00:16:45 +00:00
Esteban Küber
2763a0541c Suggest .as_ref() on borrow error involving Option/Result
When encountering a E0382 borrow error involving an `Option` or `Result`
provide a suggestion to use `.as_ref()` on the prior move location to
avoid the move.

Fix #84165.
2021-04-19 17:14:37 -07:00
bors
9d9c2c92b8 Auto merge of #84342 - Dylan-DPC:rollup-5b40142, r=Dylan-DPC
Rollup of 7 pull requests

Successful merges:

 - #84123 (Introduce CompileMonoItem DepNode)
 - #84126 (Enable sanitizers for x86_64-unknown-linux-musl)
 - #84168 (Lower async fn in traits.)
 - #84256 (doc: use U+2212 for minus sign in floating-point -0.0 remarks)
 - #84291 (fix aliasing violations in thread_local_const_init)
 - #84313 (fix suggestion for unsized function parameters)
 - #84330 (Remove unused footer section)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2021-04-19 20:49:27 +00:00
Cameron Steffen
c9c14d0c1f Small refactor 2021-04-19 15:40:21 -05:00
Cameron Steffen
98a11e01e5 Remove closure_tree 2021-04-19 15:40:20 -05:00
Dylan DPC
349fae3a32
Rollup merge of #84313 - lcnr:sized-err-msg, r=petrochenkov
fix suggestion for unsized function parameters

taken from `@fasterthanlime's` article https://fasterthanli.me/articles/whats-in-the-box
2021-04-19 22:00:10 +02:00
Dylan DPC
e5b5745db1
Rollup merge of #84168 - cjgillot:asi, r=davidtwco
Lower async fn in traits.

An error is already created by AST validation.

Fixes #84149
2021-04-19 22:00:06 +02:00
Dylan DPC
3b81ea86fb
Rollup merge of #84126 - 12101111:musl-sanitizer, r=davidtwco
Enable sanitizers for x86_64-unknown-linux-musl

Those 4 sanitizers get musl target support in LLVM 12 release.
2021-04-19 22:00:04 +02:00
Dylan DPC
817b7e0c11
Rollup merge of #84123 - bjorn3:compile_mono_item_dep_node, r=wesleywiser
Introduce CompileMonoItem DepNode

This is likely required for allowing efficient hot code swap support in cg_clif's jit mode. My prototype currently requires re-compiling all functions, which is both slow and uses a lot of memory as there is not support for freeing the memory used by replaced functions yet.

cc https://github.com/bjorn3/rustc_codegen_cranelift/issues/1087
2021-04-19 22:00:01 +02:00
Rich Kadel
5d8d67f746 compute fn_sig span from body call_site, and use body ctxt, not root 2021-04-19 12:30:55 -07:00
lcnr
a8193ca4c3 fix suggestion for unsized function parameters 2021-04-19 20:06:19 +02:00
bors
1a6c98e4d6 Auto merge of #84091 - tmiasko:check-attrs-sym, r=davidtwco
Match against attribute name when validating attributes

Extract attribute name once and match it against symbols that are being
validated, instead of using `Session::check_name` for each symbol
individually.

Assume that all validated attributes are used, instead of marking them
as such, since the attribute check should be exhaustive.
2021-04-19 18:05:44 +00:00
Ralf Jung
46d09f7a4b remove E0723 error code 2021-04-19 14:58:11 +02:00
klensy
f43ee8ebf6 fix few typos 2021-04-19 15:57:08 +03:00
Ralf Jung
04db4abbfc add gate tests and pacify tidy 2021-04-19 10:25:31 +02:00
bors
532609b01c Auto merge of #84316 - teymour-aldridge:improve-defaulted-never-note, r=petrochenkov
Improve an error message.
2021-04-19 04:51:48 +00:00
bors
c4ba8e3e5f Auto merge of #83799 - crlf0710:stablize_non_ascii_idents, r=Manishearth
Stablize `non-ascii-idents`

This is the stablization PR for RFC 2457. Currently this is waiting on fcp in [tracking issue](https://github.com/rust-lang/rust/issues/55467).

r? `@Manishearth`
2021-04-18 23:28:43 +00:00
Rich Kadel
1893721ec4 Fixes the issue with uncovered source in async function bodies
The body_span was assumed to be in the Span root context, but this was
not the case for async function bodies.
2021-04-18 16:26:18 -07:00
Ralf Jung
bd9556956a fix feature use in rustc libs 2021-04-18 22:05:45 +02:00
teymour-aldridge
567de4a202 Improve an error message. 2021-04-18 20:38:23 +01:00
Rich Kadel
d1d7fb1ae5 Only generate dummy assign when instrumenting coverage
And make the LocalDecl internal, to avoid needing to declare storage.
(For multiple `continue` stateuemtns, it must also be mutable.)
2021-04-18 12:09:14 -07:00
Ralf Jung
fbfaab2cb7 separate feature flag for unsizing casts in const fn 2021-04-18 19:11:29 +02:00
Ralf Jung
fdad6ab3a3 move 'trait bounds on const fn' to separate feature gate 2021-04-18 18:36:41 +02:00
bors
ef88434286 Auto merge of #84274 - nagisa:fix-simd, r=nikic
Don't set fast-math for the SIMD operations we set it for previously

Instead of `fast-math`. `fast-math` implies things like functions not
being able to accept as an argument or return as a result, say, `inf`
which made these functions confusingly named or behaving incorrectly,
depending on how you interpret it. It seems that the intended behaviour
was to set a `afn` flag instead. In doing so we also renamed the
intrinsics to say `_approx` so that it is clear these are not precision
oriented and the users can act accordingly.

Fixes #84268
2021-04-18 14:39:34 +00:00
Rich Kadel
448e52d97c Add coverage to continue statements
`continue` statements were missing coverage. This was particularly
noticeable in a match pattern that contained only a `continue`
statement, leaving the branch appear uncounted. This PR addresses the
problem and adds tests to prove it.
2021-04-18 03:11:25 -07:00
bors
dc99219d3a Auto merge of #84064 - hyd-dev:unknown-lints, r=petrochenkov
Do not ignore path segments in the middle in `#[allow]`/`#[warn]`/`#[deny]`/`#[forbid]` attributes

Fixes #83477.
2021-04-18 02:12:13 +00:00
Simonas Kazlauskas
487e27350a Don't set fast(-math) for certain simd ops
`fast-math` implies things like functions not being able to accept as an
argument or return as a result, say, `inf` which made these functions
confusingly named or behaving incorrectly, depending on how you
interpret it. Since the time when these intrinsics have been implemented
the intrinsics user's (stdsimd) approach has changed significantly and
so now it is required that these intrinsics operate normally rather than
in "whatever" way.

Fixes #84268
2021-04-17 23:33:10 +03:00
bors
cd9b30527e Auto merge of #84260 - Aaron1011:global-alloc-eval-always, r=cjgillot
Mark `has_global_allocator` query as `eval_always`

Fixes #84252

This query reads from untracked global state in `CStore`.
2021-04-17 12:48:50 +00:00
hyd-dev
ac044e35aa
Do not ignore path segments in the middle in #[allow]/#[warn]/#[deny]/#[forbid] attributes 2021-04-17 18:11:07 +08:00
bors
080d30235f Auto merge of #84244 - ABouttefeux:closure-return-conflict-suggest, r=estebank
fix incomplete diagnostic notes when closure returns conflicting for genric type

fixes #84128
Correctly report the span on for conflicting return type in closures
2021-04-17 07:17:31 +00:00
bors
57e28ef86f Auto merge of #84243 - Soveu:fix-derive-macro-const-default, r=petrochenkov
Builtin derive macros: fix error with const generics default

This fixes a bug where builtin derive macros (like Clone, Debug) would basically copy-paste the default from a const generic, causing a compile error with very confusing message - it would say defaults are not allowed in impl blocks, while pointing at struct/enum/union definition.
2021-04-17 04:48:36 +00:00
bors
42e5621c53 Auto merge of #84113 - SNCPlay42:suggestion-extern-crate, r=petrochenkov
Detect when suggested paths enter extern crates more rigorously

When reporting resolution errors, the compiler tries to avoid suggesting importing inaccessible paths from other crates. However, the search for suggestions only recognized when it was entering a crate root directly, and so failed to recognize a path like `crate::module::private_item`, where `module` was imported from another crate with `use other_crate::module`, as entering another crate.

Fixes #80079
Fixes #84081
2021-04-17 02:23:10 +00:00
Aaron Hill
169a221618
Mark has_global_allocator query as eval_always
Fixes #84252

This query reads from untracked global state in `CStore`.
2021-04-16 16:28:54 -04:00
bjorn3
21f13afafe Add comment 2021-04-16 20:55:51 +02:00
Josh Stone
b79af2fcde Implement #[rustc_skip_array_during_method_dispatch] 2021-04-16 11:11:59 -07:00
Aliénore Bouttefeux
af90cac0e1 fix reporting return type in some cases 2021-04-16 17:06:19 +02:00
Soveu
9ecfae44d7 builtin derive macros: fix error with const generics default 2021-04-16 16:29:11 +02:00
Dylan DPC
c7c59d7c3b
Rollup merge of #84172 - jayaddison:compiler/E0384-reduce-assertiveness, r=petrochenkov
Compiler error messages: reduce assertiveness of message E0384

This message is emitted as guidance by the compiler when a developer attempts to reassign a value to an immutable variable.  Following the message will always currently work, but it may not always be the best course of action; following the 'consider ...' messaging pattern provides a hint to the developer that it could be wise to explore other alternatives.

Resolves #84144
2021-04-16 14:08:33 +02:00
Dylan DPC
8853aaeefc
Rollup merge of #83944 - jackh726:binder-refactor-fix2, r=lcnr
Fix a couple resolve bugs from binder refactor

Fixes #83753
Fixes #83907
2021-04-16 14:08:31 +02:00
bors
d4bc912c48 Auto merge of #84217 - crlf0710:remove_main_attr_pure, r=petrochenkov
Remove #[main] attribute.

This removes the #[main] attribute support from the compiler according to the decisions within #29634. For existing use cases within test harness generation, replaced it with a newly-introduced internal attribute `#[rustc_main]`.

This is first part extracted from #84062 .

Closes #29634.

r? `@petrochenkov`
2021-04-16 08:01:45 +00:00
bors
710da44e22 Auto merge of #84228 - SkiFire13:fix-84213, r=estebank
Suggest to borrow after failing to cast from T to *const/mut T

Fixes #84213
2021-04-16 05:13:43 +00:00
Charles Lew
fc357039f9 Remove #[main] attribute. 2021-04-16 13:04:02 +08:00
klensy
cb2d52282f rename StyledBuffer.text to lines 2021-04-16 05:38:32 +03:00
klensy
247d74f207 StyledBuffer::set_style: check overwrite first 2021-04-16 05:23:40 +03:00
klensy
7e9d3c6f6c StyledBuffer::prepend: if line is empty, insert content without inserting spaces 2021-04-16 05:11:45 +03:00
klensy
e97ddedac6 added some docs for StyledBuffer 2021-04-16 04:14:59 +03:00
klensy
f5229916e3 added default for StyledChar 2021-04-16 03:20:07 +03:00
klensy
756be4a052 refactored StyledBuffer parts into StyledChar 2021-04-16 03:14:05 +03:00
bors
e87c4dd334 Auto merge of #84226 - Aaron1011:track-link-dead-code, r=Mark-Simulacrum
Track `-C link-dead-code` during incremental compilation

This option influences monomorphization, which participates in
incremental compilation.
2021-04-16 00:01:49 +00:00
Giacomo Stevanato
2899b58832 Add suggestion to borrow when casting T to *const/mut T 2021-04-15 23:49:42 +02:00
bors
7af1f55ae3 Auto merge of #84205 - workingjubilee:more-simd-intrin, r=bjorn3
Add simd_{round,trunc} intrinsics

LLVM supports many functions from math.h in its IR. Many of these
have SIMD instructions on various platforms. So, let's add round and
trunc so std::arch can use them.

Yes, exact comparison is intentional: rounding must always return a
valid integer-equal value, except for inf/NAN.
2021-04-15 21:00:11 +00:00
Aaron Hill
1ce1cda02f
Track -C link-dead-code during incremental compilation
This option influences monomorphization, which participates in
incremental compilation.
2021-04-15 15:05:26 -04:00
mark
0566ccc72f rename pat2015 to pat_param 2021-04-15 13:52:09 -05:00
mark
ebc4acee91 stabilize :pat2015, leave :pat2021 gated 2021-04-15 13:52:09 -05:00
Aaron Hill
19c9d93ab5
Run buffered lints attached to anon consts
Fixes #84195
2021-04-15 11:11:44 -04:00
bors
0894d1e906 Auto merge of #84193 - ehuss:unsafe_op_in_unsafe_fn-docs, r=RalfJung
Update docs for unsafe_op_in_unsafe_fn stability.

The unsafe_op_in_unsafe_fn lint was stabilized in #79208, but the bottom of this documentation wasn't updated.

I'm just guessing at the reason here, hopefully it is close to correct. The only discussion I found is https://github.com/rust-lang/rust/issues/71668#issuecomment-730399862 which didn't really explain the thought process behind the decision.
2021-04-15 07:11:18 +00:00
Dylan DPC
fd105db772
Rollup merge of #84192 - vext01:backend-write-typos, r=wesleywiser
Fix typos in rustc_codegen_ssa/src/back/write.rs.

Just a couple of typos I spotted when reading this comment about the job server.
2021-04-15 01:27:56 +02:00
Jubilee Young
003b8eadd7 Add more SIMD math.h intrinsics
LLVM supports many functions from math.h in its IR. Many of these have
single-instruction variants on various platforms. So, let's add them so
std::arch can use them.

Yes, exact comparison is intentional: rounding must always return a
valid integer-equal value, except for inf/NAN.
2021-04-14 15:25:06 -07:00