Commit Graph

60696 Commits

Author SHA1 Message Date
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
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
Jeffrey Seyfried
6a9248fc15 Clean up ext::tt::transcribe. 2017-01-17 08:17:28 +00:00
Jeffrey Seyfried
debcbf0b8e Refactor the parser to consume token trees. 2017-01-17 08:17:26 +00:00
Jeffrey Seyfried
de46b24758 Introduce string_reader.parse_all_token_trees(). 2017-01-17 08:16:49 +00:00
Jeffrey Seyfried
6466f55ebc Give the StringReader a sess: &ParseSess. 2017-01-17 08:16:47 +00:00
bors
7dfcac55bb Auto merge of #39050 - alexcrichton:travis-nightly, r=brson
travis: Pass --release-channel=nightly on deploy

This commit passes the `--release-channel=nightly` flag to all images which have
the `DEPLOY` flag set. This means that we'll name artifacts and the compiler
appropriately.

This reworks a bit how arguments are passed, but for now doesn't change what's
already being passed. Eventually we'll want to avoid enabling debug assertions
and llvm assertions for *all* releases, but I figure we can tackle that a little
bit more down the road.
2017-01-17 08:01:04 +00:00
Vadim Petrochenkov
66ef5f2bb5 Rename ObjectSum into TraitObject in AST/HIR 2017-01-17 10:41:44 +03:00
Austin Bonander
04ecee158c Move "completed feature gate checking" pass to after "name resolution" pass so proc-macro-attribute feature gate check can use resolve 2017-01-16 22:41:23 -08:00
Austin Bonander
68439614ba Fix feature_gate::find_lang_feature_issue() to not use unwrap() 2017-01-16 22:41:22 -08:00
Austin Bonander
375cbd20cf Implement #[proc_macro_attribute]
* Add support for `#[proc_macro]`

* Reactivate `proc_macro` feature and gate `#[proc_macro_attribute]` under it

* Have `#![feature(proc_macro)]` imply `#![feature(use_extern_macros)]`,
error on legacy import of proc macros via `#[macro_use]`
2017-01-16 22:41:22 -08:00
Alex Crichton
0618580235 travis: Pass --release-channel=nightly on deploy
This commit passes the `--release-channel=nightly` flag to all images which have
the `DEPLOY` flag set. This means that we'll name artifacts and the compiler
appropriately.

This reworks a bit how arguments are passed, but for now doesn't change what's
already being passed. Eventually we'll want to avoid enabling debug assertions
and llvm assertions for *all* releases, but I figure we can tackle that a little
bit more down the road.
2017-01-16 22:26:21 -08:00
bors
31dee37a15 Auto merge of #39090 - solson:exprkind-array, r=eddyb
Rename ExprKind::Vec to Array in HIR and HAIR.

This is a clearer name since they represent `[a, b, c]` array literals.

r? @eddyb
2017-01-17 05:55:56 +00:00
king6cong
5a462e8a68 consistent doc wording 2017-01-17 11:32:13 +08:00
bors
32da85148a Auto merge of #39087 - nrc:qquote-empty-delim, r=jseyfried
proc macros/qquote: Handle empty delimited tokens

r? @jseyfried
2017-01-17 03:29:42 +00:00
Jeffrey Seyfried
f2d1407743 Remove field tokens_consumed of Parser. 2017-01-17 03:14:42 +00:00
Alex Crichton
6b23cc48db travis: Expand the cross linux image
This expands the `cross` travis matrix entry with a few more targets that our
nightlies are building:

* x86_64-rumprun-netbsd
* arm-unknown-linux-musleabi
* arm-unknown-linux-musleabihf
* armv7-unknown-linux-musleabihf
* mips-unknown-linux-musl
* mipsel-unknown-linux-musl

This commit doesn't compile custom toolchains like our current cross-image does,
but instead compiles musl manually and then compiles libunwind manually (like
x86_64) for use for the ARM targets and just uses openwrt toolchains for the
mips targets.
2017-01-16 18:50:01 -08:00
Alex Crichton
baff51c040 travis: Tweak OSX image configuration
Somewhere between https://travis-ci.org/rust-lang/rust/jobs/192352185 and
https://travis-ci.org/rust-lang/rust/jobs/192440181 it looks like our
configuration for a newer OSX image was lost as LLDB has reverted itself back to
350. This fix appeared to work for the libc crate so let's see if we can
configure it to work for the rust repo as well.
2017-01-16 18:43:38 -08:00
Alex Crichton
2d52cb9349 appveyor: Test/Dist i586 MSVC
This is a target that we're shipping today, so this commit adds this matrix
entry to AppVeyor. This reuses the existing i686 MSVC matrix entry as it's
currently finishing about a half hour under two hours, which should hopefully
give it enough extra time to run this test suite.
2017-01-16 16:51:13 -08:00
bors
4ce7accaa7 Auto merge of #38949 - GuillaumeGomez:fix_linker, r=nagisa
Fix linker failure on windows

Fixes #38933.

r? @ollie27
2017-01-17 00:50:52 +00:00
Michael Woerister
30ba990fce ignore-gdb-version: Address review comments. 2017-01-16 18:22:38 -05:00
Vadim Petrochenkov
869b81646d syntax: Rename parse_ty -> parse_ty_no_plus, parse_ty_sum -> parse_ty 2017-01-17 02:13:41 +03:00
Vadim Petrochenkov
03620dba25 Use resizable Vec instead of P<[T]> in AST 2017-01-17 01:54:59 +03:00
Michael Woerister
fe025d4345 incr.comp.: Delete orphaned work-products. 2017-01-16 17:54:20 -05:00
Vadim Petrochenkov
2efe865d22 AST/HIR: Merge ObjectSum and PolyTraitRef 2017-01-17 01:52:47 +03:00
bors
c2b19c109e Auto merge of #39108 - GuillaumeGomez:rollup, r=GuillaumeGomez
Rollup of 6 pull requests

- Successful merges: #38247, #39028, #39065, #39084, #39105, #39106
- Failed merges:
2017-01-16 22:21:51 +00:00
Guillaume Gomez
04e74cefee Rollup merge of #39106 - istankovic:patch-2, r=GuillaumeGomez
libcollections: btree/set: fix a typo
2017-01-16 22:48:26 +01:00