]> git.lizzy.rs Git - rust.git/log
rust.git
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 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 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 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 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 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 agoStop re-exporting RestrictionResult variants.
Ms2ger [Tue, 15 Dec 2015 15:15:59 +0000 (16:15 +0100)]
Stop re-exporting RestrictionResult variants.

8 years agoRegression tests for Issue 29793.
Felix S. Klock II [Thu, 10 Dec 2015 18:30:37 +0000 (19:30 +0100)]
Regression tests for Issue 29793.

8 years agoEnsure borrows of fn/closure params do not outlive invocations.
Felix S. Klock II [Tue, 8 Dec 2015 22:38:36 +0000 (23:38 +0100)]
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.)

8 years agoUse --cfg when running doctests
Seo Sanghyeon [Tue, 15 Dec 2015 09:03:55 +0000 (18:03 +0900)]
Use --cfg when running doctests

Previously passed --cfg was used only when collecting doctests.

8 years agoMark libsyntax_ext unstable
Seo Sanghyeon [Tue, 15 Dec 2015 07:23:18 +0000 (16:23 +0900)]
Mark libsyntax_ext unstable

8 years agoFix custom deriving tests
Seo Sanghyeon [Fri, 11 Dec 2015 07:40:25 +0000 (16:40 +0900)]
Fix custom deriving tests

8 years agoFix expansion tests
Seo Sanghyeon [Thu, 10 Dec 2015 18:42:47 +0000 (03:42 +0900)]
Fix expansion tests

8 years agoMove built-in syntax extensions to a separate crate
Seo Sanghyeon [Thu, 10 Dec 2015 14:23:14 +0000 (23:23 +0900)]
Move built-in syntax extensions to a separate crate

8 years agoGenerated code spans now point to callsite parameters (where applicable)
Daniel Campbell [Tue, 15 Dec 2015 04:31:54 +0000 (17:31 +1300)]
Generated code spans now point to callsite parameters (where applicable)

8 years agoAuto merge of #30233 - retep998:where-in-the-world-is-windows-sdk, r=alexcrichton
bors [Tue, 15 Dec 2015 04:21:53 +0000 (04:21 +0000)]
Auto merge of #30233 - retep998:where-in-the-world-is-windows-sdk, r=alexcrichton

What I've done here is try to make the code match what vcvars does much more closely. It now chooses which SDK to find based on the version of MSVC that it found. It also bases the decision of whether to find all the things on whether `VCINSTALLDIR` has been set, which is more likely to have only been set by an invocation of vcvars, unlike previously where it would do some things only if `LIB` wasn't set even though there was a valid use case for libraries to add themselves to `LIB` without having invoked vcvars.

There are still some debug `println!`s so people can test the PR and make sure it works correctly on various setups.

It supports VS 2015, 2013, and 2012. People who want to use versions of VS older (or newer) than that will have to manually invoke the appropriate vcvars bat file to set the proper environment variables themselves.

Do not merge yet.

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

8 years agoAuto merge of #30105 - faineance:master, r=nrc
bors [Tue, 15 Dec 2015 01:18:01 +0000 (01:18 +0000)]
Auto merge of #30105 - faineance:master, r=nrc

Issue: #30058
Updated for:
 - Stmt
 - BinOp_
 - UnOp
 - UintTy, IntTy and FloatTy
 - Lit
 - Generics

A possible inconsistancy?
The `Stmt` methods are on the spanned varient:
```rust
pub type Stmt = Spanned<Stmt_>;

impl Stmt {
    pub fn id(s: &Stmt) -> Option<NodeId> {
        match s.node {
          StmtDecl(_, id) => Some(id),
          StmtExpr(_, id) => Some(id),
          StmtSemi(_, id) => Some(id),
          StmtMac(..) => None,
      }
  }
}
```
Whilst the methods for BinOp are on the non spanned version.
````rust
impl BinOp_ {
    pub fn to_string(op: BinOp_) -> &'static str { ... }
    pub fn lazy(b: BinOp_) -> bool { ... }

