bors [Wed, 27 May 2015 00:42:55 +0000 (00:42 +0000)]
Auto merge of #25713 - Stebalien:pattern, r=alexcrichton
Needed to support:
```rust
match X {
pattern if Y ...
}
for pattern in Y {}
```
IMO, this shouldn't require an RFC because it can't interfere with any future language changes (because `pattern if` and `pattern in` are already legal in rust) and can't cause any ambiguity.
bors [Tue, 26 May 2015 23:10:06 +0000 (23:10 +0000)]
Auto merge of #25688 - nham:E0055_E0192, r=alexcrichton
- Adds explanations for E0055, E0089, E0192, E0261-E0263, E0318
- Improves explanations for E0250, E0368, E0372.
- Converts 15 diagnostics to have error codes (E0380-E0394). Adds an explanation for E0380.
- The E0087-E0090 messages currently look like "expected {} parameter(s) found {} parameter(s)". This changes them to either use "parameter" or "parameters", based on the number.
bors [Tue, 26 May 2015 18:30:42 +0000 (18:30 +0000)]
Auto merge of #25593 - nham:E0210_E0326, r=alexcrichton
Changes:
- adds explanations for E0185, E0186, E0202, E0326
- fixes the explanation for E0053. The previous description was too narrow; there are other error cases.
- changes the error message for E0202 to be specific for associated types, since it seems inherent associated constants are implemented.
bors [Tue, 26 May 2015 16:58:07 +0000 (16:58 +0000)]
Auto merge of #25091 - quantheory:trait_associated_const_fixes, r=nikomatsakis
Closes #25046 (by rejecting the code that causes the ICE) and #24946. I haven't been able to deal with the array size or recursion issues yet for associated consts, though my hope was that the change I made for range match patterns might help with array sizes, too.
bors [Tue, 26 May 2015 14:08:24 +0000 (14:08 +0000)]
Auto merge of #25411 - alexcrichton:issue-18913, r=brson
This flag indicates that when files are being replaced or added to archives (the
`r` flag) that the new file should not be inserted if it is not newer than the
file that already exists in the archive. The compiler never actually has a use
case of *not* wanting to insert a file because it already exists, and this
causes rlibs to not be updated in some cases when the compiler was re-run too
quickly.
Alex Crichton [Thu, 14 May 2015 18:53:37 +0000 (11:53 -0700)]
rustc_back: Don't pass 'u' to ar invocations
This flag indicates that when files are being replaced or added to archives (the
`r` flag) that the new file should not be inserted if it is not newer than the
file that already exists in the archive. The compiler never actually has a use
case of *not* wanting to insert a file because it already exists, and this
causes rlibs to not be updated in some cases when the compiler was re-run too
quickly.
bors [Tue, 26 May 2015 12:15:30 +0000 (12:15 +0000)]
Auto merge of #25785 - arielb1:cleanup-201505, r=eddyb
The caching essentially eliminates "stability checking" time (my attempt to clean-up junk got tangled up with stability, so I added the caching while I was at it).
bors [Tue, 26 May 2015 09:49:36 +0000 (09:49 +0000)]
Auto merge of #25778 - econoplas:master, r=pnkfelix
A regression was introduced by commit https://github.com/rust-lang/rust/commit/7b1916d25347913fce3e336517ef22025ccd875f #25612. Negative signed integer literals less than -9223372036854775808i64 were no longer properly reported as #[warn(overflowing_literals)].
Also adding missing test cases to test/compile-fail/lint-type-overflow.rs which could have detected the regression.
Further explanation:
The expression `(negative && v > max as u64 + 1)` relies on the fact that algebraically speaking `-min == max + 1` to avoid negation and removing the need for `min` completely.
If i128 or i256 are ever added, it should also work for these types without requiring a change to `min != i64::MIN &&` also simplifying maintenance.
bors [Mon, 25 May 2015 19:52:45 +0000 (19:52 +0000)]
Auto merge of #25698 - mdinger:flat_map, r=steveklabnik
I'm not sure why `core` is on but it's blocking the playpen. Doesn't seem to be needed but I'm not sure. It's not on the playpen template and playpen works on release and nightly.
bors [Mon, 25 May 2015 18:18:11 +0000 (18:18 +0000)]
Auto merge of #25742 - thombles:tk/StringCoercion, r=steveklabnik
A few of us [over on the forum](https://users.rust-lang.org/t/string-type-coercion-in-rust/1439) have been tripped up by this distinction, which I don't think is mentioned. It's kind of logical if you read the "Deref coercions" page and squint a bit but I think it would be nice to explain it directly. Here's one way we could clarify it.
Ulrik Sverdrup [Mon, 25 May 2015 13:06:38 +0000 (15:06 +0200)]
rustdoc: Fix associated types in signatures
Functions such as `fn foo<I: Iterator>(x: I::Item)` would not
render correctly and displayed `I` instead of `I::Item`. Same thing
with `I::Item` appearing in where bounds.
econoplas [Mon, 25 May 2015 13:42:16 +0000 (07:42 -0600)]
- Fix regression of literal out of range check for negative i64 values which was introduced by commit 7b1916d25347913fce3e336517ef22025ccd875f.
- Add missing test cases to test/compile-fail/lint-type-overflow.rs which would have detected the regression.
bors [Mon, 25 May 2015 03:40:31 +0000 (03:40 +0000)]
Auto merge of #25761 - ralexstokes:master, r=steveklabnik
Typo in explanation of difference between stack and heap values.
`baz` is called at the end of a call to `bar` inside another call to `foo`. `baz` takes a copy of the value `e` which should have a value of 9 if following the rest of the stack trace.
bors [Sun, 24 May 2015 11:12:34 +0000 (11:12 +0000)]
Auto merge of #25609 - nikomatsakis:const-fn, r=pnkfelix
This is a port of @eddyb's `const-fn` branch. I rebased it, tweaked a few things, and added tests as well as a feature gate. The set of tests is still pretty rudimentary, I'd appreciate suggestions on new tests to write. Also, a double-check that the feature-gate covers all necessary cases.
One question: currently, the feature-gate allows the *use* of const functions from stable code, just not the definition. This seems to fit our usual strategy, and implies that we might (perhaps) allow some constant functions in libstd someday, even before stabilizing const-fn, if we were willing to commit to the existence of const fns but found some details of their impl unsatisfactory.
Oliver Schneider [Sat, 23 May 2015 17:03:19 +0000 (19:03 +0200)]
Rollup merge of #25703 - eddyb:lazier-loads, r=pnkfelix
Reduces pre-trans heap baseline (tested on `fn main() {}`) from 1.2MB to 696kB.
Most of the remaining allocations are used by imported macros.
While it might be possible to also load macros lazily, doing so is non-trivial and this PR doesn't tackle that.
Oliver Schneider [Sat, 23 May 2015 17:03:18 +0000 (19:03 +0200)]
Rollup merge of #25702 - killercup:rustdoc/search-primitives, r=Gankro
This minimally changes rustdoc's search as described in #25167.
Additionally, I also cleaned up some parts of the JS code.
There is one more change I made: After each result for a primitive type, I added "(Overview of primitive type)". This further differentiates the result from the module (previously, the only difference was that the module's link was blue). I'm not this is the way to go (this seems to be the only place where we do this) and it's no problem for me to remove that commit.
Oliver Schneider [Sat, 23 May 2015 17:03:18 +0000 (19:03 +0200)]
Rollup merge of #25697 - geofft:configure-friendliness, r=brson
Make the error message about missing dependencies clearer, since "need program file" is pretty confusing, and make full commands get logged, since that seems to have been the intention.
bors [Sat, 23 May 2015 15:57:48 +0000 (15:57 +0000)]
Auto merge of #25667 - lambda:rename-soft_link-to-symlink-landed-in-1.1, r=aturon
The change to split up soft_link to OS-specific symlink, symlink_file,
and symlink_dir didn't actually land in 1.0.0. Update the stability and
deprecation attributes to correctly indicate that these changes happend
in 1.1.0.
bors [Sat, 23 May 2015 12:47:16 +0000 (12:47 +0000)]
Auto merge of #25632 - alexcrichton:dt-dir, r=brson
This "fast path" in `DirEntry::file_type` on Unix wasn't turning out to be so
much of a fast path as the `DT_DIR` case wasn't handled, so directories fell
back to using `lstat` instead. This commit adds the missing case to return
quickly if a path is a directory and `DirEntry::file_type` is used.
bors [Sat, 23 May 2015 11:12:02 +0000 (11:12 +0000)]
Auto merge of #25416 - kballard:ffi-cstr-to-str-convenience, r=alexcrichton
This was motivated by http://www.evanmiller.org/a-taste-of-rust.html.
A common problem when working with FFI right now is converting from raw
C strings into `&str` or `String`. Right now you're required to say
something like
let cstr = unsafe { CStr::from_ptr(ptr) };
let result = str::from_utf8(cstr.to_bytes());
This is slightly awkward, and is not particularly intuitive for people
who haven't used the ffi module before. We can do a bit better by
providing some convenience methods on CStr:
bors [Sat, 23 May 2015 09:36:56 +0000 (09:36 +0000)]
Auto merge of #24847 - sfackler:debug-builders-stability, r=aturon
The `debug_builders` feature is up for 1.1 stabilization in #24028. This commit stabilizes the API as-is with no changes.
Some nits that @alexcrichton mentioned that may be worth discussing now if anyone cares:
* Should `debug_tuple_struct` and `DebugTupleStruct` be used instead of `debug_tuple` and `DebugTuple`? It's more typing but is a technically more correct name.
* `DebugStruct` and `DebugTuple` have `field` methods while `DebugSet`, `DebugMap` and `DebugList` have `entry` methods. Should we switch those to something else for consistency?
bors [Sat, 23 May 2015 08:01:08 +0000 (08:01 +0000)]
Auto merge of #25717 - brson:compiler-docs, r=pnkfelix
The install target depends on compiler-docs but 'all' does not.
This means that running 'make && make install' will run additional
doc builds and tests during installation, which hides bugs in
the build.
For now this just unconditionally stops building compiler docs.
Brian Anderson [Fri, 22 May 2015 20:02:52 +0000 (13:02 -0700)]
mk: Don't build compiler-docs before installation. #25699
The install target depends on compiler-docs but 'all' does not.
This means that running 'make && make install' will run additional
doc builds and tests during installation, which hides bugs in
the build.
For now this just unconditionally stops building compiler docs.
Kevin Ballard [Thu, 14 May 2015 21:49:32 +0000 (14:49 -0700)]
Add some convenience methods to go from CStr -> str
A common problem when working with FFI right now is converting from raw
C strings into `&str` or `String`. Right now you're required to say
something like
let cstr = unsafe { CStr::from_ptr(ptr) };
let result = str::from_utf8(cstr.to_bytes());
This is slightly awkward, and is not particularly intuitive for people
who haven't used the ffi module before. We can do a bit better by
providing some convenience methods on CStr:
Pascal Hertleif [Fri, 22 May 2015 12:14:28 +0000 (14:14 +0200)]
Rustdoc: Clean Up Some JS
There are more possible optimizations left (cached length in loops) as
well as some possible bugs (shadowed variables) to fix. This is mostly
syntactic.
Geoffrey Thomas [Fri, 22 May 2015 04:25:01 +0000 (00:25 -0400)]
configure: Fix printing of commands from `run`
The `run` function passed its argument to `msg` via `"$@"`, but `msg`
only printed its first argument. I think the intention was for `msg` to
print all its arguments. (If not, `run` should only `msg "$1"`.)
Geoffrey Thomas [Fri, 22 May 2015 04:20:04 +0000 (00:20 -0400)]
configure: Clarify error message about missing dependencies
Took me a moment to figure out that the appropriate response to
"need program file" was to install the program named "file", not
to think "If I didn't need the program file, why would I be
compiling things?".