Commit Graph

61137 Commits

Author SHA1 Message Date
Guillaume Gomez
ba76f5158c Rollup merge of #39091 - richard-imaoka:E0491-long-explanation, r=GuillaumeGomez
Add error explanation for E0491

Refs #32777

Please let me know if any question or anything doesn't look right about this.
2017-01-19 11:56:04 +01:00
Guillaume Gomez
7985ae0bb1 Rollup merge of #39039 - michaelwoerister:ignore-gdb-version, r=nrc
debuginfo: Ignore optimized enum tests for GDB versions that can't handle them.

Fixes https://github.com/rust-lang/rust/issues/38948.

r? @nrc
cc @Manishearth
2017-01-19 11:56:03 +01:00
Guillaume Gomez
223e084141 Rollup merge of #38970 - apasel422:may-dangle, r=pnkfelix
Deprecate `#[unsafe_destructor_blind_to_params]`

CC #34761

r? @pnkfelix
2017-01-19 11:56:02 +01:00
Guillaume Gomez
cabfb078b0 Rollup merge of #38922 - chris-morgan:fs-markdown-link-fix, r=steveklabnik
Fix a couple of bad Markdown links
2017-01-19 11:56:01 +01:00
Guillaume Gomez
ced04ff5c6 Rollup merge of #38457 - frewsxcv:include, r=GuillaumeGomez
Improvements to 'include' macro documentation.

None
2017-01-19 11:56:00 +01:00
Vadim Petrochenkov
853f697476 Fix regression in parsing of trait object types 2017-01-19 13:28:45 +03:00
Jack Vickeridge
ea70a88710 Use fs::symlink_metadata in doc for is_symlink
fs::metadata() follows symlinks so is_symlink() will always return
false. Use symlink_metadata instead in the example in the
documentation.

See issue #39088.
2017-01-19 09:30:58 +00:00
Oliver Schneider
c951341a78
add exclusive range patterns under a feature gate 2017-01-19 10:13:32 +01:00
bors
74c42ac173 Auto merge of #38464 - clarcharr:ip_cmp, r=sfackler
PartialEq and PartialOrd between IpAddr and Ipv[46]Addr.

PartialEq was rather useful, so, I figured that I'd implement it. I added PartialOrd for good measure.
2017-01-19 03:34:05 +00:00
Jorge Aparicio
6296d52ba6 calling convention for MSP430 interrupts
This calling convention is used to define interrup handlers on MSP430
microcontrollers. Usage looks like this:

``` rust
#[no_mangle]
#[link_section = "__interrupt_vector_10"]
pub static TIM0_VECTOR: unsafe extern "msp430-interrupt" fn() = tim0;

unsafe extern "msp430-interrupt" fn tim0() {
  P1OUT.write(0x00);
}
```

which generates the following assembly:

``` asm
Disassembly of section __interrupt_vector_10:

0000fff2 <TIM0_VECTOR>:
    fff2:       10 c0           interrupt service routine at 0xc010

Disassembly of section .text:

0000c010 <_ZN3msp4tim017h3193b957fd6a4fd4E>:
    c010:       c2 43 21 00     mov.b   #0,     &0x0021 ;r3 As==00
    c014:       00 13           reti
        ...
```
2017-01-18 20:42:54 -05:00
bors
2263d1ba29 Auto merge of #38712 - clarcharr:duration_sum, r=sfackler
Sum for Duration

Implemented the `Sum` trait for `Duration`. Seems reasonable.
2017-01-19 01:09:46 +00:00
Esteban Küber
2883186180 Use multiline Diagnostic for candidate in other module 2017-01-18 16:33:25 -08:00
Alex Crichton
c457b819d7 travis: Stop uploading sha256 files
We'll generate these later in the build process and otherwise they could just
cause spurious failures with files overwriting one another.
2017-01-18 16:10:05 -08:00
Corey Farwell
c8822da79b A few improvements to the slice docs.
* Simplify `Option::iter_mut` doc example.
* Document 'empty' corner-cases for `slice::{starts_with, ends_with}`.
* Indicate 'true' as code-like.
2017-01-18 19:02:12 -05:00
Mike Hommey
265bd53fe9 Update jemalloc to include various fixes for OSX 10.12 2017-01-19 09:01:52 +09:00
Josh
d492433744 Add doctest to the proc-macro derive-test 2017-01-19 09:31:55 +11:00
Josh
c759aea5b3 Stop warning when doc testing proc macro crates
Add the actually_rustdoc option to the session that
is passed  to phase_2_configure_and_expand function
inside the rustdoc test module.

