Commit Graph

79820 Commits

Author SHA1 Message Date
kennytm
63531f515d
Rollup merge of #50342 - fkjogu:euclidean, r=BurntSushi
Document round-off error in `.mod_euc()`-method, see issue #50179

Due to a round-off error the method `.mod_euc()` of both `f32` and `f64` can produce mathematical invalid outputs. If `self` in magnitude is much small than the modulus `rhs` and negative, `self + rhs` in the first branch cannot be represented in the given precision and results into `rhs`. In the mathematical strict sense, this breaks the definition. But given the limitation of floating point arithmetic it can be thought of the closest representable value to the true result, although it is not strictly in the domain `[0.0, rhs)` of the function. It is rather the left side asymptotical limit. It would be desirable that it produces the mathematical more sound approximation of `0.0`, the right side asymptotical limit. But this breaks the property, that `self == self.div_euc(rhs) * rhs + a.mod_euc(rhs)`.

The discussion in issue #50179 did not find an satisfying conclusion to which property is deemed more important. But at least we can document the behaviour. Which this pull request does.
2018-06-28 06:15:38 +08:00
kennytm
e5462b82e3
Rollup merge of #49987 - clarcharr:split_ascii_whitespace, r=SimonSapin
Add str::split_ascii_whitespace.

As mentioned in #48656.

While `str::split_whitespace` now works in `libcore`, it still makes sense to offer this method, considering how it is still more performant in cases where only ASCII is necessary.
2018-06-28 06:15:37 +08:00
Clar Charr
b5cee029a5 Add str::split_ascii_whitespace. 2018-06-27 17:54:27 -04:00
bors
cd494c1f09 Auto merge of #51139 - vakaras:issue-50716, r=nikomatsakis
Fix NLL issue 50716 and add a regression test.

Fix for NLL issue #50716.

r? @nikomatsakis
2018-06-27 21:32:44 +00:00
Niko Matsakis
1523de34a2 rustfmt various files 2018-06-27 16:30:38 -04:00
Niko Matsakis
9b1d2229ff change the enter_canonical_trait_query method to give a fulfill cx 2018-06-27 16:04:32 -04:00
Niko Matsakis
f0fdce31d9 update comments 2018-06-27 15:45:53 -04:00
Niko Matsakis
5fd3b26280 rename prequery to try_fast_path 2018-06-27 15:45:53 -04:00
Niko Matsakis
0a0dae0964 pull out ParamEnvAnd and remove QueryKey 2018-06-27 15:45:49 -04:00
bors
23b55161ab Auto merge of #51852 - oli-obk:miri_fix, r=Zoxc
Don't use `ParamEnv::reveal_all()` if there is a real one available

fixes #51841

r? @Zoxc
2018-06-27 19:30:14 +00:00
bors
4aff10bb1b Auto merge of #51850 - abarth:draw_again, r=cramertj
[fuchsia] Update zx_cprng_draw to target semantics

This change is the final step in improving the semantics of
zx_cprng_draw. Now the syscall always generates the requested number of
bytes. If the syscall would have failed to generate the requested number
of bytes, the syscall either terminates the entire operating system or
terminates the calling process, depending on whether the error is a
result of the kernel misbehaving or the userspace program misbehaving.
2018-06-27 17:20:27 +00:00
Oliver Schneider
89d8e0a260 Don't use ParamEnv::reveal_all() if there is a real one available 2018-06-27 18:24:24 +02:00
Vytautas Astrauskas
03ecd982bf Fix the error of selecting obligation by not running the borrow checker. 2018-06-27 18:14:00 +02:00
Felix S. Klock II
f288b87c23 Move regression test from compile-fail/ to ui/ test directory. 2018-06-27 18:13:43 +02:00
Vytautas Astrauskas
8b1ea84265 Fix the regression test for issue 50716. 2018-06-27 18:13:43 +02:00
Vytautas Astrauskas
612eeb1df7 Fix NLL issue 50716 and add a regression test. 2018-06-27 18:13:43 +02:00
Adam Barth
a9f7cc3b49 [fuchsia] Update zx_cprng_draw to target semantics
This change is the final step in improving the semantics of
zx_cprng_draw. Now the syscall always generates the requested number of
bytes. If the syscall would have failed to generate the requested number
of bytes, the syscall either terminates the entire operating system or
terminates the calling process, depending on whether the error is a
result of the kernel misbehaving or the userspace program misbehaving.
2018-06-27 08:56:19 -07:00
bors
ed0350e945 Auto merge of #51356 - Zoxc:encode-cleanup, r=michaelwoerister
Make opaque::Encoder append-only and make it infallible
2018-06-27 14:25:52 +00:00
Niko Matsakis
b2e899f843 move into provide methods 2018-06-27 09:42:21 -04:00
Niko Matsakis
c3f7e02fb6 rename to shrink_to_tcx_lifetime 2018-06-27 09:27:07 -04:00
Simon Sapin
1565fc2120 Document that Layout::from_size_align does not allow align=0
This was already implied since zero is not a power of two, but maybe
worth pointing out.
2018-06-27 15:07:42 +02:00
Niko Matsakis
c2f7757bc5 extend comment to note complications around lifetimes 2018-06-27 08:55:41 -04:00
Michael Woerister
ba30c1dac9 syntax_pos: Store multibyte char size as u8 instead of u32. 2018-06-27 14:00:34 +02:00
Michael Woerister
ba1d18fe29 Add comments to analzye_filemap(). 2018-06-27 14:00:34 +02:00
Michael Woerister
5a6dc8c4f5 Add SSE2 accelerated version of FileMap analysis. 2018-06-27 14:00:34 +02:00
Michael Woerister
3497138634 Use u32 instead of usize of encoding byte count of multi-byte chars. 2018-06-27 14:00:34 +02:00
Michael Woerister
04d4da1bf9 Update CodeMap tests after changing FileMap construction. 2018-06-27 14:00:34 +02:00
Michael Woerister
095a339bec Remove the now redundant CodeMap::new_filemap_with_lines() method. 2018-06-27 14:00:34 +02:00
Michael Woerister
257d279fe4 Make FileMap::{lines, multibyte_chars, non_narrow_chars} non-mutable. 2018-06-27 14:00:34 +02:00
Oliver Schneider
0fa166ad7f Detect overflows of non u32 shifts 2018-06-27 13:47:19 +02:00
Niko Matsakis
35a5065573 pacify the mercilous tidy 2018-06-27 07:28:25 -04:00
Niko Matsakis
c6a7c6fc68 improve comments on dropck_outlives 2018-06-27 07:26:29 -04:00
bors
142c98dd5a Auto merge of #51496 - petrochenkov:mhelper2, r=nikomatsakis
Implement `#[macro_export(local_inner_macros)]` (a solution for the macro helper import problem)

