about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2015-12-19Improve OwnedSlice and use it in HIRVadim Petrochenkov-34/+69
2015-12-19Auto merge of #30381 - fhahn:memchr-in-std, r=alexcrichtonbors-4/+396
This PR adds `memchr`and `memrchr` based on @BurntSushi 's rust-memchr crate to libstd (as discussed in #30151). I've update some places in libstd to use memchr/memrchr, but I am not sure if there are other places where it could be used as well. ref #30076
2015-12-19Have to use Weak instead of Arc in Weak::new() exampleSebastian Hahn-1/+1
2015-12-19Address review commentsSebastian Hahn-6/+4
2015-12-18Fix build by removing needless type prefixMichael McConville-1/+1
2015-12-18Simplify logic checking getentropy's return valueMichael McConville-5/+3
2015-12-18Use a const for getentropy(2)'s syscall numberMichael McConville-1/+5
Reported by Sebastien Marie.
2015-12-18Use the correct syscall name in panic messageMichael McConville-1/+1
I copied it from the getrandom code but forgot to change the name. Reported by Sebastien Marie.
2015-12-18Use the getentropy(2) syscall on OpenBSDMichael McConville-1/+66
Rust already supports Linux's getrandom(2), which is very similar and was based on getentropy(2). This is a pretty clean, simple addition that uses the same approach as the iOS randomness API support.
2015-12-19Prettify MIR graphviz outputSimonas Kazlauskas-9/+9
One will look at graphviz often when working with MIR, so may as well make the tables a bit more pretty :)
2015-12-19Implement arc::Weak::new()Sebastian Hahn-0/+37
2015-12-19Rename Weak::new_downgraded to Weak::newSebastian Hahn-4/+4
2015-12-19use core::mem::unintialized instead of uninit intrinsicSebastian Hahn-3/+3
2015-12-19Fix doctest failureSebastian Hahn-1/+3
2015-12-18Auto merge of #30364 - luqmana:mir-calls, r=nikomatsakisbors-24/+164
2015-12-18[MIR] Initial implementation for translating calls.Luqman Aden-24/+164
2015-12-18Fix broken link in E0070 description.Lee Jeffery-1/+1
2015-12-18Use memrchr bindings provided by libcFlorian Hahn-29/+15
2015-12-18Auto merge of #30389 - nikomatsakis:rfc1214-error, r=arielb1bors-1187/+291
Make RFC 1214 warnings into errors, and rip out the "warn or err" associated machinery. Future such attempts should go through lints anyhow. There is a fair amount of fallout in the compile-fail tests, as WF checking now occurs earlier in the process. r? @arielb1
2015-12-18Implement Weak::new_downgraded() (#30425)Sebastian Hahn-1/+37
This adds a constructor for a Weak that can never be upgraded. These are mostly useless, but for example are required when deserializing.
2015-12-18Auto merge of #29973 - petrochenkov:privinpub, r=nikomatsakisbors-320/+808
Some notes: This patch enforces the rules from [RFC 136](https://github.com/rust-lang/rfcs/blob/master/text/0136-no-privates-in-public.md) and makes "private in public" a module-level concept and not crate-level. Only `pub` annotations are used by the new algorithm, crate-level exported node set produced by `EmbargoVisitor` is not used. The error messages are tweaked accordingly and don't use the word "exported" to avoid confusing people (https://github.com/rust-lang/rust/issues/29668). The old algorithm tried to be extra smart with impls, but it mostly led to unpredictable behavior and bugs like https://github.com/rust-lang/rust/issues/28325. The new algorithm tries to be as simple as possible - an impl is considered public iff its type is public and its trait is public (if presents). A type or trait is considered public if all its components are public, [complications](https://internals.rust-lang.org/t/limits-of-type-inference-smartness/2919) with private types leaking to other crates/modules through trait impls and type inference are deliberately ignored so far. The new algorithm is not recursive and uses the nice new facility `Crate::visit_all_items`! Obsolete pre-1.0 feature `visible_private_types` is removed. This is a [breaking-change]. The two main vectors of breakage are type aliases (https://github.com/rust-lang/rust/issues/28450) and impls (https://github.com/rust-lang/rust/issues/28325). I need some statistics from a crater run (cc @alexcrichton) to decide on the breakage mitigation strategy. UPDATE: All the new errors are reported as warnings controlled by a lint `private_in_public` and lint group `future_incompatible`, but the intent is to make them hard errors eventually. Closes https://github.com/rust-lang/rust/issues/28325 Closes https://github.com/rust-lang/rust/issues/28450 Closes https://github.com/rust-lang/rust/issues/29524 Closes https://github.com/rust-lang/rust/issues/29627 Closes https://github.com/rust-lang/rust/issues/29668 Closes https://github.com/rust-lang/rust/issues/30055 r? @nikomatsakis
2015-12-18Do not substitute type aliases during error reportingVadim Petrochenkov-6/+13
Type aliases are still substituted when determining impl publicity
2015-12-18Make RFC 1214 warnings into errors, and rip out the "warn or err"Niko Matsakis-1187/+291
associated machinery. Future such attempts should go through lints anyhow. There is a fair amount of fallout in the compile-fail tests, as WF checking now occurs earlier in the process.
2015-12-18add tests for #26873Alex Burka-0/+106
2015-12-18Auto merge of #30374 - durka:issue-30371, r=alexcrichtonbors-2/+21
Fixes #30371.
2015-12-18Require exact type equality + add testsVadim Petrochenkov-43/+188
+ Rebase fixes
2015-12-18Added doc comments for new UnresolvedNameContext enum.Felix S. Klock II-0/+9
2015-12-18Made dynamic_lib migration path more explicitebadf-1/+1
2015-12-18doc: minor format fixes in book/error-handlinglnmx-1/+1
2015-12-18Rollup merge of #30452 - dotdash:24876_take_2, r=alexcrichtonManish Goregaokar-0/+103
LLVM doesn't really support reusing the same module to emit more than one file. One bug this causes is that the IR is invalidated by the stack coloring pass when emitting the first file, and then the IR verifier complains by the time we try to emit the second file. Also, we get different binaries with --emit=asm,link than with just --emit=link. In some cases leading to segfaults. Unfortunately, it seems that at this point in time, the most sensible option to circumvent this problem is to just clone the whole llvm module for the asm output if we need both, asm and obj file output. Fixes #24876 Fixes #26235
2015-12-18Rollup merge of #30447 - Xmasreturns:Docu, r=steveklabnikManish Goregaokar-4/+6
Added sentences for description of code and changed x in the example to an int
2015-12-18Rollup merge of #30431 - mmcco:cleanup, r=alexcrichtonManish Goregaokar-3/+2
Remove a needless variable and simply a cfg().
2015-12-18Rollup merge of #30420 - petrochenkov:owned2, r=nrcManish Goregaokar-413/+400
Part of https://github.com/rust-lang/rust/pull/30095 not causing mysterious segfaults. r? @nrc
2015-12-18Update liblibc to current masterFlorian Hahn-0/+0
2015-12-18Use memchr in libstd where possible, closes #30076Florian Hahn-4/+8
2015-12-18Add memchr implemenation based on rust-memchr to libstdFlorian Hahn-0/+402
2015-12-18Auto merge of #30286 - oli-obk:const_error_span, r=nikomatsakisbors-25/+37
previously the error was erased and a `non-const path` error was emitted at the location of the field access instead of at the overflow location (as can be seen in the playground: http://is.gd/EuAF5F )
2015-12-18Rollup merge of #30406 - durka:patch-13, r=sanxiynManish Goregaokar-3/+3
The previous example had no chance of compiling in either form, due to the restrictive follow set for `ty`. This one has the desired behavior: http://is.gd/kYdw4g (well, I don't exactly desire this behavior at all, but it's true at least :p )
2015-12-18Rollup merge of #30398 - jwworth:pull-request-1450205451, r=sanxiynManish Goregaokar-1/+1
This fixes a double word typo, 'the'.
2015-12-18Rollup merge of #30384 - nrc:diagnostics, r=@nikomatsakisManish Goregaokar-773/+856
Should make it possible to add JSON or HTML errors. Also tidies up a lot.
2015-12-18Rollup merge of #30286 - oli-obk:const_error_span, r=nikomatsakisManish Goregaokar-25/+37
previously the error was erased and a `non-const path` error was emitted at the location of the field access instead of at the overflow location (as can be seen in the playground: http://is.gd/EuAF5F )
2015-12-18Auto merge of #30272 - tshepang:doc-drain, r=blussbors-15/+26
Second sentence actually repeats info from first sentence. "from start to end" also feels like it adds nothing. I also extended Vec::drain example.
2015-12-17Beautify ISAAC's mixing arithmeticMichael McConville-16/+62
Call me verbose, but the existing logic was hideously formatted. The result still fits in a small terminal. No functional change.
2015-12-18Fix emitting asm and object file output at the same timeBjörn Steinbrink-0/+103
LLVM doesn't really support reusing the same module to emit more than one file. One bug this causes is that the IR is invalidated by the stack coloring pass when emitting the first file, and then the IR verifier complains by the time we try to emit the second file. Also, we get different binaries with --emit=asm,link than with just --emit=link. In some cases leading to segfaults. Unfortunately, it seems that at this point in time, the most sensible option to circumvent this problem is to just clone the whole llvm module for the asm output if we need both, asm and obj file output. Fixes #24876 Fixes #26235
2015-12-17Add a type prefix to fix buildMichael McConville-1/+1
Apparently this file's use annotations have changed since I last pulled on my test machine.
2015-12-17Make runtime function return size_tMichael McConville-3/+3
It returns sizeof(dirent_t), so I'm not sure why its return type is int. It's only used once, and that usage immediately casts it to usize.
2015-12-18Add more systematic testsVadim Petrochenkov-429/+402
2015-12-18Prohibit public glob reexports of private variantsVadim Petrochenkov-10/+57
2015-12-18Address the commentsVadim Petrochenkov-39/+47
2015-12-18Substitute type aliases before checking for privacyVadim Petrochenkov-24/+43