    pub fn is_shift(b: BinOp_) -> bool { ... }
    pub fn is_comparison(b: BinOp_) -> bool { ... }
    /// Returns `true` if the binary operator takes its arguments by value
    pub fn is_by_value(b: BinOp_) -> bool { ... }

}
pub type BinOp = Spanned<BinOp_>;
````
r? @Manishearth

8 years agoImplement trans for the MIR Switch terminator
Wesley Wiser [Fri, 11 Dec 2015 18:19:19 +0000 (13:19 -0500)]
Implement trans for the MIR Switch terminator

Fixes #29574

8 years agoOverhaul MSVC linker and Windows SDK detection code
Peter Atashian [Sun, 6 Dec 2015 08:27:21 +0000 (03:27 -0500)]
Overhaul MSVC linker and Windows SDK detection code
Fixes https://github.com/rust-lang/rust/issues/30229

Signed-off-by: Peter Atashian <retep998@gmail.com>
8 years agoAdd links in BTreeSet docs
Ori Avtalion [Sun, 13 Dec 2015 22:12:17 +0000 (00:12 +0200)]
Add links in BTreeSet docs

8 years ago[breaking-change] move ast_util functions to methods
faineance [Sat, 28 Nov 2015 19:02:07 +0000 (19:02 +0000)]
[breaking-change] move ast_util functions to methods

8 years agoAuto merge of #30328 - sanxiyn:include-type-name, r=alexcrichton
bors [Mon, 14 Dec 2015 21:08:13 +0000 (21:08 +0000)]
Auto merge of #30328 - sanxiyn:include-type-name, r=alexcrichton

Fix #30260.

8 years agoAuto merge of #27937 - DiamondLovesYou:llvm-root-and-shared, r=alexcrichton
bors [Mon, 14 Dec 2015 19:14:37 +0000 (19:14 +0000)]
Auto merge of #27937 - DiamondLovesYou:llvm-root-and-shared, r=alexcrichton

This handles cases when the LLVM used isn't configured will the 'usual' targets. Also, cases where LLVM is shared are also handled (ie with `LD_LIBRARY_PATH` etc).

8 years agoAuto merge of #30321 - sanxiyn:E0170, r=alexcrichton
bors [Mon, 14 Dec 2015 16:45:02 +0000 (16:45 +0000)]
Auto merge of #30321 - sanxiyn:E0170, r=alexcrichton

Fix #30302.

8 years agoAuto merge of #29735 - Amanieu:asm_indirect_constraint, r=pnkfelix
bors [Mon, 14 Dec 2015 13:48:41 +0000 (13:48 +0000)]
Auto merge of #29735 - Amanieu:asm_indirect_constraint, r=pnkfelix

This PR reverts #29543 and instead implements proper support for "=*m" and "+*m" indirect output operands. This provides a framework on top of which support for plain memory operands ("m", "=m" and "+m") can be implemented.

This also fixes the liveness analysis pass not handling read/write operands correctly.

8 years agoAuto merge of #30369 - jethrogb:patch-2, r=steveklabnik
bors [Mon, 14 Dec 2015 01:33:58 +0000 (01:33 +0000)]
Auto merge of #30369 - jethrogb:patch-2, r=steveklabnik

The old code returned `usize::MAX` as an error condition, which is not the Rust way.

8 years agoAuto merge of #30351 - tamird:remove-range-inclusive, r=alexcrichton
bors [Sun, 13 Dec 2015 23:40:12 +0000 (23:40 +0000)]
Auto merge of #30351 - tamird:remove-range-inclusive, r=alexcrichton

r? @alexcrichton

8 years agoBetter support for `--llvm-root`.
Richard Diamond [Sat, 22 Aug 2015 04:43:56 +0000 (23:43 -0500)]
Better support for `--llvm-root`.

This handles cases when the LLVM used isn't configured will the 'usual'
targets. Also, cases where LLVM is shared are also handled (ie with
`LD_LIBRARY_PATH` etc).

8 years agoMake BinaryHeap Dijkstra example return Option
jethrogb [Sun, 13 Dec 2015 19:40:27 +0000 (11:40 -0800)]
Make BinaryHeap Dijkstra example return Option

