Commit Graph

48792 Commits

Author SHA1 Message Date
Vadim Petrochenkov
f3f27a5c64 Rewrite VisiblePrivateTypesVisitor 2015-12-18 04:12:31 +03:00
bors
48700be9cb Auto merge of #30445 - steveklabnik:rollup, r=steveklabnik
- Successful merges: #30370, #30404, #30415, #30419, #30428, #30437, #30439, #30441, #30442, #30443
- Failed merges:
2015-12-17 20:08:48 +00:00
Steve Klabnik
7ad8fb9f3c Rollup merge of #30443 - tshepang:just-a-rename, r=steveklabnik 2015-12-17 14:47:14 -05:00
Steve Klabnik
b3bf43cdb5 Rollup merge of #30442 - tshepang:typo, r=steveklabnik 2015-12-17 14:47:14 -05:00
Steve Klabnik
e42f97dae3 Rollup merge of #30441 - tshepang:missing-comma, r=steveklabnik 2015-12-17 14:47:14 -05:00
Steve Klabnik
8cd237427c 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
2015-12-17 14:47:14 -05:00
Steve Klabnik
6565bc2fd4 Rollup merge of #30437 - tshepang:clarity, r=steveklabnik
The comma removes the sorface ambiguity
2015-12-17 14:47:13 -05:00
Steve Klabnik
b84de0c083 Rollup merge of #30428 - steveklabnik:quickfix, r=apasel422 2015-12-17 14:47:13 -05:00
Steve Klabnik
6c065b65c9 Rollup merge of #30419 - shepmaster:rogue-I, r=alexcrichton
r? @steveklabnik
2015-12-17 14:47:13 -05:00
Steve Klabnik
7fa08d5d7a Rollup merge of #30415 - steveklabnik:remove_bad_stability_note, r=alexcrichton 2015-12-17 14:47:13 -05:00
Steve Klabnik
7963529b6b 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.
2015-12-17 14:47:13 -05:00
Steve Klabnik
dbec8c4624 Rollup merge of #30370 - zachreizner:patch-1, r=apasel422 2015-12-17 14:47:12 -05:00
Tshepang Lekhonkhobe
e9c912a965 doc: no need to duplicate docs on renamed API 2015-12-17 21:10:57 +02:00
Tshepang Lekhonkhobe
bd4aa64f31 doc: fix typo 2015-12-17 20:57:14 +02:00
Tshepang Lekhonkhobe
6fdde01368 doc: add a missing comma 2015-12-17 20:55:20 +02:00
bors
6734dccc31 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.
2015-12-17 18:21:25 +00:00
Steve Wooster
fc862182c9 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.
2015-12-17 09:40:02 -08:00
Tshepang Lekhonkhobe
22b30fad96 doc: improve clarity by introducing a pause 2015-12-17 19:35:10 +02:00
Jeffrey Seyfried
ba20a862d4 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) 2015-12-17 05:43:44 +00:00
Jeffrey Seyfried
8364a6feef Remove unused imports 2015-12-17 05:43:27 +00:00
Steve Klabnik
4e2ec9a178 small fix to str doc example 2015-12-16 22:12:47 -05:00
bors
9687a8a969 Auto merge of #30354 - petrochenkov:defuse, r=sanxiyn
A relic of some old resolution algorithm?
2015-12-17 01:22:53 +00:00
bors
4af4278814 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
2015-12-16 22:53:19 +00:00
Shiney
62fa40f87a Used bold and italic in the markdown to make the stack and heap documentation clearer 2015-12-16 20:54:02 +00:00
bors
38da1a4064 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
2015-12-16 20:22:07 +00:00
Jake Goulding
936149fc25 Remove rogue I 2015-12-16 13:25:46 -05:00
Aaron Turon
bc33dd7ac4 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
2015-12-16 09:47:23 -08:00
Steve Klabnik
bf14d8f0e8 Remove incorrect words about libcore's stability 2015-12-16 11:42:18 -05:00
bors
073b0f9b85 Auto merge of #30337 - wesleywiser:mir_switch, r=nikomatsakis
Fixes #29574
2015-12-16 16:10:26 +00:00
Vadim Petrochenkov
0cc69f0ea3 rustc: Remove def::DefUse 2015-12-16 18:19:11 +03:00
bors
d4ffaf6f83 Auto merge of #30269 - sanxiyn:no-mangle-generic, r=Aatch
Fix #15844.