Implement a solution for the macro helper issue discussed in https://github.com/rust-lang/rust/issues/35896 as described in https://github.com/rust-lang/rust/issues/35896#issuecomment-395977901.

Macros exported from libraries can be marked with `#[macro_export(local_inner_macros)]` and this annotation changes how nested macros in them are resolved.

If we have a fn-like macro call `ident!(...)` and `ident` comes from a `macro_rules!` macro marked with  `#[macro_export(local_inner_macros)]` then it's replaced with `$crate::ident!(...)` and resolved as such (`$crate` gets the same context as `ident`).
2018-06-27 11:20:16 +00:00
Niko Matsakis
1be4fffc24 improve comment on instantiate NLL query result fn 2018-06-27 07:19:17 -04:00
Niko Matsakis
5bfdb97684 remove either dependency we are not using 2018-06-27 07:05:40 -04:00
Niko Matsakis
59ea17ed3f rename upcast to cast_to_tcx_lifetime and improve comment 2018-06-27 07:02:37 -04:00
Niko Matsakis
d695512437 fix wrong query description 2018-06-27 06:57:20 -04:00
Niko Matsakis
d49d5222a9 merge all the type_op_foo modules into one as they are so trivial 2018-06-27 06:53:54 -04:00
Niko Matsakis
66c88392b4 use query boiler plate for normalize_projection_ty too 2018-06-27 06:49:43 -04:00
Niko Matsakis
e6c8c632b7 use query boilerplate for prove-predicate -- slightly inefficient
This requires us to allocate a single entry vector we didn't use to
allocate. I doubt this makes a difference in practice, as this only
occurs for cache misses.
2018-06-27 06:49:20 -04:00
Niko Matsakis
ac40d73c6f use query boilerplate for subtype 2018-06-27 06:48:52 -04:00
Niko Matsakis
fa71af4192 use query boilerplate for normalize 2018-06-27 06:48:43 -04:00
Niko Matsakis
2fd8a312d9 extract out query boilerplate and use for Eq 2018-06-27 06:48:32 -04:00
Vadim Petrochenkov
d347270e0c Implement #[macro_export(local_inner_macros)] 2018-06-27 13:10:16 +03:00
Niko Matsakis
188ad384a3 nit: don't import Debug directly 2018-06-27 06:01:19 -04:00
John Kåre Alsaker
14d3c6e8f4 Make opaque::Encoder append-only and make it infallible 2018-06-27 11:43:15 +02:00
bors
c20824323c Auto merge of #51835 - tmccombs:stable-int-to-from-bytes, r=joshtriplett
Stabilize to_bytes and from_bytes for integers.

Fixes #49792
2018-06-27 09:21:34 +00:00
bors
971f7d34d4 Auto merge of #51815 - oli-obk:lowering_cleanups2, r=nikomatsakis
Lowering cleanups [2/N]

Double indirections are unnecessary
2018-06-27 07:16:13 +00:00
Joshua Liebow-Feeser
851cc39503 Optimize RefCell refcount tracking 2018-06-27 00:07:18 -07:00
Thayne McCombs
c8f9b84b39 Stabilize to_bytes and from_bytes for integers.
Fixes #49792
2018-06-26 23:17:56 -06:00