]> git.lizzy.rs Git - rust.git/log
rust.git
3 years agoBPF: review fixes
Alessandro Decina [Sun, 30 May 2021 01:57:00 +0000 (11:57 +1000)]
BPF: review fixes

3 years agoBPF: remove unnecessary flags from src/test/codegen/bpf-alu32.rs
Alessandro Decina [Sun, 30 May 2021 01:50:43 +0000 (11:50 +1000)]
BPF: remove unnecessary flags from src/test/codegen/bpf-alu32.rs

3 years agoFix tests
Alessandro Decina [Sat, 29 May 2021 12:58:04 +0000 (22:58 +1000)]
Fix tests

3 years agoBPF: misc minor review fixes
Alessandro Decina [Sat, 29 May 2021 12:21:23 +0000 (22:21 +1000)]
BPF: misc minor review fixes

3 years agoBPF: abi: extend args/ret to 32 bits
Alessandro Decina [Sat, 29 May 2021 12:18:30 +0000 (22:18 +1000)]
BPF: abi: extend args/ret to 32 bits

Let LLVM extend to 64 bits when alu32 is not enabled

3 years agoBPF: fix #[target_feature(enable = "alu32")]
Alessandro Decina [Sat, 29 May 2021 12:17:02 +0000 (22:17 +1000)]
BPF: fix #[target_feature(enable = "alu32")]

3 years agoBPF: add assembly test
Alessandro Decina [Sat, 29 May 2021 11:53:06 +0000 (21:53 +1000)]
BPF: add assembly test

3 years agoUpdate LLVM submodule
Alessandro Decina [Sun, 23 May 2021 08:05:11 +0000 (18:05 +1000)]
Update LLVM submodule

3 years agoAdd BPF target to platform-support.md
Alessandro Decina [Sat, 22 May 2021 06:28:00 +0000 (16:28 +1000)]
Add BPF target to platform-support.md

3 years agoAdd support for BPF inline assembly
Alessandro Decina [Tue, 20 Apr 2021 09:03:10 +0000 (19:03 +1000)]
Add support for BPF inline assembly

3 years agoPass target features to bpf-linker
Alessandro Decina [Sun, 18 Apr 2021 07:45:08 +0000 (17:45 +1000)]
Pass target features to bpf-linker

3 years agoAdd BPF target to config.toml.example
Alessandro Decina [Sat, 5 Dec 2020 00:24:34 +0000 (00:24 +0000)]
Add BPF target to config.toml.example

3 years agoFix formatting
Alessandro Decina [Tue, 1 Dec 2020 21:15:09 +0000 (21:15 +0000)]
Fix formatting

3 years agoAdd BPF target
Alessandro Decina [Mon, 30 Nov 2020 19:41:57 +0000 (19:41 +0000)]
Add BPF target

This change adds the bpfel-unknown-none and bpfeb-unknown-none targets
which can be used to generate little endian and big endian BPF

3 years agoAuto merge of #85594 - Dylan-DPC:rollup-40sgqgg, r=Dylan-DPC
bors [Sun, 23 May 2021 03:24:27 +0000 (03:24 +0000)]
Auto merge of #85594 - Dylan-DPC:rollup-40sgqgg, r=Dylan-DPC

Rollup of 6 pull requests

Successful merges:

 - #84758 (MSVC: Avoid using jmp stubs for dll function imports)
 - #85288 (add an example to explain std::io::Read::read returning 0 in some cases)
 - #85334 (Add doc aliases to `unit`)
 - #85525 (Fix my mailmap entry)
 - #85571 (Remove surplus prepend LinkedList fn)
 - #85575 (Fix auto-hide for implementations and implementors.)

Failed merges:

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

3 years agoRollup merge of #85575 - jsha:fix-toggle-settings, r=GuillaumeGomez
Dylan DPC [Sun, 23 May 2021 01:23:47 +0000 (03:23 +0200)]
Rollup merge of #85575 - jsha:fix-toggle-settings, r=GuillaumeGomez

Fix auto-hide for implementations and implementors.

This sets their toggles to be closed in the HTML (matching the default
setting), and opens them if the setting indicates to do so.

This distinguishes between implementations and implementors based on
being descendants of certain named elements.

Demo https://hoffman-andrews.com/rust/fix-toggle-settings/std/io/trait.Read.html#implementors
and https://hoffman-andrews.com/rust/fix-toggle-settings/std/string/struct.String.html#trait-implementations

Fixes #85411

r? `@GuillaumeGomez`

3 years agoRollup merge of #85571 - workingjubilee:reverse-prepend, r=Amanieu
Dylan DPC [Sun, 23 May 2021 01:23:47 +0000 (03:23 +0200)]
Rollup merge of #85571 - workingjubilee:reverse-prepend, r=Amanieu

Remove surplus prepend LinkedList fn

This nightly library feature provides a function on `LinkedList<T>` that is identical to `fn append` with a reversed order of arguments. Observe this diff against the `fn append` doctest:
```diff
+#![feature(linked_list_prepend)]
 fn main() {
    use std::collections::LinkedList;
    let mut list1 = LinkedList::new();
    list1.push_back('a');
    let mut list2 = LinkedList::new();
    list2.push_back('b');
    list2.push_back('c');

-    list1.append(&mut list2);
+    list2.prepend(&mut list1);

-    let mut iter = list1.iter();
+    let mut iter = list2.iter();
     assert_eq!(iter.next(), Some(&'a'));
     assert_eq!(iter.next(), Some(&'b'));
     assert_eq!(iter.next(), Some(&'c'));
     assert!(iter.next().is_none());

-    assert!(list2.is_empty());
+    assert!(list1.is_empty());
 }
```