8 years agoAuto merge of #30348 - shepmaster:box-any-docs, r=steveklabnik
bors [Sun, 13 Dec 2015 18:59:08 +0000 (18:59 +0000)]
Auto merge of #30348 - shepmaster:box-any-docs, r=steveklabnik

8 years agoAuto merge of #30343 - Seeker14491:patch-1, r=bluss
bors [Sun, 13 Dec 2015 17:11:36 +0000 (17:11 +0000)]
Auto merge of #30343 - Seeker14491:patch-1, r=bluss

The `MIN` link was broken. Reverts #29624.

8 years agoAuto merge of #30342 - salty-horse:doc_links, r=steveklabnik
bors [Sun, 13 Dec 2015 15:22:03 +0000 (15:22 +0000)]
Auto merge of #30342 - salty-horse:doc_links, r=steveklabnik

Many of the structs in `str` that are used as part of its methods do not have links to the methods.
This is especially annoying when a Google search drops you into the documentation of the struct, when you really wanted to get to the method of the same name.

This patch adds those links.

8 years agoAuto merge of #30339 - Manishearth:oops-i-did-it-again, r=eddyb
bors [Sun, 13 Dec 2015 13:34:46 +0000 (13:34 +0000)]
Auto merge of #30339 - Manishearth:oops-i-did-it-again, r=eddyb

r? @eddyb

8 years agoAuto merge of #30332 - bluss:nomicon-variance, r=gankro
bors [Sun, 13 Dec 2015 11:44:39 +0000 (11:44 +0000)]
Auto merge of #30332 - bluss:nomicon-variance, r=gankro

Update nomicon for variance typo & contravariance

Fixes #28704
Fixes #28100

8 years agoAuto merge of #30329 - salty-horse:punctuation, r=steveklabnik
bors [Sun, 13 Dec 2015 09:57:35 +0000 (09:57 +0000)]
Auto merge of #30329 - salty-horse:punctuation, r=steveklabnik

Missing period at the end of a sentence.

8 years agoAuto merge of #30314 - fhahn:issue-30299-missing-fields, r=pnkfelix
bors [Sun, 13 Dec 2015 07:56:03 +0000 (07:56 +0000)]
Auto merge of #30314 - fhahn:issue-30299-missing-fields, r=pnkfelix

This PR for #30299 adds the name of the type where the field is missing.

The span that's used for the error seems correct. What may be confusing is when the initializer with the missing field contains other intializers. These are then included in the span. For example, consider the following listing.

    struct A {
        a1: i32,
        a2: B,
    }

    struct B {
        b1: i32,
        b2: i32
    }

    fn main() {
        let x = A {
            a2: B {
                b1: 1,
                b2: 1
            },
        };
    }

It will display the following code snippet along with the message that field `a2` is missing:

        let x = A {
            a2: B {
                b1: 1,
                b2: 1
            },
        };

By adding the name of the type it's clearer where the field is missing.

8 years agoRemove duplicate test case
Tamir Duberstein [Sun, 8 Nov 2015 18:39:27 +0000 (13:39 -0500)]
Remove duplicate test case

`match-arm-statics` covers this, but needs to be compiled with
debuginfo. However, that still produces an ICE. See #29696.

8 years agoremove deprecated APIs missed in #30182
Tamir Duberstein [Sat, 12 Dec 2015 12:55:28 +0000 (07:55 -0500)]
remove deprecated APIs missed in #30182

8 years agorestore tests accidentally removed in #30182
Tamir Duberstein [Sat, 12 Dec 2015 13:13:43 +0000 (08:13 -0500)]
restore tests accidentally removed in #30182

8 years agoAuto merge of #30324 - jseyfried:unfix_30159, r=nrc
bors [Sun, 13 Dec 2015 05:18:19 +0000 (05:18 +0000)]
Auto merge of #30324 - jseyfried:unfix_30159, r=nrc

r? @nrc
Since PR #30294 unintentionally fixed issue #30159, it can cause breakage for a different reason than I originally stated in the PR (see #30159, I characterized the issue precisely there).

This commit limits the scope of the breakage to what I originally stated in the PR by "unfixing" the backwards incompatible part of #30159.

