]> git.lizzy.rs Git - rust.git/log
rust.git
3 years agoAdd a test for the shortness format in rustdoc
Alexis Bourget [Thu, 4 Feb 2021 17:59:42 +0000 (18:59 +0100)]
Add a test for the shortness format in rustdoc

3 years agoMake rustdoc respect `--error-format short`
Alexis Bourget [Tue, 2 Feb 2021 20:18:46 +0000 (21:18 +0100)]
Make rustdoc respect `--error-format short`

The other two (`human` and `json`) are already handled.

3 years agoAuto merge of #80843 - Mark-Simulacrum:fmt-bump, r=petrochenkov
bors [Tue, 2 Feb 2021 14:52:53 +0000 (14:52 +0000)]
Auto merge of #80843 - Mark-Simulacrum:fmt-bump, r=petrochenkov

Bump rustfmt version

3 years agoBump rustfmt version
Mark Rousskov [Sat, 9 Jan 2021 17:00:45 +0000 (12:00 -0500)]
Bump rustfmt version

Also switches on formatting of the mir build module

3 years agoAuto merge of #81660 - jonas-schievink:rollup-fz2lh78, r=jonas-schievink
bors [Tue, 2 Feb 2021 12:02:36 +0000 (12:02 +0000)]
Auto merge of #81660 - jonas-schievink:rollup-fz2lh78, r=jonas-schievink

Rollup of 11 pull requests

Successful merges:

 - #80629 (Add lint for 2229 migrations)
 - #81022 (Add Frames Iterator for Backtrace)
 - #81481 (move some tests)
 - #81485 (Add some tests for associated-type-bounds issues)
 - #81492 (rustdoc: Note why `rustdoc::html::markdown` is public)
 - #81577 (const_evaluatable: consider sub-expressions to be evaluatable)
 - #81599 (Implement `TrustedLen` for `Fuse<I: TrustedLen>`)
 - #81608 (Improve handling of spans around macro result parse errors)
 - #81609 (Remove the remains of query categories)
 - #81630 (Fix overflowing text on mobile when sidebar is displayed)
 - #81631 (Remove unneeded `mut` variable)

Failed merges:

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

3 years agoRollup merge of #81631 - LingMan:rem_var, r=davidtwco
Jonas Schievink [Tue, 2 Feb 2021 11:15:08 +0000 (12:15 +0100)]
Rollup merge of #81631 - LingMan:rem_var, r=davidtwco

Remove unneeded `mut` variable

`arg_elide` gets initialized, immediately cloned, and only written to after that.
The last reading access was removed back in
https://github.com/rust-lang/rust/commit/7704762604a8bf4504a06e8c9713bc7c158d362a

3 years agoRollup merge of #81630 - GuillaumeGomez:overflow-sidebar-title-text, r=pickfire
Jonas Schievink [Tue, 2 Feb 2021 11:15:06 +0000 (12:15 +0100)]
Rollup merge of #81630 - GuillaumeGomez:overflow-sidebar-title-text, r=pickfire

Fix overflowing text on mobile when sidebar is displayed

Fixes #81597.

Before:

![Screenshot from 2021-02-01 17-21-15](https://user-images.githubusercontent.com/3050060/106486857-610b0300-64b2-11eb-96d3-12b939f5b661.png)

After:

![Screenshot from 2021-02-01 17-20-59](https://user-images.githubusercontent.com/3050060/106486840-5cdee580-64b2-11eb-9492-4df27bb39e59.png)

cc `@pickfire`
r? `@Nemo157`

3 years agoRollup merge of #81609 - Julian-Wollersberger:no-query-categories, r=davidtwco
Jonas Schievink [Tue, 2 Feb 2021 11:15:04 +0000 (12:15 +0100)]
Rollup merge of #81609 - Julian-Wollersberger:no-query-categories, r=davidtwco

Remove the remains of query categories

Back in October 2020 in #77830 ``@cjgillot`` removed the query categories information from the profiler, but the actual definitions which query was in which category remained, although unused.
Here I clean that up, to simplify the query definitions even further.

It's unfortunate that this loses all the context for `git blame`, ~~but I'm working on moving those query definitions into `rustc_query_system`, which will lose that context anyway.~~ EDIT: Might not work out.

The functional changes are in the first commit. The second one only changes the indentation.

3 years agoRollup merge of #81608 - Aaron1011:macro-res-parse-err, r=davidtwco
Jonas Schievink [Tue, 2 Feb 2021 11:15:02 +0000 (12:15 +0100)]
Rollup merge of #81608 - Aaron1011:macro-res-parse-err, r=davidtwco

Improve handling of spans around macro result parse errors

Fixes #81543

After we expand a macro, we try to parse the resulting tokens as a AST
node. This commit makes several improvements to how we handle spans when
an error occurs:

* Only ovewrite the original `Span` if it's a dummy span. This preserves
  a more-specific span if one is available.
* Use `self.prev_token` instead of `self.token` when emitting an error
  message after encountering EOF, since an EOF token always has a dummy
  span
* Make `SourceMap::next_point` leave dummy spans unused. A dummy span
  does not have a logical 'next point', since it's a zero-length span.
  Re-using the span span preserves its 'dummy-ness' for other checks

3 years agoRollup merge of #81599 - sdroege:fuse-trusted-len, r=m-ou-se
Jonas Schievink [Tue, 2 Feb 2021 11:15:01 +0000 (12:15 +0100)]
Rollup merge of #81599 - sdroege:fuse-trusted-len, r=m-ou-se

Implement `TrustedLen` for `Fuse<I: TrustedLen>`

This looks like it was simply forgotten.

3 years agoRollup merge of #81577 - BoxyUwU:subexpr_const_evaluatable, r=oli-obk
Jonas Schievink [Tue, 2 Feb 2021 11:14:59 +0000 (12:14 +0100)]
Rollup merge of #81577 - BoxyUwU:subexpr_const_evaluatable, r=oli-obk

const_evaluatable: consider sub-expressions to be evaluatable

see [zulip topic](https://rust-lang.zulipchat.com/#narrow/stream/260443-project-const-generics/topic/const_evaluatable.3A.20subexpressions) for more info

cc `@lcnr`
r? `@oli-obk`

3 years agoRollup merge of #81492 - camelid:rustdoc-internal-mod-vis, r=GuillaumeGomez
Jonas Schievink [Tue, 2 Feb 2021 11:14:57 +0000 (12:14 +0100)]
Rollup merge of #81492 - camelid:rustdoc-internal-mod-vis, r=GuillaumeGomez

rustdoc: Note why `rustdoc::html::markdown` is public

Almost all of the modules are crate-private, except for
`rustdoc::json::types`, which I believe is intended to be for public
use; and `rustdoc::html::markdown`, which is used externally by the
error-index generator and so has to be public.

r? ``@GuillaumeGomez``

3 years agoRollup merge of #81485 - jackh726:atb-issues, r=Mark-Simulacrum
Jonas Schievink [Tue, 2 Feb 2021 11:14:56 +0000 (12:14 +0100)]
Rollup merge of #81485 - jackh726:atb-issues, r=Mark-Simulacrum

Add some tests for associated-type-bounds issues

Closes #38917
Closes #40093
Closes #43475
Closes #63591

#47897 is likely closable too, but it needs an MCVE
~~#38917, #40093, #43475, #47897 all are mislabeled and shouldn't have the `F-associated-type-bounds` label~~

~~#71685 is also mislabeled as commented on in that thread~~

3 years agoRollup merge of #81481 - lcnr:cast-tests, r=jackh726
Jonas Schievink [Tue, 2 Feb 2021 11:14:54 +0000 (12:14 +0100)]
Rollup merge of #81481 - lcnr:cast-tests, r=jackh726

move some tests

3 years agoRollup merge of #81022 - seanchen1991:feat/frames-iter, r=KodrAus
Jonas Schievink [Tue, 2 Feb 2021 11:14:49 +0000 (12:14 +0100)]
Rollup merge of #81022 - seanchen1991:feat/frames-iter, r=KodrAus

Add Frames Iterator for Backtrace

Second attempt at adding the ability to iterate over the frames of a Backtrace by exposing the frames method.

3 years agoRollup merge of #80629 - sexxi-goose:migrations_1, r=nikomatsakis
Jonas Schievink [Tue, 2 Feb 2021 11:14:44 +0000 (12:14 +0100)]
Rollup merge of #80629 - sexxi-goose:migrations_1, r=nikomatsakis

Add lint for 2229 migrations

Implements the first for RFC 2229 where we make the decision to migrate a root variable based on if the type of the variable needs Drop and if the root variable would be moved into the closure when the feature isn't enabled.

r? `@nikomatsakis`

3 years agoAuto merge of #79015 - WaffleLapkin:vec_append_from_within, r=KodrAus
bors [Tue, 2 Feb 2021 09:12:53 +0000 (09:12 +0000)]
Auto merge of #79015 - WaffleLapkin:vec_append_from_within, r=KodrAus

add `Vec::extend_from_within` method under `vec_extend_from_within` feature gate

Implement <https://github.com/rust-lang/rfcs/pull/2714>

### tl;dr

This PR adds a `extend_from_within` method to `Vec` which allows copying elements from a range to the end:

```rust
#![feature(vec_extend_from_within)]

let mut vec = vec![0, 1, 2, 3, 4];

vec.extend_from_within(2..);
assert_eq!(vec, [0, 1, 2, 3, 4, 2, 3, 4]);

vec.extend_from_within(..2);
assert_eq!(vec, [0, 1, 2, 3, 4, 2, 3, 4, 0, 1]);

vec.extend_from_within(4..8);
assert_eq!(vec, [0, 1, 2, 3, 4, 2, 3, 4, 0, 1, 4, 2, 3, 4]);
```

### Implementation notes

Originally I've copied `@Shnatsel's` [implementation](https://github.com/WanzenBug/rle-decode-helper/blob/690742a0de158d391b7bde1a0c71cccfdad33ab3/src/lib.rs#L74) with some minor changes to support other ranges:
```rust
pub fn append_from_within<R>(&mut self, src: R)
where
    T: Copy,
    R: RangeBounds<usize>,
{
    let len = self.len();
    let Range { start, end } = src.assert_len(len);;

    let count = end - start;
    self.reserve(count);
    unsafe {
        // This is safe because `reserve()` above succeeded,
        // so `self.len() + count` did not overflow usize
        ptr::copy_nonoverlapping(
            self.get_unchecked(src.start),
            self.as_mut_ptr().add(len),
            count,
        );
        self.set_len(len + count);
    }
}
```

But then I've realized that this duplicates most of the code from (private) `Vec::append_elements`, so I've used it instead.

Then I've applied `@KodrAus` suggestions from https://github.com/rust-lang/rust/pull/79015#issuecomment-727200852.

3 years agoupdate tracking issue for vec_extend_from_within
Ashley Mannix [Tue, 2 Feb 2021 07:47:55 +0000 (17:47 +1000)]
update tracking issue for vec_extend_from_within

3 years agoAuto merge of #81539 - nikic:update-armhf-gnu, r=sanxiyn
bors [Tue, 2 Feb 2021 06:23:10 +0000 (06:23 +0000)]
Auto merge of #81539 - nikic:update-armhf-gnu, r=sanxiyn

Update armhf-gnu to Ubuntu 20.04

This requires updating the used Linux kernel to avoid an assembler
error, the used busybox version to avoid a linker error, the used
rootfs to match the host version and the qemu flags to work with
the newer version.

r? `@Mark-Simulacrum`

3 years agoNew migration
Aman Arora [Tue, 26 Jan 2021 09:08:23 +0000 (04:08 -0500)]
New migration

3 years agoAuto merge of #81651 - ehuss:update-cargo, r=ehuss
bors [Tue, 2 Feb 2021 03:33:07 +0000 (03:33 +0000)]
Auto merge of #81651 - ehuss:update-cargo, r=ehuss

Update cargo

5 commits in c3abcfe8a75901c7c701557a728941e8fb19399e..e099df243bb2495b9b197f79c19f124032b1e778
2021-01-25 16:16:43 +0000 to 2021-02-01 16:24:34 +0000
- Impl warn for locked install without Cargo.lock (rust-lang/cargo#9108)
- Document -Z extra-link-arg. (rust-lang/cargo#9121)
- Flip 'foo' and 'bar' to be consistent (rust-lang/cargo#9120)
- Don't try to parse MSRV if feature is not enabled (rust-lang/cargo#9115)
- simplify char range check (rust-lang/cargo#9110)

3 years agoPR fixup
Aman Arora [Tue, 19 Jan 2021 08:15:36 +0000 (03:15 -0500)]
PR fixup

3 years agoMark the lint doc as compile_fail
Aman Arora [Sun, 3 Jan 2021 02:28:28 +0000 (21:28 -0500)]
Mark the lint doc as compile_fail

3 years agoTests for 2229 lint
Aman Arora [Wed, 30 Dec 2020 04:43:44 +0000 (23:43 -0500)]
Tests for 2229 lint

3 years agoUpdate cargo
Eric Huss [Tue, 2 Feb 2021 01:51:31 +0000 (17:51 -0800)]
Update cargo

3 years agoAuto merge of #81557 - GuillaumeGomez:primitive-search, r=ollie27
bors [Tue, 2 Feb 2021 00:15:06 +0000 (00:15 +0000)]
Auto merge of #81557 - GuillaumeGomez:primitive-search, r=ollie27

Fix primitive search in parameters and returned values

Part of #60485.
Fixes #74780.

Replacing #74879.

cc `@camelid` `@jyn514` `@CraftSpider`
r? `@ollie27`

3 years agoMigrations first pass
Aman Arora [Tue, 15 Dec 2020 08:38:15 +0000 (03:38 -0500)]
Migrations first pass

3 years agoProcess mentioned upvars for analysis first pass after ExprUseVisitor
Aman Arora [Sat, 21 Nov 2020 09:23:42 +0000 (04:23 -0500)]
Process mentioned upvars for analysis first pass after ExprUseVisitor

- This allows us add fake information after handling migrations if
  needed.
- Capture analysis also priortizes what we see earlier, which means
  fake information should go in last.

3 years agomore things are const evaluatable *sparkles*
Ellen [Mon, 1 Feb 2021 20:05:43 +0000 (20:05 +0000)]
more things are const evaluatable *sparkles*

3 years agoAuto merge of #80641 - Danue1:patch-1, r=oli-obk
bors [Mon, 1 Feb 2021 19:31:01 +0000 (19:31 +0000)]
Auto merge of #80641 - Danue1:patch-1, r=oli-obk

Add visitors for checking #[inline]

For #80564

3 years agoAuto merge of #81625 - jonas-schievink:rollup-mshpp2n, r=jonas-schievink
bors [Mon, 1 Feb 2021 16:30:22 +0000 (16:30 +0000)]
Auto merge of #81625 - jonas-schievink:rollup-mshpp2n, r=jonas-schievink

Rollup of 12 pull requests

Successful merges:

 - #78641 (Let io::copy reuse BufWriter buffers)
 - #79291 (Add error message for private fn)
 - #81364 (Improve `rustc_mir_build::matches` docs)
 - #81387 (Move some tests to more reasonable directories - 3)
 - #81463 (Rename NLL* to Nll* accordingly to C-CASE)
 - #81504 (Suggest accessing field when appropriate)
 - #81529 (Fix invalid camel case suggestion involving unicode idents)
 - #81536 (Indicate both start and end of pass RSS in time-passes output)
 - #81592 (Rustdoc UI fixes)
 - #81594 (Avoid building LLVM just for llvm-dwp)
 - #81598 (Fix calling convention for CRT startup)
 - #81618 (Sync rustc_codegen_cranelift)

Failed merges:

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

3 years agoFix overflowing text on mobile when sidebar is displayed
Guillaume Gomez [Mon, 1 Feb 2021 16:21:49 +0000 (17:21 +0100)]
Fix overflowing text on mobile when sidebar is displayed

3 years agoBless tests
Danuel [Mon, 1 Feb 2021 15:43:16 +0000 (00:43 +0900)]
Bless tests

3 years agoImprove diff display in case the whole key in missing
Guillaume Gomez [Mon, 1 Feb 2021 10:27:17 +0000 (11:27 +0100)]
Improve diff display in case the whole key in missing

3 years agoAdd test for primitive search
Guillaume Gomez [Sat, 30 Jan 2021 16:39:44 +0000 (17:39 +0100)]
Add test for primitive search

3 years agoPut back primitives in search
Guillaume Gomez [Sat, 30 Jan 2021 16:39:18 +0000 (17:39 +0100)]
Put back primitives in search

3 years agoRemove unneeded `mut` variable
LingMan [Wed, 20 Jan 2021 01:48:48 +0000 (02:48 +0100)]
Remove unneeded `mut` variable

`arg_elide` gets initialized, immediately cloned, and only written to after that.
The last reading access was removed back in
https://github.com/rust-lang/rust/commit/7704762604a8bf4504a06e8c9713bc7c158d362a

3 years agoFixed #[inline] to be warned in fields, arms, macro defs
Danuel [Mon, 1 Feb 2021 14:35:53 +0000 (23:35 +0900)]
Fixed #[inline] to be warned in fields, arms, macro defs

Add visitors for checking #[inline]

Add visitors for checking #[inline] with struct field

Fix test for #[inline]

Add visitors for checking #[inline] with #[macro_export] macro

Add visitors for checking #[inline] without #[macro_export] macro

Add use alias with Visitor

Fix lint error

Reduce unnecessary variable

Co-authored-by: LingMan <LingMan@users.noreply.github.com>
Change error to warning

Add warning for checking field, arm with #[allow_internal_unstable]

Add name resolver

Formatting

Formatting

Fix error fixture

Add checking field, arm, macro def

3 years agoRollup merge of #81618 - bjorn3:sync_cg_clif-2021-02-01, r=bjorn3
Jonas Schievink [Mon, 1 Feb 2021 13:29:47 +0000 (14:29 +0100)]
Rollup merge of #81618 - bjorn3:sync_cg_clif-2021-02-01, r=bjorn3

Sync rustc_codegen_cranelift

The highlight of this sync are abi compatibility with cg_llvm allowing mixing of cg_clif and cg_llvm compiled crates and switching to the x64 cranelift backend based on the new backend framework.

r? ``@ghost``

``@rustbot`` label +A-codegen +A-cranelift +T-compiler

3 years agoRollup merge of #81598 - sivadeilra:windows_dll_imports_fix_x86, r=m-ou-se
Jonas Schievink [Mon, 1 Feb 2021 13:29:45 +0000 (14:29 +0100)]
Rollup merge of #81598 - sivadeilra:windows_dll_imports_fix_x86, r=m-ou-se

Fix calling convention for CRT startup

My PR #81478 used the wrong calling convention for a set of
functions that are called by the CRT. These functions need to use
`extern "C"`.

This would only affect x86, which is the only target (that I know of)
that has multiple calling conventions.

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

3 years agoRollup merge of #81594 - bjorn3:avoid_building_llvm_for_dwp, r=sanxiyn
Jonas Schievink [Mon, 1 Feb 2021 13:29:44 +0000 (14:29 +0100)]
Rollup merge of #81594 - bjorn3:avoid_building_llvm_for_dwp, r=sanxiyn

Avoid building LLVM just for llvm-dwp

When the LLVM backend is disabled, the llvm-project submodule is not checked out by default. This breaks the bootstrap test for cg_clif. As cg_clif doesn't support split debuginfo anyway llvm-dwp is not necessary. Other backends would likely not want to build LLVM just for llvm-dwp either.

Fixes https://github.com/bjorn3/rustc_codegen_cranelift/issues/1119

3 years agoRollup merge of #81592 - GuillaumeGomez:rustdoc-ui-fixes, r=Nemo157
Jonas Schievink [Mon, 1 Feb 2021 13:29:42 +0000 (14:29 +0100)]
Rollup merge of #81592 - GuillaumeGomez:rustdoc-ui-fixes, r=Nemo157

Rustdoc UI fixes

The first commit fixes this bug (I couldn't figure out why we were setting the width manually and it works as expected without so...):

![Screenshot from 2021-01-31 12-58-46](https://user-images.githubusercontent.com/3050060/106384371-d56a7700-63ca-11eb-9e04-c06b40c2ab5e.png)

The second commit fixes a small bug. On tablets or computer with very little width, the search section goes "over" the search input, making it impossible to click on the search input:

![Screenshot from 2021-01-31 13-22-37](https://user-images.githubusercontent.com/3050060/106384413-021e8e80-63cb-11eb-8321-391a1f8a4c7e.png)

The third and last commit fixes two bugs that you can see in this screenshot:

![Screenshot from 2021-01-31 13-41-05](https://user-images.githubusercontent.com/3050060/106384424-0cd92380-63cb-11eb-82de-76218286c3fb.png)

The wheel is going over the search input and the search tab is going under the search results text. The bug was fixed by simply switching to "mobile mode" at a bigger width:

![Screenshot from 2021-01-31 13-49-50](https://user-images.githubusercontent.com/3050060/106384466-4447d000-63cb-11eb-9330-a7cd29403905.png)

cc ```@pickfire```
r? ```@Nemo157```

3 years agoRollup merge of #81536 - tgnottingham:time-passes-rss, r=oli-obk
Jonas Schievink [Mon, 1 Feb 2021 13:29:40 +0000 (14:29 +0100)]
Rollup merge of #81536 - tgnottingham:time-passes-rss, r=oli-obk

Indicate both start and end of pass RSS in time-passes output

Previously, only the end of pass RSS was indicated. This could easily
lead one to believe that the change in RSS from one pass to the next was
attributable to the second pass, when in fact it occurred between the
end of the first pass and the start of the second.

Also, improve alignment of columns.

Sample of output:

```
time:   0.739; rss:   607MB ->   637MB item_types_checking
time:   8.429; rss:   637MB ->   775MB item_bodies_checking
time:  11.063; rss:   470MB ->   775MB type_check_crate
time:   0.232; rss:   775MB ->   777MB match_checking
time:   0.139; rss:   777MB ->   779MB liveness_and_intrinsic_checking
time:   0.372; rss:   775MB ->   779MB misc_checking_2
time:   8.188; rss:   779MB ->  1019MB MIR_borrow_checking
time:   0.062; rss:  1019MB ->  1021MB MIR_effect_checking
```

3 years agoRollup merge of #81529 - estebank:case_lints, r=davidtwco
Jonas Schievink [Mon, 1 Feb 2021 13:29:39 +0000 (14:29 +0100)]
Rollup merge of #81529 - estebank:case_lints, r=davidtwco

Fix invalid camel case suggestion involving unicode idents

Follow up to #77805.

3 years agoRollup merge of #81504 - matsujika:suggestion-field-access, r=estebank
Jonas Schievink [Mon, 1 Feb 2021 13:29:37 +0000 (14:29 +0100)]
Rollup merge of #81504 - matsujika:suggestion-field-access, r=estebank

Suggest accessing field when appropriate

Fix #81222

r? ``@estebank``

3 years agoRollup merge of #81463 - matsujika:nll-ensure-c-case, r=varkor
Jonas Schievink [Mon, 1 Feb 2021 13:29:35 +0000 (14:29 +0100)]
Rollup merge of #81463 - matsujika:nll-ensure-c-case, r=varkor

Rename NLL* to Nll* accordingly to C-CASE

Given [C-CASE](https://rust-lang.github.io/api-guidelines/naming.html#casing-conforms-to-rfc-430-c-case), `NLLRegionVariableOrigin` and `NLL` are encouraged to be `NllRegionVariableOrigin` and `Nll` respectively.

3 years agoRollup merge of #81387 - c410-f3r:tests-tests-tests, r=petrochenkov
Jonas Schievink [Mon, 1 Feb 2021 13:29:33 +0000 (14:29 +0100)]
Rollup merge of #81387 - c410-f3r:tests-tests-tests, r=petrochenkov

Move some tests to more reasonable directories - 3

cc #73494
r? ````@petrochenkov````

https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-56202.rs <sup>https://github.com/rust-lang/rust/issues/56202</sup>: traits 1.008
https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-69841.rs <sup>https://github.com/rust-lang/rust/issues/69841</sup>: for-loop-while 1.014
https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-10763.rs <sup>https://github.com/rust-lang/rust/issues/10763</sup>: extern 1.016
https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-50599.rs <sup>https://github.com/rust-lang/rust/issues/50599</sup>: resolve 1.018
https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-6128.rs <sup>https://github.com/rust-lang/rust/issues/6128</sup>: traits 1.043
https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-20616-8.rs <sup>https://github.com/rust-lang/rust/issues/20616</sup>: parser 1.045
https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-46553.rs <sup>https://github.com/rust-lang/rust/issues/46553</sup>: consts 1.081
https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-33140-hack-boundaries.rs <sup>https://github.com/rust-lang/rust/issues/33140</sup>: traits 1.101
https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-25826.rs <sup>https://github.com/rust-lang/rust/issues/25826</sup>: consts 1.108
https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-56488.rs <sup>https://github.com/rust-lang/rust/issues/56488</sup>: traits 1.110
https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-58856-1.rs <sup>https://github.com/rust-lang/rust/issues/58856</sup>: parser 1.133
https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-57819.rs <sup>https://github.com/rust-lang/rust/issues/57819</sup>: parser 1.138
https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-54348.rs <sup>https://github.com/rust-lang/rust/issues/54348</sup>: consts 1.155
https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-14309.rs <sup>https://github.com/rust-lang/rust/issues/14309</sup>: lint 1.160
https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-4446.rs <sup>https://github.com/rust-lang/rust/issues/4446</sup>: threads-sendsync 1.203
https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-53675-a-test-called-panic.rs <sup>https://github.com/rust-lang/rust/issues/53675</sup>: test-attrs 1.211
https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-40231-2.rs <sup>https://github.com/rust-lang/rust/issues/40231</sup>: consts 1.213
https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-22037.rs <sup>https://github.com/rust-lang/rust/issues/22037</sup>: associated-types 1.214
https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-59029-2.rs <sup>https://github.com/rust-lang/rust/issues/59029</sup>: traits 1.219
https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-18425.rs <sup>https://github.com/rust-lang/rust/issues/18425</sup>: consts 1.237
https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-6157.rs <sup>https://github.com/rust-lang/rust/issues/6157</sup>: regions 1.238
https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-33819.rs <sup>https://github.com/rust-lang/rust/issues/33819</sup>: borrowck 1.280
https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-3683.rs <sup>https://github.com/rust-lang/rust/issues/3683</sup>: traits 1.283
https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-8709.rs <sup>https://github.com/rust-lang/rust/issues/8709</sup>: macros 1.291
https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-20616-9.rs <sup>https://github.com/rust-lang/rust/issues/20616</sup>: parser 1.293
https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-64732.rs <sup>https://github.com/rust-lang/rust/issues/64732</sup>: parser 1.296
https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-18655.rs <sup>https://github.com/rust-lang/rust/issues/18655</sup>: associated-types 1.305
https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-32947.rs <sup>https://github.com/rust-lang/rust/issues/32947</sup>: simd 1.322
https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-57198.rs <sup>https://github.com/rust-lang/rust/issues/57198</sup>: parser 1.342
https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-10764-rpass.rs <sup>https://github.com/rust-lang/rust/issues/10764</sup>: extern 1.392
https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-73541-2.rs <sup>https://github.com/rust-lang/rust/issues/73541</sup>: async-await 1.422
https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-7970b.rs <sup>https://github.com/rust-lang/rust/issues/7970</sup>: parser 1.439
https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-57684.rs <sup>https://github.com/rust-lang/rust/issues/57684</sup>: parser 1.512
https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-33264.rs <sup>https://github.com/rust-lang/rust/issues/33264</sup>: llvm-asm 1.523
https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-65284-suggest-generic-trait-bound.rs <sup>https://github.com/rust-lang/rust/issues/65284</sup>: suggestions 1.647
https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-17458.rs <sup>https://github.com/rust-lang/rust/issues/17458</sup>: consts 1.711
https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-56762.rs <sup>https://github.com/rust-lang/rust/issues/56762</sup>: consts 1.787
https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-2216.rs <sup>https://github.com/rust-lang/rust/issues/2216</sup>: for-loop-while 1.856
https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-45696-scribble-on-boxed-borrow.rs <sup>https://github.com/rust-lang/rust/issues/45696</sup>: nll 2.009
https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-46036.rs <sup>https://github.com/rust-lang/rust/issues/46036</sup>: nll 2.059

````@petrochenkov```` Can you put a place holder (like `N/A`) for tests without GitHub issues? It is a lot easier to parse fixed sized rows.

3 years agoRollup merge of #81364 - camelid:improve-build-matches-docs, r=varkor
Jonas Schievink [Mon, 1 Feb 2021 13:29:31 +0000 (14:29 +0100)]
Rollup merge of #81364 - camelid:improve-build-matches-docs, r=varkor

Improve `rustc_mir_build::matches` docs

- Fix typos
- Add more information
- General cleanup

3 years agoRollup merge of #79291 - JulianKnodt:ce_priv, r=petrochenkov
Jonas Schievink [Mon, 1 Feb 2021 13:29:29 +0000 (14:29 +0100)]
Rollup merge of #79291 - JulianKnodt:ce_priv, r=petrochenkov

Add error message for private fn

Attempts to add a more detailed error when a `const_evaluatable` fn from another scope is used inside of a scope which cannot access it.

r? ````@lcnr````

3 years agoRollup merge of #78641 - the8472:buffered-copy, r=sfackler
Jonas Schievink [Mon, 1 Feb 2021 13:29:28 +0000 (14:29 +0100)]
Rollup merge of #78641 - the8472:buffered-copy, r=sfackler

Let io::copy reuse BufWriter buffers

This optimization will allow users to implicitly set the buffer size for io::copy by wrapping the writer into a `BufWriter` if the default block size is insufficient, which should fix #49921

Due to min_specialization limitations this approach only works with `BufWriter` but not for `BufReader<R>` since `R` is unconstrained and thus the necessary specialization on `R: Read` is not always applicable. Once specialization becomes more powerful this optimization could be extended to look at the reader and writer side and use whichever buffer is larger.

3 years agoAuto merge of #81623 - jonas-schievink:rust-analyzer-2021-02-01, r=jonas-schievink
bors [Mon, 1 Feb 2021 13:29:15 +0000 (13:29 +0000)]
Auto merge of #81623 - jonas-schievink:rust-analyzer-2021-02-01, r=jonas-schievink

:arrow_up: rust-analyzer

3 years ago:arrow_up: rust-analyzer
Jonas Schievink [Mon, 1 Feb 2021 13:27:09 +0000 (14:27 +0100)]
:arrow_up: rust-analyzer

3 years agoAuto merge of #80851 - m-ou-se:panic-2021, r=petrochenkov
bors [Mon, 1 Feb 2021 10:25:31 +0000 (10:25 +0000)]
Auto merge of #80851 - m-ou-se:panic-2021, r=petrochenkov

Implement Rust 2021 panic

This implements the Rust 2021 versions of `panic!()`. See https://github.com/rust-lang/rust/issues/80162 and https://github.com/rust-lang/rfcs/pull/3007.

It does so by replacing `{std, core}::panic!()` by a bulitin macro that expands to either `$crate::panic::panic_2015!(..)` or `$crate::panic::panic_2021!(..)` depending on the edition of the caller.

This does not yet make std's panic an alias for core's panic on Rust 2021 as the RFC proposes. That will be a separate change: https://github.com/rust-lang/rust/pull/80879/commits/c5273bdfb266c35e8eab9413aa8d58d27fdbe114 That change is blocked on figuring out what to do with https://github.com/rust-lang/rust/issues/80846 first.

3 years agoMerge commit 'd556c56f792756dd7cfec742b9f2e07612dc10f4' into sync_cg_clif-2021-02-01
bjorn3 [Mon, 1 Feb 2021 09:11:46 +0000 (10:11 +0100)]
Merge commit 'd556c56f792756dd7cfec742b9f2e07612dc10f4' into sync_cg_clif-2021-02-01

3 years agoImplement `TrustedLen` for `iter::Fuse<I: TrustedLen>`
Sebastian Dröge [Sun, 31 Jan 2021 16:53:11 +0000 (18:53 +0200)]
Implement `TrustedLen` for `iter::Fuse<I: TrustedLen>`

3 years agoAdd SAFETY comment for the `TrustedRandomAccess` impl of `iter::Fuse`
Sebastian Dröge [Mon, 1 Feb 2021 07:44:10 +0000 (09:44 +0200)]
Add SAFETY comment for the `TrustedRandomAccess` impl of `iter::Fuse`

3 years agoAdd lint for 2229 migrations
Aman Arora [Mon, 28 Dec 2020 11:42:21 +0000 (06:42 -0500)]
Add lint for 2229 migrations

3 years agorustdoc: Note why `rustdoc::html::markdown` is public
Camelid [Thu, 28 Jan 2021 23:51:54 +0000 (15:51 -0800)]
rustdoc: Note why `rustdoc::html::markdown` is public

Almost all of the modules are crate-private, except for
`rustdoc::json::types`, which I believe is intended to be for public
use; and `rustdoc::html::markdown`, which is used externally by the
error-index generator and so has to be public.

3 years agoAuto merge of #81591 - RalfJung:miri, r=RalfJung
bors [Mon, 1 Feb 2021 02:42:07 +0000 (02:42 +0000)]
Auto merge of #81591 - RalfJung:miri, r=RalfJung

update Miri

Fixes https://github.com/rust-lang/rust/issues/81551
Cc `@rust-lang/miri` r? `@ghost`

3 years agoAuto merge of #81596 - jonas-schievink:rollup-utk14gr, r=jonas-schievink
bors [Sun, 31 Jan 2021 23:45:37 +0000 (23:45 +0000)]
Auto merge of #81596 - jonas-schievink:rollup-utk14gr, r=jonas-schievink

Rollup of 11 pull requests

Successful merges:

 - #80092 (2229: Fix issues with move closures and mutability)
 - #80404 (Remove const_in_array_repeat)
 - #81255 (Don't link with --export-dynamic on wasm32-wasi)
 - #81480 (Add suggestion for nested fields)
 - #81549 (Misc ip documentation fixes)
 - #81566 (Add a test for #71202)
 - #81568 (Fix an old FIXME in redundant paren lint)
 - #81571 (Fix typo in E0759)
 - #81572 (Edit multiple error code Markdown files)
 - #81589 (Fix small typo in string.rs)
 - #81590 (Stabilize int_bits_const)

Failed merges:

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

3 years agoUpdate outdated comment
Camelid [Sun, 31 Jan 2021 23:41:17 +0000 (15:41 -0800)]
Update outdated comment

The highest-priority item is the *first* in the list, not the last.
See [this code][1] for more.

[this code]: https://github.com/rust-lang/rust/blob/0e63af5da3400ace48a0345117980473fd21ad73/compiler/rustc_mir_build/src/build/matches/mod.rs#L1334-L1335

3 years agoMove some tests to more reasonable directories
Caio [Sun, 31 Jan 2021 22:46:46 +0000 (19:46 -0300)]
Move some tests to more reasonable directories

3 years agoAdd error message for private fn
kadmin [Sun, 22 Nov 2020 09:37:37 +0000 (09:37 +0000)]
Add error message for private fn

Bless tests

Update with changes from comments

3 years agoIndent the code correctly again after removing the query categories.
Julian Wollersberger [Sun, 31 Jan 2021 20:40:03 +0000 (21:40 +0100)]
Indent the code correctly again after removing the query categories.

3 years agoRemove the remains of the query categories.
Julian Wollersberger [Sun, 31 Jan 2021 20:37:17 +0000 (21:37 +0100)]
Remove the remains of the query categories.

3 years agoImprove handling of spans around macro result parse errors
Aaron Hill [Sun, 31 Jan 2021 20:21:28 +0000 (15:21 -0500)]
Improve handling of spans around macro result parse errors

Fixes #81543

After we expand a macro, we try to parse the resulting tokens as a AST
node. This commit makes several improvements to how we handle spans when
an error occurs:

* Only ovewrite the original `Span` if it's a dummy span. This preserves
  a more-specific span if one is available.
* Use `self.prev_token` instead of `self.token` when emitting an error
  message after encountering EOF, since an EOF token always has a dummy
  span
* Make `SourceMap::next_point` leave dummy spans unused. A dummy span
  does not have a logical 'next point', since it's a zero-length span.
  Re-using the span span preserves its 'dummy-ness' for other checks

3 years agoadd `Vec::extend_from_within` method
Waffle [Fri, 13 Nov 2020 09:50:12 +0000 (12:50 +0300)]
add `Vec::extend_from_within` method

Implement <https://github.com/rust-lang/rfcs/pull/2714>, changes from the RFC:
- Rename the method `append_from_within` => `extend_from_within`
- Loose :Copy bound => :Clone
- Specialize in case of :Copy

This commit also adds `Vec::split_at_spare` private method and use it to implement
`Vec::spare_capacity_mut` and `Vec::extend_from_within`. This method returns 2
slices - initialized elements (same as `&mut vec[..]`) and uninitialized but
allocated space (same as `vec.spare_capacity_mut()`).

3 years agoAdd option to build using the sysroot of rustc
bjorn3 [Sun, 31 Jan 2021 17:31:33 +0000 (18:31 +0100)]
Add option to build using the sysroot of rustc

3 years agoFix calling convention for CRT startup
Arlie Davis [Sun, 31 Jan 2021 16:49:23 +0000 (08:49 -0800)]
Fix calling convention for CRT startup

My PR #81478 used the wrong calling convention for a set of
functions that are called by the CRT. These functions need to use
`extern "C"`.

This would only affect x86, which is the only target (that I know of)
that has multiple calling conventions.

3 years agoRollup merge of #81590 - KodrAus:stabilize/int_bits_const, r=m-ou-se
Jonas Schievink [Sun, 31 Jan 2021 15:36:57 +0000 (16:36 +0100)]
Rollup merge of #81590 - KodrAus:stabilize/int_bits_const, r=m-ou-se

Stabilize int_bits_const

Closes #76904

The FCP to stabilize the `int_bits_const` feature completed on the tracking issue.

3 years agoRollup merge of #81589 - Seppel3210:master, r=jonas-schievink
Jonas Schievink [Sun, 31 Jan 2021 15:36:56 +0000 (16:36 +0100)]
Rollup merge of #81589 - Seppel3210:master, r=jonas-schievink

Fix small typo in string.rs

3 years agoRollup merge of #81572 - pierwill:edit-error-codes-1, r=jonas-schievink
Jonas Schievink [Sun, 31 Jan 2021 15:36:54 +0000 (16:36 +0100)]
Rollup merge of #81572 - pierwill:edit-error-codes-1, r=jonas-schievink

Edit multiple error code Markdown files

Makes small edits to several error code files. Fixes some missing punctuation. Changes some wording, grammar, and formatting for clarity and readability.

Adds a link to the rustup book in E0658.

3 years agoRollup merge of #81571 - schteve:fix_e0759_typo, r=jonas-schievink
Jonas Schievink [Sun, 31 Jan 2021 15:36:52 +0000 (16:36 +0100)]
Rollup merge of #81571 - schteve:fix_e0759_typo, r=jonas-schievink

Fix typo in E0759

Minor typo in E0759 error message.

3 years agoRollup merge of #81568 - osa1:remove_old_fixme, r=jonas-schievink
Jonas Schievink [Sun, 31 Jan 2021 15:36:51 +0000 (16:36 +0100)]
Rollup merge of #81568 - osa1:remove_old_fixme, r=jonas-schievink

Fix an old FIXME in redundant paren lint

Referenced bug was fixed a while ago

3 years agoRollup merge of #81566 - osa1:issue71202, r=jonas-schievink
Jonas Schievink [Sun, 31 Jan 2021 15:36:49 +0000 (16:36 +0100)]
Rollup merge of #81566 - osa1:issue71202, r=jonas-schievink

Add a test for #71202

Closes #71202

---

Note that the test normally generates this warning:

```
warning: cannot use constants which depend on generic parameters in types
  --> test.rs:10:5
   |
10 | /     const ITEM_IS_COPY: [(); 1 - {
11 | |         trait NotCopy {
12 | |             const VALUE: bool = false;
13 | |         }
...  |
26 | |         <IsCopy<T>>::VALUE
27 | |     } as usize] = [];
   | |_____________________^
   |
   = note: `#[warn(const_evaluatable_unchecked)]` on by default
   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
   = note: for more information, see issue #76200 <https://github.com/rust-lang/rust/issues/76200>
```

I added `allow(const_evaluatable_unchecked)`, but maybe we just don't want to add a test for this as the program is not really valid?

3 years agoRollup merge of #81549 - est31:wording_fix, r=jonas-schievink
Jonas Schievink [Sun, 31 Jan 2021 15:36:47 +0000 (16:36 +0100)]
Rollup merge of #81549 - est31:wording_fix, r=jonas-schievink

Misc ip documentation fixes

3 years agoRollup merge of #81480 - b-naber:nested_fields_suggestion, r=estebank
Jonas Schievink [Sun, 31 Jan 2021 15:36:46 +0000 (16:36 +0100)]
Rollup merge of #81480 - b-naber:nested_fields_suggestion, r=estebank

Add suggestion for nested fields

Closes https://github.com/rust-lang/rust/issues/81220

r? ```@estebank```

3 years agoRollup merge of #81255 - sunfishcode:wasi-no-export-dynamic, r=alexcrichton
Jonas Schievink [Sun, 31 Jan 2021 15:36:44 +0000 (16:36 +0100)]
Rollup merge of #81255 - sunfishcode:wasi-no-export-dynamic, r=alexcrichton

Don't link with --export-dynamic on wasm32-wasi

Remove --export-dynamic from the link arguments on the wasm32-wasi
target, as it emits spurious exports and increases code size.

Leave it in place for wasm32-unknown-unknown and
wasm32-unknown-emscripten. Even though it isn't a great solution
there, users are likely depending on its behavior there.

3 years agoRollup merge of #80404 - JulianKnodt:arr_ref, r=oli-obk
Jonas Schievink [Sun, 31 Jan 2021 15:36:42 +0000 (16:36 +0100)]
Rollup merge of #80404 - JulianKnodt:arr_ref, r=oli-obk

Remove const_in_array_repeat

Fixes #80371. Fixes #81315. Fixes #80767. Fixes #75682.

I thought there might be some issue with `Repeats(_, 0)`, but if you increase the items in the array it still ICEs. I'm not sure if this is the best fix but it does fix the given issue.

3 years agoRollup merge of #80092 - sexxi-goose:restrict_precision, r=nikomatsakis
Jonas Schievink [Sun, 31 Jan 2021 15:36:41 +0000 (16:36 +0100)]
Rollup merge of #80092 - sexxi-goose:restrict_precision, r=nikomatsakis

2229: Fix issues with move closures and mutability

This PR fixes two issues when feature `capture_disjoint_fields` is used.

1. Can't mutate using a mutable reference
2. Move closures try to move value out through a reference.

To do so, we
1. Compute the mutability of the capture and store it as part of the `CapturedPlace`  that is written in TypeckResults
2. Restrict capture precision. Note this is temporary for now, to allow the feature to be used with move closures and ByValue captures and might change depending on discussions with the lang team.
    - No Derefs are captured for ByValue captures, since that will result in value behind a reference getting moved.
    - No projections are applied to raw pointers since these require unsafe blocks. We capture
    them completely.

r? `````@nikomatsakis`````

3 years agoBless coverage-spanview/expected_mir_dump.*.
Mara Bos [Sun, 31 Jan 2021 15:10:08 +0000 (16:10 +0100)]
Bless coverage-spanview/expected_mir_dump.*.

3 years agoAvoid building LLVM just for llvm-dwp
bjorn3 [Sun, 31 Jan 2021 14:05:00 +0000 (15:05 +0100)]
Avoid building LLVM just for llvm-dwp

When the LLVM backend is disabled, the llvm-project submodule is not
checked out by default. This breaks the bootstrap test for cg_clif. As
cg_clif doesn't support split debuginfo anyway llvm-dwp is not
necessary. Other backends would likely not want to build LLVM just for
llvm-dwp either.

3 years agospecialize io::copy to use the memory of the writer if it is a BufWriter
The8472 [Sun, 1 Nov 2020 18:59:24 +0000 (19:59 +0100)]
specialize io::copy to use the memory of the writer if it is a BufWriter

3 years agoMove some env var definitions around to fix cross-compilation
bjorn3 [Sun, 31 Jan 2021 13:56:10 +0000 (14:56 +0100)]
Move some env var definitions around to fix cross-compilation

3 years agoFix a small error in the readme
bjorn3 [Sun, 31 Jan 2021 13:15:50 +0000 (14:15 +0100)]
Fix a small error in the readme

3 years agoRemove code comment
bjorn3 [Sun, 31 Jan 2021 13:04:19 +0000 (14:04 +0100)]
Remove code comment

3 years agoSplit config.sh and add support for copying the mingw runtime objects
bjorn3 [Sun, 31 Jan 2021 12:08:07 +0000 (13:08 +0100)]
Split config.sh and add support for copying the mingw runtime objects

3 years agoupdate Miri
Ralf Jung [Sun, 31 Jan 2021 12:45:15 +0000 (13:45 +0100)]
update Miri

3 years agoImprove resize handling
Guillaume Gomez [Sun, 31 Jan 2021 12:42:16 +0000 (13:42 +0100)]
Improve resize handling

3 years agoPrevent search section to go over search input
Guillaume Gomez [Sun, 31 Jan 2021 12:34:32 +0000 (13:34 +0100)]
Prevent search section to go over search input

3 years agoRemove unneeded explicit width from search results
Guillaume Gomez [Sun, 31 Jan 2021 12:13:52 +0000 (13:13 +0100)]
Remove unneeded explicit width from search results

3 years agostabilize int_bits_const
Ashley Mannix [Sun, 31 Jan 2021 11:50:47 +0000 (21:50 +1000)]
stabilize int_bits_const

3 years agoLink examples to the correct libc when targeting Windows
bjorn3 [Sun, 31 Jan 2021 11:46:17 +0000 (12:46 +0100)]
Link examples to the correct libc when targeting Windows

3 years agoFix sysroot dir for cg_clif_build_sysroot
bjorn3 [Sun, 31 Jan 2021 11:44:02 +0000 (12:44 +0100)]
Fix sysroot dir for cg_clif_build_sysroot

3 years agoAdd missing directory to clean_all.sh
bjorn3 [Sun, 31 Jan 2021 11:43:39 +0000 (12:43 +0100)]
Add missing directory to clean_all.sh

3 years agoFix small typo
Sebastian Widua [Sun, 31 Jan 2021 11:19:09 +0000 (12:19 +0100)]
Fix small typo

3 years agoAuto merge of #81478 - sivadeilra:windows_dll_imports, r=m-ou-se
bors [Sun, 31 Jan 2021 10:01:15 +0000 (10:01 +0000)]
Auto merge of #81478 - sivadeilra:windows_dll_imports, r=m-ou-se

Resolve DLL imports at CRT startup, not on demand

On Windows, libstd uses GetProcAddress to locate some DLL imports, so
that libstd can run on older versions of Windows. If a given DLL import
is not present, then libstd uses other behavior (such as fallback
implementations).

This commit uses a feature of the Windows CRT to do these DLL imports
during module initialization, before main() (or DllMain()) is called.
This is the ideal time to resolve imports, because the module is
effectively single-threaded at that point; no other threads can
touch the data or code of the module that is being initialized.

This avoids several problems. First, it makes the cost of performing
the DLL import lookups deterministic. Right now, the DLL imports are
done on demand, which means that application threads _might_ have to
do the DLL import during some time-sensitive operation. This is a
small source of unpredictability. Since threads can race, it's even
possible to have more than one thread running the same redundant
DLL lookup.

This commit also removes using the heap to allocate strings, during
the DLL lookups.

3 years agoRustfmt
Hirochika Matsumoto [Sun, 31 Jan 2021 07:52:46 +0000 (16:52 +0900)]
Rustfmt

3 years agoFix prefix of debug log
Hirochika Matsumoto [Sun, 31 Jan 2021 07:49:33 +0000 (16:49 +0900)]
Fix prefix of debug log

3 years agoAuto merge of #81327 - RalfJung:codegen-no-const-fail, r=oli-obk
bors [Sun, 31 Jan 2021 07:03:09 +0000 (07:03 +0000)]
Auto merge of #81327 - RalfJung:codegen-no-const-fail, r=oli-obk

codegen: assume constants cannot fail to evaluate

https://github.com/rust-lang/rust/pull/80579 landed, so we can finally remove this old hack from codegen and instead assume that consts never fail to evaluate. :)

r? `@oli-obk`