As this has received no obvious request to stabilize it, nor does it have a tracking issue, and was left on nightly and the consensus seems to have been to deprecate it in this pre-1.0 PR in 2014, https://github.com/rust-lang/rust/pull/20356, I propose simply removing it.

3 years agoRollup merge of #85525 - camelid:fix-mailmap, r=Mark-Simulacrum
Dylan DPC [Sun, 23 May 2021 01:23:46 +0000 (03:23 +0200)]
Rollup merge of #85525 - camelid:fix-mailmap, r=Mark-Simulacrum

Fix my mailmap entry

r? `@Mark-Simulacrum`

3 years agoRollup merge of #85334 - r00ster91:patch-8, r=dtolnay
Dylan DPC [Sun, 23 May 2021 01:23:41 +0000 (03:23 +0200)]
Rollup merge of #85334 - r00ster91:patch-8, r=dtolnay

Add doc aliases to `unit`

I think it makes sense for `unit` to have the same doc aliases as `tuple` does.

3 years agoRollup merge of #85288 - Geal:clarify-std-io-read, r=dtolnay
Dylan DPC [Sun, 23 May 2021 01:23:37 +0000 (03:23 +0200)]
Rollup merge of #85288 - Geal:clarify-std-io-read, r=dtolnay

add an example to explain std::io::Read::read returning 0 in some cases

I have always found the explanation about `Read::read` returning 0 to indicate EOF but not indefinitely, so here's more info using Linux as example. I can also add example code if necessary

3 years agoRollup merge of #84758 - ChrisDenton:dllimport, r=dtolnay
Dylan DPC [Sun, 23 May 2021 01:23:34 +0000 (03:23 +0200)]
Rollup merge of #84758 - ChrisDenton:dllimport, r=dtolnay

MSVC: Avoid using jmp stubs for dll function imports

Windows import libraries contain two symbols for every function: `__imp_FunctionName` and `FunctionName` (where `FunctionName` is the name of the function to be imported).

`__imp_FunctionName` contains the address of the imported function. This will be filled in by the Windows executable loader at runtime. `FunctionName` contains a jmp stub that simply jumps to the address given by `__imp_FunctionName`. E.g. it's a function that solely contains a single jmp instruction:

```asm
jmp __imp_FunctionName
```

When using an external DLL function in Rust, by default the linker will link to FunctionName, causing a bit of indirection at runtime. In Microsoft's C++ it's possible to instead tell it to insert calls to the address in `__imp_FunctionName` by using the  `__declspec(dllimport)` attribute. In Rust it's possible to get effectively the same behaviour using the `#[link]` attribute on `extern` blocks.

----

The second commit also merges multiple `extern` blocks into one block. This is because otherwise Rust will currently create duplicate linker arguments for each block. In this case having duplicates shouldn't matter much other than the noise when displaying the linker command.

3 years agoAuto merge of #81601 - jyn514:llvm-on-demand, r=Mark-Simulacrum
bors [Sun, 23 May 2021 00:40:48 +0000 (00:40 +0000)]
Auto merge of #81601 - jyn514:llvm-on-demand, r=Mark-Simulacrum

Move llvm submodule updates to rustbuild

This enables better caching, since LLVM is only updated when needed, not
whenever x.py is run. Before, bootstrap.py had to use heuristics to
guess if LLVM would be needed, and updated the module more often than
necessary as a result.

This syncs the LLVM submodule only just before building the compiler, so
people working on the standard library never have to worry about it.
Example output:

```
Copying stage0 std from stage0 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
Updating submodule src/llvm-project
Submodule 'src/llvm-project' (https://github.com/rust-lang/llvm-project.git) registered for path 'src/llvm-project'
Submodule path 'src/llvm-project': checked out 'f9a8d70b6e0365ac2172ca6b7f1de0341297458d'
```

Implements https://github.com/rust-lang/rust/issues/76653#issuecomment-770265169. This could be easily extended to other submodules, like `rust-by-example` and `rustc-dev-guide`, which aren't needed for cargo's workspace resolution.

3 years agoMove llvm submodule updates to rustbuild
Joshua Nelson [Sun, 31 Jan 2021 17:20:30 +0000 (12:20 -0500)]
Move llvm submodule updates to rustbuild

This enables better caching, since LLVM is only updated when needed, not
whenever x.py is run. Before, bootstrap.py had to use heuristics to
guess if LLVM would be needed, and updated the module more often than
necessary as a result.

This syncs the LLVM submodule only just before building the compiler, so
people working on the standard library never have to worry about it.
Example output:

```
Copying stage0 std from stage0 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
Updating submodule src/llvm-project
Submodule 'src/llvm-project' (https://github.com/rust-lang/llvm-project.git) registered for path 'src/llvm-project'
Submodule path 'src/llvm-project': checked out 'f9a8d70b6e0365ac2172ca6b7f1de0341297458d'
```

- Don't try to update the LLVM submodule when using system LLVM

  Previously, this would try to update LLVM unconditionally. Now the
  submodule is only initialized if `llvm-config` is not set.

- Don't update LLVM submodule in dry runs

  This prevents the following test failures:

  ```
  running 17 tests
  fatal: invalid gitfile format: /checkout/src/llvm-project/.git
  test builder::tests::defaults::build_cross_compile ... FAILED

  ---- builder::tests::defaults::build_default stdout ----
  thread 'main' panicked at 'command did not execute successfully: "git" "rev-parse" "HEAD"
  expected success, got: exit code: 128', src/build_helper/lib.rs:139:9
  ```

- Try running git without --progress if it fails the first time

  This avoids having to do version detection to see if --progress is
  supported or not.

- Don't try to update submodules when the source repository isn't managed by git

- Update LLVM submodules that have already been checked out

- Only check for whether the submodule should be updated in lib.rs; update
it unconditionally in native.rs

