Commit Graph

138514 Commits

Author SHA1 Message Date
Teddy Katz 15197cbc61 Ensure debug_assert! tests get run 2021-02-16 19:05:30 -05:00
Tomasz Miąsko 614b0cccfe Use -Ccodegen-units=1 to make issue-23458 test deterministic
The test case fails with either one error or two errors.
Use a single code generation unit to avoid nondeterminism.
2021-02-17 00:00:00 +00:00
Tomasz Miąsko e190f0d974 Reduce size of InterpErrorInfo to 8 bytes 2021-02-17 08:57:06 +01:00
bors 8fe989dd76 Auto merge of #81611 - cjgillot:meowner, r=estebank
Only store a LocalDefId in some HIR nodes

Some HIR nodes are guaranteed to be HIR owners: Item, TraitItem, ImplItem, ForeignItem and MacroDef.
As a consequence, we do not need to store the `HirId`'s `local_id`, and we can directly store a `LocalDefId`.

This allows to avoid a bit of the dance with `tcx.hir().local_def_id` and `tcx.hir().local_def_id_to_hir_id` mappings.
2021-02-16 22:14:32 +00:00
Giacomo Stevanato 61bb1836f8 Optimize Iterator::is_sorted_by by using Iterator::all for internal iteration 2021-02-16 21:49:56 +01:00
Manish Goregaokar a98b22c837 Add caveat to Path::display() about lossiness 2021-02-16 11:45:46 -08:00
bors a143517d44 Auto merge of #82192 - GuillaumeGomez:rollup-gi1639b, r=GuillaumeGomez
Rollup of 6 pull requests

Successful merges:

 - #82145 (Fix ES5 errors (IE11))
 - #82160 (Fix typo in rustc_infer::infer::UndoLog)
 - #82161 (Add long explanation for E0545)
 - #82163 (avoid full-slicing slices)
 - #82175 (validation: fix invalid-fn-ptr error message)
 - #82184 ([Minor] Update discriminant_value docs)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2021-02-16 19:21:22 +00:00
kadmin f52029553f Remove ordering hint 2021-02-16 19:04:03 +00:00
Guillaume Gomez 9502e5c4dc
Rollup merge of #82184 - petertodd:2021-discriminant-value-doc, r=nagisa
[Minor] Update discriminant_value docs

Updated for new `DiscriminantKind` trait.
2021-02-16 19:21:21 +01:00
Guillaume Gomez 866dc5aae5
Rollup merge of #82175 - RalfJung:invalid-fn-ptr, r=oli-obk
validation: fix invalid-fn-ptr error message

https://github.com/rust-lang/rust/pull/82061 changed the code here to print an `ImmTy` instead of a `ScalarMaybeUninit`; that was an accident. So go back to printing a `ScalarMaybeUninit`.

r? ```@oli-obk```
2021-02-16 19:21:21 +01:00
Guillaume Gomez 46b93b2e44
Rollup merge of #82163 - matthiaskrgr:slice, r=jyn514
avoid full-slicing slices

If we already have a slice, there is no need to get another full-range slice from that, just use the original.
clippy::redundant_slicing
2021-02-16 19:21:20 +01:00
Guillaume Gomez cdab137bd4
Rollup merge of #82161 - jesusprubio:add-long-explanation-e0545, r=GuillaumeGomez
Add long explanation for E0545

Helps with #61137
2021-02-16 19:21:19 +01:00
Guillaume Gomez 73d6b603a7
Rollup merge of #82160 - pierwill:patch-2, r=lcnr
Fix typo in rustc_infer::infer::UndoLog

Also use double quotes.
2021-02-16 19:21:18 +01:00
Guillaume Gomez 4df040176d
Rollup merge of #82145 - GuillaumeGomez:es5-checks, r=Nemo157
Fix ES5 errors (IE11)

rustdoc is supposed to run on IE11 but someone reported me that it wasn't. I just confirmed it by using `es-check` with the `es5` option like this:

```
$ es-check es5 src/librustdoc/html/static/*.js
```