I think fixing #30159 has enough potential for breakage to warrant a crater run. If you disagree, I can cancel this PR, leaving it fixed.

8 years agoAuto merge of #30310 - mbrubeck:doc-vec-bounds, r=steveklabnik
bors [Sun, 13 Dec 2015 01:53:06 +0000 (01:53 +0000)]
Auto merge of #30310 - mbrubeck:doc-vec-bounds, r=steveklabnik

r? @steveklabnik

Currently neither the API docs nor the book clearly explain that out-of-bounds array indexing causes a panic.  Since this is fairly important and seems to surprise a number of new Rust programmers, I think it's worth adding to both places.  (But if you think it would be better to put this info in the API docs only, that's fine too.)

Some specific things I'd like feedback on:

* The new text here talks about panicking, which hasn't been formally introduced at this point in chapter 5 (though it has been mentioned in previous sections too).
* Similarly the `Vec::get` example uses `Option<T>` which hasn't been fully introduced yet.  Should we leave out this example?

8 years agoAuto merge of #30309 - alexcrichton:more-tier-two, r=steveklabnik
bors [Sat, 12 Dec 2015 23:50:03 +0000 (23:50 +0000)]
Auto merge of #30309 - alexcrichton:more-tier-two, r=steveklabnik

We've got lots of new automation set up in the past few months, so these
platforms are now all tier 2 as we're building artifacts and gating on them.

8 years agoAuto merge of #30334 - dhuseby:FreeBSD_30333, r=alexcrichton
bors [Sat, 12 Dec 2015 20:55:44 +0000 (20:55 +0000)]
Auto merge of #30334 - dhuseby:FreeBSD_30333, r=alexcrichton

Removed the offending flag from the makefile.

8 years agoSupport `#[deprecated]` in rustdoc
Vadim Petrochenkov [Sat, 12 Dec 2015 20:01:27 +0000 (23:01 +0300)]
Support `#[deprecated]` in rustdoc

8 years agoAddress the review comments
Vadim Petrochenkov [Sat, 12 Dec 2015 18:40:45 +0000 (21:40 +0300)]
Address the review comments

8 years agoAuto merge of #30347 - rkruppe:misc-dec2flt-cleanup, r=alexcrichton
bors [Sat, 12 Dec 2015 18:02:43 +0000 (18:02 +0000)]
Auto merge of #30347 - rkruppe:misc-dec2flt-cleanup, r=alexcrichton

The landing of #30182, specifically the removal of float `from_str_radix`, allowed the refactoring in the middle commit. While I was at it, I also crossed two other nits off my TODO list.

8 years agofix dropck performance regression
Ariel Ben-Yehuda [Sat, 12 Dec 2015 17:02:33 +0000 (19:02 +0200)]
fix dropck performance regression

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 agoImplement `#[deprecated]` attribute (RFC 1270)
Vadim Petrochenkov [Fri, 4 Dec 2015 16:34:28 +0000 (19:34 +0300)]
Implement `#[deprecated]` attribute (RFC 1270)

8 years agoAuto merge of #30110 - oli-obk:pretty_const_trans, r=pnkfelix
bors [Sat, 12 Dec 2015 14:35:43 +0000 (14:35 +0000)]
Auto merge of #30110 - oli-obk:pretty_const_trans, r=pnkfelix

turned some `match`es into `if let`s.

8 years agoAuto merge of #30312 - seanmonstar:ioerror-description, r=alexcrichton
bors [Sat, 12 Dec 2015 12:47:03 +0000 (12:47 +0000)]
Auto merge of #30312 - seanmonstar:ioerror-description, r=alexcrichton

cc @pnkfelix @alexcrichton

8 years agoAuto merge of #30279 - Aatch:dst-ref-binding, r=pnkfelix
bors [Sat, 12 Dec 2015 11:01:12 +0000 (11:01 +0000)]
Auto merge of #30279 - Aatch:dst-ref-binding, r=pnkfelix

We shouldn't load DSTs when recursing into the sub-pattern of `& ref ident`.

Fixes #30277

