]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agoRollup merge of #69921 - matthiaskrgr:rustdoc_import, r=Centril
Mazdak Farrokhzad [Thu, 12 Mar 2020 15:32:25 +0000 (16:32 +0100)]
Rollup merge of #69921 - matthiaskrgr:rustdoc_import, r=Centril

rustdoc: remove unused import

```
    Checking rustdoc v0.0.0 (/home/matthias/vcs/github/rust/src/librustdoc)
warning: unused import: `rustc_span::symbol::sym`
  --> src/librustdoc/clean/inline.rs:15:5
   |
15 | use rustc_span::symbol::sym;
   |     ^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: `#[warn(unused_imports)]` on by default
```

4 years agoRollup merge of #69830 - RalfJung:miri-invalid-terminator, r=oli-obk
Mazdak Farrokhzad [Thu, 12 Mar 2020 15:32:23 +0000 (16:32 +0100)]
Rollup merge of #69830 - RalfJung:miri-invalid-terminator, r=oli-obk

miri: ICE on invalid terminators

We've run a lot of MIR in Miri (including some generators) and never seen these.

@tmandry is it correct that `Yield` and `GeneratorDrop` get lowered away?

@eddyb @oli-obk what's with this `Abort` that does not seem to ever actually exist? Codegen *does* seem to handle it, so I wonder why Miri can get away without that. In fact, codegen handles it twice:

https://github.com/rust-lang/rust/blob/1d5241c96208ca7d925442b1a5fa45ad18717a6f/src/librustc_codegen_ssa/mir/block.rs#L796

https://github.com/rust-lang/rust/blob/1d5241c96208ca7d925442b1a5fa45ad18717a6f/src/librustc_codegen_ssa/mir/mod.rs#L296

4 years agoRollup merge of #69792 - LenaWil:try_reserve_error/impl-error, r=sfackler
Mazdak Farrokhzad [Thu, 12 Mar 2020 15:32:21 +0000 (16:32 +0100)]
Rollup merge of #69792 - LenaWil:try_reserve_error/impl-error, r=sfackler

Implement Error for TryReserveError

I noticed that the Error trait wasn't implemented for TryReserveError. (#48043)

Not sure if the error messages and code style are 100% correct, it's my first time contributing to the Rust std.

4 years agoRollup merge of #69747 - spastorino:rename-rustc-guide, r=pietroalbini
Mazdak Farrokhzad [Thu, 12 Mar 2020 15:32:19 +0000 (16:32 +0100)]
Rollup merge of #69747 - spastorino:rename-rustc-guide, r=pietroalbini

Rename rustc guide

This is in preparation for https://github.com/rust-lang/rustc-guide/issues/470
Needs to be merged after we actually rename the guide.

Have used this to rename:

`git grep -l 'rustc_guide' | xargs sed -i 's/rustc_guide/rustc_dev_guide/g'`
`git grep -l 'rustc-guide' | xargs sed -i 's/rustc-guide/rustc-dev-guide/g'`
`git grep -l 'rustc guide' | xargs sed -i 's/rustc guide/rustc dev guide/g'`

4 years agoRollup merge of #69722 - estebank:negative-impl-span-ast, r=Centril
Mazdak Farrokhzad [Thu, 12 Mar 2020 15:32:17 +0000 (16:32 +0100)]
Rollup merge of #69722 - estebank:negative-impl-span-ast, r=Centril

Tweak output for invalid negative impl AST errors

Use more accurate spans for negative `impl` errors.

r? @Centril

4 years agoRollup merge of #69705 - ehuss:toolstate-remove-redundant-beta, r=Mark-Simulacrum
Mazdak Farrokhzad [Thu, 12 Mar 2020 15:32:15 +0000 (16:32 +0100)]
Rollup merge of #69705 - ehuss:toolstate-remove-redundant-beta, r=Mark-Simulacrum

Toolstate: remove redundant beta-week check.

I made a bit of a mistake in #69624.  The "beta regression" doesn't need to be checked twice.

I also rolled up #69693 to avoid merge conflicts.

4 years agoRollup merge of #69674 - mark-i-m:assoc-fn, r=matthewjasper
Mazdak Farrokhzad [Thu, 12 Mar 2020 15:32:13 +0000 (16:32 +0100)]
Rollup merge of #69674 - mark-i-m:assoc-fn, r=matthewjasper

Rename DefKind::Method and TraitItemKind::Method

r? @eddyb, @Centril, or @matthewjasper

cc #69498 #60163

4 years agoRollup merge of #69011 - foeb:document-unsafe-core-fmt, r=Mark-Simulacrum
Mazdak Farrokhzad [Thu, 12 Mar 2020 15:32:11 +0000 (16:32 +0100)]
Rollup merge of #69011 - foeb:document-unsafe-core-fmt, r=Mark-Simulacrum

Document unsafe blocks in core::fmt

r? @RalfJung
CC: @rust-lang/wg-unsafe-code-guidelines
#66219

Sorry for the hiatus, but here's a few more files with the unsafe blocks documented! I think working on it smaller chunks like this will be easier for everyone.

4 years agoRollup merge of #68899 - kinseytamsin:lexerror-error-impl, r=Centril
Mazdak Farrokhzad [Thu, 12 Mar 2020 15:32:07 +0000 (16:32 +0100)]
Rollup merge of #68899 - kinseytamsin:lexerror-error-impl, r=Centril

Add Display and Error impls for proc_macro::LexError

This should allow LexError to play much nicer with the `?` operator.

Fixes #68896.

(I'm not sure if I did the stability attributes right, so if I need to change them, please let me know!)

4 years agoAuto merge of #68551 - Marwes:allocations_mir, r=ecstatic-morse
bors [Thu, 12 Mar 2020 09:16:53 +0000 (09:16 +0000)]
Auto merge of #68551 - Marwes:allocations_mir, r=ecstatic-morse

perf: Reuse a Vec in mir simplification

Just moves the vec out of the outer loop so it is reused every iteration

4 years agoAuto merge of #68191 - simlay:add-tvSO-target, r=nagisa
bors [Thu, 12 Mar 2020 04:01:02 +0000 (04:01 +0000)]
Auto merge of #68191 - simlay:add-tvSO-target, r=nagisa

Added tvOS as targets

This is a first attempt of adding support tvOS as described in #48862. It's got a lot of overlap with [src/librustc_target/spec/apple_ios_base.rs](https://github.com/rust-lang/rust/blob/31dd4f4acbcbdb02b0745d2136399ed664a28050/src/librustc_target/spec/apple_ios_base.rs).

I thought about refactoring `apple_ios_base.rs` to include this as well but that would require each of the ios and tvos targets to be of the something like the form `let base = opts(AppleOS::TV, Arch::Arm64)?;` I also did the same thing for watchOS because from what I can tell, all three targets (iOS, tvOS, and watchOS) have the same logic but have different parameters being sent to `xcrun`. Thoughts?

As far as the `data_layout` and other parameters to `Target`, I did as much research as I could but it really seems that processor in the [iPhone 11 is the same as the apple TV](https://en.wikipedia.org/wiki/Apple-designed_processors) so I didn't change any of those parameters.

I did get this to build and tested that it's actually running the the below logic (because the parameter to `xcrun` is `appletvos` not `tvos`).

I didn't manage to get it to actually compile a file with `fn main(){}` because I don't have the stdlib for `aarch64-apple-tvos` compiled it seems. Is there documentation for this?

Similar to the ending of https://github.com/rust-lang/rust/pull/63467, I'm not sure what to do next.

4 years agoGive LexError more descriptive Display impl
Kinsey Favre [Sat, 8 Feb 2020 16:51:54 +0000 (10:51 -0600)]
Give LexError more descriptive Display impl

4 years agoCorrect stability attribute for new LexError impls
Kinsey Favre [Sat, 8 Feb 2020 15:55:49 +0000 (09:55 -0600)]
Correct stability attribute for new LexError impls

4 years agoReformat match statement to make the check pass
Lena Wildervanck [Wed, 11 Mar 2020 16:55:14 +0000 (17:55 +0100)]
Reformat match statement to make the check pass

4 years agoFormat the match statement
Lena Wildervanck [Wed, 11 Mar 2020 16:30:04 +0000 (17:30 +0100)]
Format the match statement

4 years agoAdd Display and Error impls for proc_macro::LexError
Kinsey Favre [Thu, 6 Feb 2020 18:25:18 +0000 (12:25 -0600)]
Add Display and Error impls for proc_macro::LexError

This should allow LexError to play much nicer with the `?` operator.

4 years agoreview comments
Esteban Küber [Wed, 11 Mar 2020 16:17:55 +0000 (09:17 -0700)]
review comments

4 years agorustdoc: remove unused import
Matthias Krüger [Wed, 11 Mar 2020 13:24:07 +0000 (14:24 +0100)]
rustdoc: remove unused import

4 years agoAuto merge of #69919 - Centril:rollup-fxo33zs, r=Centril
bors [Wed, 11 Mar 2020 13:05:52 +0000 (13:05 +0000)]
Auto merge of #69919 - Centril:rollup-fxo33zs, r=Centril

Rollup of 8 pull requests

Successful merges:

 - #66472 (--show-coverage json)
 - #69603 (tidy: replace `make check` with `./x.py test` in documentation)
 - #69760 (Improve expression & attribute parsing)
 - #69828 (fix memory leak when vec::IntoIter panics during drop)
 - #69850 (panic_bounds_check: use caller_location, like PanicFnLangItem)
 - #69876 (Add long error explanation for E0739)
 - #69888 ([Miri] Use a session variable instead of checking for an env var always)
 - #69893 (librustc_codegen_llvm: Use slices instead of 0-terminated strings)

Failed merges:

r? @ghost

4 years agoRollup merge of #69893 - tmiasko:cstr, r=petrochenkov
Mazdak Farrokhzad [Wed, 11 Mar 2020 13:03:54 +0000 (14:03 +0100)]
Rollup merge of #69893 - tmiasko:cstr, r=petrochenkov

librustc_codegen_llvm: Use slices instead of 0-terminated strings

Changed functions:
* LLVMRustGetOrInsertFunction
* LLVMRustGetNamedValue
* LLVMRustBuildCall (removed unused name argument)
* LLVMRustInlineAsm
* LLVMRustInlineAsmVerify
* LLVMRustAppendModuleInlineAsm

4 years agoRollup merge of #69888 - wesleywiser:miri_exception_env_var_to_session_var, r=RalfJung
Mazdak Farrokhzad [Wed, 11 Mar 2020 13:03:53 +0000 (14:03 +0100)]
Rollup merge of #69888 - wesleywiser:miri_exception_env_var_to_session_var, r=RalfJung

[Miri] Use a session variable instead of checking for an env var always

In CTFE heavy code, checking the env var everytime is inefficient. We
can do a lot better by using a `Session` variable instead.

r? @RalfJung

Part of #69297

4 years agoRollup merge of #69876 - ayushmishra2005:doc/61137-add-long-error-code-e0739, r=Dylan-DPC
Mazdak Farrokhzad [Wed, 11 Mar 2020 13:03:51 +0000 (14:03 +0100)]
Rollup merge of #69876 - ayushmishra2005:doc/61137-add-long-error-code-e0739, r=Dylan-DPC

Add long error explanation for E0739

Add long explanation for the E0739 error code
Part of #61137

r? @GuillaumeGomez

4 years agoRollup merge of #69850 - RalfJung:panic-bounds-check, r=eddyb
Mazdak Farrokhzad [Wed, 11 Mar 2020 13:03:49 +0000 (14:03 +0100)]
Rollup merge of #69850 - RalfJung:panic-bounds-check, r=eddyb

panic_bounds_check: use caller_location, like PanicFnLangItem

The `PanicFnLangItem` got switched to using `#[caller_location]` at some point, but `PanicBoundsCheckFnLangItem` was kept in the old style. For consistency, switch that one over to use `#[caller_location]` as well.

