Commit graph

153821 commits

Author SHA1 Message Date
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
Deadbeef
523490e94a
Allow ~const bounds on trait assoc functions 2021-08-28 08:03:16 +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
Roxane
8fcfd6e136 Add missing const edge case 2021-08-27 08:25:06 -04:00
Deadbeef
2d7dbf2e05
Fix rustfmt test 2021-08-27 11:53:03 +00:00
Eric Huss
e6637284cc Remove vestigial rustfix tests. 2021-08-27 04:52:51 -07:00
Deadbeef
0a3a6087fb
Revive tests 2021-08-27 10:33:15 +00:00
Eduard-Mihai Burtescu
87d1fb747f rustc_target: require TyAbiInterface in LayoutOf. 2021-08-27 13:09:32 +03:00
Eduard-Mihai Burtescu
8486571a10 rustc_target: rename TyAndLayoutMethods to TyAbiInterface. 2021-08-27 13:09:32 +03:00
Eduard-Mihai Burtescu
83d986aa28 rustc_target: add lifetime parameter to LayoutOf. 2021-08-27 13:09:32 +03:00
bors
4a6547cca6 Auto merge of #88227 - 12101111:nobundle-link-order, r=petrochenkov
Adjust linking order of static nobundle libraries

Link the static libraries with "-bundle" modifier from upstream rust crate right after linking this rust crate.
Some linker such as GNU linker `ld.bdf` treat order of linking as order of dependency.

After this change, static libraries with "-bundle" modifier is linked in the same order as "+bundle" modifier.
So we can change the value of "bundle" modifier without causing linking error.

fix: https://github.com/rust-lang/rust/issues/87541

r? `@petrochenkov`
2021-08-27 09:18:14 +00:00
Deadbeef
f3d96e9391
fmt 2021-08-27 08:09:00 +00:00
Deadbeef
580ca930ac
Fix UI test 2021-08-27 07:12:40 +00:00
Deadbeef
80e1ee5aee
Add ty::BoundConstness 2021-08-27 06:49:18 +00:00