Commit Graph

108311 Commits

Author SHA1 Message Date
Mazdak Farrokhzad
dde2484fce
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`.
2020-03-11 14:03:44 +01:00
Mazdak Farrokhzad
741d4ff713
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
2020-03-11 14:03:42 +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
Tomasz Miąsko
1106579c78 librustc_codegen_llvm: Use slices instead of 0-terminated strings
Changed functions:
* LLVMRustGetOrInsertFunction
* LLVMRustGetNamedValue
* LLVMRustBuildCall (removed unused name argument)
* LLVMRustInlineAsm
* LLVMRustInlineAsmVerify
* LLVMRustAppendModuleInlineAsm
2020-03-11 08:10:21 +01:00
Ryan Lopopolo
533784d3a2 Add docs for From::<&mut str>::from String impl 2020-03-10 18:47:19 -07:00
Ryan Lopopolo
18feaa3fa2 Add stable feature name 2020-03-10 18:45:08 -07:00
Esteban Küber
29be741c9c review comments 2020-03-10 17:59:32 -07:00
Dylan MacKenzie
68f20019f7 Ignore mir-opt test when panic=abort 2020-03-10 17:18:16 -07:00
Dylan MacKenzie
8ea5ac60b6 Add mir-opt test for better drop elaboration 2020-03-10 17:18:16 -07:00
Wesley Wiser
5357f83ee8 [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.
2020-03-10 18:18:04 -04:00
Santiago Pastorino
b3b32b74bc
rust-lang.github.io/rustc-dev-guide -> rustc-dev-guide.rust-lang.org 2020-03-10 17:08:18 -03:00
Santiago Pastorino
d00b2696d8
Rename Rustc Guide to Rustc Dev Guide 2020-03-10 17:08:18 -03:00
Santiago Pastorino
1ddcea3422
Rename rustc_guide to rustc_dev_guide 2020-03-10 17:08:17 -03:00
Santiago Pastorino
9d4fdba8be
Rename rustc guide to rustc dev guide 2020-03-10 17:08:16 -03:00
Santiago Pastorino
0037f4e37c
Rename rustc-guide to rustc-dev-guide 2020-03-10 17:08:10 -03: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
Lena Wildervanck
88f8b88160 Remove deprecated description function of TryReserveError 2020-03-10 11:19:40 +01:00
Ralf Jung
0b2329da9a also make panic_fmt track_caller 2020-03-10 10:31:03 +01:00
Mazdak Farrokhzad
458383dd33 parse_if_expr: recover on attributes 2020-03-10 08:55:18 +01:00
Mazdak Farrokhzad
ba3ae46de9 trait-object-lifetime-parens: improve recovery. 2020-03-10 08:35:23 +01:00
Mazdak Farrokhzad
d1822b3dcf use check_path more 2020-03-10 08:35:23 +01:00
Mazdak Farrokhzad
c0b073bc62 simplify & improve parse_ty_tuple_or_parens 2020-03-10 08:35:23 +01:00
Mazdak Farrokhzad
25cd01b863 issue 68890: add more minimal repro 2020-03-10 08:35:23 +01:00
Mazdak Farrokhzad
09997e7227 error_block_no_opening_brace: handle closures better 2020-03-10 08:35:23 +01:00
Mazdak Farrokhzad
c01b3e6996 block-no-opening-brace: add another statement 2020-03-10 08:35:23 +01:00
Mazdak Farrokhzad
65b7ba5129 parser: add note for 'label expr. 2020-03-10 08:35:23 +01:00
Mazdak Farrokhzad
83be689b94 parser/attr: adjust indentation. 2020-03-10 08:35:23 +01:00
Mazdak Farrokhzad
e72df7edad parse_labeled_expr: add a suggestion on missing colon. 2020-03-10 08:35:23 +01:00
Mazdak Farrokhzad
fe848b44fe parse_block_tail: reduce visibility 2020-03-10 08:35:23 +01:00
Mazdak Farrokhzad
addbc5b9df unify/improve/simplify attribute parsing 2020-03-10 08:35:23 +01:00
Mazdak Farrokhzad
be86b2d37b parse: recover on fn foo() = expr; 2020-03-10 08:32:34 +01:00
Mazdak Farrokhzad
379f3181de parse: simplify parse_fn_body 2020-03-10 08:32:34 +01:00
Mazdak Farrokhzad
055733f3b3 parse: recover on &'lt $expr / 'lt $expr. 2020-03-10 08:32:34 +01:00
Mazdak Farrokhzad
8ee220c447 more reuse in block parsing & improve diagnostics. 2020-03-10 08:32:34 +01:00
Mazdak Farrokhzad
883e90dd81 simplify parse_inner_attributes 2020-03-10 08:32:34 +01:00
Mazdak Farrokhzad
c303c4463c use error_block_no_opening_brace more 2020-03-10 08:32:34 +01:00