This is also helpful for Miri as it means the `assert_panic` machine hook never needs to know the current `Span`.

4 years agoRollup merge of #69828 - RalfJung:vec-leak, r=kennytm
Mazdak Farrokhzad [Wed, 11 Mar 2020 13:03:47 +0000 (14:03 +0100)]
Rollup merge of #69828 - RalfJung:vec-leak, r=kennytm

fix memory leak when vec::IntoIter panics during drop

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

4 years agoRollup merge of #69760 - Centril:parse-expr-improve, r=estebank
Mazdak Farrokhzad [Wed, 11 Mar 2020 13:03:45 +0000 (14:03 +0100)]
Rollup merge of #69760 - Centril:parse-expr-improve, r=estebank

Improve expression & attribute parsing

This PR includes misc improvements to expression and attribute parsing.

1. Some code simplifications
2. Better recovery for various block forms, e.g. `loop statements }` (missing `{` after `loop`). (See e.g., `block-no-opening-brace.rs` among others for examples.)
3. Added recovery for e.g., `unsafe $b` where `$b` refers to a `block` macro fragment. (See `bad-interpolated-block.rs` for examples.)
4. ^--- These are done so that code sharing in block parsing is increased.
5. Added recovery for e.g., `'label: loop { ... }` (See `labeled-no-colon-expr.rs`.)
6. Added recovery for e.g., `&'lifetime expr` (See `regions-out-of-scope-slice.rs`.)
7. Added recovery for e.g., `fn foo() = expr;` (See `fn-body-eq-expr-semi.rs`.)
8. Simplified attribute parsing code & slightly improved diagnostics.
9. Added recovery for e.g., `Box<('a) + Trait>`.
10. Added recovery for e.g, `if true #[attr] {} else #[attr] {} else #[attr] if true {}`.

