Commit Graph

107986 Commits

Author SHA1 Message Date
Matthias Krüger
3244c84363 rustdoc: remove unused import 2020-03-11 14:24:07 +01:00
bors
303d8aff60 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
2020-03-11 09:37:19 +00:00
Mazdak Farrokhzad
6a8683fcd0
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
2020-03-11 10:36:33 +01:00
Mazdak Farrokhzad
a05bab5925
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
2020-03-11 10:36:31 +01:00
Mazdak Farrokhzad
62e3daee3f
Rollup merge of #69859 - contrun:fix-62456, r=matthewjasper
fix #62456

closes https://github.com/rust-lang/rust/issues/62456
2020-03-11 10:36:29 +01:00
Mazdak Farrokhzad
dfbbd5d6ea
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
2020-03-11 10:36:28 +01:00
Mazdak Farrokhzad
452c147fba
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.
2020-03-11 10:36:26 +01:00
Mazdak Farrokhzad
ae122721dc
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
2020-03-11 10:36:24 +01:00
Mazdak Farrokhzad
25091ed9b7
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.
2020-03-11 10:36:22 +01:00
Mazdak Farrokhzad
d7f0b88ade
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
2020-03-11 10:36:19 +01:00
Mazdak Farrokhzad
43079147f4
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.
2020-03-11 10:36:18 +01:00
Mazdak Farrokhzad
a7c2eef2ae
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)
2020-03-11 10:36:16 +01:00
Vadim Petrochenkov
6b27e8d2a6 parse: Tweak the function parameter edition check
Move anon-params tests to ui/anon-params.
2020-03-10 22:35:01 +03:00
bors
1581278534 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
2020-03-10 17:12:48 +00:00
Florian Gilcher
69aaed872c 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>
2020-03-10 18:11:36 +01:00
Mazdak Farrokhzad
4d16c217b8 Matrix::push: recursively expand or-patterns 2020-03-10 17:46:19 +01:00
Bastian Kauschke
7b3e3ff39a explain the use of a custom identity function 2020-03-10 12:46:22 +01:00
Mazdak Farrokhzad
bafa5cc9ba macros/unknown-builtin: use hack for musl problems 2020-03-10 08:30:07 +01:00
Mazdak Farrokhzad
87b6bc3518 span-api-tests: leave FIXME 2020-03-10 07:26:27 +01:00
Ana-Maria Mihalache
4809be0137 rustc_errors: Use ensure_source_file_source_present where necessary. 2020-03-10 07:26:27 +01:00
Mazdak Farrokhzad
cf2d4236eb --bless some tests 2020-03-10 07:26:27 +01:00
Mazdak Farrokhzad
b3bc427228 adjust span-api-tests.rs 2020-03-10 07:26:27 +01:00
Mazdak Farrokhzad
192d134e80 pacify rustdoc by using better url 2020-03-10 07:26:27 +01:00
Mazdak Farrokhzad
fd302f46dc Store TokenStream in rmeta::MacroDef.
This removes a hack from `load_macro_untracked` in which parsing is used.
2020-03-10 07:26:27 +01:00
bors
dd155df0a6 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
2020-03-10 05:48:27 +00:00
Mazdak Farrokhzad
3e9efbd8b4
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.
2020-03-10 06:47:59 +01:00
Mazdak Farrokhzad
20361bd2bf
Rollup merge of #69861 - Dylnuge:dylnuge/locale-doc, r=Mark-Simulacrum
Add note about localization to std::fmt docs

Closes #69681
2020-03-10 06:47:58 +01:00
Mazdak Farrokhzad
6f1db996c1
Rollup merge of #69847 - GuillaumeGomez:cleanup-e0393, r=Dylan-DPC
clean up E0393 explanation

r? @Dylan-DPC
2020-03-10 06:47:56 +01:00
Mazdak Farrokhzad
436f2ec58c
Rollup merge of #69836 - JohnTitor:immediate-outputs, r=nagisa
Check if output is immediate value

Fixes #62046

r? @nagisa
2020-03-10 06:47:55 +01:00
Mazdak Farrokhzad
08095f4978
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
2020-03-10 06:47:53 +01:00
Mazdak Farrokhzad
6ad5e69b5a
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
2020-03-10 06:47:52 +01:00
Mazdak Farrokhzad
977d69fc19
Rollup merge of #69714 - spastorino:place-ref-lifetime, r=oli-obk
Make PlaceRef take just one lifetime

