]> git.lizzy.rs Git - rust.git/log
rust.git
3 years agoWork around various issues cleaning up bootstrap on Windows
Ryan Levick [Tue, 16 Feb 2021 15:50:45 +0000 (16:50 +0100)]
Work around various issues cleaning up bootstrap on Windows

3 years agoReplace File::create and write_all with fs::write
est31 [Tue, 16 Feb 2021 07:09:07 +0000 (08:09 +0100)]
Replace File::create and write_all with fs::write

Also don't convert to u8 buffers and back
when we are only creating strings.

3 years ago[Minor] Update discriminant_value docs
Peter Todd [Tue, 16 Feb 2021 13:16:31 +0000 (08:16 -0500)]
[Minor] Update discriminant_value docs

3 years agoupdate Miri
Ralf Jung [Tue, 16 Feb 2021 10:17:42 +0000 (11:17 +0100)]
update Miri

3 years agoDo not delete bootstrap.exe on Windows during clean
Ryan Levick [Tue, 16 Feb 2021 09:35:15 +0000 (10:35 +0100)]
Do not delete bootstrap.exe on Windows during clean

Windows does not allow deleting currently running executables

3 years agoadd test
Ralf Jung [Tue, 16 Feb 2021 10:14:34 +0000 (11:14 +0100)]
add test

3 years agofix MIR fn-ptr pretty-printing
Ralf Jung [Tue, 16 Feb 2021 08:59:38 +0000 (09:59 +0100)]
fix MIR fn-ptr pretty-printing

3 years agovalidation: fix invalid-fn-ptr error message
Ralf Jung [Tue, 16 Feb 2021 08:57:21 +0000 (09:57 +0100)]
validation: fix invalid-fn-ptr error message

3 years agoIgnore Atomic*::fetch_{min,max} tests on ARM
bjorn3 [Tue, 16 Feb 2021 08:45:27 +0000 (09:45 +0100)]
Ignore Atomic*::fetch_{min,max} tests on ARM

3 years agoAuto merge of #82058 - gilescope:to_digit_speedup, r=lcnr
bors [Tue, 16 Feb 2021 08:38:11 +0000 (08:38 +0000)]
Auto merge of #82058 - gilescope:to_digit_speedup, r=lcnr

no need to check assertion on fast path as will always hold.

V small change. Easy to review though!

3 years agoFix run-make-fulldeps test
Benoît du Garreau [Tue, 16 Feb 2021 08:02:13 +0000 (09:02 +0100)]
Fix run-make-fulldeps test

3 years agoDocument that `assert!` format arguments are evaluated lazily
Teddy Katz [Tue, 16 Feb 2021 02:06:00 +0000 (21:06 -0500)]
Document that `assert!` format arguments are evaluated lazily

It can be useful to do some computation in `assert!` format arguments, in order to get better error messages. For example:

```rust
assert!(
    some_condition,
    "The state is invalid. Details: {}",
    expensive_call_to_get_debugging_info(),
);
```

It seems like `assert!` only evaluates the format arguments if the assertion fails, which is useful but doesn't appear to be documented anywhere. This PR documents the behavior and adds some tests.

3 years agoAuto merge of #81734 - richkadel:fixfordash, r=pnkfelix
bors [Tue, 16 Feb 2021 05:45:10 +0000 (05:45 +0000)]
Auto merge of #81734 - richkadel:fixfordash, r=pnkfelix

Ensures `make` tests run under /bin/dash (if available), like CI, and fixes a Makefile

Note: This cherrypicks #81688 (`@pnkfelix)`

Updates `tools.mk` to explicitly require `SHELL := /bin/dash`, since CI uses `dash` but other environments (including developer local machines) may default to `bash`.

Replaces bash-specific shell command in one Makefile with a dash-compatible alternative, and re-enables the affected Makefile test.

Removes apparently redundant definition of `UNAME`.

Also see: [zulip discussion thread](https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/how.20to.20run.2Fbless.20src.2Ftest.2Frun-make-fulldeps.2Fcoverage.20.3F)

r? `@pnkfelix`

FYI: `@wesleywiser` `@tmandry`

3 years agoUpdate w/ comments
kadmin [Sun, 14 Feb 2021 04:35:18 +0000 (04:35 +0000)]
Update w/ comments