This prevents the warning code from triggering when
parsing proc_macro_derive attributes, just like when
`--test` is normally invoked.
2017-01-19 08:31:29 +11:00
Michael Woerister
5f118b954e travis: Gate on some minimal support for incremental compilation.
This commit adds a travis job that builds a stage2 compiler in
incremental mode (but with empty incremental compilation cache).
Building incrementally with an empty cache makes sure that the
compiler doesn't crash in dependency tracking during bootstrapping.
2017-01-18 12:06:22 -05:00
Michael Woerister
deeba3443e Add regression test for debuginfo + LTO 2017-01-18 11:24:43 -05:00
Guillaume Gomez
08c20bb017 Add missing Debug implementation for librand structs 2017-01-18 17:13:47 +01:00
Andre Bogus
b40432c949 add test case for filter+count 2017-01-18 13:55:47 +01:00
Andrew Cann
2c6bc18610 Feature gate &Void's uninhabitedness.
References to empty types are only considered empty if feature(never_type) is
enabled.
2017-01-18 15:05:28 +08:00
Georg Brandl
871357a534 collections: update docs of slice get() and friends
for the new SliceIndex trait.  Also made the docs of the unchecked
versions a bit clearer; they return a reference, not an "unsafe
pointer".
2017-01-18 07:25:09 +01:00
Chris Stankus
5c58653e46 E0122 should apply with where clauses 2017-01-18 00:16:19 -06:00
bors
c8af93f090 Auto merge of #38168 - estebank:help-E0034, r=nrc
E0034: provide disambiguated syntax for candidates

For a given file

```rust
trait A { fn foo(&self) {} }
trait B : A { fn foo(&self) {} }

fn bar<T: B>(a: &T) {
  a.foo()
}
```

provide the following output

```
error[E0034]: multiple applicable items in scope
 --> file.rs:6:5
  |
6 |   a.foo(1)
  |     ^^^ multiple `foo` found
  |
note: candidate #1 is defined in the trait `A`
 --> file.rs:2:11
  |
2 | trait A { fn foo(&self, a: usize) {} }
  |           ^^^^^^^^^^^^^^^^^^^^^^^^^^
help: to use it here write `A::foo(&a, 1)` instead
 --> file.rs:6:5
  |
6 |   a.foo(1)
  |     ^^^
note: candidate #2 is defined in the trait `B`
 --> file.rs:3:15
  |
3 | trait B : A { fn foo(&self, a: usize) {} }
  |               ^^^^^^^^^^^^^^^^^^^^^^^^^^
help: to use it here write `B::foo(&a, 1)` instead
 --> file.rs:6:5
  |
6 |   a.foo(1)
  |     ^^^
```

Fix #37767.
2017-01-18 04:45:25 +00:00
Alex Crichton
92e98a06d4 travis: Fix post-failure lldb invocation
Pass an absolute path, not just the basename.
2017-01-17 18:55:24 -08:00
bors
be1daa4a18 Auto merge of #39019 - nikomatsakis:issue-38919, r=eddyb
only consider value items when searching for methods, not types

Fixes #38919

r? @eddyb
2017-01-18 02:20:03 +00:00
Niko Matsakis
f57d5ad7e1 check inherent impls of traits for overlap as well 2017-01-17 18:32:09 -05:00
Niko Matsakis
d25f066c07 run rustdoc tests in the same sort of thread rustc runs in 2017-01-17 18:15:08 -05:00
Niko Matsakis
d82d4b66f2 tolerate None return from get_line 2017-01-17 17:56:03 -05:00
Niko Matsakis
2bade8133c more complete error message 2017-01-17 17:55:49 -05:00
Esteban Küber
fc774e629f Teach Diagnostics to highlight text 2017-01-17 14:28:53 -08:00
Brian Anderson
a0a4af139d 1.15 release notes 2017-01-17 22:20:26 +00:00
gralpli
9fd3860e56 Fix ICE when compiling fn f<T: ?for<'a> Sized>() {} 2017-01-17 22:52:43 +01:00
bors
c07a6ae77c Auto merge of #37972 - bluss:iter-find-is-on-a-roll, r=sfackler
Improve the slice iterator's searching methods

Improve all, any, find, position, rposition by explicitly unrolling the loop for the slice iterators.

- Introduce a few extension methods and functions for raw pointers make the new code easy to express
- Introduce helper methods `search_while, rsearch_while` that generalize all the searching methods

LLVM doesn't unroll the loop in `.find()` by default (clang is the same), so performance benefits a lot from explicit unrolling here. An iterator method without conditional exits (like `.fold()`) does not need this on the other hand.

