Commit graph

153781 commits

Author SHA1 Message Date
Vadim Petrochenkov
59013cdebe ast_lowering: Introduce lower_span for catching all spans entering HIR 2021-08-29 10:49:40 +03:00
bors
66acdee9f7 Auto merge of #88295 - alexcrichton:update-stdarch, r=kennytm
Update the stdarch submodule

This notably brings in a number of codegen updates to ensure that wasm
simd intrinsics generate the expected instruction with LLVM 13
2021-08-29 07:32:04 +00:00
inquisitivecrystal
3ee6d0b6b6 Fix: don't document private macros by default 2021-08-29 00:31:15 -07:00
bors
757a65bfdf Auto merge of #88250 - rusticstuff:macos-lld, r=nagisa
Make `-Z gcc-ld=lld` work for Apple targets

`-Z gcc-ld=lld` was introduced in #85961. It does not work on Macos because lld needs be either named `ld64` or passed `-flavor darwin` as the first two arguments in order to select the Mach-O flavor. Rust invokes cc (=clang) on Macos for linking which calls `ld` as linker binary and not `ld64`, so just creating an `ld64` binary and modifying the search path with `-B` does not work.

In order to solve this patch does:
* Set the `lld_flavor` for all Apple-derived targets to `LldFlavor::Ld64`. As far as I can see this actually works towards fixing `-Xlinker=rust-lld` as all those targets use the Mach-O object format.
* Copy/hardlink rust-lld to the gcc-ld subdirectory as ld64 next to ld.
* If `-Z gcc-ld=lld` is used and the target lld flavor is Ld64 add `-fuse-ld=/path/to/ld64` to the linker invocation.

Fixes #86945.
2021-08-29 04:51:14 +00:00
bors
3a21a5b324 Auto merge of #88088 - nbdd0121:const2, r=nagisa
Forbid inline const block referencing params from being used in patterns

Fix #82518
2021-08-29 02:21:07 +00:00
Roxane
33817d2881 Move match tests in match folder 2021-08-28 19:54:12 -04:00
bors
677b517e66 Auto merge of #87921 - kellerkindt:master, r=kennytm
Add Saturating type (based on Wrapping type)

Tracking #87920