The PR fixes those issues and add CI checks to prevent regressions.

`@Mark-Simulacrum:` I added checks in the CI, but not sure if it's the correct way to do it. Any help on that side would be very appreciated!

r? `@Nemo157`
2021-02-16 19:21:14 +01:00
bors 9d3deed8a2 Auto merge of #82150 - RalfJung:miri, r=RalfJung
update Miri

This pulls in the recent cargo-miri fixes by `@hyd-dev.`
Cc `@rust-lang/miri` r? `@ghost`
Fixes https://github.com/rust-lang/rust/issues/82173
2021-02-16 16:22:56 +00:00
est31 e527def9c7 Replace File::create and write_all with fs::write
Also don't convert to u8 buffers and back
when we are only creating strings.
2021-02-16 14:19:32 +01:00
Peter Todd 3a03cbc9dd
[Minor] Update discriminant_value docs 2021-02-16 08:16:31 -05:00
Ralf Jung 92764acdea update Miri 2021-02-16 11:17:42 +01:00
Ralf Jung e5514efab2 add test 2021-02-16 11:14:34 +01:00
Ralf Jung 897cb61076 validation: fix invalid-fn-ptr error message 2021-02-16 09:58:35 +01:00
bjorn3 dfdadad228 Ignore Atomic*::fetch_{min,max} tests on ARM 2021-02-16 09:45:27 +01:00
bors f1c47c79fe Auto merge of #82058 - gilescope:to_digit_speedup, r=lcnr
no need to check assertion on fast path as will always hold.

V small change. Easy to review though!
2021-02-16 08:38:11 +00:00
Teddy Katz cb653b100c Document that `assert!` format arguments are evaluated lazily
It can be useful to do some computation in `assert!` format arguments, in order to get better error messages. For example:

```rust
assert!(
    some_condition,
    "The state is invalid. Details: {}",
    expensive_call_to_get_debugging_info(),
);
```

It seems like `assert!` only evaluates the format arguments if the assertion fails, which is useful but doesn't appear to be documented anywhere. This PR documents the behavior and adds some tests.
2021-02-16 00:55:46 -05:00
bors 090dac0c38 Auto merge of #81734 - richkadel:fixfordash, r=pnkfelix
Ensures `make` tests run under /bin/dash (if available), like CI, and fixes a Makefile

Note: This cherrypicks #81688 (`@pnkfelix)`

Updates `tools.mk` to explicitly require `SHELL := /bin/dash`, since CI uses `dash` but other environments (including developer local machines) may default to `bash`.

Replaces bash-specific shell command in one Makefile with a dash-compatible alternative, and re-enables the affected Makefile test.

Removes apparently redundant definition of `UNAME`.

Also see: [zulip discussion thread](https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/how.20to.20run.2Fbless.20src.2Ftest.2Frun-make-fulldeps.2Fcoverage.20.3F)

r? `@pnkfelix`

FYI: `@wesleywiser` `@tmandry`
2021-02-16 05:45:10 +00:00
kadmin b97951b50f Update w/ comments 2021-02-16 05:14:22 +00:00
Aman Arora f99e152e5a Use iter::position in truncate_capture_for_move 2021-02-15 22:00:40 -05:00
Aman Arora 1b86ad8485 Treat read of COpy types via refs as not move in move-closure 2021-02-15 22:00:38 -05:00
Aman Arora e39c3c05a4 Handle restricting closure origin 2021-02-15 22:00:36 -05:00
Aman Arora b86c5db96e Implement reborrow for closure captures 2021-02-15 22:00:25 -05:00
bors 42a4673fbd Auto merge of #82153 - jonas-schievink:rollup-ls5r943, r=jonas-schievink
Rollup of 19 pull requests