r? @estebank

4 years agoRollup merge of #69603 - chrissimpkins:tidy-docs-update, r=petrochenkov
Mazdak Farrokhzad [Wed, 11 Mar 2020 13:03:44 +0000 (14:03 +0100)]
Rollup merge of #69603 - chrissimpkins:tidy-docs-update, r=petrochenkov

tidy: replace `make check` with `./x.py test` in documentation

This PR includes a minor documentation update for tidy.  It replaces the `make check` approach with `./x.py test` and describes how to execute the tidy checks (only) with ~~`./x.py test src/tools/tidy`~~ `./x.py test tidy`.

4 years agoRollup merge of #66472 - GuillaumeGomez:show-coverage-json, r=ollie27
Mazdak Farrokhzad [Wed, 11 Mar 2020 13:03:42 +0000 (14:03 +0100)]
Rollup merge of #66472 - GuillaumeGomez:show-coverage-json, r=ollie27

--show-coverage json

The purpose of this change is to be able to use it as a tool in docs.rs in order to provide some more stats to crates' owners. Eventually even create a badge or something along the line.

r? @QuietMisdreavus

4 years agoAuto merge of #69914 - Centril:rollup-wtmdinz, r=Centril
bors [Wed, 11 Mar 2020 09:37:19 +0000 (09:37 +0000)]
Auto merge of #69914 - Centril:rollup-wtmdinz, r=Centril