### Unresolved Questions
<!--
Include any open questions that need to be answered before the feature can be
stabilised.
-->

 - [x] ~`impl Div for Saturating<T>` falls back on inner integer division - which seems alright?~
    - [x] add `saturating_div`? (to respect division by `-1`)
 - [x] There is no `::saturating_shl` and `::saturating_shr`. (How to) implement `Shl`, `ShlAssign`, `Shr` and `ShrAssign`?
   - [naively](3f7d2ce28f)
 - [x] ~`saturating_neg` is only implemented on [signed integer types](https://doc.rust-lang.org/std/?search=saturating_n)~
 - [x] Is the implementation copied over from the `Wrapping`-type correct for `Saturating`?
   - [x] `Saturating::rotate_left`
   - [x] `Saturating::rotate_right`
   - [x] `Not`
   - [x] `BitXorOr` and `BitXorOrAssign`
   - [x] `BitOr` and `BitOrAssign`
   - [x] `BitAnd` and `BitAndAssign`
   - [x] `Saturating::swap_bytes`
   - [x] `Saturating::reverse_bits`
2021-08-28 23:39:02 +00:00
Roxane
f7b0e3b441 Create a specific match folder for match tests 2021-08-28 19:29:47 -04:00
Roxane
cd35e251ea Add additional match test case 2021-08-28 19:29:46 -04:00
Roxane
20de556a26 Handle match with non axhaustive variants in closures 2021-08-28 19:27:32 -04:00
bors
5eacec9ec7 Auto merge of #85690 - bstrie:m2_arena, r=jackh726,nagisa
Macros 2.0-ify rustc_arena

For the purpose of battle-testing macros 2.0 I'm looking to dogfood it in rustc, one crate at a time.

(Note that there are only 12 changed lines if you ignore whitespace.)
2021-08-28 20:58:12 +00:00
bors
926f069950 Auto merge of #85600 - 12101111:rustbuild-libunwind, r=petrochenkov
build llvm libunwind.a in rustbuild

This PR move the building of llvm-libunwind from build script of libunwind to rustbuild, so user don't need a C compiler and recompile this C/C++ library when using build-std, and user can use codegen flags `link-self-contained` and cargo flag `build-std-features` to control the behavior of libunwind linking.
2021-08-28 18:17:29 +00:00
bors
42a2a53ec1 Auto merge of #88390 - sexxi-goose:missing-case, r=nikomatsakis
Add missing const edge case

We don't "process" const so we need to check for additional cases when the PatKind is a Path. We need to make sure that if there is only one variant that there is no field. If there is one or more field, we will want to borrow the match scrutinee

Closes https://github.com/rust-lang/rust/issues/88331
r? `@nikomatsakis`
2021-08-28 15:36:38 +00:00
bors
84b0183412 Auto merge of #88388 - ldm0:outliner, r=nikic
Revert "Disable the machine outliner by default"

The fix commit is already in the fork: https://github.com/rust-lang/llvm-project/commit/6c78dbd4ca1f
Linked:
- https://github.com/rust-lang/rust/issues/85351
- https://github.com/rust-lang/rust/pull/86020
2021-08-28 13:10:26 +00:00
Michael Watzko
ce636f25e5 Unimpl Shl{Assign} for signed Saturating types until the correct impl is clear 2021-08-28 13:39:09 +02:00
Michael Watzko
977ae5ac2c Fix mentions of wrapping operations 2021-08-28 13:29:19 +02:00
Michael Watzko
acf0a0c394 Use wrapping shift for unsigned types 2021-08-28 13:28:35 +02:00
bors
05cccdc9b3 Auto merge of #88019 - inquisitivecrystal:macro-def, r=cjgillot
Treat macros as HIR items

Macros have historically been treated differently from other items at the HIR level. This PR makes them just like normal items. There are a few special cases left over, which I've attempted to lay out below. By normalizing the treatment of macro items, this PR simplifies a fair bit of code and fixes some bugs at the same time. For more information, see #87406.

r? `@cjgillot`

## Backwards incompatibility

This is backwards incompatible in one small way. Due to a mistake, it was previously possible to apply stability attributes to an exported macro, even without enabling the `staged_api` feature. This never should have worked. After this PR, it will error, as it should. We could make it a warning instead, but that would require a special case for a feature that shouldn't ever have worked and is likely used by no or very few crates, so I'm not thrilled about the idea.

## Notes for reviewers
### Commit seperation

I'd recommend reviewing this PR commit by commit. The commit chunking wasn't perfect, but it's better than looking at the combined diff, which is quite overwhelming. The compiler and standard library build after each commit, although tests do not necessarily pass and tools do not necessarily build till the end of the series.

### Special cases
There are a few special cases that remain after this change. Here are the notable ones I remember:

1. Visibility works a bit differently for `macro_rules!` macros than other items, since they aren't generally marked with `pub` but instead with `#[macro_export]`.
2. Since `#[macro_export]` macros always have paths at the top level of the crate, some additional handling needs to be done on the reexport to top level.
### Performance impact

I don't know for sure, but theses changes may slightly hurt performance. They create more work for the compiler in a few places. For instance, some operations that were previously run only for exported macros are now run for all macros. A perf run is probably advisable. For all I know we'll see performance improvements instead. :)

## Issues resolved

This resolves #87406 (the tracking issue for this change). It also fixes several bugs:

Fixes #59306.
Fixes #73754.
Fixes #87257.
2021-08-28 10:45:28 +00:00
Guillaume Gomez
261ee26ac5 Add test for code blocks color 2021-08-28 11:44:02 +02:00
Guillaume Gomez
1c3aedd23a Fix code blocks color in ayu theme 2021-08-28 11:44:02 +02:00
bors
2031fd6e46 Auto merge of #88245 - Sl1mb0:s390-asm, r=Amanieu
S390x inline asm

This adds register definitions and constraint codes for the s390x general and floating point registers necessary for fixing #85931; as well as a few tests.

Further testing is needed, but I am a little unsure of what specific tests should be added to `src/test/assembly/asm/s390x.rs` to address this.
2021-08-28 08:04:41 +00:00
inquisitivecrystal
b5a41418f8 Update tests 2021-08-28 00:24:39 -07:00
inquisitivecrystal
1f7bce012d Teach tools that macros are now HIR items 2021-08-28 00:24:39 -07:00
inquisitivecrystal
0299ed8bbb Remove obsolete MacroDef variant of OwnerNode 2021-08-28 00:24:30 -07:00
inquisitivecrystal
8c62fa0575 Treat macros as HIR items 2021-08-28 00:16:34 -07:00
liudingming
bf2f6656bc Revert machine outliner disabling on LLVM 13 2021-08-28 15:11:46 +08:00
12101111
9a53d59b97
fix evaluation of target_feature = "crt-static" 2021-08-28 14:40:17 +08:00
Cheng XU
2de6c14b25
RELEASES.md: fix broken link 2021-08-27 23:21:50 -07:00
12101111
4c9896f279
build llvm libunwind.a in rustbuild 2021-08-28 14:14:22 +08:00
Aaron Hill
c9157efad6
Don't use guess_head_span in predicates_of for foreign span
Previously, the result of `predicates_of` for a foreign trait
would depend on the *current* state of the corresponding source
file in the foreign crate. This could lead to ICEs during incremental
compilation, since the on-disk contents of the upstream source file
could potentially change without the upstream crate being recompiled.