Should the default be Deny instead?
2015-12-16 14:12:43 +00:00
bors
785a8a6681 Auto merge of #30410 - Manishearth:rollup, r=Manishearth
- Successful merges: #30320, #30368, #30372, #30376, #30388, #30392
- Failed merges: #30354, #30389
2015-12-16 12:16:43 +00:00
Manish Goregaokar
f0361a0502 Rollup merge of #30392 - Ms2ger:RestrictionResult, r=alexcrichton 2015-12-16 17:46:30 +05:30
Manish Goregaokar
b0b9a556df Rollup merge of #30388 - DanielJCampbell:macro-ident-spans, r=nrc
r? @nrc
2015-12-16 17:46:29 +05:30
Manish Goregaokar
7aabc66a85 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.
2015-12-16 17:46:29 +05:30
Manish Goregaokar
d91c344637 Rollup merge of #30372 - sanxiyn:rustdoc-cfg, r=alexcrichton
Fix #30252.
2015-12-16 17:46:29 +05:30
Manish Goregaokar
b20f427391 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).
2015-12-16 17:46:29 +05:30
Manish Goregaokar
ee24bddfc5 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).
2015-12-16 17:46:29 +05:30
bors
ce7bc51933 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).
2015-12-16 10:09:36 +00:00
bors
ac2c5ff024 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
2015-12-16 08:15:23 +00:00
bors
9ace0a46de Auto merge of #30141 - oli-obk:fix/30117, r=arielb1
r? @arielb1
2015-12-16 05:40:41 +00:00
Ms2ger
9a0ab50ac0 Stop re-exporting RestrictionResult variants. 2015-12-15 16:15:59 +01:00
Felix S. Klock II
5299441954 Regression tests for Issue 29793. 2015-12-15 15:18:45 +01:00
Felix S. Klock II
c00574848b Ensure borrows of fn/closure params do not outlive invocations.
resolve_lifetime.rs: Switch from BlockScope to FnScope in ScopeChain
construction. Lifetimes introduced by a fn signature are scoped to the
call-site for that fn. (Note `add_scope_and_walk_fn` must only add
FnScope for the walk of body, *not* of the fn signature.)

region.rs: Introduce new CodeExtentData::CallSiteScope variant. Use
CodeExtentData as the cx.parent, rather than just a NodeId.  Change
DestructionScopeData to CallSiteScopeData.

regionck.rs: Thread call_site_scope via Rcx; constrain fn return
values.

(update; incorporated review feedback from niko.)
2015-12-15 15:18:40 +01:00
Seo Sanghyeon
eb25721063 Use --cfg when running doctests
Previously passed --cfg was used only when collecting doctests.
2015-12-15 18:03:55 +09:00
Seo Sanghyeon
0883f10550 Mark libsyntax_ext unstable 2015-12-15 16:23:18 +09:00
Seo Sanghyeon
9410bfa0cd Fix custom deriving tests 2015-12-15 15:04:47 +09:00
Seo Sanghyeon
bb21b6738a Fix expansion tests 2015-12-15 15:04:47 +09:00
Seo Sanghyeon
f9ba107824 Move built-in syntax extensions to a separate crate 2015-12-15 15:04:46 +09:00
Daniel Campbell
2dcd791d46 Generated code spans now point to callsite parameters (where applicable) 2015-12-15 17:41:03 +13:00