about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2016-03-09Auto merge of #32097 - jseyfried:fix_resolution_regression, r=nikomatsakisbors-21/+65
Fix a regression in import resolution This fixes #32089 (caused by #31726) by deducing that name resolution has failed (as opposed to being determinate) in more cases. r? @nikomatsakis
2016-03-09Auto merge of #31710 - eddyb:reify, r=nikomatsakisbors-2242/+2056
Distinguish fn item types to allow reification from nothing to fn pointers. The first commit is a rebase of #26284, except for files that have moved since. This is a [breaking-change], due to: * each FFI function has a distinct type, like all other functions currently do * all generic parameters on functions are recorded in their item types, e.g.: `size_of::<u8>` & `size_of::<i8>`'s types differ despite their identical signature. * function items are zero-sized, which will stop transmutes from working on them The first two cases are handled in most cases with the new coerce-unify logic, which will combine incompatible function item types into function pointers, at the outer-most level of if-else chains, match arms and array literals. The last case is specially handled during type-checking such that transmutes from a function item type to a pointer or integer type will continue to work for another release cycle, but are being linted against. To get rid of warnings and ensure your code will continue to compile, cast to a pointer before transmuting.
2016-03-09Auto merge of #31618 - alexcrichton:no-thread-spawns, r=brsonbors-52/+608
Optimize some functions in std::process * Be sure that `read_to_end` gets directed towards `read_to_end_uninitialized` for all handles * When spawning a child that guaranteed doesn't need a stdin, don't actually create a stdin pipe for that process, instead just redirect it to /dev/null * When calling `wait_with_output`, don't spawn threads to read out the pipes of the child. Instead drain all pipes on the calling thread and *then* wait on the process. Functionally, it is intended that nothing changes as part of this PR --- Note that this was the same as #31613, and even after that it turned out that fixing Windows was easier than I thought! To copy a comment from over there: > As some rationale for this as well, it's always bothered me that we've spawned threads in the standard library for this (seems a bit overkill), and I've also been curious lately as to our why our build times for Windows are so much higher than Unix (on the buildbots we have). I have done basically 0 investigation into why, but I figured it can't help to try to optimize Command::output which I believe is called quite a few times during the test suite.
2016-03-09collections: Fix broken doc exampleAlex Crichton-1/+1
PR #32135 was accidentally merged without tests passing, and unfortunately one of the tests added was broken, so this fixes that.
2016-03-10Merge pull request #32135 from nathankleyn/improve-docs-for-btreemapSteve Klabnik-0/+111
Add missing documentation examples for BTreeMap.
2016-03-09std: Don't spawn threads in `wait_with_output`Alex Crichton-33/+458
Semantically there's actually no reason for us to spawn threads as part of the call to `wait_with_output`, and that's generally an incredibly heavyweight operation for just reading a few bytes (especially when stderr probably rarely has bytes!). An equivalent operation in terms of what's implemented today would be to just drain both pipes of all contents and then call `wait` on the child process itself. On Unix we can implement this through some convenient use of the `select` function, whereas on Windows we can make use of overlapped I/O. Note that on Windows this requires us to use named pipes instead of anonymous pipes, but they're semantically the same under the hood.
2016-03-09Add missing "basic usage" sections to docs, fix review comments.Nathan Kleyn-1/+36
2016-03-09trans: Keep transmutes from fn item types working, but lint them.Eduard Burtescu-14/+140
2016-03-09Auto merge of #32073 - jseyfried:fix_another_trait_privacy_error, r=nikomatsakisbors-33/+22
Fix incorrect trait privacy error This PR fixes #21670 by using the crate metadata instead of `ExternalExports` to determine if an external item is public. r? @nikomatsakis
2016-03-09typeck: Unify if-else blocks, match arms and array elements by coercing ↵Eduard Burtescu-171/+422
where possible.
2016-03-09typeck: Remove the redundant "unifier" from check_expr_with_unifier.Eduard Burtescu-48/+25
2016-03-09typeck: Support multiple expressions getting coerced at the same type.Eduard Burtescu-216/+225
2016-03-09typeck: don't wastefully clone expressions for cast checks.Eduard Burtescu-7/+7
2016-03-09typeck: Remove Coerce::unpack_actual_value.Eduard Burtescu-30/+20
2016-03-09infer: Take the origin in report_mismatched_types.Eduard Burtescu-47/+19
2016-03-09typeck: rename mk_assignty to coercion::try.Eduard Burtescu-15/+8
2016-03-09infer: Remove redundant commit_if_ok calls.Eduard Burtescu-3/+3
2016-03-09Test that function types are actually zero-sized.Eduard Burtescu-0/+22
2016-03-09tests: Avoid transmuting from fn item types.Eduard Burtescu-59/+51
2016-03-09typeck: Use TyFnDef for methods.Eduard Burtescu-8/+11
2016-03-09typeck: Introduce reification for fn ptr casts.Eduard Burtescu-3/+15
2016-03-09trans: Reify functions & methods to fn ptrs only where necessary.Eduard Burtescu-1320/+685
2016-03-09trans: Remove unused ref_id from monomorphic_fn.Eduard Burtescu-16/+4
2016-03-09trans: Move type_of_fn_from_ty callers to type_of.Eduard Burtescu-27/+13
2016-03-09Print fn type parameters for TyFnDef.Eduard Burtescu-14/+46
2016-03-09Track fn type and lifetime parameters in TyFnDef.Eduard Burtescu-116/+130
2016-03-09Split TyBareFn into TyFnDef and TyFnPtr.Eli Friedman-324/+406
There's a lot of stuff wrong with the representation of these types: TyFnDef doesn't actually uniquely identify a function, TyFnPtr is used to represent method calls, TyFnDef in the sub-expression of a cast isn't correctly reified, and probably some other stuff I haven't discovered yet. Splitting them seems like the right first step, though.
2016-03-09Auto merge of #31631 - jonas-schievink:agoraphobia, r=nrcbors-119/+129
[breaking-batch] Move more uses of `panictry!` out of libsyntax
2016-03-09Auto merge of #30804 - shssoichiro:deny-warnings-msg, r=nrcbors-2/+20
Show clearer error message when #![deny(warnings)] escalates a warning Addresses #30730
2016-03-09Auto merge of #32071 - jseyfried:parse_pub, r=nikomatsakisbors-53/+17
Make errors for unnecessary visibility qualifiers consistent This PR refactors away `syntax::parse::parser::ParsePub` so that unnecessary visibility qualifiers on variant fields are reported not by the parser but by `privacy::SanePrivacyVisitor` (thanks to @petrochenkov's drive-by improvements in #31919). r? @nikomatsakis
2016-03-08Auto merge of #32023 - matklad:diamonds-and-rust, r=nikomatsakisbors-0/+33
tests: add test for empty <> Rust allows to specify an empty list of type and lifetime parameters, but there are no tests for it: ``` user@UNIT-326 [12:53:45] [~/projects/rust] [diamonds-and-rust] -> % grep "<>" -R src/test src/test/compile-fail/generic-type-params-name-repr.rs: // And don't print <> at all when there's just defaults. src/test/debuginfo/issue22656.rs:// when trying to handle a Vec<> or anything else that contains zero-sized ``` So let's add them! Besides it's such a wonderful opportunity to put a reference to Judas Priest band into the branch name ;)
2016-03-08Auto merge of #31981 - achanda:unspecified-ip, r=alexcrichtonbors-17/+20
Exclude 0.0.0.0 from the list of globally routable addresses
2016-03-08std: Don't always create stdin for childrenAlex Crichton-10/+16
For example if `Command::output` or `Command::status` is used then stdin is just immediately closed. Add an option for this so as an optimization we can avoid creating pipes entirely. This should help reduce the number of active file descriptors when spawning processes on Unix and the number of active handles on Windows.
2016-03-08std: Funnel read_to_end through to one locationAlex Crichton-11/+136
This pushes the implementation detail of proxying `read_to_end` through to `read_to_end_uninitialized` all the way down to the `FileDesc` and `Handle` implementations on Unix/Windows. This way intermediate layers will also be able to take advantage of this optimized implementation. This commit also adds the optimized implementation for `ChildStdout` and `ChildStderr`.
2016-03-08Auto merge of #32126 - steveklabnik:rollup, r=steveklabnikbors-42/+105
Rollup of 7 pull requests - Successful merges: #31772, #32083, #32084, #32092, #32099, #32103, #32115 - Failed merges:
2016-03-08Add missing documentation examples for BTreeMap.Nathan Kleyn-0/+76
As part of the ongoing effort to document all methods with examples, this commit adds the missing examples for the `BTreeMap` collection type. This is part of issue #29348.
2016-03-08Rollup merge of #32115 - tclfs:patch-1, r=apasel422Steve Klabnik-1/+1
Update a spelling inconsistency L26: "zero cost" -> "zero-cost"
2016-03-08Rollup merge of #32103 - timmontague:patch-1, r=alexcrichtonSteve Klabnik-1/+1
Fixed link in ownership documentation Changed "[vector]" to a link to the vector documentation.
2016-03-08Rollup merge of #32099 - bluss:doc-string-slicing, r=alexcrichtonSteve Klabnik-13/+51
Clarify documentation for string slicing (Index impls) Clarify documentation for string slicing (Index impls) - Mention the sugared syntax for the implementations, since it's not apparent from the docs that `Index<Range<usize>>` corresponds to `&self[a..b]`. - Be specific in that start <= end and end <= len This is just one fix in response to #32057
2016-03-08Rollup merge of #32092 - bluss:operator-overload, r=steveklabnikSteve Klabnik-10/+10
Update syntax index with OpAssign traits book: Update syntax index with OpAssign traits The traits are stable from Rust 1.8.
2016-03-08Rollup merge of #32084 - gokhanettin:typo-in-comment, r=alexcrichtonSteve Klabnik-5/+5
Fix typos - mismatching parentheses in comments Fixes mismatching parentheses in the comments of precision example. r? @steveklabnik
2016-03-08Rollup merge of #32083 - nodakai:reference-scoped-enum-alias, r=nikomatsakisSteve Klabnik-0/+10
reference.md: clarify the limitation of type alias on an enum Tentatively define the current behavior as the specification. Cf. rust-lang/rust#26264, rust-lang/rust#28556, rust-lang/rust#30936
2016-03-08Rollup merge of #31772 - nodakai:patch-1, r=steveklabnikSteve Klabnik-12/+27
Clarify the semantics of enum discriminants cf. https://doc.rust-lang.org/error-index.html#E0082 > The default type for enum discriminants is isize, but it can be adjusted by adding the repr attribute to the enum declaration. It would be great if anyone could check my English.
2016-03-08Auto merge of #32009 - alexcrichton:trim-fulldeps, r=brsonbors-48/+3
mk: Distribute fewer TARGET_CRATES Right now everything in TARGET_CRATES is built by default for all non-fulldeps tests and is distributed by default for all target standard library packages. Currenly this includes a number of unstable crates which are rarely used such as `graphviz` and `rbml`> This commit trims down the set of `TARGET_CRATES`, moves a number of tests to `*-fulldeps` as a result, and trims down the dependencies of libtest so we can distribute fewer crates in the `rust-std` packages.
2016-03-08Auto merge of #31995 - alexcrichton:fix-make-clena-empty, r=brsonbors-1/+2
rustbuild: Fix building from an empty directory A stray shutil.rmtree happened when it shouldn't have happened, causing the entire build to fail.
2016-03-08Auto merge of #31957 - GuillaumeGomez:error_display, r=brsonbors-11/+23
Add error file for E0152 It completes #31818. However it is not complete yet: * test will need to be updated * the file name displayed is a bit too unclear. I'm not sure yet what's the "correct" file name to display. If anyone has an idea on this, it'd be very appreciated. r? @brson
2016-03-08Auto merge of #31954 - japaric:rfc243, r=nikomatsakisbors-16/+369
implement the `?` operator The `?` postfix operator is sugar equivalent to the try! macro, but is more amenable to chaining: `File::open("foo")?.metadata()?.is_dir()`. `?` is accepted on any *expression* that can return a `Result`, e.g. `x()?`, `y!()?`, `{z}?`, `(w)?`, etc. And binds more tightly than unary operators, e.g. `!x?` is parsed as `!(x?)`. cc #31436 --- cc @aturon @eddyb
2016-03-07Auto merge of #31606 - Ms2ger:ClosureKind, r=eddybbors-57/+56
Rename ClosureKind variants and stop re-exporting them.
2016-03-08Update a spelling inconsistencyTang Chenglong-1/+1
L26: "zero cost" -> "zero-cost"
2016-03-07Auto merge of #29734 - Ryman:whitespace_consistency, r=Aatchbors-63/+110
libsyntax: be more accepting of whitespace in lexer Fixes #29590. Perhaps this may need more thorough testing? r? @Aatch