One of the raw pointer extension methods is `fn post_inc(&mut self) -> Self` which is the rustic equivalent of “`ptr++`”, and it is a nice way to express the raw pointer loop (see commit 3).

Specific development notes about `search_while`: I tried both computing an end pointer "rounded" to 4, as well as the `ptrdistance >= 4` loop condition, ptrdistance was better. I tried handling the last 0-3 elements unrolled or with a while loop, the loop was better.
2017-01-17 21:52:03 +00:00
Jeffrey Seyfried
0b9e26f390 Fix fallout in rustdoc. 2017-01-17 21:06:45 +00:00
Jeffrey Seyfried
4c98e1bc59 Remove the lookahead buffer. 2017-01-17 21:06:44 +00:00
Stephen E. Baker
3d85f73def Clarify when range is removed by drain
Based on a discussion on #rust-beginners the existing note for drain is confusing. This new wording was suggested.
2017-01-17 14:39:16 -05:00
Martin Hafskjold Thoresen
90fbe155f2
Fix BinaryHeap place by only constructing vec::PlaceBack once 2017-01-17 19:25:48 +01:00
bors
bd8e9b0c82 Auto merge of #39109 - michaelwoerister:incr-comp-cache-cleanup, r=nikomatsakis
incr.comp.: Delete orphaned work-products.

The new partitioning scheme uncovered a hole in our incr. comp. cache directory garbage collection. So far, we relied on unneeded work products being deleted during the initial cache invalidation phase. However, we the new scheme, we get object files/work products that only contain code from upstream crates. Sometimes this code is not needed anymore (because all callers have been removed from the source) but because nothing that actually influences the contents of these work products had changed, we never deleted them from disk.

r? @nikomatsakis
2017-01-17 18:22:20 +00:00
Alex Crichton
1080a69b01 travis: Pass --enable-llvm-static-stdcpp
All our releases are compiled with this, so let's be sure to do so whenever
`DEPLOY` is set. This'll ensure that we don't have dynamic dependencies on
libstdc++ which LLVM depends on, but instead we link it all statically to have
more portable binaries.
2017-01-17 08:51:03 -08:00
bors
aedebfe77d Auto merge of #39100 - Mark-Simulacrum:fix-stage1, r=eddyb
Fix stage 1 tests broken because i128 doesn't work in stage 1

Broken by https://github.com/rust-lang/rust/pull/38992.
2017-01-17 14:38:29 +00:00
Andrew Cann
dd13cc3e5d Fix make tidy 2017-01-17 21:49:39 +08:00
Andrew Cann
1c51f60ee2 Change unreachable patterns ICEs to warnings
Allow code with unreachable `?` and `for` patterns to compile.
Add some tests.
2017-01-17 21:32:27 +08:00
Richard S. Imaoka
c525094bad Add error explanation for E0491 2017-01-17 22:16:55 +09:00
bors
a167c042ab Auto merge of #39110 - petrochenkov:sum, r=eddyb
Merge ObjectSum and PolyTraitRef in AST/HIR + some other refactoring

`ObjectSum` and `PolyTraitRef` are the same thing (list of bounds), they exist separately only due to parser quirks. The second commit merges them.

The first commit replaces `Path` with `Ty` in (not yet supported) equality predicates. They are parsed as types anyway and arbitrary types can always be disguised as paths using aliases, so this doesn't add any new functionality.

The third commit uses `Vec` instead of `P<[T]>` in AST. AST is not immutable like HIR and `Vec`s are more convenient for it, unnecessary conversions are also avoided.

The last commit renames `parse_ty_sum` (which is used for parsing types in general) into `parse_ty`, and renames `parse_ty` (which is used restricted contexts where `+` is not permitted due to operator priorities or other reasons) into `parse_ty_no_plus`.

This is the first part of https://github.com/rust-lang/rust/issues/39085#issuecomment-272743755 and https://github.com/rust-lang/rust/issues/39080 focused on data changes and mechanical renaming, I'll submit a PR with parser changes a bit later.

r? @eddyb
2017-01-17 12:31:15 +00:00
Andre Bogus
27f76157aa fix style nits 2017-01-17 13:18:16 +01:00
bors
0825c96b14 Auto merge of #39095 - nagisa:fix-ub-in-testhelp, r=alexcrichton
Fix UB in test helpers

Macro expansion producing defined has undefined behavior in C/C++.
2017-01-17 10:10:32 +00:00
Eitan Adler
1cf9d6a7f2 minor typo fix 2017-01-17 00:18:45 -08:00
Jeffrey Seyfried
57c0ed097c Avoid interpolated token trees. 2017-01-17 08:17:28 +00:00