Commit Graph

153439 Commits

Author SHA1 Message Date
Xuanwo e32f4c06d3
Remove extra empty lines
Signed-off-by: Xuanwo <github@xuanwo.io>
2021-08-16 13:45:34 +08:00
Joshua Nelson 03df65497e feature gate doc(primitive) 2021-08-16 05:41:16 +00:00
Xuanwo b4b495e48e
Optimize unnecessary check in VecDeque::retain
Signed-off-by: Xuanwo <github@xuanwo.io>
2021-08-16 13:37:51 +08:00
Laurențiu Nicola 45734cbd8a ⬆️ rust-analyzer 2021-08-16 08:21:02 +03:00
kit 79e402e9e0 Allow the iOS toolchain to be built on Linux
The iOS toolchain can be built on Linux with minor changes. The
compilation will invoke `xcrun` to find the path to the iPhone SDK but
a fake `xcrun` executable can be used.

```
#!/bin/sh
echo "/path/to/sdk"
```

The iOS toolchain can then be built and linked with rustup.

```
$ ./x.py build --stage 2 --host x86_64-unknown-linux-gnu \
  	 --target aarch64-apple-ios
$ rustup toolchain link stage1 build/x86_64-unknown-linux-gnu/stage1
```

It's possible to take this toolchain and compile an iOS executable
with it. This requires the ld64 linker and an iOS SDK. The ld64 linker
can be taken from
[cctools](https://github.com/tpoechtrager/cctools-port). A project's
.cargo/config can then be edited to use the linker for this target.

```
[target.aarch64-apple-ios]
linker = "/path/to/cctools/bin/arm-apple-darwin-ld"
rustflags = [
    "-C",
    """
link-args=
    -F/path/to/sdk/System/Library/Frameworks
    -L/path/to/sdk/usr/lib
    -L/path/to/sdk/usr/lib/system/
    -adhoc_codesign
    """,
]
```
2021-08-16 15:04:58 +10:00
Joshua Nelson 5522177db6 Only run expensive calculations if the method name is recognized 2021-08-16 03:55:27 +00:00
Thom Chiovoloni 402a9c9f5e Uplift the `invalid_atomic_ordering` lint from clippy to rustc
- Deprecate clippy::invalid_atomic_ordering
- Use rustc_diagnostic_item for the orderings in the invalid_atomic_ordering lint
- Reduce code duplication
- Give up on making enum variants diagnostic items and just look for
`Ordering` instead

  I ran into tons of trouble with this because apparently the change to
  store HIR attrs in a side table also gave the DefIds of the
  constructor instead of the variant itself. So I had to change
  `matches_ordering` to also check the grandparent of the defid as well.

- Rename `atomic_ordering_x` symbols to just the name of the variant
- Fix typos in checks - there were a few places that said "may not be
  Release" in the diagnostic but actually checked for SeqCst in the lint.
- Make constant items const
- Use fewer diagnostic items
- Only look at arguments after making sure the method matches

  This prevents an ICE when there aren't enough arguments.

- Ignore trait methods
- Only check Ctors instead of going through `qpath_res`

  The functions take values, so this couldn't ever be anything else.

- Add if_chain to allowed dependencies
- Fix grammar
- Remove unnecessary allow
2021-08-16 03:55:27 +00:00
bors 23461b210f Auto merge of #87696 - ssomers:btree_lazy_iterator_cleanup, r=Mark-Simulacrum
BTree: merge the complication introduced by #81486 and #86031

Also:
- Deallocate the last few tree nodes as soon as an `into_iter` iterator steps beyond the end, instead of waiting around for the drop of the iterator (just to share more code).
- Symmetric code for backward iteration.
- Mark unsafe the methods on dying handles, modelling dying handles after raw pointers: it's the caller's responsibility to use them safely.

r? `@Mark-Simulacrum`
2021-08-16 03:45:26 +00:00
Erik Desjardins b865a761cb add regression test 2021-08-15 23:44:34 -04:00
Erik Desjardins 8e11199a15 Revert "Auto merge of #83417 - erikdesjardins:enableremovezsts, r=oli-obk"
This reverts commit 8007b506ac, reversing
changes made to e55c13e109.
2021-08-15 23:44:34 -04:00
Joshua Nelson 6216b4ece4 Document private items for rustfmt
This is possible now that rustdoc allows passing
`--document-private-items` more than once.
2021-08-16 01:46:56 +00:00
bors 2a6fb9a4c0 Auto merge of #80357 - c410-f3r:new-hir-let, r=matthewjasper
Introduce `hir::ExprKind::Let` - Take 2

Builds on #68577 and depends on #79328.

cc #53667
2021-08-16 00:31:42 +00:00
Aaron Hill 1ac7881c9f
Add `--target` flag to `issue-85019-moved-src-dir` 2021-08-15 17:37:26 -05:00
the8472 7256a6a86d
Apply suggestions from code review
Co-authored-by: Amanieu d'Antras <amanieu@gmail.com>
2021-08-16 00:01:41 +02:00
bors 2bd17c1d43 Auto merge of #87590 - Amanieu:deprecate_llvm_asm, r=nagisa
Deprecate llvm_asm!

We would like to remove `llvm_asm!` from the compiler once `asm!` is stabilized. This PR deprecates `llvm_asm!` to encourage any remaining users to migrate to `asm!` (or if `asm!` is not supported for their target, to add this support to rustc).

The only remaining user of `llvm_asm!` in the standard library was `black_box`, which has been rewritten to use volatile operations when `asm!` is not available on the current target.

cc `@rust-lang/wg-inline-asm`

cc `@RalfJung` for the changes to `black_box` which might affect Miri.

r? `@nagisa`
2021-08-15 21:22:02 +00:00
Aaron Hill fd15c182c1
Copy over run-make ignores from issue-83112-incr-test-moved-file 2021-08-15 15:20:58 -05:00
Aaron Hill 179fd38bb5
Update rustc_codegen_cratelift for working_dir change 2021-08-15 15:17:37 -05:00
Aaron Hill a895069c50
Include (potentially remapped) working dir in crate hash
Fixes #85019

A `SourceFile` created during compilation may have a relative
path (e.g. if rustc itself is invoked with a relative path).
When we write out crate metadata, we convert all relative paths
to absolute paths using the current working direction.

However, the working directory is not included in the crate hash.
This means that the crate metadata can change while the crate
hash remains the same. Among other problems, this can cause a
fingerprint mismatch ICE, since incremental compilation uses
the crate metadata hash to determine if a foreign query is green.

This commit moves the field holding the working directory from
`Session` to `Options`, including it as part of the crate hash.
2021-08-15 15:17:37 -05:00
Caio 6aa9937a76 Introduce hir::ExprKind::Let - Take 2 2021-08-15 16:18:26 -03:00
Matthew Jasper 2d9f2eae84 Use correct drop scopes for if expressions 2021-08-15 16:05:25 -03:00
bors 2d2bc94c8c Auto merge of #87982 - m-ou-se:non-fmt-panic-assert-str, r=cjgillot
Add automatic migration for assert!(.., string).

Fixes part of #87313.
2021-08-15 17:57:39 +00:00
Eric Huss 634244e63f Update RELEASES to clarify attribute macro values. 2021-08-15 10:38:45 -07:00
Gary Guo e62ecdc5a7 Add a dead code test for using anon const in pattern 2021-08-15 18:17:21 +01:00
Erin Power 0455fe342f Update RELEASES.md for 1.55.0
Co-authored-by: Eric Huss <eric@huss.org>
Co-authored-by: inquisitivecrystal <22333129+inquisitivecrystal@users.noreply.github.com>
Co-authored-by: Mark Rousskov <mark.simulacrum@gmail.com>
Co-authored-by: Daniel Giger <danielg3432@gmail.com>
2021-08-15 13:17:11 -04:00
ibraheemdev 58f988fa40 move object safety test to library/core 2021-08-15 13:00:25 -04:00
bjorn3 856dd71bac
Update redox_syscall
The currently pinned version doesn't compile with the latest rustc nightly
2021-08-15 18:40:40 +02:00
Aaron Hill d8c3a649a6
Remove `HashStable` impls for `FileName` and `RealFileName`
These impls were unused, and incorrectly hashed the local
(non-remapped) path for `RealFileName::Remapped` (which would
break reproducible builds if these impls were used).
2021-08-15 10:48:53 -05:00
bors c0490a2dbb Auto merge of #87792 - GuillaumeGomez:ci-fetch, r=pietroalbini
Remove git fetch from CI

https://github.com/rust-lang/rust/pull/86623 added a call to `git fetch`, which is problematic for releases.

r? `@pietroalbini`
2021-08-15 14:02:40 +00:00
Rémy Rakic 2cf4b87393 De-dupe NLL HRTB diagnostics' use of `type_op_prove_predicate` 2021-08-15 14:49:36 +02:00
Amanieu d'Antras 632a400a36 Fix ui tests for llvm_asm! deprecation 2021-08-15 13:27:13 +01:00
Amanieu d'Antras 6fd4f3463f Allow the use of the deprecated llvm_asm! in black_box 2021-08-15 13:14:32 +01:00
Amanieu d'Antras 4dd933cdc2 Deprecate llvm_asm! 2021-08-15 13:14:32 +01:00
bors 58d685ecb3 Auto merge of #86692 - dns2utf8:parallelize_rustdoc-gui_tests, r=GuillaumeGomez
Run rustdoc-gui tests in parallel

I hid the passing tests and only show the failed ones in alphabetical order:
![image](https://user-images.githubusercontent.com/739070/123663020-84e63100-d825-11eb-9b35-0a8c30cd219c.png)

Also this PR cuts down the execution time from ~40 to ~9 seconds
2021-08-15 10:56:35 +00:00
bors dfe5fd0902 Auto merge of #87975 - m-ou-se:unused-import-attributes, r=nagisa
Include attributes in removal span for unused imports.

Fixes https://github.com/rust-lang/rust/issues/87973
2021-08-15 07:40:53 +00:00
Rémy Rakic a69c7cc0d5 don't derive `Copy` for `RegionElement` 2021-08-15 09:11:03 +02:00
Rémy Rakic 19dfea552a Slight cleanup 2021-08-15 09:11:03 +02:00
Rémy Rakic 5cf6edb4c5 Fix dyn trait warning 2021-08-15 09:11:02 +02:00
Matthew Jasper d563a63788 Report nicer errors for HRTB NLL errors from queries 2021-08-15 09:11:01 +02:00
Matthew Jasper 0c388b0261 Report mismatched type errors for bound region errors in NLL 2021-08-15 09:11:00 +02:00
Matthew Jasper 5e6027c6bf Track causes for universes created during borrowck 2021-08-15 09:10:46 +02:00
Matthew Jasper e271383c6b Simplify BoundUniversalRegionError 2021-08-15 08:44:37 +02:00
Matthew Jasper 4421dd17fa Return the canonicalized query from type ops 2021-08-15 08:44:36 +02:00
Matthew Jasper 842f0590db Show bound lifetimes when comparing types in diagnostics 2021-08-15 08:44:35 +02:00
Matthew Jasper 5d52c0e0c6 Remove unused Option from NllTypeRelatingDelegate 2021-08-15 08:44:35 +02:00
bors 40db258731 Auto merge of #87974 - steffahn:slice_split_size_hints, r=dtolnay
Test and fix `size_hint` for slice’s [r]split* iterators

Adds extensive test (of `size_hint`) for all the _[r]split*_ iterators.
Fixes `size_hint` upper bound for _split_inclusive*_ iterators which was one higher than necessary for non-empty slices.
Fixes `size_hint` lower bound for _[r]splitn*_ iterators when _n == 0_, which was one too high.

**Lower bound being one too high was a logic error, violating the correctness condition of `size_hint`.**

_Edit:_ I’ve opened an issue for that bug, so this PR fixes #87978
2021-08-15 04:48:42 +00:00
Roxane 9c32b5b3ba Only compute place if upvars can be resolved 2021-08-14 21:00:58 -04:00
bors 85109e257a Auto merge of #87581 - Amanieu:asm_clobber_abi, r=nagisa
Add support for clobber_abi to asm!

This PR adds the `clobber_abi` feature that was proposed in #81092.

Fixes #81092

cc `@rust-lang/wg-inline-asm`

r? `@nagisa`
2021-08-14 22:29:27 +00:00
Gary Guo 2969aece41 Fix dead code warning when inline const is used in pattern 2021-08-14 22:58:04 +01:00
Stefan Schindler 7f2b52b1d6 More spacing between the different blocks of results 2021-08-14 23:36:17 +02:00
Stefan Schindler 86fa21cda5 Implement a finish method for the status_bar and some cleanup 2021-08-14 23:19:28 +02:00