Commit Graph

42976 Commits

Author SHA1 Message Date
bors
a97b3ff16f Auto merge of #25741 - richo:backtrace-message, r=alexcrichton
The second commit seems reasonable to me but I can remove if it's contentious. The first is purely cosmetic but has been irking me for ages.
2015-05-27 02:15:44 +00:00
bors
e4c64a1499 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.
2015-05-27 00:42:55 +00:00
bors
fe85342ef6 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.

This is, in part, more progress towards #24407
2015-05-26 23:10:06 +00:00
bors
cccc137b88 Auto merge of #25675 - bluss:rustdoc-assoc-types-index, r=alexcrichton
rustdoc: Associated type fixes

The first commit fixes a bug with "dud" items in the search index from
misrepresented `type` items in trait impl blocks.

For a trait *implementation* there are typedefs which are the types for
that particular trait and implementor. Skip these in the search index.

There were lots of dud items in the search index due to this (search for
Item, Iterator's associated type).

Add a boolean to clean::TypedefItem so that it tracks whether the it is
a type alias on its own, or if it's a `type` item in a trait impl.

The second commit fixes a bug that made signatures and where bounds
using associated types (if they were not on `Self`) incorrect.

The third commit fixes so that where clauses in type alias definititons
are shown.

Fixes #22442
Fixes #24417
Fixes #25769
2015-05-26 21:36:57 +00:00
Nick Hamann
570a043576 Convert 15 diagnostics to have error codes (E0380-E0394).
Also adds explanations for E0380 and E0381.
2015-05-26 15:12:52 -05:00
Nick Hamann
fbef978fd7 Pluralize E0087-E0090 messages based on number of parameters. 2015-05-26 15:12:52 -05:00
Nick Hamann
d8d4a6a842 Fix typo. 2015-05-26 15:12:52 -05:00
Nick Hamann
efb5a85e59 Small improvements for explanations of E0250, E0368, E0372. 2015-05-26 15:12:52 -05:00
Nick Hamann
b593359f7f Add error explanations for E0055, E0089, E0192, E0261, E0262, E0263, E0318. 2015-05-26 15:12:52 -05:00
bors
1742a01f8d Auto merge of #24657 - aochagavia:rustdoc, r=alexcrichton
Fixes #24575 
Fixes #25673 

r? @alexcrichton
2015-05-26 20:04:09 +00:00
bors
6a003abc37 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.

Part of #24407
2015-05-26 18:30:42 +00:00
bors
0ea80faae8 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.

This PR is pretty much orthogonal to #25065.
2015-05-26 16:58:07 +00:00
bors
a83201ff9f 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.

Closes #18913
2015-05-26 14:08:24 +00:00
Alex Crichton
fa0834d630 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.

Closes #18913
2015-05-26 07:06:31 -07:00
bors
c654a07d29 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).

r? @eddyb
2015-05-26 12:15:30 +00:00
bors
8a872943ff Auto merge of #25778 - econoplas:master, r=pnkfelix
A regression was introduced by commit 7b1916d253 #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.

r? @pnkfelix
2015-05-26 09:49:36 +00:00
Ariel Ben-Yehuda
0ec3183df8 Remove ObjectCastMap 2015-05-26 12:33:53 +03:00
Ariel Ben-Yehuda
f4ee40ead2 Use lookup_locally_or_in_crate_store more often 2015-05-26 12:33:53 +03:00
Ariel Ben-Yehuda
c7711002bb Make caching in stability work. This improves stability check performance
by 90%.
2015-05-26 11:38:56 +03:00
Ariel Ben-Yehuda
014bf0df34 Clean-up some junk 2015-05-26 11:38:56 +03:00
bors
7cb9914fce Auto merge of #25767 - mystor:patch-1, r=Gankro
By the same logic that `mem::forget` is safe, `boxed::into_raw` is actually a safe function.

Fixes #25755.
2015-05-25 23:02:52 +00:00
bors
cc156c2f38 Auto merge of #25771 - killercup:trpl/cleanup-markdown-links, r=steveklabnik
In all other places the IDs of link references are without spaces (and explicitly set).

These are just some cleanups I did for the PDF version.

r? @steveklabnik
2015-05-25 21:28:51 +00:00
Ulrik Sverdrup
06304ed522 rustdoc: Show where clauses in type aliases
Yes, it's allowed. Example:

    type MapFn<I, B> where I: Iterator = Map<I, fn(I::Item) -> B>;