3 years agoAuto merge of #85578 - RalfJung:alloc-mem-extra, r=oli-obk
bors [Sat, 22 May 2021 20:04:52 +0000 (20:04 +0000)]
Auto merge of #85578 - RalfJung:alloc-mem-extra, r=oli-obk

CTFE get_alloc_extra_mut: also provide ref to MemoryExtra

This would let me use mutable references in more places in Stacked Borrows, avoiding some `RefCell` overhead. :)

r? `@oli-obk`

3 years agoAuto merge of #85078 - RalfJung:const_fn_unsize, r=oli-obk
bors [Sat, 22 May 2021 17:38:15 +0000 (17:38 +0000)]
Auto merge of #85078 - RalfJung:const_fn_unsize, r=oli-obk

stabilize const_fn_unsize

I will post a stabilization report and ask for FCP in https://github.com/rust-lang/rust/issues/64992.
This PR is for the implementation side of stabilization.

r? `@oli-obk`
Fixes https://github.com/rust-lang/rust/issues/64992

3 years agoFix auto-hide for implementations and implementors.
Jacob Hoffman-Andrews [Sat, 22 May 2021 04:24:03 +0000 (21:24 -0700)]
Fix auto-hide for implementations and implementors.

This sets their toggles to be closed in the HTML (matching the default
setting), and opens them if the setting indicates to do so.

This distinguishes between implementations and implementors based on
being descendants of certain named elements.

3 years agoAuto merge of #85514 - GuillaumeGomez:upgrade-minifer-version, r=Mark-Simulacrum
bors [Sat, 22 May 2021 14:54:45 +0000 (14:54 +0000)]
Auto merge of #85514 - GuillaumeGomez:upgrade-minifer-version, r=Mark-Simulacrum

Upgrade minifier version to 0.0.41

3 years agoCTFE get_alloc_extra_mut: also provide ref to MemoryExtra
Ralf Jung [Sat, 22 May 2021 13:20:20 +0000 (15:20 +0200)]
CTFE get_alloc_extra_mut: also provide ref to MemoryExtra

3 years agoAuto merge of #85557 - hyd-dev:abi, r=RalfJung
bors [Sat, 22 May 2021 11:49:13 +0000 (11:49 +0000)]
Auto merge of #85557 - hyd-dev:abi, r=RalfJung

Add `rustc_mir::interpret::Machine::enforce_abi()`

To specify whether to skip the [ABI](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_target/abi/enum.Abi.html) check for function calls, so that we could test unwinding out of a `extern "C"` function call in Miri by disabling the check: https://github.com/rust-lang/miri/pull/1776#discussion_r633698382

I have tested that it works in Miri with a `-Zmiri-disable-abi-check` command line flag.

3 years agoAdd default implementation for `enforce_abi()`
hyd-dev [Sat, 22 May 2021 11:04:28 +0000 (19:04 +0800)]
Add default implementation for `enforce_abi()`

3 years agoconst_fn_unsize: check that the cast behaves correctly
Ralf Jung [Sat, 8 May 2021 14:36:39 +0000 (16:36 +0200)]
const_fn_unsize: check that the cast behaves correctly

3 years agostabilize const_fn_unsize
Ralf Jung [Sat, 8 May 2021 14:28:29 +0000 (16:28 +0200)]
stabilize const_fn_unsize

3 years agoAuto merge of #85568 - GuillaumeGomez:search-result-extra-info, r=jsha
bors [Sat, 22 May 2021 07:07:38 +0000 (07:07 +0000)]
Auto merge of #85568 - GuillaumeGomez:search-result-extra-info, r=jsha

Search result extra info

The CSS rule was not updated when we updated the search result, this fixes it:

