Commit Graph

91502 Commits

Author SHA1 Message Date
Mazdak Farrokhzad
822b4fcb3b
Rollup merge of #59419 - frewsxcv:frewsxcv-qu, r=varkor
Utilize `?` instead of `return None`.

None
2019-03-26 09:05:53 +01:00
Mazdak Farrokhzad
0677eb1eaa
Rollup merge of #59410 - tbu-:pr_doc_clarifyclamp, r=joshtriplett
Clarify `{Ord,f32,f64}::clamp` docs a little

Explicitly call out when it returns NaN, adhere to the panic doc
guidelines.
2019-03-26 09:05:52 +01:00
Mazdak Farrokhzad
95e7a50166
Rollup merge of #59389 - euclio:deprecated-suggestion, r=varkor
replace redundant note in deprecation warning
2019-03-26 09:05:51 +01:00
Mazdak Farrokhzad
e298691ee9
Rollup merge of #59374 - faern:simplify-checked-duration-since, r=shepmaster
Simplify checked_duration_since

This follows the same design as we updated to in #56490. Internally, all the system specific time implementations are checked, no panics. Then the panicking publicly exported API can just call the checked version of itself and make do with a single panic (`expect`) at the top.

Since the internal sys implementations are now checked, this gets rid of the extra `if self >= &earlier` check in `checked_duration_since`. Except likely making the generated machine code simpler, it also reduces the algorithm from "Check panic condition -> call possibly panicking method" to just "call non panicking method".

Added two test cases:
* Edge case: Make sure `checked_duration_since` on two equal `Instant`s produce a zero duration, not a `None`.
* Most common/intended usage: Make sure `later.checked_duration_since(earlier)`, returns an expected value.
2019-03-26 09:05:48 +01:00
Mazdak Farrokhzad
0616b73c2f
Rollup merge of #59362 - pnkfelix:demo-from-iterator-short-circuiting, r=Centril
Demo `FromIterator` short-circuiting

while looking at a FIXME in `FromIterator for Option` and `FromIterator for Result`, I realized that the current documentation does not have example code showing exactly what is meant by "no further elements are taken."

The code snippets provided here are meant to correct that.
2019-03-26 09:05:47 +01:00
Mazdak Farrokhzad
e132e43e85
Rollup merge of #59334 - ewk:readme, r=Mark-Simulacrum
Update build instructions in README.md

Add additional instructions when `sudo ./x.py install` fails to
complete the build.

This resolves issues #40108 and #49269.

r? @steveklabnik
2019-03-26 09:05:46 +01:00
Mazdak Farrokhzad
4fbe25cc6b
Rollup merge of #59315 - Zoxc:move-query, r=oli-obk
Add no_hash to query macro and move some queries over

r? @oli-obk
2019-03-26 09:05:44 +01:00
Mazdak Farrokhzad
ba55822801
Rollup merge of #59267 - estebank:assoc-const-as-field, r=davidtwco
Provide suggestion when using field access instead of path

When trying to access an associated constant as if it were a field of
an instance, provide a suggestion for the correct syntax.

Fix #57316.
2019-03-26 09:05:43 +01:00
Mazdak Farrokhzad
90c2d641eb
Rollup merge of #59232 - saleemjaffer:mir_place_refactor, r=oli-obk
Merge `Promoted` and `Static` in `mir::Place`

fixes #53848
2019-03-26 09:05:40 +01:00
Mazdak Farrokhzad
b316514dbd
Rollup merge of #59150 - estebank:type-ascription, r=varkor
Expand suggestions for type ascription parse errors

Fix #51222. CC #48016, #47666, #54516, #34255.
2019-03-26 09:05:39 +01:00
Philipp Hansch
8a9c620340
Improve some compiletest documentation
This adds some missing documentation for rustfix related things and adds
a test for the `is_test` function.
2019-03-26 07:55:00 +01:00
Esteban Küber
6ad77b0938 review comments 2019-03-25 21:38:23 -07:00
kenta7777
630d5a4895 renames EvalContext to InterpretCx. 2019-03-26 13:06:15 +09:00
Esteban Küber
4bad56e54c When moving out of a for loop head, suggest borrowing it in nll mode 2019-03-25 19:29:02 -07:00
bors
54479c624c Auto merge of #59136 - jethrogb:jb/sgx-std-test, r=sanxiyn
SGX target: fix std unit tests

This fixes some tests and some code in the SGX sys implementation to make the `std` unit test suite pass.