Rollup of 10 pull requests

Successful merges:

 - #66059 (mem::zeroed/uninit: panic on types that do not permit zero-initialization)
 - #69373 (Stabilize const for integer {to,from}_{be,le,ne}_bytes methods)
 - #69591 (Use TypeRelating for instantiating query responses)
 - #69625 (Implement nth, last, and count for iter::Copied)
 - #69645 (const forget tests)
 - #69766 (Make Point `Copy` in arithmetic documentation)
 - #69825 (make `mem::discriminant` const)
 - #69859 (fix #62456)
 - #69891 (Exhaustiveness checking, `Matrix::push`: recursively expand or-patterns)
 - #69896 (parse: Tweak the function parameter edition check)

Failed merges:

r? @ghost

4 years agoRollup merge of #69896 - petrochenkov:reqname2, r=Centril
Mazdak Farrokhzad [Wed, 11 Mar 2020 09:36:33 +0000 (10:36 +0100)]
Rollup merge of #69896 - petrochenkov:reqname2, r=Centril

parse: Tweak the function parameter edition check

Follow-up to https://github.com/rust-lang/rust/pull/69801.

Edition of a code fragment is inferred from "the place where the code is written".
For individual tokens like edition-specific keywords it may be the span of the token itself ("uninterpolated" span), but for larger code fragments it's probably not, in the test example the trait method is obviously written in "2015 edition code".

r? @Centril

4 years agoRollup merge of #69891 - Centril:fix-69875, r=varkor
Mazdak Farrokhzad [Wed, 11 Mar 2020 09:36:31 +0000 (10:36 +0100)]
Rollup merge of #69891 - Centril:fix-69875, r=varkor

Exhaustiveness checking, `Matrix::push`: recursively expand or-patterns

> There's an implicit invariant that there should be no or-patterns directly in the first column of the matrix, but this invariant is broken exactly when an or-pattern has a child that is itself an or-pattern.

Here we preserve this broken invariant by recursively expanding `PatKind::Or`s in `Matrix::push`.
Fixes https://github.com/rust-lang/rust/issues/69875.

r? @varkor
cc @Nadrieril
cc https://github.com/rust-lang/rust/issues/54883

4 years agoRollup merge of #69859 - contrun:fix-62456, r=matthewjasper
Mazdak Farrokhzad [Wed, 11 Mar 2020 09:36:29 +0000 (10:36 +0100)]
Rollup merge of #69859 - contrun:fix-62456, r=matthewjasper

fix #62456

closes https://github.com/rust-lang/rust/issues/62456

4 years agoRollup merge of #69825 - lcnr:discriminant, r=oli-obk
Mazdak Farrokhzad [Wed, 11 Mar 2020 09:36:28 +0000 (10:36 +0100)]
Rollup merge of #69825 - lcnr:discriminant, r=oli-obk

make `mem::discriminant` const

implements #69821, which could be used as a tracking issue for `const_discriminant`.

Should this be added to the meta tracking issue #57563?
@Lokathor

4 years agoRollup merge of #69766 - skade:make-point-copy-in-add-documentation, r=shepmaster
Mazdak Farrokhzad [Wed, 11 Mar 2020 09:36:26 +0000 (10:36 +0100)]
Rollup merge of #69766 - skade:make-point-copy-in-add-documentation, r=shepmaster

Make Point `Copy` in arithmetic documentation

Small composite types like `Point { x: i32, y: i32}` are plain
old data and we should encourage users to derive `Copy` on them.

This changes the semantics of the edited examples slightly: instead
of consuming the operands during addition, it will copy them. This
is desired behaviour.

4 years agoRollup merge of #69645 - DutchGhost:const-forget-tests, r=Dylan-DPC
Mazdak Farrokhzad [Wed, 11 Mar 2020 09:36:24 +0000 (10:36 +0100)]
Rollup merge of #69645 - DutchGhost:const-forget-tests, r=Dylan-DPC

const forget tests

Adds tests for https://github.com/rust-lang/rust/pull/69617

4 years agoRollup merge of #69625 - Stebalien:feat/iter-copy-specialize, r=KodrAus
Mazdak Farrokhzad [Wed, 11 Mar 2020 09:36:22 +0000 (10:36 +0100)]
Rollup merge of #69625 - Stebalien:feat/iter-copy-specialize, r=KodrAus

Implement nth, last, and count for iter::Copied

Implement nth, last and count for iter::Copied.