3 years agoUse iter::position in truncate_capture_for_move
Aman Arora [Sat, 13 Feb 2021 06:59:35 +0000 (01:59 -0500)]
Use iter::position in truncate_capture_for_move

3 years agoTreat read of COpy types via refs as not move in move-closure
Aman Arora [Fri, 12 Feb 2021 00:36:05 +0000 (19:36 -0500)]
Treat read of COpy types via refs as not move in move-closure

3 years agoHandle restricting closure origin
Aman Arora [Tue, 9 Feb 2021 04:31:26 +0000 (23:31 -0500)]
Handle restricting closure origin

3 years agoImplement reborrow for closure captures
Aman Arora [Thu, 4 Feb 2021 07:12:31 +0000 (02:12 -0500)]
Implement reborrow for closure captures

3 years agoAuto merge of #82153 - jonas-schievink:rollup-ls5r943, r=jonas-schievink
bors [Tue, 16 Feb 2021 02:14:13 +0000 (02:14 +0000)]
Auto merge of #82153 - jonas-schievink:rollup-ls5r943, r=jonas-schievink

Rollup of 19 pull requests

Successful merges:

 - #81503 (Suggest to create a new `const` item if the `fn` in the array is a `const fn`)
 - #81897 (Add match pattern diagnostics regression test)
 - #81975 (Seal the CommandExt, OsStrExt and OsStringExt traits)
 - #82009 (const_generics: Dont evaluate array length const when handling errors)
 - #82060 (Fix typos in BTreeSet::{first, last} docs)
 - #82061 (CTFE validation: catch ReadPointerAsBytes and better error)
 - #82063 (Fixed minor typo in catch_unwind docs)
 - #82067 (const_generics: Fix incorrect ty::ParamEnv::empty() usage)
 - #82077 (Edit `rustc_arena::DropArena` docs)
 - #82096 (Fix a typo)
 - #82106 (Remove unnecessary `Option` in `default_doc`)
 - #82107 (expand: Some cleanup)
 - #82118 (Add missing env!-decl variant)
 - #82119 (Fix typo in link to CreateSymbolicLinkW documentation.)
 - #82120 (Stabilize Arguments::as_str)
 - #82129 (Remove redundant bool_to_option feature gate)
 - #82133 (Update link for extern prelude.)
 - #82141 (32-bit ARM: Emit `lr` instead of `r14` when specified as an `asm!` output register.)
 - #82147 (:arrow_up: rust-analyzer)

Failed merges:

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

3 years agoInline try_get_cached
Tomasz Miąsko [Tue, 16 Feb 2021 00:00:00 +0000 (00:00 +0000)]
Inline try_get_cached

3 years agoavoid full-slicing slices
Matthias Krüger [Mon, 15 Feb 2021 23:30:06 +0000 (00:30 +0100)]
avoid full-slicing slices

If we already have a slice, there is no need to get another full-range slice from that, just use the original.
clippy::redundant_slicing

3 years agoRemove HirItemLike.
Camille GILLOT [Mon, 1 Feb 2021 10:32:26 +0000 (11:32 +0100)]
Remove HirItemLike.

3 years agoTrait impls are Items, therefore HIR owners.
Camille GILLOT [Mon, 1 Feb 2021 10:12:49 +0000 (11:12 +0100)]
Trait impls are Items, therefore HIR owners.

3 years agoUse less HirId when referring to items.
Camille GILLOT [Sun, 31 Jan 2021 17:21:04 +0000 (18:21 +0100)]
Use less HirId when referring to items.

3 years agoOnly store a LocalDefId in hir::MacroDef.
Camille GILLOT [Sun, 31 Jan 2021 17:20:18 +0000 (18:20 +0100)]
Only store a LocalDefId in hir::MacroDef.

3 years agoIndex Modules using their LocalDefId.
Camille GILLOT [Sun, 31 Jan 2021 16:58:57 +0000 (17:58 +0100)]
Index Modules using their LocalDefId.

3 years agoFix E0657.
Camille GILLOT [Sun, 31 Jan 2021 10:01:49 +0000 (11:01 +0100)]
Fix E0657.

