Commit Graph

43172 Commits

Author SHA1 Message Date
Matt Brubeck
6c2b340fdc Improve docs for Vec::as_slice and as_mut_slice
Fixes #25622.
2015-05-27 12:37:29 -07:00
Manish Goregaokar
db1914ef7e Rollup merge of #25726 - nham:cell_docs, r=alexcrichton
Currently part of the description of the `into_inner` method of `UnsafeCell` seems backwards.
2015-05-28 00:35:20 +05:30
Manish Goregaokar
04016171ca Rollup merge of #25668 - steveklabnik:doc_const, r=alexcrichton 2015-05-28 00:35:20 +05:30
Manish Goregaokar
689e94b422 Rollup merge of #25128 - steveklabnik:gh24816, r=alexcrichton
Fixes #24816

r? @alexcrichton
2015-05-28 00:35:19 +05:30
Steve Klabnik
4db7e56b01 Small wording fix in TRPL: lifetimes
Fixes #25438
2015-05-27 15:02:42 -04:00
Steve Klabnik
62e5dee1c5 fix example for E0018
Fixes #25326
2015-05-27 14:51:58 -04:00
Ariel Ben-Yehuda
699fc80780 Address review comments 2015-05-27 20:42:42 +03:00
Ariel Ben-Yehuda
c68e65251c test fixes 2015-05-27 20:31:56 +03:00
bors
af60248ecf Auto merge of #25799 - alexcrichton:fix-link-in-mk, r=luqmana
The changes scaled back in 4cc025d8 were a little too aggressive and broke a
bunch of cross compilations by not defining the `LINK_$(1)` variable for all
targets. This commit ensures that the variable is defined for all targets by
defaulting it to the normal compiler if it's not already defined (it's only
defined specially for MSVC).

Closes #25723
Closes #25802
2015-05-27 17:25:00 +00:00
Alex Crichton
279ec9b9b8 test: Join child threads on windows in tests
Windows tests can often deadlock if a child thread continues after the main
thread and then panics, and a `println!` executed in a child thread after the
main thread has exited is at risk of panicking.
2015-05-27 09:15:19 -07:00
bors
efcc1d1bcb Auto merge of #25797 - eddyb:const-trait-to-trait, r=luqmana
Fixes #24644.
2015-05-27 12:37:56 +00:00
bors
f56782ab9c Auto merge of #25762 - dotdash:codegen_test, r=alexcrichton
The current codegen tests only compare IR line counts between similar
rust and C programs, the latter getting compiled with clang. That looked
like a good idea back then, but actually things like lifetime intrinsics
mean that less IR isn't always better, so the metric isn't really
helpful.

Instead, we can start doing tests that check specific aspects of the
generated IR, like attributes or metadata. To do that, we can use LLVM's
FileCheck tool which has a number of useful features for such tests.

To start off, I created some tests for a few things that were recently
added and/or broken.
2015-05-27 10:21:11 +00:00
Björn Steinbrink
677367599e Revamp codegen tests to check IR quality instead of quantity
The current codegen tests only compare IR line counts between similar
rust and C programs, the latter getting compiled with clang. That looked
like a good idea back then, but actually things like lifetime intrinsics
mean that less IR isn't always better, so the metric isn't really
helpful.

Instead, we can start doing tests that check specific aspects of the
generated IR, like attributes or metadata. To do that, we can use LLVM's
FileCheck tool which has a number of useful features for such tests.

To start off, I created some tests for a few things that were recently
added and/or broken.
2015-05-27 12:08:31 +02:00
Johannes Oertel
c40866785f Remove build date from the output of --version
Closes #25812.
2015-05-27 11:28:41 +02:00
bors
eb16ad6e71 Auto merge of #25790 - eddyb:oh-snap-ctfe-arrived, r=alexcrichton 2015-05-27 08:47:53 +00:00
Eduard Burtescu
377b0900ae Use const fn to abstract away the contents of UnsafeCell & friends. 2015-05-27 11:19:03 +03:00
Eduard Burtescu
6e8e4f847c Remove #[cfg(stage0)] items. 2015-05-27 11:19:02 +03:00
Eduard Burtescu
07503dfb8b Register snapshots (2015-05-24 ba0e1cd). 2015-05-27 11:19:02 +03:00
bors
a2cf2c66e0 Auto merge of #25791 - barosl:use-paths-as-items, r=alexcrichton
Currently, for `use` declarations with multiple paths, only the `use` item itself is saved in the AST map, not the individual path nodes. This can lead to a problem when a span of a specific path node is needed.

For example, #24818 caused an ICE because of this, in `ImportResolver::check_for_conflicting_import()`.

Fixes #25763.
2015-05-27 07:14:45 +00:00
bors
5a2c766cdd Auto merge of #25749 - richo:python3, r=alexcrichton
This is enough to make `make tidy` work if you're using python3

There's definitely more stuff to do, but PR'ing now to avoid bitrot
2015-05-27 05:24:36 +00:00
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
Ralph Giles
bb61b0b8bb Update rustc manpage.
rustc -C target-cpu=help is no longer supported. Recommend the
llc tool intead like 'rustc --help'.
2015-05-26 16:29:32 -07:00
Ralph Giles
ea5c8eb2c9 Bump manpage date and version for 1.2.0-dev.
Estimating August as the release date for 1.2.0.
2015-05-26 16:29:12 -07: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
Steve Klabnik
577bbaceb9 Add note about filesystems to fs::rename
Fixes #24816
2015-05-26 19:02:24 -04:00
Nick Cameron
ff68204880 Add a WONTFIX message to a failing test.
Closes #20184
2015-05-27 10:16:49 +12:00
Johannes Oertel
909cbbeda8 Enable colored test output when capturing output of tests
The output of individual tests can be captured now so it's safe to use
colorized output even when running tests in parallel. Closes #782.
2015-05-26 23:51:13 +02: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
Richo Healey
96d7400b1a etc: use codecs in featureck
this asserts that source is valid utf8 on both python3 and python2
2015-05-26 12:11:46 -07: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
Alex Crichton
bc7c62de6d mk: Ensure LINK_$(1) is defined for all targets
The changes scaled back in 4cc025d8 were a little too aggressive and broke a
bunch of cross compilations by not defining the `LINK_$(1)` variable for all
targets. This commit ensures that the variable is defined for all targets by
defaulting it to the normal compiler if it's not already defined (it's only
defined specially for MSVC).

Closes #25723
2015-05-26 10:05:46 -07:00
Ariel Ben-Yehuda
65a3245319 Add tests for fixed issues
Fixes #23037.
Fixes #25339.
2015-05-26 20:01:20 +03: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
Steve Klabnik
04c7b82c19 Document std::env::const values 2015-05-26 12:22:28 -04:00
Eduard Burtescu
d957e04d01 Do not trip an assert when coercing &Trait to &Trait in constants.
Fixes #24644.
2015-05-26 17:57:50 +03:00
Ariel Ben-Yehuda
ae10e478eb Implement defaults for associated types 2015-05-26 17:22:29 +03: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
Barosl Lee
0ae30e608c Associate each path in a use declaration with the item in the AST map
Currently, for `use` declarations with multiple paths, only the `use`
item itself is saved in the AST map, not the individual path nodes. This
can lead to a problem when a span of a specific path node is needed.

For example, #24818 caused an ICE because of this, in
`ImportResolver::check_for_conflicting_import()`.

Fixes #25763.
2015-05-26 17:42:56 +09:00