]> git.lizzy.rs Git - rust.git/log
rust.git
8 years agoAuto merge of #30408 - durka:issue-26873, r=alexcrichton
bors [Sat, 19 Dec 2015 08:08:53 +0000 (08:08 +0000)]
Auto merge of #30408 - durka:issue-26873, r=alexcrichton

I think we can close #26873 with these tests.

8 years agoAuto merge of #30403 - webmobster:master, r=alexcrichton
bors [Sat, 19 Dec 2015 06:21:10 +0000 (06:21 +0000)]
Auto merge of #30403 - webmobster:master, r=alexcrichton

I didn't see any reason that debug couldn't be added to this object, since every field derives debug.

8 years agoAuto merge of #30184 - petrochenkov:ascr, r=nikomatsakis
bors [Sat, 19 Dec 2015 02:45:15 +0000 (02:45 +0000)]
Auto merge of #30184 - petrochenkov:ascr, r=nikomatsakis

This PR is a rebase of the original PR by @eddyb https://github.com/rust-lang/rust/pull/21836 with some unrebasable parts manually reapplied, feature gate added + type equality restriction added as described below.

This implementation is partial because the type equality restriction is applied to all type ascription expressions and not only those in lvalue contexts. Thus, all difficulties with detection of these contexts and translation of coercions having effect in runtime are avoided.
So, you can't write things with coercions like `let slice = &[1, 2, 3]: &[u8];`. It obviously makes type ascription less useful than it should be, but it's still much more useful than not having type ascription at all.
In particular, things like `let v = something.iter().collect(): Vec<_>;` and `let u = t.into(): U;` work as expected and I'm pretty happy with these improvements alone.

Part of https://github.com/rust-lang/rust/issues/23416

8 years agoAuto merge of #30381 - fhahn:memchr-in-std, r=alexcrichton
bors [Sat, 19 Dec 2015 00:57:25 +0000 (00:57 +0000)]
Auto merge of #30381 - fhahn:memchr-in-std, r=alexcrichton

This PR adds `memchr`and `memrchr` based on @BurntSushi 's rust-memchr crate to libstd (as discussed in #30151).

I've update some places in libstd to use memchr/memrchr, but I am not sure if there are other places where it could be used as well.

ref #30076

8 years agoAuto merge of #30364 - luqmana:mir-calls, r=nikomatsakis
bors [Fri, 18 Dec 2015 23:06:24 +0000 (23:06 +0000)]
Auto merge of #30364 - luqmana:mir-calls, r=nikomatsakis

8 years ago[MIR] Initial implementation for translating calls.
Luqman Aden [Sun, 13 Dec 2015 13:48:43 +0000 (05:48 -0800)]
[MIR] Initial implementation for translating calls.

8 years agoUse memrchr bindings provided by libc
Florian Hahn [Thu, 17 Dec 2015 23:36:38 +0000 (00:36 +0100)]
Use memrchr bindings provided by libc

8 years agoAuto merge of #30389 - nikomatsakis:rfc1214-error, r=arielb1
bors [Fri, 18 Dec 2015 20:44:33 +0000 (20:44 +0000)]
Auto merge of #30389 - nikomatsakis:rfc1214-error, r=arielb1

Make RFC 1214 warnings into errors, and rip out the "warn or err"
associated machinery. Future such attempts should go through lints
anyhow.

There is a fair amount of fallout in the compile-fail tests, as WF
checking now occurs earlier in the process.

r? @arielb1

8 years agoAuto merge of #29973 - petrochenkov:privinpub, r=nikomatsakis
bors [Fri, 18 Dec 2015 18:54:52 +0000 (18:54 +0000)]
Auto merge of #29973 - petrochenkov:privinpub, r=nikomatsakis