Before:
![Screenshot from 2021-05-21 22-56-17](https://user-images.githubusercontent.com/3050060/119197314-d31a4e80-ba87-11eb-863a-bc0b3de3bfb2.png)

After:
![Screenshot from 2021-05-21 22-54-53](https://user-images.githubusercontent.com/3050060/119197227-b54ce980-ba87-11eb-9f43-c10803ca1b90.png)

r? `@jsha`

3 years agoAuto merge of #85531 - luqmana:flip-gc, r=petrochenkov
bors [Sat, 22 May 2021 04:42:36 +0000 (04:42 +0000)]
Auto merge of #85531 - luqmana:flip-gc, r=petrochenkov

Swap TargetOptions::linker_is_gnu default from false to true and update targets as appropriate.

#85274 gated the `--gc-sections` flag on targets that specified `linker_is_gnu` to stop us from passing it to incompatible linkers. But that had the unintended effect of the flag no longer being passed on targets for which it is valid and hence caused a regression in binary size. Given that most `ld`-style linkers are GNU compatible, this change flips our default for `linker_is_gnu` from false to true. That also means updating the targets that relied on the previous default:
* Apple
* Illumos
* L4Re (not sure about this one)
* MSVC
* NvtPtx
* Solaris

Fixes #85519

3 years agoAuto merge of #85505 - flip1995:clippyup, r=Manishearth
bors [Sat, 22 May 2021 01:59:57 +0000 (01:59 +0000)]
Auto merge of #85505 - flip1995:clippyup, r=Manishearth

Update Clippy

Bi-weekly Clippy update

r? `@Manishearth`

3 years agoRemove surplus prepend LinkedList fn
Jubilee Young [Fri, 21 May 2021 23:05:07 +0000 (16:05 -0700)]
Remove surplus prepend LinkedList fn

Originally committed to Rust in 2013, it is identical to append
with a reversed order of arguments.

3 years agoAdd test for search result keyword extra info
Guillaume Gomez [Fri, 21 May 2021 20:53:50 +0000 (22:53 +0200)]
Add test for search result keyword extra info

3 years agoFix display for primitive and keyword extra info
Guillaume Gomez [Fri, 21 May 2021 20:53:31 +0000 (22:53 +0200)]
Fix display for primitive and keyword extra info

3 years agoAuto merge of #85560 - GuillaumeGomez:rollup-8k90rc7, r=GuillaumeGomez
bors [Fri, 21 May 2021 19:17:22 +0000 (19:17 +0000)]
Auto merge of #85560 - GuillaumeGomez:rollup-8k90rc7, r=GuillaumeGomez

Rollup of 4 pull requests

Successful merges:

 - #85506 (Reset "focusedByTab" field when doing another search)
 - #85548 (Remove dead toggle JS code)
 - #85550 (facepalm: operator precedence fail on my part.)
 - #85555 (Check for more things in THIR unsafeck)

Failed merges:

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

3 years agoRollup merge of #85555 - LeSeulArtichaut:thir-unsafeck, r=nikomatsakis
Guillaume Gomez [Fri, 21 May 2021 18:06:09 +0000 (20:06 +0200)]
Rollup merge of #85555 - LeSeulArtichaut:thir-unsafeck, r=nikomatsakis

Check for more things in THIR unsafeck

Reunion of #85306, #85381 and #85419 with conflicts resolved.
r? `@nikomatsakis`

3 years agoRollup merge of #85550 - pnkfelix:fix-max-rss-division-on-mac, r=Mark-Simulacrum
Guillaume Gomez [Fri, 21 May 2021 18:06:08 +0000 (20:06 +0200)]
Rollup merge of #85550 - pnkfelix:fix-max-rss-division-on-mac, r=Mark-Simulacrum

facepalm: operator precedence fail on my part.

This bug was only visible on mac. Also, print_step_rusage is a relatively new
internal feature, that is not heavily used, and has no tests. All of these
factors contributed to how this went uncaught this long. Thanks to Josh Triplett
for pointing it out!

3 years agoRollup merge of #85548 - GuillaumeGomez:remove-dead-js, r=jsha
Guillaume Gomez [Fri, 21 May 2021 18:06:07 +0000 (20:06 +0200)]
Rollup merge of #85548 - GuillaumeGomez:remove-dead-js, r=jsha

Remove dead toggle JS code

Explanations on how I got there: I randomly saw `adjustToggle` while browsing through code, checked where it was called, put a `debugger;` instruction in it and checked on all pages while playing with settings and toggles. The breakpoint was never triggered. I then looked at `collapseNonInherent` (its grand-parent). In there, the breakpoint was triggered so I look at what was being done and in fact... nothing. So I simply removed it all, re-ran the tests and play with the UI. Everything is working as expected.

Better double check in case I forgot to check a case though, but if nothing has been left out, then it's a great cleanup once again. :)

r? ``@jsha``

3 years agoRollup merge of #85506 - GuillaumeGomez:reset-focusedByTab, r=jsha
Guillaume Gomez [Fri, 21 May 2021 18:06:06 +0000 (20:06 +0200)]
Rollup merge of #85506 - GuillaumeGomez:reset-focusedByTab, r=jsha

Reset "focusedByTab" field when doing another search

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

The problem was simply that we forget to reset the `focusedByTab` field, which was still referring to removed DOM elements.

r? ``@jsha``

3 years agoCheck for use of mutable/extern statics in THIR unsafeck
LeSeulArtichaut [Sun, 16 May 2021 22:29:54 +0000 (00:29 +0200)]
Check for use of mutable/extern statics in THIR unsafeck

3 years agoAuto merge of #85511 - Mark-Simulacrum:eq-not-sup, r=nikomatsakis
bors [Fri, 21 May 2021 16:36:36 +0000 (16:36 +0000)]
Auto merge of #85511 - Mark-Simulacrum:eq-not-sup, r=nikomatsakis

Adjust self-type check to require equality

When we encounter `SomeType::<X>::foo`, `self_ty` is `SomeType<X>` and the method is defined in an impl on `SomeType<A>`. Previously, we required simply that `self_ty <: impl_ty`, but this is too lax: we should require equality in order to use the method. This was found as part of unrelated work on never type stabilization, but also fixes one of the wf test cases.

3 years agoCheck for ptr-to-int casts in const functions in THIR unsafeck
LeSeulArtichaut [Sat, 15 May 2021 14:29:57 +0000 (16:29 +0200)]
Check for ptr-to-int casts in const functions in THIR unsafeck

3 years agoCheck for initialization of layout-restricted types
LeSeulArtichaut [Sat, 15 May 2021 13:26:28 +0000 (15:26 +0200)]
Check for initialization of layout-restricted types

3 years agofacepalm: operator precedence fail on my part.
Felix S. Klock II [Fri, 21 May 2021 14:48:36 +0000 (10:48 -0400)]
facepalm: operator precedence fail on my part.

This bug was only visible on mac. Also, print_step_rusage is a relatively new
internal feature, that is not heavily used, and has no tests. All of these
factors contributed to how this went uncaught this long. Thanks to Josh Triplett
for pointing it out!

3 years agoAdd `rustc_mir::interpret::Machine::enforce_abi()`
hyd-dev [Fri, 21 May 2021 14:19:37 +0000 (22:19 +0800)]
Add `rustc_mir::interpret::Machine::enforce_abi()`

3 years agoAdjust self-type to require equality
Mark Rousskov [Thu, 20 May 2021 14:15:56 +0000 (10:15 -0400)]
Adjust self-type to require equality

3 years agoRemove dead toggle JS code
Guillaume Gomez [Fri, 21 May 2021 13:50:55 +0000 (15:50 +0200)]
Remove dead toggle JS code

3 years agoAuto merge of #85482 - scottmcm:more-try-bootstrap, r=yaahc
bors [Fri, 21 May 2021 13:46:04 +0000 (13:46 +0000)]
Auto merge of #85482 - scottmcm:more-try-bootstrap, r=yaahc

`#[cfg(bootstrap)]` out `NoneError` and other v1 try_trait stuff

Closes #46871

r? `@yaahc`

3 years agoAuto merge of #85416 - durin42:llvm-catchup-may-2021, r=nagisa
bors [Fri, 21 May 2021 11:21:06 +0000 (11:21 +0000)]
Auto merge of #85416 - durin42:llvm-catchup-may-2021, r=nagisa

PassWrapper: update for LLVM change D102093

In https://reviews.llvm.org/D102093 lots of things stopped taking the
DebugLogging boolean parameter. Mercifully we appear to always set
DebugPassManager to false, so I don't think we're losing anything by not
passing this parameter.

3 years agoAuto merge of #85400 - lnicola:rust-analyzer-2021-05-17, r=jonas-schievink
bors [Fri, 21 May 2021 08:33:36 +0000 (08:33 +0000)]
Auto merge of #85400 - lnicola:rust-analyzer-2021-05-17, r=jonas-schievink

:arrow_up: rust-analyzer

3 years agoRemove linker_is_gnu: true cases as that is now the default.
Luqman Aden [Fri, 21 May 2021 06:36:04 +0000 (23:36 -0700)]
Remove linker_is_gnu: true cases as that is now the default.

3 years agoAuto merge of #85060 - ChrisDenton:win-file-exists, r=yaahc
bors [Fri, 21 May 2021 05:47:24 +0000 (05:47 +0000)]
Auto merge of #85060 - ChrisDenton:win-file-exists, r=yaahc

Windows implementation of feature `path_try_exists`

Draft of a Windows implementation of `try_exists` (#83186).

The first commit reorganizes the code so I would be interested to get some feedback on if this is a good idea or not. It moves the `Path::try_exists` function to `fs::exists`. leaving the former as a wrapper for the latter. This makes it easier to provide platform specific implementations and matches the `fs::metadata` function.

The other commit implements a Windows specific variant of `exists`. I'm still figuring out my approach so this is very much a first draft. Eventually this will need some more eyes from knowledgable Windows people.

3 years agoAuto merge of #85382 - Aaron1011:project-eval, r=nikomatsakis
bors [Fri, 21 May 2021 02:39:39 +0000 (02:39 +0000)]
Auto merge of #85382 - Aaron1011:project-eval, r=nikomatsakis

Always produce sub-obligations when using cached projection result

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

When we skip adding the sub-obligations to the `obligation` list, we can affect whether or not the final result is `EvaluatedToOk` or `EvaluatedToOkModuloObligations`. This creates problems for incremental compilation, since the projection cache is untracked shared state.

To solve this issue, we unconditionally process the sub-obligations. Surprisingly, this is a slight performance *win* in many cases.

3 years agoAuto merge of #85524 - RalfJung:miri, r=RalfJung
bors [Thu, 20 May 2021 23:53:36 +0000 (23:53 +0000)]
Auto merge of #85524 - RalfJung:miri, r=RalfJung

update miri

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

3 years agoSwap TargetOptions::linker_is_gnu default from false to true and update targets as...
Luqman Aden [Thu, 20 May 2021 23:38:40 +0000 (16:38 -0700)]
Swap TargetOptions::linker_is_gnu default from false to true and update targets as appropriate.

3 years agoAuto merge of #85521 - alexcrichton:less-tls-inline, r=Mark-Simulacrum
bors [Thu, 20 May 2021 21:11:19 +0000 (21:11 +0000)]
Auto merge of #85521 - alexcrichton:less-tls-inline, r=Mark-Simulacrum

std: Don't inline TLS accessor on MinGW

This is causing [issues] on Cargo's own CI for MinGW and given the
original investigation there's no reason that MinGW should work when
MSVC doesn't, this this tweaks the MSVC exception to being a Windows exception.

[issues]: https://github.com/rust-lang/cargo/runs/2626676503?check_suite_focus=true#step:9:2453

3 years agoFix my mailmap entry
Noah Lev [Mon, 17 May 2021 23:03:08 +0000 (16:03 -0700)]
Fix my mailmap entry

3 years agoupdate miri
Ralf Jung [Thu, 20 May 2021 20:05:08 +0000 (22:05 +0200)]
update miri

3 years agostd: Don't inline TLS accessor on MinGW
Alex Crichton [Thu, 20 May 2021 19:45:05 +0000 (12:45 -0700)]
std: Don't inline TLS accessor on MinGW

This is causing [issues] on Cargo's own CI for MinGW and given the
original investigation there's no reason that MinGW should work when
MSVC doesn't, this this tweaks the MSVC exception to being a Windows exception.

[issues]: https://github.com/rust-lang/cargo/runs/2626676503?check_suite_focus=true#step:9:2453

3 years agoAuto merge of #85518 - GuillaumeGomez:rollup-mq4ohfy, r=GuillaumeGomez
bors [Thu, 20 May 2021 18:30:26 +0000 (18:30 +0000)]
Auto merge of #85518 - GuillaumeGomez:rollup-mq4ohfy, r=GuillaumeGomez

Rollup of 5 pull requests

Successful merges:

 - #85275 (Move `std::memchr` to `sys_common`)
 - #85326 (bootstrap: ensure host std when cross-compiling tools, fixes #85320)
 - #85375 (Fix missing lifetimes diagnostics after #83759)
 - #85507 (Extend escape key check)
 - #85509 (Prevent tab title to "null" if the URL is a search one)

Failed merges:

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

3 years agoRollup merge of #85509 - GuillaumeGomez:search-null-title, r=jsha
Guillaume Gomez [Thu, 20 May 2021 15:56:58 +0000 (17:56 +0200)]
Rollup merge of #85509 - GuillaumeGomez:search-null-title, r=jsha

Prevent tab title to "null" if the URL is a search one

When we arrive on page with a search parameter in the URL, until the results are displayed, the page title is "null". It's because of this code:

```js
if (params.search !== undefined) {
    var search = searchState.outputElement();
    search.innerHTML = "<h3 style=\"text-align: center;\">" +
       searchState.loadingText + "</h3>";
    searchState.showResults(search);
    loadSearch();
}
```

In `searchState.showResults`, we have this:

```js
document.title = searchState.title;
```

But since it's `null`, we set it as title. This PR fixes it.

r? `@jsha`

3 years agoRollup merge of #85507 - GuillaumeGomez:extend-escape-key-check, r=jsha
Guillaume Gomez [Thu, 20 May 2021 15:56:57 +0000 (17:56 +0200)]
Rollup merge of #85507 - GuillaumeGomez:extend-escape-key-check, r=jsha

Extend escape key check

Since #84462 has been merged, we can now extend the `escape-key` test.

r? `@jsha`

3 years agoRollup merge of #85375 - SkiFire13:fix-85347, r=jackh726
Guillaume Gomez [Thu, 20 May 2021 15:56:56 +0000 (17:56 +0200)]
Rollup merge of #85375 - SkiFire13:fix-85347, r=jackh726

Fix missing lifetimes diagnostics after #83759

In #83759 while rebasing I didn't realize there was a new function for suggesting to add lifetime arguments. It relied on some invariants, namely that if a generic type/trait has angle brackets then it must have some generic argument, which is now no longer true. This PR updates that function to handle the new invariants.

This also adds a new regression test but I'm not sure if that's the correct place for it.

Fixes #85347

3 years agoRollup merge of #85326 - infinity0:fix-cross-compile-tools, r=Mark-Simulacrum
Guillaume Gomez [Thu, 20 May 2021 15:56:51 +0000 (17:56 +0200)]
Rollup merge of #85326 - infinity0:fix-cross-compile-tools, r=Mark-Simulacrum

bootstrap: ensure host std when cross-compiling tools, fixes #85320

3 years agoRollup merge of #85275 - CDirkx:memchr, r=m-ou-se
Guillaume Gomez [Thu, 20 May 2021 15:56:46 +0000 (17:56 +0200)]
Rollup merge of #85275 - CDirkx:memchr, r=m-ou-se

Move `std::memchr` to `sys_common`

`std::memchr` is a thin abstraction over the different `memchr` implementations in `sys`, along with documentation and tests. The module is only used internally by `std`, nothing is exported externally. Code like this is exactly what the `sys_common` module is for, so this PR moves it there.

3 years agoAuto merge of #85493 - Amanieu:fix_85446, r=dtolnay
bors [Thu, 20 May 2021 15:49:31 +0000 (15:49 +0000)]
Auto merge of #85493 - Amanieu:fix_85446, r=dtolnay

Update stdarch to fix x86 byte shift intrinsics

Fixes #85446

3 years agoUpgrade minifier version to 0.0.41
Guillaume Gomez [Thu, 20 May 2021 14:51:44 +0000 (16:51 +0200)]
Upgrade minifier version to 0.0.41

3 years agoPrevent tab title to "null" if the URL is a search one
Guillaume Gomez [Thu, 20 May 2021 14:01:08 +0000 (16:01 +0200)]
Prevent tab title to "null" if the URL is a search one

3 years agoAuto merge of #84665 - adamgemmell:aarch64-features, r=Amanieu
bors [Thu, 20 May 2021 13:07:35 +0000 (13:07 +0000)]
Auto merge of #84665 - adamgemmell:aarch64-features, r=Amanieu

Update list of allowed aarch64 features

I recently added these features to std_detect for aarch64 linux, pending [review](https://github.com/rust-lang/stdarch/pull/1146).

I have commented any features not supported by LLVM 9, the current minimum version for Rust. Some (PAuth at least) were renamed between 9 & 12 and I've left them disabled. TME, however, is not in LLVM 9 but I've left it enabled.

See https://github.com/rust-lang/stdarch/issues/993

3 years agoExtend escape key check
Guillaume Gomez [Thu, 20 May 2021 11:37:29 +0000 (13:37 +0200)]
Extend escape key check

3 years agoMerge commit '9e3cd88718cd1912a515d26dbd9c4019fd5a9577' into clippyup
flip1995 [Thu, 20 May 2021 10:30:31 +0000 (12:30 +0200)]
Merge commit '9e3cd88718cd1912a515d26dbd9c4019fd5a9577' into clippyup

3 years agoReset "focusedByTab" field when doing another search
Guillaume Gomez [Thu, 20 May 2021 10:45:25 +0000 (12:45 +0200)]
Reset "focusedByTab" field when doing another search

3 years agoAuto merge of #7252 - flip1995:rustup, r=flip1995
bors [Thu, 20 May 2021 10:07:36 +0000 (10:07 +0000)]
Auto merge of #7252 - flip1995:rustup, r=flip1995

Rustup

r? `@ghost`

cc `@xFrednet` There was a change to the `rustc_span::FileName` removing the `Display` impl for it. I adapted the metadata collector to compile with that change. I'm not sure if I changed the behavior with this. The path to the string is now printed relative to the `clippy_lints` dir. So for example `src/swap.rs`. I think this should be fine, but probably something to be aware of.

changelog: none

3 years agoBump nightly version -> 2021-05-20
flip1995 [Thu, 20 May 2021 10:06:22 +0000 (12:06 +0200)]
Bump nightly version -> 2021-05-20

3 years agoMerge remote-tracking branch 'upstream/master' into rustup
flip1995 [Thu, 20 May 2021 09:59:34 +0000 (11:59 +0200)]
Merge remote-tracking branch 'upstream/master' into rustup

3 years agoAuto merge of #85486 - RalfJung:rollup-4ibcxuu, r=RalfJung
bors [Thu, 20 May 2021 07:39:24 +0000 (07:39 +0000)]
Auto merge of #85486 - RalfJung:rollup-4ibcxuu, r=RalfJung

Rollup of 8 pull requests

Successful merges:

 - #84717 (impl FromStr for proc_macro::Literal)
 - #85169 (Add method-toggle to <details> for methods)
 - #85287 (Expose `Concurrent` (private type in public i'face))
 - #85315 (adding time complexity for partition_in_place iter method)
 - #85439 (Add diagnostic item to `CStr`)
 - #85464 (Fix UB in documented example for `ptr::swap`)
 - #85470 (Fix invalid CSS rules for a:hover)
 - #85472 (CTFE Machine: do not expose Allocation)

Failed merges:

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

3 years agoAuto merge of #84697 - CDirkx:util, r=m-ou-se
bors [Thu, 20 May 2021 04:58:13 +0000 (04:58 +0000)]
Auto merge of #84697 - CDirkx:util, r=m-ou-se

Introduce `sys_common::rt::rtprintpanic!` to replace `sys_common::util` functionality

This PR introduces a new macro `rtprintpanic!`, similar to `sys_common::util::dumb_print` and uses that macro to replace all `sys_common::util` functionality.

3 years agoAdd track_caller to `builder_helper::output`
Joshua Nelson [Wed, 3 Feb 2021 16:22:35 +0000 (11:22 -0500)]
Add track_caller to `builder_helper::output`

If something goes wrong here, showing `fn output` is unhelpful. Show
where the command is being run instead.

3 years agoAuto merge of #85391 - Mark-Simulacrum:opt-tostring, r=scottmcm
bors [Thu, 20 May 2021 00:55:27 +0000 (00:55 +0000)]
Auto merge of #85391 - Mark-Simulacrum:opt-tostring, r=scottmcm

Avoid zero-length memcpy in formatting

This has two separate and somewhat orthogonal commits. The first change adjusts the ToString general impl for all types that implement Display; it no longer uses the full format machinery, rather directly falling onto a `std::fmt::Display::fmt` call. The second change directly adjusts the general core::fmt::write function which handles the production of format_args! to avoid zero-length push_str calls.

Both changes target the fact that push_str will still call memmove internally (or a similar function), as it doesn't know the length of the passed string. For zero-length strings in particular, this is quite expensive, and even for very short (several bytes long) strings, this is also expensive. Future work in this area may wish to have us fallback to write_char or similar, which may be cheaper on the (typically) short strings between the interpolated pieces in format_args!.

3 years agoUpdate stdarch to fix x86 byte shift intrinsics
Amanieu d'Antras [Thu, 20 May 2021 00:51:05 +0000 (01:51 +0100)]
Update stdarch to fix x86 byte shift intrinsics

Fixes #85446

3 years agoWindows implementation of `fs::try_exists`
Chris Denton [Tue, 18 May 2021 03:18:46 +0000 (04:18 +0100)]
Windows implementation of `fs::try_exists`

3 years agoMove the implementation of `Path::exists` to `sys_common::fs` so platforms can specia...
Chris Denton [Wed, 17 Mar 2021 03:52:02 +0000 (03:52 +0000)]
Move the implementation of `Path::exists` to `sys_common::fs` so platforms can specialize it

Windows implementation of `fs::try_exists`

3 years agoRollup merge of #85472 - RalfJung:allocation, r=oli-obk
Ralf Jung [Wed, 19 May 2021 22:19:09 +0000 (00:19 +0200)]
Rollup merge of #85472 - RalfJung:allocation, r=oli-obk

CTFE Machine: do not expose Allocation

`Memory` is careful now to not expose direct access to `Allocation`, but this one slipped through.
r? ``@oli-obk``

3 years agoRollup merge of #85470 - GuillaumeGomez:fix-css-rules, r=jsha
Ralf Jung [Wed, 19 May 2021 22:19:08 +0000 (00:19 +0200)]
Rollup merge of #85470 - GuillaumeGomez:fix-css-rules, r=jsha

Fix invalid CSS rules for a:hover

When hovering some links:

![Screenshot from 2021-05-19 15-00-31](https://user-images.githubusercontent.com/3050060/118823585-5f2a4b80-b8b9-11eb-8043-bb7759a178c7.png)
![Screenshot from 2021-05-19 15-00-29](https://user-images.githubusercontent.com/3050060/118823566-5b96c480-b8b9-11eb-8c4e-08e490752fbf.png)

It is a side-effect from #84462.

r? ```@jsha```

3 years agoRollup merge of #85464 - steffahn:fix_ub_in_ptr_swap_docs, r=dtolnay
Ralf Jung [Wed, 19 May 2021 22:19:08 +0000 (00:19 +0200)]
Rollup merge of #85464 - steffahn:fix_ub_in_ptr_swap_docs, r=dtolnay

Fix UB in documented example for `ptr::swap`

Compare [this (short) discussion on zulip](https://rust-lang.zulipchat.com/#narrow/stream/122651-general/topic/Pointers.20to.20overlapping.20arrays) (or [in the archive](https://zulip-archive.rust-lang.org/122651general/92017Pointerstooverlappingarrays.html), if you don’t have an account).

``@rustbot`` label T-doc T-libs

3 years agoRollup merge of #85439 - mgacek8:add_diagnostic_item_to_CStr_type, r=davidtwco
Ralf Jung [Wed, 19 May 2021 22:19:07 +0000 (00:19 +0200)]
Rollup merge of #85439 - mgacek8:add_diagnostic_item_to_CStr_type, r=davidtwco

Add diagnostic item to `CStr`

Required for clippy issue: https://github.com/rust-lang/rust-clippy/issues/7145

3 years agoRollup merge of #85315 - satylogin:master, r=yaahc
Ralf Jung [Wed, 19 May 2021 22:19:02 +0000 (00:19 +0200)]
Rollup merge of #85315 - satylogin:master, r=yaahc

adding time complexity for partition_in_place iter method

I feel that one thing missing from rust docs compared to cpp references is existence of time complexity for all methods and functions. While it would be humongous task to include it for everything in single go, it is still doable if we as community keep on adding it in relevant places as and when we find them.

This PR adds the time complexity for partition_in_place method in iter.

3 years agoRollup merge of #85287 - eggyal:expose-test-concurrent, r=m-ou-se
Ralf Jung [Wed, 19 May 2021 22:18:58 +0000 (00:18 +0200)]
Rollup merge of #85287 - eggyal:expose-test-concurrent, r=m-ou-se

Expose `Concurrent` (private type in public i'face)

#53410 introduced experimental support for custom test frameworks.

Such frameworks may wish to build upon `library/test` by calling into its publicly exposed API (which I entirely understand is wholly unstable).  However, any that wish to call `test::run_test` cannot currently do so because `test::options::Concurrent` (the type of its `concurrent` parameter) is not publicly exposed.

3 years agoRollup merge of #85169 - jsha:hoist-classes, r=GuillaumeGomez
Ralf Jung [Wed, 19 May 2021 22:18:57 +0000 (00:18 +0200)]
Rollup merge of #85169 - jsha:hoist-classes, r=GuillaumeGomez

Add method-toggle to <details> for methods

The makes the code for handling "auto-hide" settings more consistent.

Demo at https://hoffman-andrews.com/rust/hoist-classes/std/string/struct.String.html

Fixes #84829

3 years agoRollup merge of #84717 - dtolnay:literalfromstr, r=petrochenkov
Ralf Jung [Wed, 19 May 2021 22:18:56 +0000 (00:18 +0200)]
Rollup merge of #84717 - dtolnay:literalfromstr, r=petrochenkov

impl FromStr for proc_macro::Literal

Note that unlike `impl FromStr for proc_macro::TokenStream`, this impl does not permit whitespace or comments. The input string must consist of nothing but your literal.

- `"1".parse::<Literal>()` ⟶ ok

- `"1.0".parse::<Literal>()` ⟶ ok

- `"'a'".parse::<Literal>()` ⟶ ok

- `"\"\n\"".parse::<Literal>()` ⟶ ok

- `"0 1".parse::<Literal>()` ⟶ LexError

- `" 0".parse::<Literal>()` ⟶ LexError

- `"0 ".parse::<Literal>()` ⟶ LexError

- `"/* comment */0".parse::<Literal>()` ⟶ LexError

- `"0/* comment */".parse::<Literal>()` ⟶ LexError

- `"0// comment".parse::<Literal>()` ⟶ LexError

---

## Use case

```rust
let hex_int: Literal = format!("0x{:x}", int).parse().unwrap();
```

The only way this is expressible in the current API is significantly worse.

```rust
let hex_int = match format!("0x{:x}", int)
    .parse::<TokenStream>()
    .unwrap()
    .into_iter()
    .next()
    .unwrap()
{
    TokenTree::Literal(literal) => literal,
    _ => unreachable!(),
};
```

3 years agoCheck for calls to functions with `#[target_feature]` in THIR unsafeck
LeSeulArtichaut [Fri, 14 May 2021 21:52:34 +0000 (23:52 +0200)]
Check for calls to functions with `#[target_feature]` in THIR unsafeck

3 years agoCheck for raw pointer dereference in THIR unsafeck
LeSeulArtichaut [Fri, 14 May 2021 21:19:59 +0000 (23:19 +0200)]
Check for raw pointer dereference in THIR unsafeck

3 years agoAuto merge of #85340 - the8472:no-inplaceiterable-on-peekable, r=yaahc
bors [Wed, 19 May 2021 21:50:45 +0000 (21:50 +0000)]
Auto merge of #85340 - the8472:no-inplaceiterable-on-peekable, r=yaahc

remove InPlaceIterable marker from Peekable due to unsoundness

The unsoundness is not in Peekable per se, it rather is due to the
interaction between Peekable being able to hold an extra item
and vec::IntoIter's clone implementation shortening the allocation.

An alternative solution would be to change IntoIter's clone implementation
to keep enough spare capacity available.

fixes #85322

3 years ago#[cfg(bootstrap)] out the v1 try_trait stuff
Scott McMurray [Wed, 19 May 2021 19:59:02 +0000 (12:59 -0700)]
#[cfg(bootstrap)] out the v1 try_trait stuff

3 years agoAuto merge of #83842 - LeSeulArtichaut:thir-vec, r=nikomatsakis
bors [Wed, 19 May 2021 18:41:23 +0000 (18:41 +0000)]
Auto merge of #83842 - LeSeulArtichaut:thir-vec, r=nikomatsakis

Store THIR in `IndexVec`s instead of an `Arena`

This is a necessary step to store the THIR in a query: #85273. See [relevant discussion on Zulip](https://rust-lang.zulipchat.com/#narrow/stream/278509-project-thir-unsafeck/topic/THIR-dependent.20queries.20design).

r? `@ghost` cc `@cjgillot` `@nikomatsakis`

3 years agoimpl FromStr for proc_macro::Literal
David Tolnay [Thu, 29 Apr 2021 19:08:35 +0000 (12:08 -0700)]
impl FromStr for proc_macro::Literal