4 years agoRollup merge of #69591 - matthewjasper:query-response-relate, r=nikomatsakis
Mazdak Farrokhzad [Wed, 11 Mar 2020 09:36:19 +0000 (10:36 +0100)]
Rollup merge of #69591 - matthewjasper:query-response-relate, r=nikomatsakis

Use TypeRelating for instantiating query responses

`eq` can add constraints to `RegionConstraintData`, which isn't allowed during borrow checking outside of a `CustomTypeOp`. Use `TypeRelating` instead to always push constraints to the obligations list.

closes #69490

4 years agoRollup merge of #69373 - tspiteri:const_int_conversion, r=oli-obk
Mazdak Farrokhzad [Wed, 11 Mar 2020 09:36:18 +0000 (10:36 +0100)]
Rollup merge of #69373 - tspiteri:const_int_conversion, r=oli-obk

Stabilize const for integer {to,from}_{be,le,ne}_bytes methods

All of these functions can be implemented simply and naturally as const functions, e.g. `u32::from_le_bytes` can be implemented as
```rust
(bytes[0] as u32)
    | (bytes[1] as u32) << 8
    | (bytes[2] as u32) << 16
    | (bytes[3] as u32) << 24
```
So stabilizing the constness will not expose that internally they are implemented using transmute which is not const in stable.

4 years agoRollup merge of #66059 - RalfJung:panic-on-non-zero, r=eddyb
Mazdak Farrokhzad [Wed, 11 Mar 2020 09:36:16 +0000 (10:36 +0100)]
Rollup merge of #66059 - RalfJung:panic-on-non-zero, r=eddyb

mem::zeroed/uninit: panic on types that do not permit zero-initialization

r? @eddyb @oli-obk

Cc https://github.com/rust-lang/rust/issues/62825

