]> git.lizzy.rs Git - rust.git/log
rust.git
3 years agoAuto merge of #85876 - jeanlucthumm:master, r=GuillaumeGomez
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.

Demonstration is attached

https://user-images.githubusercontent.com/4934853/120258768-7ff28980-c247-11eb-8c8f-1a2ceb242788.mp4

3 years agoAuto merge of #85909 - cjgillot:alloc-kind-query, r=Aaron1011
bors [Mon, 28 Jun 2021 01:20:01 +0000 (01:20 +0000)]
Auto merge of #85909 - cjgillot:alloc-kind-query, r=Aaron1011

Make allocator_kind a query.

Part of #85153

r? `@Aaron1011`

3 years agoAuto merge of #86589 - JohnTitor:add-triangle-to-summary, r=jsha
bors [Sun, 27 Jun 2021 22:57:34 +0000 (22:57 +0000)]
Auto merge of #86589 - JohnTitor:add-triangle-to-summary, r=jsha

Show triangle on the "Details" disclosure element in all cases

Re-submission of #82805, fixes the style issue by applying the same margin as `<p>`.

<details><summary>Before</summary>

![before 1](https://user-images.githubusercontent.com/25030997/123215032-e4c99880-d502-11eb-9ccc-6df58f3a6b0b.png)
![before 2](https://user-images.githubusercontent.com/25030997/123215035-e5622f00-d502-11eb-9275-6c6dfcfdf72e.png)
</details>

<details><summary>After</summary>

![after 1](https://user-images.githubusercontent.com/25030997/123215037-e5fac580-d502-11eb-9b49-c99d1eafb1b4.png)
![after 2](https://user-images.githubusercontent.com/25030997/123215040-e5fac580-d502-11eb-8afc-ab713d3dc658.png)
</details>

r? `@GuillaumeGomez`

3 years agoAuto merge of #85359 - lrh2000:reserved-prefixes, r=nikomatsakis
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].

[Zulip]: https://rust-lang.zulipchat.com/#narrow/stream/268952-edition-2021/topic/reserved.20prefixes/near/238470099

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.

Fixes #84599

3 years agoAuto merge of #86445 - sexxi-goose:box_fix, r=nikomatsakis
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.

Closes https://github.com/rust-lang/project-rfc-2229/issues/50

r? `@nikomatsakis`

3 years agoAdd Website features page to rustdoc book
Jean-Luc Thumm [Tue, 22 Jun 2021 22:40:37 +0000 (15:40 -0700)]
Add Website features page to rustdoc book

3 years agoAdd go_to_first boolean query param to immeidately jump to the first search result
Jean-Luc Thumm [Tue, 1 Jun 2021 02:20:41 +0000 (19:20 -0700)]
Add go_to_first boolean query param to immeidately jump to the first search result

3 years agoAuto merge of #86655 - jonas-schievink:const-arguments-as-str, r=kennytm
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.

3 years agoAuto merge of #86295 - usbalbin:revert_revert_of_constness, r=RalfJung
bors [Sun, 27 Jun 2021 13:19:48 +0000 (13:19 +0000)]
Auto merge of #86295 - usbalbin:revert_revert_of_constness, r=RalfJung

Revert revert of constness in #86003

Re-constify `mem::swap`, `mem::replace`, `ptr::write` which were marked as not `const` in #86003

Once the checks pass, this should solve #86236

3 years agoUpdate and bless tests for const read out of bounds
Albin Hedman [Sun, 27 Jun 2021 12:24:49 +0000 (14:24 +0200)]
Update and bless tests for const read out of bounds

3 years agoUpdate and bless tests for copy intrinsic
Albin Hedman [Sun, 27 Jun 2021 11:48:01 +0000 (13:48 +0200)]
Update and bless tests for copy intrinsic

3 years agoFix the test copy-intrinsic
Albin Hedman [Tue, 15 Jun 2021 17:22:31 +0000 (19:22 +0200)]
Fix the test copy-intrinsic

3 years agoBring back tests removed in 'Revert PRs 81238 and 82967 (which made copy and copy_non...
Albin Hedman [Tue, 15 Jun 2021 14:47:31 +0000 (16:47 +0200)]
Bring back tests removed in 'Revert PRs 81238 and 82967 (which made copy and copy_nonoverlapping' 5f6016f1259142de7ab1f186f412fa3ca26607a8

3 years agoBless out_of_bounds_read test
Albin Hedman [Mon, 14 Jun 2021 18:47:54 +0000 (20:47 +0200)]
Bless out_of_bounds_read test

3 years agoAdd reference to tracking issue #86302 for const_ptr_write
Albin Hedman [Mon, 14 Jun 2021 17:58:34 +0000 (19:58 +0200)]
Add reference to tracking issue #86302 for const_ptr_write

3 years agoAdd reference to issue for const_intrinsic_copy in ptr::write
Albin Hedman [Mon, 14 Jun 2021 17:39:02 +0000 (19:39 +0200)]
Add reference to issue for const_intrinsic_copy in ptr::write

3 years agoRevert "With the revert of PR 83091, `swap` is not a `const fn` anymore."
Albin Hedman [Mon, 14 Jun 2021 15:35:29 +0000 (17:35 +0200)]
Revert "With the revert of PR 83091, `swap` is not a `const fn` anymore."

This reverts commit 34deda3cc250c2607a68cda75fe256f43b110fdc.

3 years agoRevert "Remove tests that were also added in PR 79684."
Albin Hedman [Mon, 14 Jun 2021 15:32:51 +0000 (17:32 +0200)]
Revert "Remove tests that were also added in PR 79684."

This reverts commit e118a2cbf1e590cb5a7586ad01c6c3431c2b4f48.

3 years agoRevert "Revert tests added by PR 81167."
Albin Hedman [Mon, 14 Jun 2021 15:30:12 +0000 (17:30 +0200)]
Revert "Revert tests added by PR 81167."

This reverts commit cebfcd3256a6ec8655f0d9f45426d6f42a92da9c.

3 years agoRevert "Revert effects of PRs 81167 and 83091."
Albin Hedman [Mon, 14 Jun 2021 15:29:22 +0000 (17:29 +0200)]
Revert "Revert effects of PRs 81167 and 83091."

This reverts commit 9d96b0ed8c0f37bc09e737e1ab5880e8f5dd43f2.

3 years agoAdd FIXME comment
Yuki Okushi [Sun, 27 Jun 2021 07:18:52 +0000 (16:18 +0900)]
Add FIXME comment

3 years agoAuto merge of #85448 - nanguye2496:nanguye2496/debuginfo_tests, r=Mark-Simulacrum
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.

3 years agoMake `fmt::Arguments::as_str` unstably const
Jonas Schievink [Sun, 27 Jun 2021 01:54:06 +0000 (03:54 +0200)]
Make `fmt::Arguments::as_str` unstably const

3 years agoAuto merge of #86645 - FabianWolff:issue-82328, r=LeSeulArtichaut
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.

3 years agoUpdate reserved prefixes test for new edition lint wording.
Mara Bos [Sat, 26 Jun 2021 20:49:29 +0000 (20:49 +0000)]
Update reserved prefixes test for new edition lint wording.

3 years agoReorder some lines in `unpretty-expr-fn-arg.rs`
Fabian Wolff [Sat, 26 Jun 2021 20:43:27 +0000 (22:43 +0200)]
Reorder some lines in `unpretty-expr-fn-arg.rs`

3 years agoUse `Option::map()` instead of `if let`
Fabian Wolff [Sat, 26 Jun 2021 20:26:26 +0000 (22:26 +0200)]
Use `Option::map()` instead of `if let`

3 years agoAuto merge of #86267 - ZuseZ4:master, r=nagisa
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.

```rust
// test.rs
extern { fn __enzyme_autodiff(_: usize, ...) -> f64; }

fn square(x : f64) -> f64 {
   return x * x;
}

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.

3 years agoRemove dropping of loaded plugins and better debug info
Manuel Drehwald [Sat, 26 Jun 2021 17:30:09 +0000 (19:30 +0200)]
Remove dropping of loaded plugins and better debug info

3 years agoAuto merge of #86449 - Stupremee:render-self-cast-in-type-bound, r=GuillaumeGomez
bors [Sat, 26 Jun 2021 16:13:52 +0000 (16:13 +0000)]
Auto merge of #86449 - Stupremee:render-self-cast-in-type-bound, r=GuillaumeGomez

rustdoc: Render `<Self as X>::Y` type casts properly across crate bounds

My last PR that introduced the type casting did not work for cross-crate re-exported traits, which is fixed in this PR.

Fully resolves #85454

3 years agoUse FutureIncompatibilityReason to denote edition
lrh2000 [Sat, 26 Jun 2021 15:40:07 +0000 (23:40 +0800)]
Use FutureIncompatibilityReason to denote edition

3 years agoAdd reserved_prefixe tests for macros from different editions.
Mara Bos [Mon, 14 Jun 2021 20:39:04 +0000 (20:39 +0000)]
Add reserved_prefixe tests for macros from different editions.

3 years agoNo reserved_prefix suggestion in proc macro call_site.
Mara Bos [Mon, 14 Jun 2021 20:38:57 +0000 (20:38 +0000)]
No reserved_prefix suggestion in proc macro call_site.

3 years agoAdd quote!() example to reserved_prefix lint test.
Mara Bos [Mon, 14 Jun 2021 17:07:40 +0000 (17:07 +0000)]
Add quote!() example to reserved_prefix lint test.

3 years agoRename 'bad prefix' to 'unknown prefix'.
Mara Bos [Mon, 14 Jun 2021 16:50:20 +0000 (16:50 +0000)]
Rename 'bad prefix' to 'unknown prefix'.

3 years agoCheck the span's edition for the reserved prefixes.
Mara Bos [Mon, 14 Jun 2021 16:48:07 +0000 (16:48 +0000)]
Check the span's edition for the reserved prefixes.

3 years agoImprove comments for reserved prefixes.
Mara Bos [Mon, 14 Jun 2021 16:46:46 +0000 (16:46 +0000)]
Improve comments for reserved prefixes.

Co-authored-by: Niko Matsakis <niko@alum.mit.edu>
3 years agoAdd test for the reserved_prefix migration lint.
Mara Bos [Mon, 14 Jun 2021 12:57:26 +0000 (12:57 +0000)]
Add test for the reserved_prefix migration lint.

3 years agoAdd migration lint for reserved prefixes.
Mara Bos [Mon, 14 Jun 2021 12:56:49 +0000 (12:56 +0000)]
Add migration lint for reserved prefixes.

3 years agoUpdate reserved-prefixes test output.
Mara Bos [Mon, 14 Jun 2021 13:03:55 +0000 (13:03 +0000)]
Update reserved-prefixes test output.

3 years agoFix note in reserved prefix error.
Mara Bos [Mon, 14 Jun 2021 12:25:59 +0000 (12:25 +0000)]
Fix note in reserved prefix error.

3 years agoAdd machine applicable suggestion to unknown prefix error.
Mara Bos [Mon, 14 Jun 2021 12:25:18 +0000 (12:25 +0000)]
Add machine applicable suggestion to unknown prefix error.

3 years agoReserve prefixed identifiers and string literals (RFC 3101)
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].

[Zulip]: https://rust-lang.zulipchat.com/#narrow/stream/268952-edition-2021/topic/reserved.20prefixes/near/238470099

3 years agoFix ICE with `-Zunpretty=hir,typed` when an expression occurs in a function signature
Fabian Wolff [Sat, 26 Jun 2021 14:05:53 +0000 (16:05 +0200)]
Fix ICE with `-Zunpretty=hir,typed` when an expression occurs in a function signature

3 years agoAuto merge of #85682 - m-ou-se:array-into-iter-2, r=nikomatsakis
bors [Sat, 26 Jun 2021 13:33:04 +0000 (13:33 +0000)]
Auto merge of #85682 - m-ou-se:array-into-iter-2, r=nikomatsakis

Update array_into_iter lint for 1.53 and edition changes.

This updates the array_into_iter lint for Rust 1.53 and the edition changes.

See https://github.com/rust-lang/rust/issues/84513

r? `@estebank`

3 years agoFix array-into-iter tests.
Mara Bos [Fri, 25 Jun 2021 17:26:31 +0000 (17:26 +0000)]
Fix array-into-iter tests.

3 years agoRemove issue-78660-cap-lints-future-compat test.
Mara Bos [Thu, 10 Jun 2021 14:48:26 +0000 (14:48 +0000)]
Remove issue-78660-cap-lints-future-compat test.

3 years agoAdd test for suggestion of array_into_iter in for loop.
Mara Bos [Tue, 25 May 2021 17:15:48 +0000 (19:15 +0200)]
Add test for suggestion of array_into_iter in for loop.

3 years agoBetter suggestion for array_into_iter in for loop.
Mara Bos [Tue, 25 May 2021 17:15:27 +0000 (19:15 +0200)]
Better suggestion for array_into_iter in for loop.

3 years agoUpdate tests for updated array_into_iter lint.
Mara Bos [Tue, 25 May 2021 15:56:19 +0000 (17:56 +0200)]
Update tests for updated array_into_iter lint.

3 years agoAdd new suggestion to array_into_iter lint.
Mara Bos [Tue, 25 May 2021 15:13:15 +0000 (17:13 +0200)]
Add new suggestion to array_into_iter lint.

3 years agoChange wording on array_into_iter lint for 1.53 and edition changes.
Mara Bos [Tue, 25 May 2021 15:12:45 +0000 (17:12 +0200)]
Change wording on array_into_iter lint for 1.53 and edition changes.

3 years agoAuto merge of #84814 - Stupremee:properly-render-hrtbs, r=GuillaumeGomez
bors [Sat, 26 Jun 2021 10:52:16 +0000 (10:52 +0000)]
Auto merge of #84814 - Stupremee:properly-render-hrtbs, r=GuillaumeGomez

Properly render HRTBs

```rust
pub fn test<T>()
where
    for<'a> &'a T: Iterator,
{}
```

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.

Resolves #78482

3 years agoAuto merge of #86586 - Smittyvb:https-everywhere, r=petrochenkov
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)

3 years agoAuto merge of #86637 - ehuss:spellings, r=dtolnay
bors [Sat, 26 Jun 2021 05:09:27 +0000 (05:09 +0000)]
Auto merge of #86637 - ehuss:spellings, r=dtolnay

Fix a few misspellings.

3 years agoAuto merge of #86622 - FabianWolff:issue-83475, r=jonas-schievink
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.

3 years agoAuto merge of #86015 - jyn514:revert-revert, r=Mark-Simulacrum
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.

3 years agoDownload the GCC sources insecurely
Smitty [Fri, 25 Jun 2021 21:15:36 +0000 (17:15 -0400)]
Download the GCC sources insecurely

This is needed as they are built on a long-outdated Debian version. :(

3 years agoAdd debug info tests for range, fix-sized array, and cell types.
Nam Nguyen [Tue, 30 Mar 2021 17:43:39 +0000 (10:43 -0700)]
Add debug info tests for range, fix-sized array, and cell types.

3 years agoAuto merge of #86599 - Amanieu:asm_raw, r=nagisa
bors [Fri, 25 Jun 2021 20:44:28 +0000 (20:44 +0000)]
Auto merge of #86599 - Amanieu:asm_raw, r=nagisa

Add a "raw" option for asm! which ignores format string specifiers

This is useful when including raw assembly snippets using `include_str!`.

3 years agoFix a few misspellings.
Eric Huss [Fri, 25 Jun 2021 20:18:56 +0000 (13:18 -0700)]
Fix a few misspellings.

3 years agoAuto merge of #86627 - JohnTitor:rollup-ey29pc1, r=JohnTitor
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)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

3 years agoCheck that `#[cmse_nonsecure_entry]` is applied to a function definition
Fabian Wolff [Fri, 25 Jun 2021 13:36:38 +0000 (15:36 +0200)]
Check that `#[cmse_nonsecure_entry]` is applied to a function definition

3 years agoRollup merge of #86624 - jethrogb:update-compiler_builtins, r=Amanieu
Yuki Okushi [Fri, 25 Jun 2021 15:42:14 +0000 (00:42 +0900)]
Rollup merge of #86624 - jethrogb:update-compiler_builtins, r=Amanieu

Update compiler-builtins

r? ``@Amanieu``

3 years agoRollup merge of #86608 - notriddle:notriddle/cleanup-rustdoc, r=jyn514
Yuki Okushi [Fri, 25 Jun 2021 15:42:13 +0000 (00:42 +0900)]
Rollup merge of #86608 - notriddle:notriddle/cleanup-rustdoc, r=jyn514

chore(rustdoc): remove unused members of RenderType

PR #86561 removes the only place the `generics` member is read. This PR does even more cleanup.

3 years agoRollup merge of #86592 - jhpratt:non_exhaustive, r=JohnTitor
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]`).

`@rustbot` label +C-cleanup +T-libs +S-waiting-on-review

3 years agoRollup merge of #86513 - fee1-dead:cross-crate-doc-hidden, r=danielhenrymantilla
Yuki Okushi [Fri, 25 Jun 2021 15:42:10 +0000 (00:42 +0900)]
Rollup merge of #86513 - fee1-dead:cross-crate-doc-hidden, r=danielhenrymantilla

Rustdoc: Do not list impl when trait has doc(hidden)

Fixes #86448.

3 years agoRollup merge of #86330 - rylev:update-fcw-handling, r=nikomatsakis
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.

r? ``@m-ou-se``

3 years agoAuto merge of #85603 - ogoffart:fix-uninhabited-enum-branching-pass, r=wesleywiser
bors [Fri, 25 Jun 2021 15:35:47 +0000 (15:35 +0000)]
Auto merge of #85603 - ogoffart:fix-uninhabited-enum-branching-pass, r=wesleywiser

Fix uninhabited enum branching pass

when the discriminant is taken with some projection.

3 years agoUpdate compiler-builtins
Jethro Beekman [Fri, 25 Jun 2021 14:00:57 +0000 (16:00 +0200)]
Update compiler-builtins

3 years agoFix clippy test
Ryan Levick [Fri, 25 Jun 2021 13:29:14 +0000 (15:29 +0200)]
Fix clippy test

3 years agoFix new broken tests
Ryan Levick [Thu, 24 Jun 2021 14:45:19 +0000 (16:45 +0200)]
Fix new broken tests

3 years agoFix new lints
Ryan Levick [Wed, 23 Jun 2021 13:52:28 +0000 (15:52 +0200)]
Fix new lints

3 years agoAdd back missing doc
Ryan Levick [Thu, 17 Jun 2021 17:36:49 +0000 (19:36 +0200)]
Add back missing doc

3 years agoAddress PR feedback
Ryan Levick [Wed, 16 Jun 2021 12:27:44 +0000 (14:27 +0200)]
Address PR feedback

3 years agoChange how edition based future compatibility warnings are handled
Ryan Levick [Tue, 15 Jun 2021 15:16:21 +0000 (17:16 +0200)]
Change how edition based future compatibility warnings are handled

3 years agoAuto merge of #86583 - dns2utf8:use_https, r=pietroalbini
bors [Fri, 25 Jun 2021 12:20:17 +0000 (12:20 +0000)]
Auto merge of #86583 - dns2utf8:use_https, r=pietroalbini

Use https for sourceforge during CI

I saw that we use http during CI opening up the CI process to on the wire tampering.

based on #86573

r? `@pietroalbini`

3 years agoAuto merge of #86505 - JohnTitor:fix-86483, r=jackh726
bors [Fri, 25 Jun 2021 09:28:17 +0000 (09:28 +0000)]
Auto merge of #86505 - JohnTitor:fix-86483, r=jackh726

Do not panic in `return_type_impl_trait`

Fixes #86483

3 years agoFetch expat from github because the project switched
Stefan Schindler [Wed, 23 Jun 2021 20:01:18 +0000 (22:01 +0200)]
Fetch expat from github because the project switched

3 years agoUse https for sourceforge during CI
Stefan Schindler [Wed, 23 Jun 2021 19:20:19 +0000 (21:20 +0200)]
Use https for sourceforge during CI

3 years agoShow triangle on the "Details" disclosure element in all cases
Yuki Okushi [Thu, 24 Jun 2021 06:41:31 +0000 (15:41 +0900)]
Show triangle on the "Details" disclosure element in all cases

Co-authored-by: Miguel Ojeda <ojeda@kernel.org>
3 years agoAuto merge of #86151 - scottmcm:simple-hash-of, r=joshtriplett
bors [Fri, 25 Jun 2021 06:47:30 +0000 (06:47 +0000)]
Auto merge of #86151 - scottmcm:simple-hash-of, r=joshtriplett

Add `BuildHasher::hash_one` as unstable

Inspired by https://github.com/rust-lang/rust/pull/86140/files#diff-246941135168fbc44fce120385ee9c3156e08a1c3e2697985b56dcb8d728eedeR2416, where I wanted to write a quick test for a `Hash` implementation and it took more of a dance than I'd hoped.

It looks like this would be handy in hashtable implementations, too -- a quick look at hashbrown found two places where it needs to do the same dance:
https://github.com/rust-lang/hashbrown/blob/6302512a8a514fe5bd442464ebcd78139c82e1e2/src/map.rs#L247-L270

I wanted to get a "seems plausible" from a libs member before making a tracking issue, so random-sampling the intersection of highfive and governance gave me...
r? `@joshtriplett`

(As always, bikeshed away!  And let me know if I missed something obvious again that I should have used instead.)

3 years agoRenamed test and added test for same crate
Deadbeef [Fri, 25 Jun 2021 06:08:06 +0000 (14:08 +0800)]
Renamed test and added test for same crate

3 years agoAuto merge of #85640 - bjorn3:custom_ice_hook, r=jackh726
bors [Fri, 25 Jun 2021 04:06:32 +0000 (04:06 +0000)]
Auto merge of #85640 - bjorn3:custom_ice_hook, r=jackh726

Allow changing the bug report url for the ice hook

cc https://github.com/bjorn3/rustc_codegen_cranelift/issues/1174

3 years agofixup! 2229: Capture box completely in move closures
Aman Arora [Tue, 22 Jun 2021 05:58:17 +0000 (01:58 -0400)]
fixup! 2229: Capture box completely in move closures

fixup! 2229: Capture box completely in move closures

3 years agoAuto merge of #86574 - m-ou-se:or-pattern-lint-fix, r=petrochenkov
bors [Fri, 25 Jun 2021 01:23:16 +0000 (01:23 +0000)]
Auto merge of #86574 - m-ou-se:or-pattern-lint-fix, r=petrochenkov

Don't lint :pat when re-parsing a macro from another crate.

`compile_macro` is used both when compiling the original definition in the crate that defines it, and to compile the macro when loading it when compiling a crate that uses it. We should only emit lints in the first case.

This adds a `is_definition: bool` to pass this information in, so we don't warn about things that only concern the definition site.

Fixes #86567

3 years ago2229: Capture box completely in move closures
Aman Arora [Fri, 18 Jun 2021 20:35:10 +0000 (16:35 -0400)]
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.

3 years agochore(rustdoc): remove unused members of RenderType
Michael Howell [Thu, 24 Jun 2021 19:53:35 +0000 (12:53 -0700)]
chore(rustdoc): remove unused members of RenderType

Commit e629381653bb3579f0cea0b256e391edef5e8dbb removes the only place
these members variables are actually read.

3 years agoAuto merge of #86272 - nagisa:nagisa/tidy-llvm-components, r=Mark-Simulacrum
bors [Thu, 24 Jun 2021 22:42:26 +0000 (22:42 +0000)]
Auto merge of #86272 - nagisa:nagisa/tidy-llvm-components, r=Mark-Simulacrum

tidy: verify that test revisions with --target have associated needs-llvm-components directives

This ensures that people who tend to write `--target` `#[no_core]` tests don't miss specifying the `needs-llvm-components` directive. This is necessary for the test suite to pass when LLVM is compiled with a subset of components enabled.

While here I also took the opportunity to implement a more fine-grained handling of the ignore directives, so that they are evaluated for each revision, rather than for the entire test. With this even if people have `arm` component disabled, only the revision that depends on the arm component will not run.

Fixes https://github.com/rust-lang/rust/issues/82405

3 years agoAdd a "raw" option for asm! which ignores format string specifiers
Amanieu d'Antras [Thu, 24 Jun 2021 15:25:44 +0000 (16:25 +0100)]
Add a "raw" option for asm! which ignores format string specifiers

3 years agoDon't lint :pat when re-parsing a macro from another crate.
Mara Bos [Wed, 23 Jun 2021 14:07:32 +0000 (14:07 +0000)]
Don't lint :pat when re-parsing a macro from another crate.

3 years agocompiletest: ignore tests on a per-revision basis
Simonas Kazlauskas [Sun, 13 Jun 2021 19:06:11 +0000 (22:06 +0300)]
compiletest: ignore tests on a per-revision basis

Otherwise something that ought to seemingly work like `//[x86]
needs-llvm-components: x86` or `//[nll_beyond]should-fail` do not get
evaluated properly.

3 years agoRe-Annotate the tests with needs-llvm-components
Simonas Kazlauskas [Sun, 13 Jun 2021 18:19:39 +0000 (21:19 +0300)]
Re-Annotate the tests with needs-llvm-components

Doesn't work though, because compiletest doesn't process ignores on a
per-revision manner.

3 years agotidy: tests with --target need llvm components
Simonas Kazlauskas [Sun, 13 Jun 2021 15:56:13 +0000 (18:56 +0300)]
tidy: tests with --target need llvm components

Herein we verify that all of the tests that specify a `--target`
compile-flag, are also annotated with the minimal set of required llvm
components necessary to run that test.

3 years agoAuto merge of #85651 - dns2utf8:rustdoc_flexbox, r=GuillaumeGomez
bors [Thu, 24 Jun 2021 20:01:39 +0000 (20:01 +0000)]
Auto merge of #85651 - dns2utf8:rustdoc_flexbox, r=GuillaumeGomez

rustdoc: staggered layout for module contents on mobile

This PR adds the container `<item-table>` with its two children `<item-left>` and `<item-right>`.
It uses grid-layout on desktop and flexbox on mobile to make better use of the available space.

Additionally it allows to share parts of the CSS with the search function.

* Demo: https://data.estada.ch/rustdoc-nightly_126561cb3_2021-05-25/generic_array/index.html
* Related: #85540

## Desktop
![grafik](https://user-images.githubusercontent.com/739070/119416896-2be62300-bce4-11eb-9555-792b859ab611.png)

## Mobile
![grafik](https://user-images.githubusercontent.com/739070/119416934-44563d80-bce4-11eb-9e77-70a72edcc487.png)

r? `@GuillaumeGomez` `@jsha`

3 years agoAuto merge of #86467 - ChrisDenton:win-env-clear, r=JohnTitor
bors [Thu, 24 Jun 2021 17:37:29 +0000 (17:37 +0000)]
Auto merge of #86467 - ChrisDenton:win-env-clear, r=JohnTitor

Windows: Fix `Command::env_clear` so it works if no variables are set

Previously, it would error unless at least one new environment variable was added. The missing null presumably meant that Windows was reading random memory in that case.

See: [CreateProcessW](https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-createprocessw) (scroll down to `lpEnvironment`). Essentially the environment block is a null terminated list of null terminated strings and an empty list is `\0\0` and not `\0`.

EDIT: Oh, [CreateEnvironmentBlock](https://docs.microsoft.com/en-gb/windows/win32/api/userenv/nf-userenv-createenvironmentblock) states this much more explicitly.

Fixes #31259

3 years agoAuto merge of #85427 - ehuss:fix-use-placement, r=jackh726
bors [Thu, 24 Jun 2021 14:56:28 +0000 (14:56 +0000)]
Auto merge of #85427 - ehuss:fix-use-placement, r=jackh726

Fix use placement for suggestions near main.

This fixes an edge case for the suggestion to add a `use`. When running with `--test`, the `main` function will be annotated with an `#[allow(dead_code)]` attribute. The `UsePlacementFinder` would end up using the dummy span of that synthetic attribute. If there are top-level inner attributes, this would place the `use` in the wrong position. The solution here is to ignore attributes with dummy spans.

In the process of working on this, I discovered that the `use_suggestion_placement` test was broken. `UsePlacementFinder` is unaware of active attributes. Attributes like `#[derive]` don't exist in the AST since they are removed. Fixing that is difficult, since the AST does not retain enough information. I considered trying to place the `use` towards the top of the module after any `extern crate` items, but I couldn't find a way to get a span for the start of a module block (the `mod` span starts at the `mod` keyword, and it seems tricky to find the spot just after the opening bracket and past inner attributes). For now, I just put some comments about the issue. This appears to have been a known issue in #44215 where the test for it was introduced, and the fix seemed to be deferred to later.

3 years agoMigrate from custom elements to divs with classes to be compatible with safari
Stefan Schindler [Thu, 17 Jun 2021 22:33:42 +0000 (00:33 +0200)]
Migrate from custom elements to divs with classes to be compatible with safari

3 years agoHide Crate Version on narrow Screens
Stefan Schindler [Wed, 16 Jun 2021 20:24:02 +0000 (22:24 +0200)]
Hide Crate Version on narrow Screens

3 years agoFixing the test rustdoc by ignoring `*[@id="module-item"]//following-sibling::item...
Stefan Schindler [Wed, 16 Jun 2021 14:16:11 +0000 (16:16 +0200)]
Fixing the test rustdoc by ignoring `*[@id="module-item"]//following-sibling::item-right` relationship and rustdoc-gui