#59009 must be merged first.
2019-03-26 01:48:34 +00:00
Guillaume Gomez
868833f9a6 Fix code block display in portability element in dark theme 2019-03-26 00:38:29 +01:00
Esteban Küber
91b7423760 Reject integer suffix when tuple indexing 2019-03-25 16:11:21 -07:00
Corey Farwell
28c602a94e Utilize ? instead of return None. 2019-03-25 23:29:49 +01:00
Josh Stone
9e663032a1 [CI] record docker image info for reuse
This writes an extra `dist/image-$image.txt` which contains the S3 URL
of the cached image and the `sha256` digest of the docker entry point.
This will be uploaded with the rest of the deployed artifacts in the
Travis `after_success` script.
2019-03-25 15:27:49 -07:00
Chris Gregory
fd42918a41 Link to PhantomData in NonNull documentation 2019-03-25 18:04:42 -04:00
John Kåre Alsaker
00d8fa3fdb Update tests 2019-03-25 23:01:00 +01:00
John Kåre Alsaker
32bc4a50c0 Make more lints incremental 2019-03-25 23:00:59 +01:00
John Kåre Alsaker
7e156c2066 Make some lints incremental 2019-03-25 23:00:34 +01:00
Jorge Aparicio
7d365cf27f compile all crates under test w/ -Zemit-stack-sizes 2019-03-25 22:50:07 +01:00
Philipp Hansch
d808bd4651
Save coverage file in build_base path, not /tmp 2019-03-25 22:48:35 +01:00
Christian
6c479c3d02 Formatting changes, including better wrapping and creating short summary lines. 2019-03-25 22:21:05 +01:00
Chris Gregory
fbfc8082b4 Rework documentation into examples 2019-03-25 17:20:54 -04:00
Chris Gregory
e91689cd97 Rework documentation to be about fat pointers 2019-03-25 16:38:21 -04:00
John Kåre Alsaker
f7c66fb625 Allocate HIR id counters on demand 2019-03-25 19:43:04 +01:00
Jethro Beekman
f229422cc1 SGX target: fix std unit tests 2019-03-25 11:31:19 -07:00
gnzlbg
24db517419 black_box should use inline assembly on wasm32 2019-03-25 18:43:51 +01:00
Chris Gregory
c709a10434 Refactor tuple comparison tests 2019-03-25 13:00:57 -04:00
bors
4c27fb19ba Auto merge of #59258 - euclio:suggestions-filter-crate, r=oli-obk
filter suggestions from extern prelude

Fixes #59027.

Modifies the candidate gathering code to call `filter_fn` on extern crates, which causes them to be filtered out when looking for a type.
2019-03-25 16:34:15 +00:00
John Kåre Alsaker
cb4ac714e1 Allocate HIR id counters for use trees in MiscCollector 2019-03-25 15:04:28 +01:00
bors
d91b32b4dc Auto merge of #59256 - petrochenkov:derval2, r=Zoxc
Make meta-item API compatible with `LocalInternedString::get` soundness fix

r? @Zoxc
2019-03-25 12:21:46 +00:00
ljedrz
7dd8b776b5 hir: replace NodeId with HirId in ItemId 2019-03-25 13:08:46 +01:00
Tobias Bucher
0bb36a2f90 Clarify {Ord,f32,f64}::clamp docs a little
Explicitly call out when it returns NaN, adhere to the panic doc
guidelines.
2019-03-25 12:52:42 +01:00
Felix S Klock II
0e83e96852
add missing braces
add missing braces analogous to those suggested by killercup
2019-03-25 11:50:11 +01:00
gnzlbg
cfa76c438a black_box should inhibit optimizations on platforms without inline assembly 2019-03-25 11:49:08 +01:00
Pascal Hertleif
6315221b39
Update src/libcore/option.rs
Co-Authored-By: pnkfelix <pnkfelix@pnkfx.org>
2019-03-25 11:48:08 +01:00
gnzlbg
f2443831e9 Remove dupplicated config 2019-03-25 11:44:06 +01:00
gnzlbg
f5d6b3af69 Moves test::black_box to core::hint
This changes removes a cyclic dependency between the "test" and "libtest"
crates, where "libtest" depends on "test" for "black_box", but "test" depends on
"libtest" for everything else.

I've chosen the "hint" module because there seems to be enough consensus in the
discussion of RFC2360 that this module is where such an intrinsic would belong,
but this PR does not implement that RFC! (note: if that RFC ever gets merged,
the API, docs, etc. of this API will need to change).

For backwards compatibility reasons I've chosen to also keep the "test" feature
gate for these instead of adding a new feature gate. If we change the feature
gate, we'll potentially all benchmarks, and while that's something that we could
do, it seems unnecessary to do that now - if RFC2360 gets merged, we'll need to
do that anyways.
2019-03-25 11:44:06 +01:00
bors
3f36ac4e83 Auto merge of #59242 - euclio:asm-ice, r=nagisa
make asm diagnostic instruction optional

`DiagnosticInfoInlineAsm::getInstruction` may return a null pointer, so
the instruction shouldn't be blindly unwrapped.

Reopening from #55193. I was unable to trigger the assertion on Windows after rebasing.

Fixes #23458.
Fixes #55216.
2019-03-25 09:05:00 +00:00
Philipp Hansch
98d7c5463b
s/lints/diagnostics
Not all suggestions come from lints
2019-03-25 06:58:30 +01:00
Philipp Hansch
d485ebfc21
Fix two bootstrap tests 2019-03-25 06:57:32 +01:00
bors
60eca54a7c Auto merge of #59240 - euclio:struct-field-span, r=oli-obk
use the identifier span for missing struct field
2019-03-25 05:40:12 +00:00
Andy Russell
695dfe7dff
compiletest: make path normalization smarter 2019-03-25 01:06:45 -04:00
Esteban Küber
4beea1720a Deduplicate code for path suggestion 2019-03-24 19:43:02 -07:00
Esteban Küber
5390414379 Provide suggestion when using field access instead of path
When trying to access an associated constant as if it were a field of
an instance, provide a suggestion for the correct syntax.
2019-03-24 19:21:54 -07:00
bors
46914715e2 Auto merge of #59195 - estebank:for-loop-move, r=petrochenkov
When moving out of a for loop head, suggest borrowing it

When encountering code like the following, suggest borrowing the for loop
head to avoid moving it into the for loop pattern:

```
fn main() {
    let a = vec![1, 2, 3];
    for i in &a {
        for j in a {
            println!("{} * {} = {}", i, j, i * j);
        }
    }
}
```

Fix #25534.
2019-03-25 00:38:15 +00:00