3 years agoOnly store a LocalDefId in hir::ForeignItem.
Camille GILLOT [Sun, 31 Jan 2021 23:33:38 +0000 (00:33 +0100)]
Only store a LocalDefId in hir::ForeignItem.

3 years agoOnly store a LocalDefId in hir::ImplItem.
Camille GILLOT [Sat, 30 Jan 2021 22:25:03 +0000 (23:25 +0100)]
Only store a LocalDefId in hir::ImplItem.

3 years agoOnly store a LocalDefId in hir::TraitItem.
Camille GILLOT [Sat, 30 Jan 2021 19:46:50 +0000 (20:46 +0100)]
Only store a LocalDefId in hir::TraitItem.

3 years agoOnly store a LocalDefId in hir::Item.
Camille GILLOT [Sat, 30 Jan 2021 16:47:51 +0000 (17:47 +0100)]
Only store a LocalDefId in hir::Item.

Items are guaranteed to be HIR owner.

3 years agoUse an ItemId inside mir::GlobalAsm.
Camille GILLOT [Sat, 30 Jan 2021 18:18:48 +0000 (19:18 +0100)]
Use an ItemId inside mir::GlobalAsm.

3 years agoUse ItemId as a strongly typed index.
Camille GILLOT [Sat, 30 Jan 2021 11:06:04 +0000 (12:06 +0100)]
Use ItemId as a strongly typed index.

3 years agoAdd assertions on HIR enum sizes.
Camille GILLOT [Fri, 29 Jan 2021 18:27:56 +0000 (19:27 +0100)]
Add assertions on HIR enum sizes.

3 years agoRemove useless Named trait.
Camille GILLOT [Sat, 30 Jan 2021 10:28:28 +0000 (11:28 +0100)]
Remove useless Named trait.

3 years agoAdd long explanation for E0545
Jesus Rubio [Mon, 15 Feb 2021 18:16:39 +0000 (19:16 +0100)]
Add long explanation for E0545

3 years agoSimplify pattern grammar by allowing nested leading vert
mark [Mon, 8 Feb 2021 02:40:33 +0000 (20:40 -0600)]
Simplify pattern grammar by allowing nested leading vert

Along the way, we also implement a handful of diagnostics improvements
and fixes, particularly with respect to the special handling of `||` in
place of `|` and when there are leading verts in function params, which
don't allow top-level or-patterns anyway.

3 years agoFix typo in rustc_infer::infer::UndoLog
pierwill [Mon, 15 Feb 2021 18:02:03 +0000 (10:02 -0800)]
Fix typo in rustc_infer::infer::UndoLog

Also use double quotes.

3 years agoname async generators something more human friendly in type error diagnostics
Gus Wynn [Fri, 29 Jan 2021 02:16:52 +0000 (18:16 -0800)]
name async generators something more human friendly in type error diagnostics

3 years agoUpdate RELEASES.md 1.50 to include methods stabilized in #79342
Christiaan Dirkx [Mon, 15 Feb 2021 16:39:56 +0000 (17:39 +0100)]
Update RELEASES.md 1.50 to include methods stabilized in #79342

3 years agoRollup merge of #82147 - lnicola:rust-analyzer-2021-02-15, r=jonas-schievink
Jonas Schievink [Mon, 15 Feb 2021 15:07:12 +0000 (16:07 +0100)]
Rollup merge of #82147 - lnicola:rust-analyzer-2021-02-15, r=jonas-schievink

:arrow_up: rust-analyzer

3 years agoRollup merge of #82141 - jrvanwhy:issue-82052, r=sanxiyn
Jonas Schievink [Mon, 15 Feb 2021 15:07:11 +0000 (16:07 +0100)]
Rollup merge of #82141 - jrvanwhy:issue-82052, r=sanxiyn

32-bit ARM: Emit `lr` instead of `r14` when specified as an `asm!` output register.

On 32-bit ARM platforms, the register `r14` has the alias `lr`. When used as an output register in `asm!`, rustc canonicalizes the name to `r14`. LLVM only knows the register by the name `lr`, and rejects it. This changes rustc's LLVM code generation to output `lr` instead.

closes #82052

r? ``@nagisa``