8 years agoAuto merge of #27929 - w00ns:issue-27889-same-field-names, r=pnkfelix
bors [Sat, 12 Dec 2015 09:03:39 +0000 (09:03 +0000)]
Auto merge of #27929 - w00ns:issue-27889-same-field-names, r=pnkfelix

Fix for issue #27889: same field names in enum variants

8 years agoAuto merge of #30242 - arielb1:region-unification, r=nikomatsakis
bors [Sat, 12 Dec 2015 06:18:44 +0000 (06:18 +0000)]
Auto merge of #30242 - arielb1:region-unification, r=nikomatsakis

Fixes #29844

I would prefer to
(a) make some performance measurements
(b) use the unification table in a few more places
before committing further, but this is probably good enough for beta.

r? @nikomatsakis

8 years agonomicon: Mention contravariance
Ulrik Sverdrup [Fri, 11 Dec 2015 17:23:31 +0000 (18:23 +0100)]
nomicon: Mention contravariance

8 years agoCorrect reference to `Box<Any>` in `Any` docs
Jake Goulding [Fri, 11 Dec 2015 23:44:11 +0000 (18:44 -0500)]
Correct reference to `Box<Any>` in `Any` docs

8 years agodec2flt: Remove unused macro argument
Robin Kruppe [Fri, 11 Dec 2015 23:10:15 +0000 (00:10 +0100)]
dec2flt: Remove unused macro argument

The argument was a remnant of an earlier, needlessly complicated implementation.

8 years agodec2flt: Simplify imports and module surface
Robin Kruppe [Fri, 11 Dec 2015 23:07:42 +0000 (00:07 +0100)]
dec2flt: Simplify imports and module surface

The import has been unnecessarily complicated since ParseFloatError::Invalid is not longer used unqualified.
The pfe_* functions do not need to be public any more since the only other use site, from_str_radix for floats, has been removed.

8 years agoRemove an accent in a comment
Robin Kruppe [Fri, 11 Dec 2015 23:06:05 +0000 (00:06 +0100)]
Remove an accent in a comment

8 years agoPartially undo the fix of issue #30159 in PR #30294 to avoid breakage.
Jeffrey Seyfried [Fri, 11 Dec 2015 21:21:13 +0000 (21:21 +0000)]
Partially undo the fix of issue #30159 in PR #30294 to avoid breakage.

8 years agoFix MIN, MAX links
Brian Bowman [Fri, 11 Dec 2015 21:00:54 +0000 (15:00 -0600)]
Fix MIN, MAX links

The `MIN` link was broken. Reverts #29624.

8 years agoAdd missing links to str docs
Ori Avtalion [Fri, 11 Dec 2015 13:25:50 +0000 (15:25 +0200)]
Add missing links to str docs