Additionally, this ensure that that the metadata we produce for a crate
only depends on its *compiled* upstream dependencies (e.g an rlib or
rmeta file), *not* the current on-disk state of the upstream crate
source files.
2021-08-27 23:19:49 -05:00
Santiago Pastorino
6ac223582f
Add weird return types TAIT test 2021-08-27 22:40:23 -03:00
Santiago Pastorino
c85529e628
Add auto trait leakage TAIT test that should work but currently doesn't 2021-08-27 22:03:39 -03:00
Santiago Pastorino
d0e08dffcf
Add auto trait that shouldn't leak TAIT test 2021-08-27 21:59:49 -03:00
Santiago Pastorino
5ac46d7bd8
Add auto trait leakage TAIT test 2021-08-27 21:25:59 -03:00
Aaron Hill
672d370764
Remove Session.if_let_suggestions
We can instead if either the LHS or RHS types contain
`TyKind::Error`. In addition to covering the case where
we would have previously updated `if_let_suggestions`, this might
also prevent redundant errors in other cases as well.
2021-08-27 18:28:22 -05:00
Mateusz Mikuła
f58289cc51 Update stacker and psm crates 2021-08-28 00:40:49 +02:00
Ryan Zoeller
0d1d9788e5 Handle stack_t.ss_sp type change for DragonFlyBSD
stack_t.ss_sp is now c_void on DragonFlyBSD, so the specialization is no longer needed.

Changed in 02922ef750.
2021-08-27 17:31:42 -05:00
Santiago Pastorino
1ba86f2c34
Add inference cycle TAIT test 2021-08-27 18:35:34 -03:00
bors
ac50a53359 Auto merge of #88328 - fee1-dead:not-quite-const, r=oli-obk
Introduce `~const`

 - [x] Removed `?const` and change uses of `?const`
 - [x] Added `~const` to the AST. It is gated behind const_trait_impl.
 - [x] Validate `~const` in ast_validation.
 - [x] Update UI Tests
 - [x] Add enum `BoundConstness` (With variants `NotConst` and
 `ConstIfConst` allowing future extensions)
 - [x] Adjust trait selection and pre-existing code to use `BoundConstness`.
 - [ ] Optional steps for this PR
      - [x] Fix #88155
      - [x] ~~Do something with constness bounds in chalk~~ Must be done to rust-lang/chalk (just tried to refactor, there are a lot of errors to resolve :( )
      - [ ] Adjust Error messages for `~const` bounds that can't be satisfied.

r? `@oli-obk`
2021-08-27 21:35:08 +00:00
Joe Ardent
7a46ff5981 Fix formatting in release notes from 52a988344b 2021-08-27 14:24:25 -07:00
Niko Matsakis
c4dba5a64e use |= 2021-08-27 17:13:41 -04:00
Santiago Pastorino
d7a777f034
Add nested TAIT inference test that fails 2021-08-27 17:51:46 -03:00
Santiago Pastorino
5c7400c12d
Add nested TAIT inference test 2021-08-27 17:48:51 -03:00
Niko Matsakis
f34909d68f simplify the logic and document 2021-08-27 16:30:45 -04:00
bors
dfd84729d6 Auto merge of #88397 - nagisa:nagisa/unsupported-calling-conventions, r=Mark-Simulacrum
Tracking issue for `UNSUPPORTED_CALLING_CONVENTIONS`

This was previously forgotten. Nominating for 1.55 as this lint will make it into stable in that release.

r? `@Mark-Simulacrum`
2021-08-27 18:45:53 +00:00
Simonas Kazlauskas
fb5fbaaab0 Tracking issue for UNSUPPORTED_CALLING_CONVENTIONS 2021-08-27 20:47:00 +03:00
klensy
92e30f608b crossbeam-deque v0.7.3 -> v0.7.4:
https://rustsec.org/advisories/RUSTSEC-2021-0093
    https://github.com/crossbeam-rs/crossbeam/pull/728/files

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

tar v0.4.35 -> v0.4.37:
    https://rustsec.org/advisories/RUSTSEC-2021-0080
    updated to 0.4.37 as there breaking change in 0.4.36: https://github.com/alexcrichton/tar-rs/pull/260
2021-08-27 17:38:53 +03:00
Chris Denton
50da1eb1cd
Document std::env::current_exe rename behaviour
It might not be obvious that the "path of the current running executable" may (or may not) mean "at the time it was loaded".
2021-08-27 14:25:29 +01:00
csmoe
5eb960c8d9 add rustc-demangle assertion on mangled symbol 2021-08-27 21:18:20 +08:00
Roxane
110a9b3b1c Add comment and fix fmt issue 2021-08-27 09:00:50 -04:00