Yuki Okushi [Mon, 28 Jun 2021 23:46:10 +0000 (08:46 +0900)]
Rollup merge of #86529 - cuviper:ssl3, r=Mark-Simulacrum
Add support for OpenSSL 3.0.0
This updates the `openssl` and `openssl-sys` crates to support building
the toolchain with system libraries up to OpenSSL 3.0.0. This does not
affect the static version used via `openssl-src` in CI builds.
bors [Mon, 28 Jun 2021 16:48:01 +0000 (16:48 +0000)]
Auto merge of #86690 - JohnTitor:rollup-4ukk4yw, r=JohnTitor
Rollup of 6 pull requests
Successful merges:
- #86206 (Fix type checking of return expressions outside of function bodies)
- #86358 (fix pretty print for `loop`)
- #86568 (Don't dist miri or rust-analyzer on stable or beta.)
- #86683 (:arrow_up: rust-analyzer)
- #86687 (Allow anyone to set `perf-regression` label)
- #86688 (Add a regression test for issue-65384)
Add new tool to check HTML:
* Make html-checker run by default on rust compiler docs as well
* Ensure html-checker is run on CI
* Lazify tidy binary presence check
Yuki Okushi [Mon, 28 Jun 2021 15:26:57 +0000 (00:26 +0900)]
Rollup merge of #86568 - ehuss:dist-miri-stable, r=Mark-Simulacrum
Don't dist miri or rust-analyzer on stable or beta.
This prevents miri and rust-analyzer from being built for "dist" or "install" on the stable/beta channels. It is a nightly-only tool and should not be included.
Yuki Okushi [Mon, 28 Jun 2021 15:26:54 +0000 (00:26 +0900)]
Rollup merge of #86206 - FabianWolff:issue-86188, r=Mark-Simulacrum
Fix type checking of return expressions outside of function bodies
This pull request fixes #86188. The problem is that the current code for type-checking `return` expressions stops if the `return` occurs outside of a function body, while the correct behavior is to continue type-checking the return value expression (otherwise an ICE happens later on because variables declared in the return value expression don't have a type).
Also, I have noticed that it is sometimes not obvious why a `return` is outside of a function body; for instance, in the example from #86188 (which currently causes an ICE):
```rust
fn main() {
[(); return || {
let tx;
}]
}
```
I have changed the error message to also explain why the `return` is considered outside of the function body:
```
error[E0572]: return statement outside of function body
--> ice0.rs:2:10
|
1 | / fn main() {
2 | | [(); return || {
| |__________^
3 | || let tx;
4 | || }]
| ||_____^ the return is part of this body...
5 | | }
| |_- ...not the enclosing function body
```
bors [Mon, 28 Jun 2021 06:24:49 +0000 (06:24 +0000)]
Auto merge of #86684 - inquisitivecrystal:libs-tracking-issue, r=m-ou-se
Fix typo in libs tracking issue template
Currently, the libs tracking issue template expands FCP as "final commenting period". Everywhere else, including in [the official explanation](https://rust-lang.github.io/rfcs/), it's expanded as "final comment period". That version also sounds a bit better. Accordingly, this PR changes the tracking issue template to use that version.
bors [Mon, 28 Jun 2021 03:43:39 +0000 (03:43 +0000)]
Auto merge of #85876 - jeanlucthumm:master, r=GuillaumeGomez
Add `go_to_first` query param to jump to first result
Fixes #84214
Note that while the issue initially wanted to navigate to an entry on exact match, the discussion settled on using a query parameter (`&go_to_first=true`) instead, regardless of exact or partial match.
bors [Sun, 27 Jun 2021 20:33:25 +0000 (20:33 +0000)]
Auto merge of #85359 - lrh2000:reserved-prefixes, r=nikomatsakis
Reserve prefixed identifiers and literals (RFC 3101)
This PR denies any identifiers immediately followed by one of three tokens `"`, `'` or `#`, which is stricter than the requirements of RFC 3101 but may be necessary according to the discussion at [Zulip].
The tracking issue #84599 says we'll add a feature gate named `reserved_prefixes`, but I don't think I can do this because it is impossible for the lexer to know whether a feature is enabled or not. I guess determining the behavior by the edition information should be enough.
bors [Sun, 27 Jun 2021 18:10:35 +0000 (18:10 +0000)]
Auto merge of #86445 - sexxi-goose:box_fix, r=nikomatsakis
2229: Capture box completely in move closures
Even if the content from box is used in a sharef-ref context,
we capture the box entirerly.
This is motivated by:
1) We only capture data that is on the stack.
2) Capturing data from within the box might end up moving more data than
the user anticipated.
bors [Sun, 27 Jun 2021 15:45:29 +0000 (15:45 +0000)]
Auto merge of #86655 - jonas-schievink:const-arguments-as-str, r=kennytm
Make `fmt::Arguments::as_str` unstably const
Motivation: mostly to move "panic!() in const contexts" forward, making use of `as_str` was mentioned in https://github.com/rust-lang/rust/issues/85194#issuecomment-852345377 and seems like the simplest way forward.
bors [Sun, 27 Jun 2021 06:58:07 +0000 (06:58 +0000)]
Auto merge of #85448 - nanguye2496:nanguye2496/debuginfo_tests, r=Mark-Simulacrum
Add debug info tests for range, fix-sized array, and cell types
This PR add several debug info tests to guarantee that the displays of fixed sized arrays, range types, cell types, threads, locks, and mutexes in CDB are correct.
It also updates CDB tests for slices in pretty-std.rs after string visualization in WinDbg is fixed by this PR: #81898.
bors [Sun, 27 Jun 2021 00:15:49 +0000 (00:15 +0000)]
Auto merge of #86645 - FabianWolff:issue-82328, r=LeSeulArtichaut
Fix ICE with `-Zunpretty=hir,typed`
This PR fixes #82328. The `-Zunpretty=hir,typed` pretty-printer maintains an `Option` with type-checking results and sets the `Option` to `Some` when entering a body. However, this leads to an ICE if an expression occurs in a function signature (i.e. outside of a body), such as `128` in
```rust
fn foo(-128..=127: i8) {}
```
This PR fixes the ICE by checking (if necessary) whether the expression's owner has a body, and retrieving type-checking results for that on the fly.
bors [Sat, 26 Jun 2021 19:20:41 +0000 (19:20 +0000)]
Auto merge of #86267 - ZuseZ4:master, r=nagisa
Allow loading of llvm plugins on nightly
Based on a discussion in #82734 / with `@wsmoses.`
Mainly moves [this](https://github.com/wsmoses/rust/commit/0149bc4e7e596005c665b132877abebe5258a0f6) behind a -Z flag, so it can only be used on nightly,
as requested by `@nagisa` in https://github.com/rust-lang/rust/issues/82734#issuecomment-835863940
This change allows loading of llvm plugins like Enzyme.
Right now it also requires a shared library LLVM build of rustc for symbol resolution.
fn main() {
unsafe {
println!("Hello, world {} {}!", square(3.0), __enzyme_autodiff(square as usize, 3.0));
}
}
```
```
./rustc test.rs -Z llvm-plugins="./LLVMEnzyme-12.so" -C passes="enzyme"
./test
Hello, world 9 6!
```
I will try to figure out how to simplify the usage and get this into stable in a later iteration,
but having this on nightly will already help testing further steps.
lrh2000 [Sun, 16 May 2021 03:10:05 +0000 (11:10 +0800)]
Reserve prefixed identifiers and string literals (RFC 3101)
This commit denies any identifiers immediately followed by
one of three tokens `"`, `'` or `#`, which is stricter than
the requirements of RFC 3101 but may be necessary according
to the discussion at [Zulip].
This will now render properly including the `for<'a>`
![image](https://user-images.githubusercontent.com/39732259/116808426-fe6ce600-ab38-11eb-9452-f33f554fbb8e.png)
I do not know if this covers all cases, it only covers everything that I could think of that includes `for` and lifetimes in where bounds.
Also someone need to mentor me on how to add a proper rustdoc test for this.
bors [Sat, 26 Jun 2021 08:24:31 +0000 (08:24 +0000)]
Auto merge of #86586 - Smittyvb:https-everywhere, r=petrochenkov
Use HTTPS links where possible
While looking at #86583, I wondered how many other (insecure) HTTP links were in `rustc`. This changes most other `http` links to `https`. While most of the links are in comments or documentation, there are a few other HTTP links that are used by CI that are changed to HTTPS.
Notes:
- I didn't change any to or in licences
- Some links don't support HTTPS :(
- Some `http` links were dead, in those cases I upgraded them to their new places (all of which used HTTPS)
bors [Sat, 26 Jun 2021 02:28:45 +0000 (02:28 +0000)]
Auto merge of #86622 - FabianWolff:issue-83475, r=jonas-schievink
Check that `#[cmse_nonsecure_entry]` is applied to a function definition
This PR fixes #83475. The compiler currently neglects to check whether `#[cmse_nonsecure_entry]` is applied to a function (and not, say, a struct) definition, leading to an ICE later on when the type checker attempts to retrieve the function signature. I have fixed this problem by adding an appropriate check to the `check_attr` pass, so that an error is reported instead of an ICE.
bors [Fri, 25 Jun 2021 23:47:56 +0000 (23:47 +0000)]
Auto merge of #86015 - jyn514:revert-revert, r=Mark-Simulacrum
Move LLVM submodule updates back to native.rs
Time to find more bugs!
The first commit is a straight revert of https://github.com/rust-lang/rust/pull/85647, the second is a fix for https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/x.2Epy.20always.20updates.20LLVM.20submodule/near/240113320 and https://github.com/rust-lang/rust/pull/82653#issuecomment-846755631. I haven't been able to replicate https://github.com/rust-lang/rust/pull/82653#issuecomment-849013698.
bors [Fri, 25 Jun 2021 18:16:37 +0000 (18:16 +0000)]
Auto merge of #86627 - JohnTitor:rollup-ey29pc1, r=JohnTitor
Rollup of 5 pull requests
Successful merges:
- #86330 (Change how edition based future compatibility warnings are handled)
- #86513 (Rustdoc: Do not list impl when trait has doc(hidden))
- #86592 (Use `#[non_exhaustive]` where appropriate)
- #86608 (chore(rustdoc): remove unused members of RenderType)
- #86624 (Update compiler-builtins)
Yuki Okushi [Fri, 25 Jun 2021 15:42:12 +0000 (00:42 +0900)]
Rollup merge of #86592 - jhpratt:non_exhaustive, r=JohnTitor
Use `#[non_exhaustive]` where appropriate
Due to the std/alloc split, it is not possible to make `alloc::collections::TryReserveError::AllocError` non-exhaustive without having an unstable, doc-hidden method to construct (which negates the benefits from `#[non_exhaustive]`).
Yuki Okushi [Fri, 25 Jun 2021 15:42:06 +0000 (00:42 +0900)]
Rollup merge of #86330 - rylev:update-fcw-handling, r=nikomatsakis
Change how edition based future compatibility warnings are handled
This fixes https://github.com/rust-lang/rust/issues/85894 by updating how future compatibility lints work. This makes it more apparent that future compatibility warnings can happen for several different reasons.
For now `FutureCompatibilityReasons` are limited to three reasons, but we can easily add more.
This also updates the generated warning for FCW's that signal code that will error in a future edition. This makes the diagnostics between FCWs at edition boundaries more distinct from those not happening at an edition boundary.