Some notes:
This patch enforces the rules from [RFC 136](https://github.com/rust-lang/rfcs/blob/master/text/0136-no-privates-in-public.md) and makes "private in public" a module-level concept and not crate-level. Only `pub` annotations are used by the new algorithm, crate-level exported node set produced by `EmbargoVisitor` is not used. The error messages are tweaked accordingly and don't use the word "exported" to avoid confusing people (https://github.com/rust-lang/rust/issues/29668).

The old algorithm tried to be extra smart with impls, but it mostly led to unpredictable behavior and bugs like https://github.com/rust-lang/rust/issues/28325.
The new algorithm tries to be as simple as possible - an impl is considered public iff its type is public and its trait is public (if presents).
A type or trait is considered public if all its components are public, [complications](https://internals.rust-lang.org/t/limits-of-type-inference-smartness/2919) with private types leaking to other crates/modules through trait impls and type inference are deliberately ignored so far.

The new algorithm is not recursive and uses the nice new facility `Crate::visit_all_items`!

Obsolete pre-1.0 feature `visible_private_types` is removed.

This is a [breaking-change].
The two main vectors of breakage are type aliases (https://github.com/rust-lang/rust/issues/28450) and impls (https://github.com/rust-lang/rust/issues/28325).
I need some statistics from a crater run (cc @alexcrichton) to decide on the breakage mitigation strategy.
UPDATE: All the new errors are reported as warnings controlled by a lint `private_in_public` and lint group `future_incompatible`, but the intent is to make them hard errors eventually.

Closes https://github.com/rust-lang/rust/issues/28325
Closes https://github.com/rust-lang/rust/issues/28450
Closes https://github.com/rust-lang/rust/issues/29524
Closes https://github.com/rust-lang/rust/issues/29627
Closes https://github.com/rust-lang/rust/issues/29668
Closes https://github.com/rust-lang/rust/issues/30055

r? @nikomatsakis

8 years agoDo not substitute type aliases during error reporting
Vadim Petrochenkov [Fri, 18 Dec 2015 17:57:36 +0000 (20:57 +0300)]
Do not substitute type aliases during error reporting
Type aliases are still substituted when determining impl publicity

8 years agoMake RFC 1214 warnings into errors, and rip out the "warn or err"
Niko Matsakis [Tue, 15 Dec 2015 09:31:58 +0000 (04:31 -0500)]
Make RFC 1214 warnings into errors, and rip out the "warn or err"
associated machinery. Future such attempts should go through lints
anyhow.

There is a fair amount of fallout in the compile-fail tests, as WF
checking now occurs earlier in the process.

8 years agoadd tests for #26873
Alex Burka [Wed, 16 Dec 2015 02:35:11 +0000 (21:35 -0500)]
add tests for #26873

8 years agoAuto merge of #30374 - durka:issue-30371, r=alexcrichton
bors [Fri, 18 Dec 2015 17:06:19 +0000 (17:06 +0000)]
Auto merge of #30374 - durka:issue-30371, r=alexcrichton

Fixes #30371.

8 years agoRequire exact type equality + add tests
Vadim Petrochenkov [Fri, 18 Dec 2015 17:00:19 +0000 (20:00 +0300)]
Require exact type equality + add tests

+ Rebase fixes

8 years agoAuto merge of #30457 - Manishearth:rollup, r=Manishearth
bors [Fri, 18 Dec 2015 15:17:29 +0000 (15:17 +0000)]
Auto merge of #30457 - Manishearth:rollup, r=Manishearth

- Successful merges: #30272, #30286, #30365, #30381, #30384, #30398, #30406, #30408, #30420, #30431, #30447, #30452
- Failed merges:

8 years agoRollup merge of #30452 - dotdash:24876_take_2, r=alexcrichton
Manish Goregaokar [Fri, 18 Dec 2015 08:13:46 +0000 (13:43 +0530)]
Rollup merge of #30452 - dotdash:24876_take_2, r=alexcrichton

LLVM doesn't really support reusing the same module to emit more than
one file. One bug this causes is that the IR is invalidated by the stack
coloring pass when emitting the first file, and then the IR verifier
complains by the time we try to emit the second file. Also, we get
different binaries with --emit=asm,link than with just --emit=link. In
some cases leading to segfaults.

Unfortunately, it seems that at this point in time, the most sensible
option to circumvent this problem is to just clone the whole llvm module
for the asm output if we need both, asm and obj file output.

Fixes #24876
Fixes #26235

8 years agoRollup merge of #30447 - Xmasreturns:Docu, r=steveklabnik
Manish Goregaokar [Fri, 18 Dec 2015 08:13:46 +0000 (13:43 +0530)]
Rollup merge of #30447 - Xmasreturns:Docu, r=steveklabnik

Added sentences for description of code and changed x in the example to an int

8 years agoRollup merge of #30431 - mmcco:cleanup, r=alexcrichton
Manish Goregaokar [Fri, 18 Dec 2015 08:13:46 +0000 (13:43 +0530)]
Rollup merge of #30431 - mmcco:cleanup, r=alexcrichton

Remove a needless variable and simply a cfg().

8 years agoRollup merge of #30420 - petrochenkov:owned2, r=nrc
Manish Goregaokar [Fri, 18 Dec 2015 08:13:46 +0000 (13:43 +0530)]
Rollup merge of #30420 - petrochenkov:owned2, r=nrc

Part of https://github.com/rust-lang/rust/pull/30095 not causing mysterious segfaults.

r? @nrc

8 years agoUpdate liblibc to current master
Florian Hahn [Thu, 17 Dec 2015 23:16:25 +0000 (00:16 +0100)]
Update liblibc to current master

8 years agoUse memchr in libstd where possible, closes #30076
Florian Hahn [Mon, 14 Dec 2015 23:03:42 +0000 (00:03 +0100)]
Use memchr in libstd where possible, closes #30076

8 years agoAdd memchr implemenation based on rust-memchr to libstd
Florian Hahn [Sat, 12 Dec 2015 22:38:03 +0000 (23:38 +0100)]
Add memchr implemenation based on rust-memchr to libstd

8 years agoAuto merge of #30286 - oli-obk:const_error_span, r=nikomatsakis
bors [Fri, 18 Dec 2015 12:23:54 +0000 (12:23 +0000)]
Auto merge of #30286 - oli-obk:const_error_span, r=nikomatsakis

previously the error was erased and a `non-const path` error was emitted at the location of the field access instead of at the overflow location (as can be seen in the playground: http://is.gd/EuAF5F )

8 years agoRollup merge of #30406 - durka:patch-13, r=sanxiyn
Manish Goregaokar [Fri, 18 Dec 2015 08:13:46 +0000 (13:43 +0530)]
Rollup merge of #30406 - durka:patch-13, r=sanxiyn

The previous example had no chance of compiling in either form, due to the restrictive follow set for `ty`. This one has the desired behavior: http://is.gd/kYdw4g (well, I don't exactly desire this behavior at all, but it's true at least :p )

8 years agoRollup merge of #30398 - jwworth:pull-request-1450205451, r=sanxiyn
Manish Goregaokar [Fri, 18 Dec 2015 08:13:45 +0000 (13:43 +0530)]
Rollup merge of #30398 - jwworth:pull-request-1450205451, r=sanxiyn

This fixes a double word typo, 'the'.

8 years agoRollup merge of #30384 - nrc:diagnostics, r=@nikomatsakis
Manish Goregaokar [Fri, 18 Dec 2015 08:13:45 +0000 (13:43 +0530)]
Rollup merge of #30384 - nrc:diagnostics, r=@nikomatsakis

Should make it possible to add JSON or HTML errors. Also tidies up a lot.

8 years agoRollup merge of #30286 - oli-obk:const_error_span, r=nikomatsakis
Manish Goregaokar [Fri, 18 Dec 2015 08:13:45 +0000 (13:43 +0530)]
Rollup merge of #30286 - oli-obk:const_error_span, r=nikomatsakis

previously the error was erased and a `non-const path` error was emitted at the location of the field access instead of at the overflow location (as can be seen in the playground: http://is.gd/EuAF5F )

8 years agoAuto merge of #30272 - tshepang:doc-drain, r=bluss
bors [Fri, 18 Dec 2015 05:05:09 +0000 (05:05 +0000)]
Auto merge of #30272 - tshepang:doc-drain, r=bluss

Second sentence actually repeats info from first sentence. "from start to end" also feels like it adds nothing.

I also extended Vec::drain example.

8 years agoFix emitting asm and object file output at the same time
Björn Steinbrink [Fri, 18 Dec 2015 00:24:40 +0000 (01:24 +0100)]
Fix emitting asm and object file output at the same time

LLVM doesn't really support reusing the same module to emit more than
one file. One bug this causes is that the IR is invalidated by the stack
coloring pass when emitting the first file, and then the IR verifier
complains by the time we try to emit the second file. Also, we get
different binaries with --emit=asm,link than with just --emit=link. In
some cases leading to segfaults.

Unfortunately, it seems that at this point in time, the most sensible
option to circumvent this problem is to just clone the whole llvm module
for the asm output if we need both, asm and obj file output.

Fixes #24876
Fixes #26235

8 years agoAuto merge of #30414 - alexcrichton:fix-cross-builds, r=brson
bors [Fri, 18 Dec 2015 03:05:02 +0000 (03:05 +0000)]
Auto merge of #30414 - alexcrichton:fix-cross-builds, r=brson

It looks like #27937 accidentally switched the llvmdeps file from the target to
the host by accident, so be sure to use the right llvmdeps file which is built
for the target when building rustc_llvm

8 years agoAdd more systematic tests
Vadim Petrochenkov [Fri, 18 Dec 2015 01:56:27 +0000 (04:56 +0300)]
Add more systematic tests

8 years agoProhibit public glob reexports of private variants
Vadim Petrochenkov [Sun, 13 Dec 2015 18:57:07 +0000 (21:57 +0300)]
Prohibit public glob reexports of private variants

8 years agoAddress the comments
Vadim Petrochenkov [Fri, 4 Dec 2015 18:51:18 +0000 (21:51 +0300)]
Address the comments

8 years agoSubstitute type aliases before checking for privacy
Vadim Petrochenkov [Thu, 26 Nov 2015 22:48:26 +0000 (01:48 +0300)]
Substitute type aliases before checking for privacy

8 years agoUse lint instead of warning
Vadim Petrochenkov [Thu, 26 Nov 2015 17:56:20 +0000 (20:56 +0300)]
Use lint instead of warning

8 years agoReport errors not caught by the old visitor as warnings
Vadim Petrochenkov [Thu, 26 Nov 2015 16:26:15 +0000 (19:26 +0300)]
Report errors not caught by the old visitor as warnings

8 years agoProhibit private variant reexports
Vadim Petrochenkov [Tue, 24 Nov 2015 00:36:12 +0000 (03:36 +0300)]
Prohibit private variant reexports

8 years agoApproximate type aliases as public when determining impl publicity
Vadim Petrochenkov [Mon, 23 Nov 2015 10:36:49 +0000 (13:36 +0300)]
Approximate type aliases as public when determining impl publicity

8 years agoUpdate error messages and error descriptions
Vadim Petrochenkov [Sat, 21 Nov 2015 15:36:10 +0000 (18:36 +0300)]
Update error messages and error descriptions

8 years agoFix the fallout
Vadim Petrochenkov [Sat, 21 Nov 2015 14:39:15 +0000 (17:39 +0300)]
Fix the fallout

8 years agoRewrite VisiblePrivateTypesVisitor
Vadim Petrochenkov [Sat, 21 Nov 2015 14:38:17 +0000 (17:38 +0300)]
Rewrite VisiblePrivateTypesVisitor

8 years agoAuto merge of #29907 - nagisa:mir-moar-constants, r=nikomatsakis
bors [Fri, 18 Dec 2015 00:24:05 +0000 (00:24 +0000)]
Auto merge of #29907 - nagisa:mir-moar-constants, r=nikomatsakis

Still will not translate references to items like `X` or `Y::V` where

```
struct X;
enum Y { V }
```

but I must go work on university things so I’m PRing what I have.

r? @nikomatsakis

8 years agoClarified shadowing example
Xmasreturns [Thu, 17 Dec 2015 21:05:00 +0000 (13:05 -0800)]
Clarified shadowing example

Added some additional descriptive sentences and changed x to an int in
the example

8 years agoAbstract away differences between Vec and ptr::P in HIR
Vadim Petrochenkov [Thu, 17 Dec 2015 17:41:28 +0000 (20:41 +0300)]
Abstract away differences between Vec and ptr::P in HIR

8 years agoDeprecate name `OwnedSlice` and don't use it
Vadim Petrochenkov [Wed, 16 Dec 2015 18:44:33 +0000 (21:44 +0300)]
Deprecate name `OwnedSlice` and don't use it

8 years agolibsyntax: Merge OwnedSlice into ptr::P
Vadim Petrochenkov [Wed, 16 Dec 2015 17:58:26 +0000 (20:58 +0300)]
libsyntax: Merge OwnedSlice into ptr::P

8 years agoAuto merge of #30445 - steveklabnik:rollup, r=steveklabnik
bors [Thu, 17 Dec 2015 20:08:48 +0000 (20:08 +0000)]
Auto merge of #30445 - steveklabnik:rollup, r=steveklabnik

- Successful merges: #30370, #30404, #30415, #30419, #30428, #30437, #30439, #30441, #30442, #30443
- Failed merges:

8 years agoRollup merge of #30443 - tshepang:just-a-rename, r=steveklabnik
Steve Klabnik [Thu, 17 Dec 2015 19:47:14 +0000 (14:47 -0500)]
Rollup merge of #30443 - tshepang:just-a-rename, r=steveklabnik

8 years agoRollup merge of #30442 - tshepang:typo, r=steveklabnik
Steve Klabnik [Thu, 17 Dec 2015 19:47:14 +0000 (14:47 -0500)]
Rollup merge of #30442 - tshepang:typo, r=steveklabnik

8 years agoRollup merge of #30441 - tshepang:missing-comma, r=steveklabnik
Steve Klabnik [Thu, 17 Dec 2015 19:47:14 +0000 (14:47 -0500)]
Rollup merge of #30441 - tshepang:missing-comma, r=steveklabnik

8 years agoRollup merge of #30439 - swooster:swooster-nomicon-patch-1, r=steveklabnik
Steve Klabnik [Thu, 17 Dec 2015 19:47:14 +0000 (14:47 -0500)]
Rollup merge of #30439 - swooster:swooster-nomicon-patch-1, r=steveklabnik

The Rustonomicon's Lifetimes chapter uses the idiom "big ask", which is obscure compared to "tall order" (check [Google ngrams](https://books.google.com/ngrams/graph?content=big+ask%2C+tall+order&year_start=1800)). Also, it's easily mistaken for a typo; either "a big task" or "a big thing to ask" could plausibly work there.

r? @steveklabnik

8 years agoRollup merge of #30437 - tshepang:clarity, r=steveklabnik
Steve Klabnik [Thu, 17 Dec 2015 19:47:13 +0000 (14:47 -0500)]
Rollup merge of #30437 - tshepang:clarity, r=steveklabnik

The comma removes the sorface ambiguity

8 years agoRollup merge of #30428 - steveklabnik:quickfix, r=apasel422
Steve Klabnik [Thu, 17 Dec 2015 19:47:13 +0000 (14:47 -0500)]
Rollup merge of #30428 - steveklabnik:quickfix, r=apasel422

8 years agoRollup merge of #30419 - shepmaster:rogue-I, r=alexcrichton
Steve Klabnik [Thu, 17 Dec 2015 19:47:13 +0000 (14:47 -0500)]
Rollup merge of #30419 - shepmaster:rogue-I, r=alexcrichton

r? @steveklabnik

8 years agoRollup merge of #30415 - steveklabnik:remove_bad_stability_note, r=alexcrichton
Steve Klabnik [Thu, 17 Dec 2015 19:47:13 +0000 (14:47 -0500)]
Rollup merge of #30415 - steveklabnik:remove_bad_stability_note, r=alexcrichton

8 years agoRollup merge of #30404 - Shiney:ImprovedStackHeap, r=steveklabnik
Steve Klabnik [Thu, 17 Dec 2015 19:47:13 +0000 (14:47 -0500)]
Rollup merge of #30404 - Shiney:ImprovedStackHeap, r=steveklabnik

…entation clearer

I could not use colors as suggested for #29854 because Github doesn't support these in markdown, however this solution may be better for color-blind readers.

8 years agoRollup merge of #30370 - zachreizner:patch-1, r=apasel422
Steve Klabnik [Thu, 17 Dec 2015 19:47:12 +0000 (14:47 -0500)]
Rollup merge of #30370 - zachreizner:patch-1, r=apasel422

8 years agodoc: improve drain examples and remove secondary info from leading paragraph
Tshepang Lekhonkhobe [Tue, 8 Dec 2015 22:04:54 +0000 (00:04 +0200)]
doc: improve drain examples and remove secondary info from leading paragraph

8 years agodoc: no need to duplicate docs on renamed API
Tshepang Lekhonkhobe [Thu, 17 Dec 2015 19:04:26 +0000 (21:04 +0200)]
doc: no need to duplicate docs on renamed API

8 years agoTest generic methods
Simonas Kazlauskas [Sat, 5 Dec 2015 18:35:46 +0000 (20:35 +0200)]
Test generic methods

8 years agodoc: fix typo
Tshepang Lekhonkhobe [Thu, 17 Dec 2015 18:57:14 +0000 (20:57 +0200)]
doc: fix typo

8 years agodoc: add a missing comma
Tshepang Lekhonkhobe [Thu, 17 Dec 2015 18:55:20 +0000 (20:55 +0200)]
doc: add a missing comma

8 years agoAdd a debug implementation to process::Output
Ed Clarke [Wed, 16 Dec 2015 20:28:54 +0000 (20:28 +0000)]
Add a debug implementation to process::Output

8 years agoAuto merge of #30325 - jseyfried:fixes_30078, r=nrc
bors [Thu, 17 Dec 2015 18:21:25 +0000 (18:21 +0000)]
Auto merge of #30325 - jseyfried:fixes_30078, r=nrc

This fixes a bug in which unused imports can get wrongly marked as used when checking for unused qualifications in `resolve_path` (issue #30078), and it removes unused imports that were previously undetected because of the bug.

8 years agoChange "big ask" to "tall order" in Rustonomicon.
Steve Wooster [Thu, 17 Dec 2015 17:40:02 +0000 (09:40 -0800)]
Change "big ask" to "tall order" in Rustonomicon.

The Rustonomicon's Lifetimes chapter uses the idiom "big ask", which is obscure compared to "tall order" (check Google ngrams). Also, it's easily mistaken for a typo; either "a big task" or "a big thing to ask" could plausibly work there.

8 years agodoc: improve clarity by introducing a pause
Tshepang Lekhonkhobe [Thu, 17 Dec 2015 17:27:52 +0000 (19:27 +0200)]
doc: improve clarity by introducing a pause

8 years agorustc_resolve: fix a bug in which unused imports can get wrongly marked as used when...
Jeffrey Seyfried [Sat, 12 Dec 2015 03:30:53 +0000 (03:30 +0000)]
rustc_resolve: fix a bug in which unused imports can get wrongly marked as used when checking for unused qualifications in resolve_path (fixes #30078)

8 years agoRemove unused imports
Jeffrey Seyfried [Sat, 12 Dec 2015 03:29:35 +0000 (03:29 +0000)]
Remove unused imports

8 years agoTrivial cleanup
Michael McConville [Thu, 17 Dec 2015 05:36:31 +0000 (00:36 -0500)]
Trivial cleanup

Remove a needless variable and simply a cfg().

8 years agosmall fix to str doc example
Steve Klabnik [Thu, 17 Dec 2015 03:12:47 +0000 (22:12 -0500)]
small fix to str doc example

8 years agoAuto merge of #30354 - petrochenkov:defuse, r=sanxiyn
bors [Thu, 17 Dec 2015 01:22:53 +0000 (01:22 +0000)]
Auto merge of #30354 - petrochenkov:defuse, r=sanxiyn

A relic of some old resolution algorithm?

8 years agoAuto merge of #30341 - pnkfelix:call-site-scope, r=nikomatsakis
bors [Wed, 16 Dec 2015 22:53:19 +0000 (22:53 +0000)]
Auto merge of #30341 - pnkfelix:call-site-scope, r=nikomatsakis

Ensure borrows of fn/closure params do not outlive invocations.

Does this by adding a new CallSiteScope to the region (or rather code extent) hierarchy, which outlives even the ParameterScope (which in turn outlives the DestructionScope of a fn/closure's body).

Fix #29793

r? @nikomatsakis

8 years agotest errors
Nick Cameron [Tue, 15 Dec 2015 03:51:13 +0000 (16:51 +1300)]
test errors

8 years agoUsed bold and italic in the markdown to make the stack and heap documentation clearer
Shiney [Tue, 15 Dec 2015 22:13:04 +0000 (22:13 +0000)]
Used bold and italic in the markdown to make the stack and heap documentation clearer

8 years agoA little more refactoring inside emitter.rs
Nick Cameron [Tue, 15 Dec 2015 03:42:05 +0000 (16:42 +1300)]
A little more refactoring inside emitter.rs

8 years agoAdd the files I fogot about earlier
Nick Cameron [Tue, 15 Dec 2015 01:11:27 +0000 (14:11 +1300)]
Add the files I fogot about earlier

d'oh

8 years agoMove a bunch of stuff from Session to syntax::errors
Nick Cameron [Mon, 14 Dec 2015 05:15:39 +0000 (18:15 +1300)]
Move a bunch of stuff from Session to syntax::errors

The intention here is that Session is a very thin wrapper over the error handling infra.

8 years agomove error handling from libsyntax/diagnostics.rs to libsyntax/errors/*
Nick Cameron [Sun, 13 Dec 2015 22:17:55 +0000 (11:17 +1300)]
move error handling from libsyntax/diagnostics.rs to libsyntax/errors/*

Also split out emitters into their own module.

8 years agoAuto merge of #29962 - aturon:coherence-errors, r=nmatsakis
bors [Wed, 16 Dec 2015 20:22:07 +0000 (20:22 +0000)]
Auto merge of #29962 - aturon:coherence-errors, r=nmatsakis

Currently, a coherence error based on overlapping impls simply mentions
the trait, and points to the two conflicting impls:

```
error: conflicting implementations for trait `Foo`
```

With this commit, the error will include all input types to the
trait (including the `Self` type) after unification between the
overlapping impls. In other words, the error message will provide
feedback with full type details, like:

```
error: conflicting implementations of trait `Foo<u32>` for type `u8`:
```

When the `Self` type for the two impls unify to an inference variable,
it is elided in the output, since "for type `_`" is just noise in that
case.

Closes #23980

r? @nikomatsakis

8 years agoRemove rogue I
Jake Goulding [Wed, 16 Dec 2015 18:25:33 +0000 (13:25 -0500)]
Remove rogue I

8 years agoProvide overlapping types for coherence errors
Aaron Turon [Tue, 1 Dec 2015 19:26:47 +0000 (11:26 -0800)]
Provide overlapping types for coherence errors

Currently, a coherence error based on overlapping impls simply mentions
the trait, and points to the two conflicting impls:

```
error: conflicting implementations for trait `Foo`
```

With this commit, the error will include all input types to the
trait (including the `Self` type) after unification between the
overlapping impls. In other words, the error message will provide
feedback with full type details, like:

```
error: conflicting implementations of trait `Foo<u32>` for type `u8`:
```

When the `Self` type for the two impls unify to an inference variable,
it is elided in the output, since "for type `_`" is just noise in that
case.

Closes #23980

8 years agoRemove incorrect words about libcore's stability
Steve Klabnik [Wed, 16 Dec 2015 16:42:18 +0000 (11:42 -0500)]
Remove incorrect words about libcore's stability

8 years agoAuto merge of #30337 - wesleywiser:mir_switch, r=nikomatsakis
bors [Wed, 16 Dec 2015 16:10:26 +0000 (16:10 +0000)]
Auto merge of #30337 - wesleywiser:mir_switch, r=nikomatsakis

Fixes #29574

8 years agomk: Use the right llvmdeps.rs file for cross build
Alex Crichton [Wed, 16 Dec 2015 16:06:27 +0000 (08:06 -0800)]
mk: Use the right llvmdeps.rs file for cross build

It looks like #27937 accidentally switched the llvmdeps file from the target to
the host by accident, so be sure to use the right llvmdeps file which is built
for the target when building rustc_llvm

8 years agorustc: Remove def::DefUse
Vadim Petrochenkov [Sat, 12 Dec 2015 22:50:07 +0000 (01:50 +0300)]
rustc: Remove def::DefUse

8 years agoAdd ExprType to HIR and make everything compile
Vadim Petrochenkov [Thu, 3 Dec 2015 02:37:48 +0000 (05:37 +0300)]
Add ExprType to HIR and make everything compile
+ Apply parser changes manually
+ Add feature gate

8 years agoAuto merge of #30269 - sanxiyn:no-mangle-generic, r=Aatch
bors [Wed, 16 Dec 2015 14:12:43 +0000 (14:12 +0000)]
Auto merge of #30269 - sanxiyn:no-mangle-generic, r=Aatch

Fix #15844.

Should the default be Deny instead?

8 years agoImplement type ascription.
Eduard Burtescu [Sun, 1 Feb 2015 07:59:46 +0000 (09:59 +0200)]
Implement type ascription.

8 years agoAuto merge of #30410 - Manishearth:rollup, r=Manishearth
bors [Wed, 16 Dec 2015 12:16:43 +0000 (12:16 +0000)]
Auto merge of #30410 - Manishearth:rollup, r=Manishearth

- Successful merges: #30320, #30368, #30372, #30376, #30388, #30392
- Failed merges: #30354, #30389

8 years agoRollup merge of #30392 - Ms2ger:RestrictionResult, r=alexcrichton
Manish Goregaokar [Wed, 16 Dec 2015 12:16:30 +0000 (17:46 +0530)]
Rollup merge of #30392 - Ms2ger:RestrictionResult, r=alexcrichton

8 years agoRollup merge of #30388 - DanielJCampbell:macro-ident-spans, r=nrc
Manish Goregaokar [Wed, 16 Dec 2015 12:16:29 +0000 (17:46 +0530)]
Rollup merge of #30388 - DanielJCampbell:macro-ident-spans, r=nrc

r? @nrc

8 years agoRollup merge of #30376 - salty-horse:btree_links, r=alexcrichton
Manish Goregaokar [Wed, 16 Dec 2015 12:16:29 +0000 (17:46 +0530)]
Rollup merge of #30376 - salty-horse:btree_links, r=alexcrichton

The BtreeSet main description mentions `BTreeMap`, `Ord`, `Cell`, `RefCell`.

This patch adds links to their documentation.

8 years agoRollup merge of #30372 - sanxiyn:rustdoc-cfg, r=alexcrichton
Manish Goregaokar [Wed, 16 Dec 2015 12:16:29 +0000 (17:46 +0530)]
Rollup merge of #30372 - sanxiyn:rustdoc-cfg, r=alexcrichton

Fix #30252.

8 years agoRollup merge of #30368 - arielb1:region-unification-2, r=nikomatsakis
Manish Goregaokar [Wed, 16 Dec 2015 12:16:29 +0000 (17:46 +0530)]
Rollup merge of #30368 - arielb1:region-unification-2, r=nikomatsakis

Turns out that calling `resolve_type_variables_if_possible` in a O(n^2)
loop is a bad idea. Now we just resolve each copy of the region variable
to its lowest name each time (we resolve the region variable to its lowest
name, rather than to its unify-table name to avoid the risk of
the unify-table name changing infinitely many times. That may be
not a problem in practice, but I am not sure of it).

8 years agoRollup merge of #30320 - nrc:err-names, r=@nikomatsakis
Manish Goregaokar [Wed, 16 Dec 2015 12:16:29 +0000 (17:46 +0530)]
Rollup merge of #30320 - nrc:err-names, r=@nikomatsakis

We can now handle name resolution errors and get past type checking (if we're a bit lucky). This is the first step towards doing code completion for partial programs (we need error recovery in the parser and early access to save-analysis).

8 years agoAuto merge of #30300 - sanxiyn:syntax-ext, r=nikomatsakis
bors [Wed, 16 Dec 2015 10:09:36 +0000 (10:09 +0000)]
Auto merge of #30300 - sanxiyn:syntax-ext, r=nikomatsakis

This reduces iteration time (`make rustc-stage1`) for moved syntax extensions from 11 minutes to 3 minutes on my machine.

Because of the signature change, this is a [breaking-change] for people directly calling `expand_crate`. I think it is rare: from GitHub search, only case I found is [glassful](https://github.com/kmcallister/glassful).

8 years agoAuto merge of #30206 - petrochenkov:newdepr, r=brson
bors [Wed, 16 Dec 2015 08:15:23 +0000 (08:15 +0000)]
Auto merge of #30206 - petrochenkov:newdepr, r=brson

Closes https://github.com/rust-lang/rust/issues/29935

The attributes `deprecated` and `rustc_deprecated` are completely independent in this implementation and it leads to some noticeable code duplication. Representing `deprecated` as
```
Stability {
    level: Stable { since: "" },
    feature: "",
    depr: Some(Deprecation),
}
```
or, contrariwise, splitting rustc_deprecation from stability makes most of the duplication go away.
I can do this refactoring, but before doing it I must be sure, that further divergence of `deprecated` and `rustc_deprecated` is certainly not a goal.

cc @llogiq

8 years agoAuto merge of #30141 - oli-obk:fix/30117, r=arielb1
bors [Wed, 16 Dec 2015 05:40:41 +0000 (05:40 +0000)]
Auto merge of #30141 - oli-obk:fix/30117, r=arielb1

r? @arielb1

8 years agochange macro ambiguity example from ty to ident
Alex Burka [Wed, 16 Dec 2015 01:48:25 +0000 (20:48 -0500)]
change macro ambiguity example from ty to ident

The previous example had no chance of compiling in either form, due to the restrictive follow set for `ty`. This one has the desired behavior: http://is.gd/kYdw4g (well, I don't exactly desire this behavior at all, but it's true at least :p )

8 years agoFix typo
Jake Worth [Tue, 15 Dec 2015 18:51:08 +0000 (12:51 -0600)]
Fix typo