3 years agoRollup merge of #82133 - ehuss:extern-prelude-link, r=jyn514
Jonas Schievink [Mon, 15 Feb 2021 15:07:10 +0000 (16:07 +0100)]
Rollup merge of #82133 - ehuss:extern-prelude-link, r=jyn514

Update link for extern prelude.

There was some reorganization in the reference as part of https://github.com/rust-lang/reference/pull/937.

3 years agoRollup merge of #82129 - est31:master, r=jyn514
Jonas Schievink [Mon, 15 Feb 2021 15:07:09 +0000 (16:07 +0100)]
Rollup merge of #82129 - est31:master, r=jyn514

Remove redundant bool_to_option feature gate

3 years agoRollup merge of #82120 - sfackler:arguments-as-str, r=dtolnay
Jonas Schievink [Mon, 15 Feb 2021 15:07:08 +0000 (16:07 +0100)]
Rollup merge of #82120 - sfackler:arguments-as-str, r=dtolnay

Stabilize Arguments::as_str

Closes #74442

3 years agoRollup merge of #82119 - m-ou-se:typo, r=dtolnay
Jonas Schievink [Mon, 15 Feb 2021 15:07:06 +0000 (16:07 +0100)]
Rollup merge of #82119 - m-ou-se:typo, r=dtolnay

Fix typo in link to CreateSymbolicLinkW documentation.

3 years agoRollup merge of #82118 - lukaslueg:env_decl, r=m-ou-se
Jonas Schievink [Mon, 15 Feb 2021 15:07:05 +0000 (16:07 +0100)]
Rollup merge of #82118 - lukaslueg:env_decl, r=m-ou-se

Add missing env!-decl variant

Resolves #82117

3 years agoRollup merge of #82107 - petrochenkov:minexpclean, r=Aaron1011
Jonas Schievink [Mon, 15 Feb 2021 15:07:04 +0000 (16:07 +0100)]
Rollup merge of #82107 - petrochenkov:minexpclean, r=Aaron1011

expand: Some cleanup

See individual commits for details.

r? ``@Aaron1011``

3 years agoRollup merge of #82106 - jyn514:cleanup-bootstrap, r=Mark-Simulacrum
Jonas Schievink [Mon, 15 Feb 2021 15:07:02 +0000 (16:07 +0100)]
Rollup merge of #82106 - jyn514:cleanup-bootstrap, r=Mark-Simulacrum

Remove unnecessary `Option` in `default_doc`

Previously, there were two different ways to encode the same info: `None` or
`Some(&[])`. Now there is only one way, `&[]`.

3 years agoRollup merge of #82096 - TaKO8Ki:fix-typo, r=GuillaumeGomez
Jonas Schievink [Mon, 15 Feb 2021 15:07:01 +0000 (16:07 +0100)]
Rollup merge of #82096 - TaKO8Ki:fix-typo, r=GuillaumeGomez

Fix a typo

This pull request fixes a typo.

3 years agoRollup merge of #82077 - pierwill:edit-droparena, r=lcnr
Jonas Schievink [Mon, 15 Feb 2021 15:07:00 +0000 (16:07 +0100)]
Rollup merge of #82077 - pierwill:edit-droparena, r=lcnr

Edit `rustc_arena::DropArena` docs

- Add a "Safety" section, edit formatting for clarity
- Add missing punctuation in code comments

3 years agoRollup merge of #82067 - BoxyUwU:hahaicantthinkofabadpun, r=oli-obk
Jonas Schievink [Mon, 15 Feb 2021 15:06:59 +0000 (16:06 +0100)]
Rollup merge of #82067 - BoxyUwU:hahaicantthinkofabadpun, r=oli-obk

const_generics: Fix incorrect ty::ParamEnv::empty() usage

Fixes #80561

Not sure if I should keep the `debug!(..)`s or not but its the second time I've needed them so they sure seem useful lol

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

3 years agoRollup merge of #82063 - NULLx76:fix-minor-typo, r=jonas-schievink
Jonas Schievink [Mon, 15 Feb 2021 15:06:58 +0000 (16:06 +0100)]
Rollup merge of #82063 - NULLx76:fix-minor-typo, r=jonas-schievink

Fixed minor typo in catch_unwind docs