Also see [this summary comment](https://github.com/rust-lang/rust/pull/66059#issuecomment-586734747)

4 years agolibrustc_codegen_llvm: Use slices instead of 0-terminated strings
Tomasz Miąsko [Tue, 10 Mar 2020 00:00:00 +0000 (00:00 +0000)]
librustc_codegen_llvm: Use slices instead of 0-terminated strings

Changed functions:
* LLVMRustGetOrInsertFunction
* LLVMRustGetNamedValue
* LLVMRustBuildCall (removed unused name argument)
* LLVMRustInlineAsm
* LLVMRustInlineAsmVerify
* LLVMRustAppendModuleInlineAsm

4 years agoreview comments
Esteban Küber [Wed, 11 Mar 2020 00:59:32 +0000 (17:59 -0700)]
review comments

4 years ago[Miri] Use a session variable instead of checking for an env var always
Wesley Wiser [Mon, 17 Feb 2020 01:32:25 +0000 (20:32 -0500)]
[Miri] Use a session variable instead of checking for an env var always

In CTFE heavy code, checking the env var everytime is inefficient. We
can do a lot better by using a `Session` variable instead.

4 years agorust-lang.github.io/rustc-dev-guide -> rustc-dev-guide.rust-lang.org
Santiago Pastorino [Mon, 9 Mar 2020 21:33:04 +0000 (18:33 -0300)]
rust-lang.github.io/rustc-dev-guide -> rustc-dev-guide.rust-lang.org

4 years agoRename Rustc Guide to Rustc Dev Guide
Santiago Pastorino [Fri, 6 Mar 2020 14:17:12 +0000 (11:17 -0300)]
Rename Rustc Guide to Rustc Dev Guide

4 years agoRename rustc_guide to rustc_dev_guide
Santiago Pastorino [Fri, 6 Mar 2020 13:54:00 +0000 (10:54 -0300)]
Rename rustc_guide to rustc_dev_guide

4 years agoRename rustc guide to rustc dev guide
Santiago Pastorino [Thu, 5 Mar 2020 21:07:42 +0000 (18:07 -0300)]
Rename rustc guide to rustc dev guide

4 years agoRename rustc-guide to rustc-dev-guide
Santiago Pastorino [Fri, 6 Mar 2020 14:13:26 +0000 (11:13 -0300)]
Rename rustc-guide to rustc-dev-guide

4 years agoparse: Tweak the function parameter edition check
Vadim Petrochenkov [Tue, 10 Mar 2020 18:02:15 +0000 (21:02 +0300)]
parse: Tweak the function parameter edition check

Move anon-params tests to ui/anon-params.

4 years agoAuto merge of #66364 - Centril:cleanup-macro-def, r=petrochenkov,eddyb
bors [Tue, 10 Mar 2020 17:12:48 +0000 (17:12 +0000)]
Auto merge of #66364 - Centril:cleanup-macro-def, r=petrochenkov,eddyb

Cleanup `rmeta::MacroDef`

Avoid using rountrip parsing in the encoder and in `fn load_macro_untracked`.

The main reason I was interested in this was to remove `rustc_parse` as a dependency of `rustc_metadata` but it seems like this had other benefits as well.

Fixes #49511.

r? @eddyb
cc @matthewjasper @estebank @petrochenkov

4 years agoMake Point `Copy` in arithmetic documentation
Florian Gilcher [Fri, 6 Mar 2020 09:37:23 +0000 (10:37 +0100)]
Make Point `Copy` in arithmetic documentation

Small composite types like `Point { x: i32, y: i32}` are plain
old data and we should encourage users to derive `Copy` on them.

This changes the semantics of the edited examples slightly: instead
of consuming the operands during addition, it will copy them. This
is desired behaviour.

Co-Authored-By: Jake Goulding <shepmaster@mac.com>
4 years agoMatrix::push: recursively expand or-patterns
Mazdak Farrokhzad [Tue, 10 Mar 2020 15:20:47 +0000 (16:20 +0100)]
Matrix::push: recursively expand or-patterns

4 years agoexplain the use of a custom identity function
Bastian Kauschke [Tue, 10 Mar 2020 11:46:22 +0000 (12:46 +0100)]
explain the use of a custom identity function

4 years agoRemove deprecated description function of TryReserveError
Lena Wildervanck [Tue, 10 Mar 2020 10:19:40 +0000 (11:19 +0100)]
Remove deprecated description function of TryReserveError

4 years agoalso make panic_fmt track_caller
Ralf Jung [Tue, 10 Mar 2020 09:31:03 +0000 (10:31 +0100)]
also make panic_fmt track_caller

4 years agoparse_if_expr: recover on attributes
Mazdak Farrokhzad [Sat, 7 Mar 2020 16:16:29 +0000 (17:16 +0100)]
parse_if_expr: recover on attributes

4 years agotrait-object-lifetime-parens: improve recovery.
Mazdak Farrokhzad [Sat, 7 Mar 2020 12:52:55 +0000 (13:52 +0100)]
trait-object-lifetime-parens: improve recovery.

4 years agouse check_path more
Mazdak Farrokhzad [Sat, 7 Mar 2020 12:15:58 +0000 (13:15 +0100)]
use check_path more

4 years agosimplify & improve parse_ty_tuple_or_parens
Mazdak Farrokhzad [Sat, 7 Mar 2020 11:54:31 +0000 (12:54 +0100)]
simplify & improve parse_ty_tuple_or_parens

4 years agoissue 68890: add more minimal repro
Mazdak Farrokhzad [Sat, 7 Mar 2020 11:14:39 +0000 (12:14 +0100)]
issue 68890: add more minimal repro

4 years agoerror_block_no_opening_brace: handle closures better
Mazdak Farrokhzad [Sat, 7 Mar 2020 10:00:40 +0000 (11:00 +0100)]
error_block_no_opening_brace: handle closures better

4 years agoblock-no-opening-brace: add another statement
Mazdak Farrokhzad [Sat, 7 Mar 2020 08:49:46 +0000 (09:49 +0100)]
block-no-opening-brace: add another statement

4 years agoparser: add note for `'label expr`.
Mazdak Farrokhzad [Sat, 7 Mar 2020 08:41:12 +0000 (09:41 +0100)]
parser: add note for `'label expr`.

4 years agoparser/attr: adjust indentation.
Mazdak Farrokhzad [Sat, 7 Mar 2020 08:31:00 +0000 (09:31 +0100)]
parser/attr: adjust indentation.

4 years agoparse_labeled_expr: add a suggestion on missing colon.
Mazdak Farrokhzad [Fri, 6 Mar 2020 02:43:59 +0000 (03:43 +0100)]
parse_labeled_expr: add a suggestion on missing colon.

4 years agoparse_block_tail: reduce visibility
Mazdak Farrokhzad [Thu, 5 Mar 2020 23:32:05 +0000 (00:32 +0100)]
parse_block_tail: reduce visibility

4 years agounify/improve/simplify attribute parsing
Mazdak Farrokhzad [Thu, 5 Mar 2020 10:42:56 +0000 (11:42 +0100)]
unify/improve/simplify attribute parsing

4 years agoparse: recover on `fn foo() = expr;`
Mazdak Farrokhzad [Thu, 5 Mar 2020 08:08:09 +0000 (09:08 +0100)]
parse: recover on `fn foo() = expr;`

4 years agoparse: simplify parse_fn_body
Mazdak Farrokhzad [Thu, 5 Mar 2020 07:08:07 +0000 (08:08 +0100)]
parse: simplify parse_fn_body

4 years agoparse: recover on `&'lt $expr` / `'lt $expr`.
Mazdak Farrokhzad [Thu, 5 Mar 2020 06:54:22 +0000 (07:54 +0100)]
parse: recover on `&'lt $expr` / `'lt $expr`.

4 years agomore reuse in block parsing & improve diagnostics.
Mazdak Farrokhzad [Thu, 5 Mar 2020 04:49:30 +0000 (05:49 +0100)]
more reuse in block parsing & improve diagnostics.

4 years agosimplify parse_inner_attributes
Mazdak Farrokhzad [Thu, 5 Mar 2020 02:24:58 +0000 (03:24 +0100)]
simplify parse_inner_attributes

4 years agouse error_block_no_opening_brace more
Mazdak Farrokhzad [Thu, 5 Mar 2020 01:46:13 +0000 (02:46 +0100)]
use error_block_no_opening_brace more

4 years agoparse_labeled_expr: simplify
Mazdak Farrokhzad [Thu, 5 Mar 2020 00:47:15 +0000 (01:47 +0100)]
parse_labeled_expr: simplify

4 years agomacros/unknown-builtin: use hack for musl problems
Mazdak Farrokhzad [Tue, 10 Mar 2020 07:30:07 +0000 (08:30 +0100)]
macros/unknown-builtin: use hack for musl problems

4 years agospan-api-tests: leave FIXME
Mazdak Farrokhzad [Fri, 6 Mar 2020 13:35:21 +0000 (14:35 +0100)]
span-api-tests: leave FIXME

4 years agorustc_errors: Use ensure_source_file_source_present where necessary.
Ana-Maria Mihalache [Thu, 5 Mar 2020 15:31:11 +0000 (15:31 +0000)]
rustc_errors: Use ensure_source_file_source_present where necessary.

4 years ago--bless some tests
Mazdak Farrokhzad [Mon, 10 Feb 2020 16:37:12 +0000 (17:37 +0100)]
--bless some tests

4 years agoadjust span-api-tests.rs
Mazdak Farrokhzad [Mon, 10 Feb 2020 16:38:51 +0000 (17:38 +0100)]
adjust span-api-tests.rs

4 years agopacify rustdoc by using better url
Mazdak Farrokhzad [Thu, 14 Nov 2019 10:40:01 +0000 (11:40 +0100)]
pacify rustdoc by using better url

4 years agoStore `TokenStream` in `rmeta::MacroDef`.
Mazdak Farrokhzad [Wed, 13 Nov 2019 12:01:43 +0000 (13:01 +0100)]
Store `TokenStream` in `rmeta::MacroDef`.
This removes a hack from `load_macro_untracked` in which parsing is used.

4 years agoAuto merge of #69879 - Centril:rollup-ryea91j, r=Centril
bors [Tue, 10 Mar 2020 05:48:27 +0000 (05:48 +0000)]
Auto merge of #69879 - Centril:rollup-ryea91j, r=Centril

Rollup of 10 pull requests

Successful merges:

 - #69475 (Remove the `no_force` query attribute)
 - #69514 (Remove spotlight)
 - #69677 (rustc_metadata: Give decoder access to whole crate store)
 - #69714 (Make PlaceRef take just one lifetime)
 - #69799 (Allow ZSTs in `AllocRef`)
 - #69817 (test(patterns): add patterns feature tests to borrowck test suite)
 - #69836 (Check if output is immediate value)
 - #69847 (clean up E0393 explanation)
 - #69861 (Add note about localization to std::fmt docs)
 - #69877 (Vec::new is const stable in 1.39 not 1.32)

Failed merges:

r? @ghost

4 years agoRollup merge of #69877 - CAD97:patch-1, r=dtolnay
Mazdak Farrokhzad [Tue, 10 Mar 2020 05:47:59 +0000 (06:47 +0100)]
Rollup merge of #69877 - CAD97:patch-1, r=dtolnay

Vec::new is const stable in 1.39 not 1.32

Changelog: https://github.com/rust-lang/rust/blob/master/RELEASES.md#version-1390-2019-11-07

This really surprised me when a MSRV check for 1.35 failed with `Vec::new is not yet stable as a const fn` and the docs said that it was const stabilized in 1.32.

4 years agoRollup merge of #69861 - Dylnuge:dylnuge/locale-doc, r=Mark-Simulacrum
Mazdak Farrokhzad [Tue, 10 Mar 2020 05:47:58 +0000 (06:47 +0100)]
Rollup merge of #69861 - Dylnuge:dylnuge/locale-doc, r=Mark-Simulacrum

Add note about localization to std::fmt docs

Closes #69681

4 years agoRollup merge of #69847 - GuillaumeGomez:cleanup-e0393, r=Dylan-DPC
Mazdak Farrokhzad [Tue, 10 Mar 2020 05:47:56 +0000 (06:47 +0100)]
Rollup merge of #69847 - GuillaumeGomez:cleanup-e0393, r=Dylan-DPC

clean up E0393 explanation

r? @Dylan-DPC

4 years agoRollup merge of #69836 - JohnTitor:immediate-outputs, r=nagisa
Mazdak Farrokhzad [Tue, 10 Mar 2020 05:47:55 +0000 (06:47 +0100)]
Rollup merge of #69836 - JohnTitor:immediate-outputs, r=nagisa

Check if output is immediate value

Fixes #62046

r? @nagisa

4 years agoRollup merge of #69817 - thekuom:test/borrow-checking-pattern-features, r=Centril
Mazdak Farrokhzad [Tue, 10 Mar 2020 05:47:53 +0000 (06:47 +0100)]
Rollup merge of #69817 - thekuom:test/borrow-checking-pattern-features, r=Centril

test(patterns): add patterns feature tests to borrowck test suite

Addresses request here: https://github.com/rust-lang/rust/pull/69690#issuecomment-595763571

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

r? @Centril

4 years agoRollup merge of #69799 - TimDiekmann:zst, r=Amanieu
Mazdak Farrokhzad [Tue, 10 Mar 2020 05:47:52 +0000 (06:47 +0100)]
Rollup merge of #69799 - TimDiekmann:zst, r=Amanieu

Allow ZSTs in `AllocRef`

Allows ZSTs in all `AllocRef` methods. The implementation of `AllocRef` for `Global` and `System` were adjusted to reflect those changes.

This is the second item on the roadmap to support ZSTs in `AllocRef`: https://github.com/rust-lang/wg-allocators/issues/38#issuecomment-595861542
After this has landed, I will adapt `RawVec`, but since this will be a pretty big overhaul, it makes sense to do a different PR for it.

~~Requires #69794 to land first~~

r? @Amanieu

4 years agoRollup merge of #69714 - spastorino:place-ref-lifetime, r=oli-obk
Mazdak Farrokhzad [Tue, 10 Mar 2020 05:47:50 +0000 (06:47 +0100)]
Rollup merge of #69714 - spastorino:place-ref-lifetime, r=oli-obk

Make PlaceRef take just one lifetime

r? @eddyb

4 years agoRollup merge of #69677 - petrochenkov:spancode, r=eddyb
Mazdak Farrokhzad [Tue, 10 Mar 2020 05:47:49 +0000 (06:47 +0100)]
Rollup merge of #69677 - petrochenkov:spancode, r=eddyb

rustc_metadata: Give decoder access to whole crate store

Pre-requisite for https://github.com/rust-lang/rust/pull/68941.
r? @eddyb

4 years agoRollup merge of #69514 - GuillaumeGomez:remove-spotlight, r=kinnison
Mazdak Farrokhzad [Tue, 10 Mar 2020 05:47:47 +0000 (06:47 +0100)]
Rollup merge of #69514 - GuillaumeGomez:remove-spotlight, r=kinnison

Remove spotlight

I had a few comments saying that this feature was at best misunderstood or not even used so I decided to organize a poll about on [twitter](https://twitter.com/imperioworld_/status/1232769353503956994). After 87 votes, the result is very clear: it's not useful. Considering the amount of code we have just to run it, I think it's definitely worth it to remove it.

r? @kinnison

cc @ollie27

4 years agoRollup merge of #69475 - Zoxc:no-no-force, r=michaelwoerister
Mazdak Farrokhzad [Tue, 10 Mar 2020 05:47:46 +0000 (06:47 +0100)]
Rollup merge of #69475 - Zoxc:no-no-force, r=michaelwoerister

Remove the `no_force` query attribute

This removes the `no_force` query attribute and instead uses the `DepNodeParams` trait to find out if a query can be forced.

Also the `analysis` query is moved to the query macro.

r? @eddyb

4 years agoRemoved trailing whitespace
Ayush Kumar Mishra [Tue, 10 Mar 2020 03:37:29 +0000 (09:07 +0530)]
Removed trailing whitespace

4 years agoVec::new is const tstable in 1.39 not 1.32
Christopher Durham [Tue, 10 Mar 2020 03:07:04 +0000 (23:07 -0400)]
Vec::new is const tstable in 1.39 not 1.32

4 years agoAdd long error explanation for E0739
Ayush Kumar Mishra [Tue, 10 Mar 2020 03:03:14 +0000 (08:33 +0530)]
Add long error explanation for E0739

4 years agoupdate x.py tidy testing command
Chris Simpkins [Tue, 10 Mar 2020 03:00:41 +0000 (23:00 -0400)]
update x.py tidy testing command

4 years agofix test failure due to earlier emitted error
YI [Tue, 10 Mar 2020 02:54:48 +0000 (10:54 +0800)]
fix test failure due to earlier emitted error

4 years agoremove trailing whitespace (tidy)
Chris Simpkins [Tue, 10 Mar 2020 02:15:41 +0000 (22:15 -0400)]
remove trailing whitespace (tidy)

4 years agoAdd documentation of tool testing with x.py script
Chris Simpkins [Tue, 10 Mar 2020 02:04:59 +0000 (22:04 -0400)]
Add documentation of tool testing with x.py script

4 years agoadd documentation of x.py tool testing
Chris Simpkins [Tue, 10 Mar 2020 01:55:56 +0000 (21:55 -0400)]
add documentation of x.py tool testing

4 years agoupdate tidy documentation to recommend ./x.py test tidy
Chris Simpkins [Tue, 10 Mar 2020 01:40:00 +0000 (21:40 -0400)]
update tidy documentation to recommend ./x.py test tidy

4 years agofix #62456
YI [Mon, 9 Mar 2020 17:51:08 +0000 (01:51 +0800)]
fix #62456