Fixes #25769
2015-05-25 23:10:36 +02:00
bors
1d0002887e 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.

Seems easier to understand without `take()`.
2015-05-25 19:52:45 +00:00
Michael Layzell
d416fc1d40 Remove unsafe block around boxed::into_raw() as it is now safe 2015-05-25 14:44:22 -04:00
bors
6770253c67 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.
2015-05-25 18:18:11 +00:00
Ulrik Sverdrup
d1cd689b48 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.

This fixes the bug by using paths for generics.

Fixes #24417
2015-05-25 19:06:58 +02:00
bors
45001c0ef8 Auto merge of #25773 - dotdash:deref_dst, r=eddyb
Fat pointers aren't immediate, so in a datum, they're not actually
ByValue but ByRef.

Fixes #24589
2015-05-25 15:54:39 +00:00
Björn Steinbrink
efd3e75503 Fix auto_ref for fat pointers
Fat pointers aren't immediate, so in a datum, they're not actually
ByValue but ByRef.

Fixes #24589
2015-05-25 17:25:41 +02:00
econoplas
43502adf07 - Fix regression of literal out of range check for negative i64 values which was introduced by commit 7b1916d253.
- Add missing test cases to test/compile-fail/lint-type-overflow.rs which would have detected the regression.
2015-05-25 07:42:16 -06:00
Adolfo Ochagavía
87038831f1 Rustdoc: ignore deref-inherited static methods
Fixes #24575
2015-05-25 15:35:10 +02:00
Pascal Hertleif
6bb56b4fa7 TRPL: Clean up some Markdown links
In all other places the IDs of link references are without spaces (and
explicitly set).
2015-05-25 15:10:50 +02:00
bors
38c943f7ef Auto merge of #25770 - dotdash:bool_transmute, r=eddyb
Fixes #25746
2015-05-25 12:20:24 +00:00
Björn Steinbrink
8527c7f43b Fix transmutes with boolean source values
Fixes #25746
2015-05-25 13:08:31 +02:00
Björn Steinbrink
860448f070 Fix interchanged names of to_arg_ty and from_arg_ty 2015-05-25 12:58:19 +02:00
Thomas Karpiniec
2b3354cbf8 book: add no_run and use statement to strings no-coercion example 2015-05-25 18:38:17 +10:00
bors
2bc0bf2586 Auto merge of #25764 - tshepang:typo, r=steveklabnik 2015-05-25 05:19:11 +00:00
bors
e9005fb43e 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.

This PR fixes this typo and should close #25635.
2015-05-25 03:40:31 +00:00
bors
0d64659c30 Auto merge of #25736 - tshepang:path-nits, r=steveklabnik 2015-05-25 01:56:48 +00:00
Michael Layzell
04ab4a3471 Mark boxed::into_raw as safe
By the same logic that `mem::forget` is safe, `boxed::into_raw` is actually a safe function. Fixes #25755.
2015-05-24 21:45:29 -04:00
bors
7c4eedc21e Auto merge of #25756 - tshepang:needless-cloned, r=steveklabnik 2015-05-25 00:15:24 +00:00
Tshepang Lekhonkhobe
1bb16fcd5f doc: fix io::Write::write typo 2015-05-25 01:59:04 +02:00
bors
893e416933 Auto merge of #25758 - tshepang:add-cloned-example, r=Gankro 2015-05-24 22:42:00 +00:00
Tshepang Lekhonkhobe
2d5d6fbca4 doc: add example for Iterator::cloned() 2015-05-25 00:22:44 +02:00
Alex Stokes
c7f92018ac Fix typo in diagram demonstrating stack vs. heap values 2015-05-24 15:18:43 -07:00
Tshepang Lekhonkhobe
02b951f66c doc: cloned() and mut not needed 2015-05-24 22:55:34 +02:00
bors
820b1d8393 Auto merge of #25464 - zaeleus:trpl-riol, r=pnkfelix
r? @steveklabnik
2015-05-24 15:52:17 +00:00
bors
ba0e1cd814 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.

r? @pnkfelix
2015-05-24 11:12:34 +00:00
bors
cc56c20ba4 Auto merge of #25168 - Manishearth:register_attr, r=eddyb
This lets plugin authors opt attributes out of the `custom_attribute`
and `unused_attribute` checks.


cc @thepowersgang
2015-05-24 09:38:26 +00:00
Thomas Karpiniec
49597fcbf2 book: explanation that String -> &str coercion doesn't happen for &str traits 2015-05-24 13:54:05 +10:00