Changed "a an exception" to "an exception" inside of the `std::panic::catch_unwind` docs.

3 years agoRollup merge of #82061 - RalfJung:ctfe-read-pointer-as-bytes, r=oli-obk
Jonas Schievink [Mon, 15 Feb 2021 15:06:57 +0000 (16:06 +0100)]
Rollup merge of #82061 - RalfJung:ctfe-read-pointer-as-bytes, r=oli-obk

CTFE validation: catch ReadPointerAsBytes and better error

r? ``@oli-obk``
Fixes https://github.com/rust-lang/rust/issues/79690
Cc https://github.com/rust-lang/miri/issues/1706

3 years agoRollup merge of #82060 - taiki-e:typo, r=m-ou-se
Jonas Schievink [Mon, 15 Feb 2021 15:06:56 +0000 (16:06 +0100)]
Rollup merge of #82060 - taiki-e:typo, r=m-ou-se

Fix typos in BTreeSet::{first, last} docs

map -> set

3 years agoRollup merge of #82009 - BoxyUwU:idontknooow, r=varkor
Jonas Schievink [Mon, 15 Feb 2021 15:06:55 +0000 (16:06 +0100)]
Rollup merge of #82009 - BoxyUwU:idontknooow, r=varkor

const_generics: Dont evaluate array length const when handling errors

Fixes #79518
Fixes #78246

cc ````@lcnr````

This was ICE'ing because we dont pass in the correct ``ParamEnv`` which meant that there was no ``Self: Foo`` predicate to make ``Self::Assoc`` well formed which caused an ICE when trying to normalize ``Self::Assoc`` in the mir interpreter

r? ````@varkor````

3 years agoRollup merge of #81975 - Amanieu:seal2, r=m-ou-se
Jonas Schievink [Mon, 15 Feb 2021 15:06:54 +0000 (16:06 +0100)]
Rollup merge of #81975 - Amanieu:seal2, r=m-ou-se

Seal the CommandExt, OsStrExt and OsStringExt traits