Successful merges:

 - #81503 (Suggest to create a new `const` item if the `fn` in the array is a `const fn`)
 - #81897 (Add match pattern diagnostics regression test)
 - #81975 (Seal the CommandExt, OsStrExt and OsStringExt traits)
 - #82009 (const_generics: Dont evaluate array length const when handling errors)
 - #82060 (Fix typos in BTreeSet::{first, last} docs)
 - #82061 (CTFE validation: catch ReadPointerAsBytes and better error)
 - #82063 (Fixed minor typo in catch_unwind docs)
 - #82067 (const_generics: Fix incorrect ty::ParamEnv::empty() usage)
 - #82077 (Edit `rustc_arena::DropArena` docs)
 - #82096 (Fix a typo)
 - #82106 (Remove unnecessary `Option` in `default_doc`)
 - #82107 (expand: Some cleanup)
 - #82118 (Add missing env!-decl variant)
 - #82119 (Fix typo in link to CreateSymbolicLinkW documentation.)
 - #82120 (Stabilize Arguments::as_str)
 - #82129 (Remove redundant bool_to_option feature gate)
 - #82133 (Update link for extern prelude.)
 - #82141 (32-bit ARM: Emit `lr` instead of `r14` when specified as an `asm!` output register.)
 - #82147 (⬆️ rust-analyzer)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2021-02-16 02:14:13 +00:00
Tomasz Miąsko db36db2e81 Inline try_get_cached 2021-02-16 00:00:00 +00:00
Matthias Krüger 4390a61b64 avoid full-slicing slices
If we already have a slice, there is no need to get another full-range slice from that, just use the original.
clippy::redundant_slicing
2021-02-16 00:31:11 +01:00
Camille GILLOT 91d8e59cca Remove HirItemLike. 2021-02-15 19:36:13 +01:00
Camille GILLOT 7dd1e8cfdf Trait impls are Items, therefore HIR owners. 2021-02-15 19:36:13 +01:00
Camille GILLOT f395f2ea12 Use less HirId when referring to items. 2021-02-15 19:36:12 +01:00
Camille GILLOT c4e7427081 Only store a LocalDefId in hir::MacroDef. 2021-02-15 19:35:55 +01:00
Camille GILLOT ff14cac621 Index Modules using their LocalDefId. 2021-02-15 19:32:30 +01:00
Camille GILLOT 7878fa70d6 Fix E0657. 2021-02-15 19:32:29 +01:00
Camille GILLOT 996dc8d5c5 Only store a LocalDefId in hir::ForeignItem. 2021-02-15 19:32:29 +01:00
Camille GILLOT 786a80e9ea Only store a LocalDefId in hir::ImplItem. 2021-02-15 19:32:29 +01:00
Camille GILLOT a871a0f111 Only store a LocalDefId in hir::TraitItem. 2021-02-15 19:32:28 +01:00
Camille GILLOT cebbba081e Only store a LocalDefId in hir::Item.
Items are guaranteed to be HIR owner.
2021-02-15 19:32:10 +01:00
Camille GILLOT bd3cd5dbed Use an ItemId inside mir::GlobalAsm. 2021-02-15 19:24:58 +01:00
Camille GILLOT c676e358a5 Use ItemId as a strongly typed index. 2021-02-15 19:24:58 +01:00
Camille GILLOT ac8961fc04 Add assertions on HIR enum sizes. 2021-02-15 19:24:57 +01:00
Camille GILLOT 21b0cdc9c0 Remove useless Named trait. 2021-02-15 19:24:57 +01:00
Jesus Rubio 8192793d50 Add long explanation for E0545 2021-02-15 19:16:39 +01:00
mark aee1e59e6f Simplify pattern grammar by allowing nested leading vert
Along the way, we also implement a handful of diagnostics improvements
and fixes, particularly with respect to the special handling of `||` in
place of `|` and when there are leading verts in function params, which
don't allow top-level or-patterns anyway.
2021-02-15 12:07:54 -06:00
pierwill f2f7ffecd7
Fix typo in rustc_infer::infer::UndoLog
Also use double quotes.
2021-02-15 10:02:03 -08:00
Gus Wynn c28d86c53b name async generators something more human friendly in type error diagnostics 2021-02-15 08:51:08 -08:00