r? @eddyb
2020-03-10 06:47:50 +01:00
Mazdak Farrokhzad
5a62acaf9e
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
2020-03-10 06:47:49 +01:00
Mazdak Farrokhzad
61150353bf
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
2020-03-10 06:47:47 +01:00
Mazdak Farrokhzad
5b08aad6d9
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
2020-03-10 06:47:46 +01:00
Christopher Durham
a56196205b
Vec::new is const tstable in 1.39 not 1.32 2020-03-09 23:07:04 -04:00
YI
0a0c850d73 fix test failure due to earlier emitted error 2020-03-10 10:54:48 +08:00
YI
906bb8d0e8 fix #62456 2020-03-10 09:30:24 +08:00
Dylan Nugent
7c60405dd6 Add note about localization to std::fmt docs 2020-03-09 12:31:33 -04:00
John Kåre Alsaker
2f120095b5 Add a comment to recover. 2020-03-09 14:50:40 +01:00
John Kåre Alsaker
f4450772ed Remove the no_force query attribute 2020-03-09 14:50:40 +01:00
John Kåre Alsaker
cbce21767b Remove the need for no_force 2020-03-09 14:50:40 +01:00
John Kåre Alsaker
67012158a3 Move analysis to the query macro 2020-03-09 14:50:40 +01:00
Matthew Kuo
b974d6fc30 test(patterns): add borrowck tests for combination of pattern features
Adds borrowck tests for the following features:
- bindings_after_at
- or_patterns
- slice_patterns
- box_patterns
2020-03-09 08:27:45 -05:00
bors
3dbade652e Auto merge of #69851 - Centril:rollup-iivxvah, r=Centril
Rollup of 6 pull requests

Successful merges:

 - #69201 (Permit attributes on 'if' expressions)
 - #69685 (unix: Don't override existing SIGSEGV/BUS handlers)
 - #69762 (Ensure that validity only raises validity errors)
 - #69779 (librustc_codegen_llvm: Use slices in preference to 0-terminated strings)
 - #69801 (rustc_parse: Remove `Parser::normalized(_prev)_token`)
 - #69842 (Add more regression tests)

Failed merges:

r? @ghost
2020-03-09 11:58:17 +00:00
Mazdak Farrokhzad
7e903f82ff
Rollup merge of #69842 - JohnTitor:more-tests, r=Centril
Add more regression tests

Closes #54239
Closes #57200
Closes #57201
Closes #60473
Closes #64620
Closes #67166

r? @Centril
2020-03-09 12:57:54 +01:00
Mazdak Farrokhzad
2677d59298
Rollup merge of #69801 - petrochenkov:nonorm, r=Centril
rustc_parse: Remove `Parser::normalized(_prev)_token`

Perform the "normalization" (renamed to "uninterpolation") on the fly when necessary.

The final part of https://github.com/rust-lang/rust/pull/69579 https://github.com/rust-lang/rust/pull/69384 https://github.com/rust-lang/rust/pull/69376 https://github.com/rust-lang/rust/pull/69211 https://github.com/rust-lang/rust/pull/69034 https://github.com/rust-lang/rust/pull/69006.
r? @Centril
2020-03-09 12:57:53 +01:00
Mazdak Farrokhzad
2409e70bdb
Rollup merge of #69779 - tmiasko:di-cstr, r=nagisa
librustc_codegen_llvm: Use slices in preference to 0-terminated strings

Additionally whenever possible match C API provided by the LLVM.
2020-03-09 12:57:51 +01:00
Mazdak Farrokhzad
c9bbfb9474
Rollup merge of #69762 - RalfJung:validity-errors, r=oli-obk
Ensure that validity only raises validity errors

For now, only as a debug-assertion (similar to const-prop detecting errors that allocate).

Now includes https://github.com/rust-lang/rust/pull/69646.
[Relative diff](https://github.com/RalfJung/rust/compare/layout-visitor...RalfJung:validity-errors).

r? @oli-obk
2020-03-09 12:57:50 +01:00
Mazdak Farrokhzad
eaf6905c55
Rollup merge of #69685 - cuviper:soft-segv, r=sfackler
unix: Don't override existing SIGSEGV/BUS handlers

Although `stack_overflow::init` runs very early in the process, even
before `main`, there may already be signal handlers installed for things
like the address sanitizer. In that case, just leave it alone, and don't
bother trying to allocate our own signal stacks either.

Fixes #69524.
2020-03-09 12:57:48 +01:00