A crater run (https://github.com/rust-lang/rust/pull/81213#issuecomment-767651811) has shown that this does not break any existing code.

This also unblocks #77728.

Based on #81213.

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

3 years agoRollup merge of #81897 - vandenheuvel:match_exhaustive_diagnostics_regression_test...
Jonas Schievink [Mon, 15 Feb 2021 15:06:53 +0000 (16:06 +0100)]
Rollup merge of #81897 - vandenheuvel:match_exhaustive_diagnostics_regression_test, r=Mark-Simulacrum

Add match pattern diagnostics regression test

Closes #72377 by adding a regression test.

This test case fails on stable but now works on beta and nightly. It *should* have worked already for years, the crucial point whether it is mentioned that some uncovered patterns are not explicitly mentioned.

3 years agoRollup merge of #81503 - henryboisdequin:fix-const-fn-arr-err-msg, r=estebank
Jonas Schievink [Mon, 15 Feb 2021 15:06:47 +0000 (16:06 +0100)]
Rollup merge of #81503 - henryboisdequin:fix-const-fn-arr-err-msg, r=estebank

Suggest to create a new `const` item if the `fn` in the array is a `const fn`

Fixes #73734. If the `fn` in the array repeat expression is a `const fn`, suggest creating a new `const` item. On nightly, suggest creating an inline `const` block. This PR also removes the `suggest_const_in_array_repeat_expressions` as it is no longer necessary.

Example:

```rust
fn main() {
    // Should not compile but hint to create a new const item (stable) or an inline const block (nightly)
    let strings: [String; 5] = [String::new(); 5];
    println!("{:?}", strings);
}

```

Gives this error:

```
error[E0277]: the trait bound `std::string::String: std::marker::Copy` is not satisfied
 --> $DIR/const-fn-in-vec.rs:3:32
  |
2 |     let strings: [String; 5] = [String::new(); 5];
  |                             ^^^^^^^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `String`
  |
  = note: the `Copy` trait is required because the repeated element will be copied
```

With this change, this is the error message:

```
error[E0277]: the trait bound `String: Copy` is not satisfied
  --> $DIR/const-fn-in-vec.rs:3:32
   |
LL |     let strings: [String; 5] = [String::new(); 5];
   |                                ^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `String`
   |
   = help: moving the function call to a new `const` item will resolve the error
```

3 years agoUse local path for already-imported function
Simon Sapin [Mon, 15 Feb 2021 13:25:22 +0000 (14:25 +0100)]
Use local path for already-imported function

This module has `use super::*;` at the top.

Co-authored-by: Oli Scherer <github35764891676564198441@oli-obk.de>
3 years agoPointer metadata: add tracking issue number
Simon Sapin [Fri, 29 Jan 2021 13:38:48 +0000 (14:38 +0100)]
Pointer metadata: add tracking issue number

3 years agoAdd a ThinBox library as a libcore test for pointer metadata APIs
Simon Sapin [Mon, 18 Jan 2021 21:24:33 +0000 (22:24 +0100)]
Add a ThinBox library as a libcore test for pointer metadata APIs

3 years agoFix intra-doc link to raw pointer method
Simon Sapin [Mon, 18 Jan 2021 19:56:29 +0000 (20:56 +0100)]
Fix intra-doc link to raw pointer method

CC https://github.com/rust-lang/rust/pull/80181

3 years agoFix libcore unit tests in stage 0
Simon Sapin [Mon, 18 Jan 2021 19:45:34 +0000 (20:45 +0100)]
Fix libcore unit tests in stage 0

3 years agoMore doc-comments for pointer metadata APIs
Simon Sapin [Mon, 18 Jan 2021 18:45:32 +0000 (19:45 +0100)]
More doc-comments for pointer metadata APIs

3 years agoUse new pointer metadata API inside libcore instead of manual transmutes
Simon Sapin [Mon, 18 Jan 2021 16:18:13 +0000 (17:18 +0100)]
Use new pointer metadata API inside libcore instead of manual transmutes

3 years agoAdd `to_raw_parts` methods to `*const`, `*mut`, and `NonNull`
Simon Sapin [Mon, 18 Jan 2021 15:56:53 +0000 (16:56 +0100)]
Add `to_raw_parts` methods to `*const`, `*mut`, and `NonNull`

These are not named `into_` because they do not consume their receiver
since raw pointers are `Copy`.

3 years agoAdd `ptr::from_raw_parts`, `ptr::from_raw_parts_mut`, and `NonNull::from_raw_parts`
Simon Sapin [Mon, 18 Jan 2021 15:19:29 +0000 (16:19 +0100)]
Add `ptr::from_raw_parts`, `ptr::from_raw_parts_mut`, and `NonNull::from_raw_parts`

The use of module-level functions instead of associated functions
on `<*const T>` or `<*mut T>` follows the precedent of
`ptr::slice_from_raw_parts` and `ptr::slice_from_raw_parts_mut`.

3 years agoAdd `size_of`, `align_of`, and `layout` methods to `DynMetadata`
Simon Sapin [Wed, 13 Jan 2021 10:09:15 +0000 (11:09 +0100)]
Add `size_of`, `align_of`, and `layout` methods to `DynMetadata`

3 years agoParameterize `DynMetadata` over its `dyn SomeTrait` type
Simon Sapin [Tue, 29 Dec 2020 17:31:22 +0000 (18:31 +0100)]
Parameterize `DynMetadata` over its `dyn SomeTrait` type

3 years agoAdd `ptr::Pointee` trait (for all types) and `ptr::metadata` function
Simon Sapin [Mon, 19 Oct 2020 13:38:11 +0000 (15:38 +0200)]
Add `ptr::Pointee` trait (for all types) and `ptr::metadata` function

RFC: https://github.com/rust-lang/rfcs/pull/2580

3 years ago:arrow_up: rust-analyzer
Laurențiu Nicola [Mon, 15 Feb 2021 12:58:36 +0000 (14:58 +0200)]
:arrow_up: rust-analyzer

3 years agoAuto merge of #81855 - cjgillot:ensure-cache, r=oli-obk
bors [Mon, 15 Feb 2021 12:11:59 +0000 (12:11 +0000)]
Auto merge of #81855 - cjgillot:ensure-cache, r=oli-obk

Check the result cache before the DepGraph when ensuring queries

Split out of https://github.com/rust-lang/rust/pull/70951

Calling `ensure` on already forced queries is a common operation.
Looking at the results cache first is faster than checking the DepGraph for a green node.

3 years agothe environment round here is awfully empty
Ellen [Mon, 15 Feb 2021 11:38:20 +0000 (11:38 +0000)]
the environment round here is awfully empty

capitalism

3 years agoFix ES5 errors (IE11)
Guillaume Gomez [Mon, 15 Feb 2021 09:11:37 +0000 (10:11 +0100)]
Fix ES5 errors (IE11)

3 years ago32-bit ARM: Emit `lr` instead of `r14` when specified as an `asm!` output register.
Johnathan Van Why [Mon, 15 Feb 2021 06:05:33 +0000 (22:05 -0800)]
32-bit ARM: Emit `lr` instead of `r14` when specified as an `asm!` output register.

On 32-bit ARM platforms, the register `r14` has the alias `lr`. When used as an output register in `asm!`, rustc canonicalizes the name to `r14`. LLVM only knows the register by the name `lr`, and rejects it. This changes rustc's LLVM code generation to output `lr` instead.

3 years agoUpdate methods.rs
Squirrel [Mon, 15 Feb 2021 07:39:15 +0000 (07:39 +0000)]
Update methods.rs

Remove unused const

3 years agoUse wrapping sub
Squirrel [Mon, 15 Feb 2021 07:35:28 +0000 (07:35 +0000)]
Use wrapping sub

Co-authored-by: Mara <m-ou.se@m-ou.se>
3 years agoRevise HIR lowering comment
Edward Shen [Mon, 15 Feb 2021 05:28:58 +0000 (00:28 -0500)]
Revise HIR lowering comment

3 years agoFix test issue reference
Edward Shen [Mon, 15 Feb 2021 05:03:57 +0000 (00:03 -0500)]
Fix test issue reference

3 years agoUse delay_span_bug for mismatched subst/hir arg
Edward Shen [Mon, 15 Feb 2021 04:59:45 +0000 (23:59 -0500)]
Use delay_span_bug for mismatched subst/hir arg

3 years agoUpdate link for extern prelude.
Eric Huss [Mon, 15 Feb 2021 03:38:40 +0000 (19:38 -0800)]
Update link for extern prelude.

3 years agoRemove redundant bool_to_option feature gate
est31 [Mon, 15 Feb 2021 02:55:52 +0000 (03:55 +0100)]
Remove redundant bool_to_option feature gate

3 years agoUse !Sync std::lazy::OnceCell in usefulness checking
Tomasz Miąsko [Mon, 15 Feb 2021 00:00:00 +0000 (00:00 +0000)]
Use !Sync std::lazy::OnceCell in usefulness checking

The `rustc_data_structures::sync::OnceCell` is thread-safe when building
a parallel compiler. This is unnecessary for the purposes of pattern
usefulness checking. Use `!Sync` `std::lazy::OnceCell` instead.

3 years agoStabilize Arguments::as_str
Steven Fackler [Sun, 14 Feb 2021 22:47:08 +0000 (17:47 -0500)]
Stabilize Arguments::as_str

Closes #74442

3 years agoHide internals items in documentation
Alphyr [Sat, 16 Jan 2021 17:30:22 +0000 (18:30 +0100)]
Hide internals items in documentation

Co-authored-by: Joshua Nelson <joshua@yottadb.com>
3 years agoApply suggestions
Benoît du Garreau [Wed, 16 Dec 2020 21:06:06 +0000 (22:06 +0100)]
Apply suggestions

- Move `assert_failed` to core::panicking`
- Make `assert_failed` use an enum instead of a string

3 years agoApply suggestion
Benoît du Garreau [Wed, 9 Dec 2020 10:29:42 +0000 (11:29 +0100)]
Apply suggestion

3 years agoFix UI tests and merge `assert_eq` and `assert_ne` internal functions
Benoît du Garreau [Mon, 16 Nov 2020 20:33:01 +0000 (21:33 +0100)]
Fix UI tests and merge `assert_eq` and `assert_ne` internal functions

3 years agoUpdate library/core/src/macros/mod.rs
lukaslueg [Sun, 14 Feb 2021 22:33:43 +0000 (23:33 +0100)]
Update library/core/src/macros/mod.rs

Co-authored-by: Joshua Nelson <joshua@yottadb.com>
3 years agoAuto merge of #82103 - Dylan-DPC:rollup-5wv8rid, r=Dylan-DPC
bors [Sun, 14 Feb 2021 22:26:21 +0000 (22:26 +0000)]
Auto merge of #82103 - Dylan-DPC:rollup-5wv8rid, r=Dylan-DPC

Rollup of 11 pull requests

Successful merges:

 - #80523 (#[doc(inline)] sym_generated)
 - #80920 (Visit more targets when validating attributes)
 - #81720 (Updated smallvec version due to RUSTSEC-2021-0003)
 - #81891 ([rustdoc-json] Make `header` a vec of modifiers, and FunctionPointer consistent)
 - #81912 (Implement the precise analysis pass for lint `disjoint_capture_drop_reorder`)
 - #81914 (Fixing bad suggestion for `_` in `const` type when a function #81885)
 - #81919 (BTreeMap: fix internal comments)
 - #81927 (Add a regression test for #32498)
 - #81965 (Fix MIR pretty printer for non-local DefIds)
 - #82029 (Use debug log level for developer oriented logs)
 - #82056 (fix ice (#82032))

Failed merges:

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

3 years agoFix typo in link to CreateSymbolicLinkW documentation.
Mara Bos [Sun, 14 Feb 2021 22:16:45 +0000 (23:16 +0100)]
Fix typo in link to CreateSymbolicLinkW documentation.

3 years agoUse `#[rustc_inherit_overflow_checks]` instead of Add::add etc.
Mara Bos [Wed, 3 Feb 2021 23:20:08 +0000 (00:20 +0100)]
Use `#[rustc_inherit_overflow_checks]` instead of Add::add etc.

3 years agoImprove assert_eq! and assert_ne!
Benoît du Garreau [Mon, 16 Nov 2020 14:40:33 +0000 (15:40 +0100)]
Improve assert_eq! and assert_ne!

It should improve compile times and reduce instruction cache use by moving the
panic formatting to a monomorphised function

3 years agoAdd missing env!-decl variant
Lukas Lueg [Sun, 14 Feb 2021 21:39:47 +0000 (22:39 +0100)]
Add missing env!-decl variant

Resolves #82117

3 years agoSimpler way to convert to digit
Giles Cope [Sun, 14 Feb 2021 11:34:22 +0000 (11:34 +0000)]
Simpler way to convert to digit

3 years agoexpand: Remove redundant calls to configure
Vadim Petrochenkov [Sun, 14 Feb 2021 16:47:00 +0000 (19:47 +0300)]
expand: Remove redundant calls to configure

Starting from https://github.com/rust-lang/rust/pull/63468 cfg attributes on variants, fields, fn params etc. are processed together with other attributes (via `configure!`).

3 years agoexpand: Remove obsolete `ExpansionConfig::keep_macs`
Vadim Petrochenkov [Sun, 14 Feb 2021 16:43:54 +0000 (19:43 +0300)]
expand: Remove obsolete `ExpansionConfig::keep_macs`

Maybe it was used before the introduction of placeholders, but now it has no effect.

3 years agorustc_span: Remove obsolete `allow_internal_unstable_backcompat_hack`
Vadim Petrochenkov [Sun, 14 Feb 2021 15:56:21 +0000 (18:56 +0300)]
rustc_span: Remove obsolete `allow_internal_unstable_backcompat_hack`

3 years agoDon't fail to remove files if they are missing
Simonas Kazlauskas [Sun, 14 Feb 2021 16:27:08 +0000 (18:27 +0200)]
Don't fail to remove files if they are missing

In the backend we may want to remove certain temporary files, but in
certain other situations these files might not be produced in the first
place. We don't exactly care about that, and the intent is really that
these files are gone after a certain point in the backend.

Here we unify the backend file removing calls to use `ensure_removed`
which will attempt to delete a file, but will not fail if it does not
exist (anymore).

The tradeoff to this approach is, of course, that we may miss instances
were we are attempting to remove files at wrong paths due to some bug –
compilation would silently succeed but the temporary files would remain
there somewhere.