8 years agoRemove leftover debugging code (fixes #30336)
Manish Goregaokar [Fri, 11 Dec 2015 20:12:50 +0000 (15:12 -0500)]
Remove leftover debugging code (fixes #30336)

8 years agoFixes #30333 by removing the -arch i386 form the right spot
Dave Huseby [Fri, 11 Dec 2015 18:51:30 +0000 (10:51 -0800)]
Fixes #30333 by removing the -arch i386 form the right spot

8 years agonomicon: Fix variance in example
Ulrik Sverdrup [Fri, 11 Dec 2015 17:15:57 +0000 (18:15 +0100)]
nomicon: Fix variance in example

&'b mut B was described incorrectly (just in this example, is correct in
the actual text).

8 years agobook: Add missing punctuation
Ori Avtalion [Fri, 11 Dec 2015 16:18:02 +0000 (18:18 +0200)]
book: Add missing punctuation

8 years agoInclude type name in symbol for methods
Seo Sanghyeon [Fri, 11 Dec 2015 15:01:08 +0000 (00:01 +0900)]
Include type name in symbol for methods

8 years agoDocument bounds checking in the book
Matt Brubeck [Thu, 10 Dec 2015 20:14:41 +0000 (12:14 -0800)]
Document bounds checking in the book

8 years agoFix for issue #27889: same field names in enum variants
w00ns [Fri, 21 Aug 2015 06:22:51 +0000 (08:22 +0200)]
Fix for issue #27889: same field names in enum variants

8 years agoAuto merge of #30308 - tsion:typo, r=sanxiyn
bors [Fri, 11 Dec 2015 09:56:51 +0000 (09:56 +0000)]
Auto merge of #30308 - tsion:typo, r=sanxiyn

r? @steveklabnik

8 years agoDo not include generics in suggestion to qualify enum variants
Seo Sanghyeon [Fri, 11 Dec 2015 08:43:04 +0000 (17:43 +0900)]
Do not include generics in suggestion to qualify enum variants

8 years agoAuto merge of #30265 - oli-obk:const_val_trans, r=pnkfelix
bors [Fri, 11 Dec 2015 08:12:41 +0000 (08:12 +0000)]
Auto merge of #30265 - oli-obk:const_val_trans, r=pnkfelix

r? @nagisa

I'm going to need the `ConstVal` -> `ValueRef` translation to start removing trans/consts piece by piece. If you need anything implemented in the translation, feel free to assign an issue to me.

8 years agoMake name resolution errors non-fatal
Nick Cameron [Fri, 11 Dec 2015 07:59:11 +0000 (20:59 +1300)]
Make name resolution errors non-fatal

8 years agoAuto merge of #30248 - petevine:master, r=brson
bors [Fri, 11 Dec 2015 06:29:06 +0000 (06:29 +0000)]
Auto merge of #30248 - petevine:master, r=brson

Running `/usr/bin/time -v make` to build rust (using local llvm) shows the maximum memory usage at 715 megabytes on 32-bit x86 (on arm linux it's even less @ 580M).

Reworded according to @brson's [input](https://github.com/rust-lang/rust/pull/30196#issuecomment-162088921).

8 years agoAuto merge of #30294 - jseyfried:fix_shadowed_use_visibility, r=nrc
bors [Fri, 11 Dec 2015 04:27:53 +0000 (04:27 +0000)]
Auto merge of #30294 - jseyfried:fix_shadowed_use_visibility, r=nrc

This fixes a bug in which the visibility of a use declaration defining a name in one namespace (e.g. the value namespace) is overridden by a later use declaration defining the same name in the other namespace (e.g. the type namespace). For example,
```rust
fn f() {}
pub mod bar {}

mod foo {
    use f; // This import should not be visible outside `foo`,
    pub use bar as f; // but it visible outside of `foo` because of this import.
}

fn main() { foo::f(); }
```
As the example demonstrates, this is a [breaking-change], but it looks unlikely to cause breakage in practice, and any breakage can be fixed by correcting visibility modifiers.

8 years agoAuto merge of #30307 - pnkfelix:fix-issue-26656, r=alexcrichton
bors [Fri, 11 Dec 2015 02:44:21 +0000 (02:44 +0000)]
Auto merge of #30307 - pnkfelix:fix-issue-26656, r=alexcrichton

Long awaited regression test for dropck on trait object method.

Fix #26656.

8 years agoRename (Ns)ImportResolution
Jeffrey Seyfried [Fri, 11 Dec 2015 01:38:13 +0000 (01:38 +0000)]
Rename (Ns)ImportResolution

8 years agoAuto merge of #30301 - michaelwoerister:mir-to-metadata2, r=nikomatsakis
bors [Fri, 11 Dec 2015 00:59:48 +0000 (00:59 +0000)]
Auto merge of #30301 - michaelwoerister:mir-to-metadata2, r=nikomatsakis

This PR makes `Mir` `RustcEncodable` and `RustcDecodable` and stores it in crate metadata for inlinable items.

Some other things in here:
- `mir::visit::Visitor` is extended to also visit `Literals`, `Spans` and `DefIds`.
- It also adds `mir::visit::MutVisitor` which allows to mutate the visited `Mir` structure in place.
- Some numbers on how big MIR is in metadata (total metadata size in bytes):

|                | w/ MIR     | w/o MIR     | Rel. Size |
|----------------|-----------:|------------:|:---------:|
| libcore        | 17,695,473 |  14,263,377 |  124%     |
| liblibc        | 411,440   |  404,382    | 102%      |
| libcollections |  4,537,975 |   3,526,933 |   129%    |
| libserialize   |  2,574,769 |   2,060,798 |   125%    |
| libsyntax      | 15,262,894 |  12,075,574 |  126%     |
| librustc       | 16,984,537 |  13,692,168 |  124%     |

So, adding MIR to metadata makes it about 25% bigger. It could be worse, considering that it still uses the inefficient RBML encoding. Still, the question is whether we should put MIR emission behind a `-Z` flag.

8 years agoAdd name of initializer to missing field message, closes #30299
Florian Hahn [Thu, 10 Dec 2015 23:25:08 +0000 (00:25 +0100)]
Add name of initializer to missing field message, closes #30299

8 years agoAuto merge of #30148 - steveklabnik:doc_string, r=alexcrichton
bors [Thu, 10 Dec 2015 23:18:07 +0000 (23:18 +0000)]
Auto merge of #30148 - steveklabnik:doc_string, r=alexcrichton

Part of #29376

8 years agostd: improve io error descriptions
Sean McArthur [Thu, 10 Dec 2015 21:29:33 +0000 (13:29 -0800)]
std: improve io error descriptions

8 years agoImprove documentation on String's methods
Steve Klabnik [Tue, 1 Dec 2015 21:07:53 +0000 (16:07 -0500)]
Improve documentation on String's methods

Part of #29376

8 years agoMake MIR encodable and store it in crate metadata.
Michael Woerister [Tue, 8 Dec 2015 20:53:19 +0000 (15:53 -0500)]
Make MIR encodable and store it in crate metadata.

8 years agoAdd a MIR visitor that allows to mutate the visited data
Michael Woerister [Tue, 8 Dec 2015 19:09:16 +0000 (14:09 -0500)]
Add a MIR visitor that allows to mutate the visited data

8 years agoAdd visit_defid(), visit_span(), and visit_literal() to MIR visitor
Michael Woerister [Tue, 8 Dec 2015 19:07:25 +0000 (14:07 -0500)]
Add visit_defid(), visit_span(), and visit_literal() to MIR visitor

8 years agoMIR: Make Mir take ownership of InlineAsm values.
Michael Woerister [Thu, 10 Dec 2015 21:39:17 +0000 (16:39 -0500)]
MIR: Make Mir take ownership of InlineAsm values.

8 years agoAuto merge of #30303 - mitaa:htmldocck, r=brson
bors [Thu, 10 Dec 2015 21:36:08 +0000 (21:36 +0000)]
Auto merge of #30303 - mitaa:htmldocck, r=brson

This changes the error output and behaviour to:
* not emit python backtraces
* run all checks
* include a context line per error
* move the offending line-number to the start of the line

fixes #21455

8 years agoMIR: Refactor mir::Terminator to use tuples instead of a fixed-size arrays.
Michael Woerister [Thu, 10 Dec 2015 20:46:40 +0000 (15:46 -0500)]
MIR: Refactor mir::Terminator to use tuples instead of a fixed-size arrays.

8 years agoAdd TupleSlice trait to rustc_data_structures.
Michael Woerister [Thu, 10 Dec 2015 19:35:53 +0000 (14:35 -0500)]
Add TupleSlice trait to rustc_data_structures.

8 years agoAuto merge of #30182 - alexcrichton:remove-deprecated, r=aturon
bors [Thu, 10 Dec 2015 19:54:15 +0000 (19:54 +0000)]
Auto merge of #30182 - alexcrichton:remove-deprecated, r=aturon

This is a standard "clean out libstd" commit which removes all 1.5-and-before
deprecated functionality as it's now all been deprecated for at least one entire
cycle.

8 years agobook: Update Tier 2 platforms
Alex Crichton [Thu, 10 Dec 2015 19:50:20 +0000 (11:50 -0800)]
book: Update Tier 2 platforms

We've got lots of new automation set up in the past few months, so these
platforms are now all tier 2 as we're building artifacts and gating on them.

8 years agoCorrect 'bye' to 'byte' in str docs.
Scott Olson [Thu, 10 Dec 2015 19:49:04 +0000 (13:49 -0600)]
Correct 'bye' to 'byte' in str docs.