Commit Graph

48757 Commits

Author SHA1 Message Date
Alex Crichton
04f9a3f8fe 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
2015-12-16 08:06:27 -08: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
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
bors
9e63cecb10 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
2015-12-15 04:21:53 +00:00
bors
8f031bf962 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
2015-12-15 01:18:01 +00:00
Peter Atashian
915cb376e9 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>
2015-12-14 18:04:35 -05:00
Ori Avtalion
37b8e22c68 Add links in BTreeSet docs 2015-12-14 23:15:21 +02:00
faineance
ec8ea22c7f [breaking-change] move ast_util functions to methods 2015-12-14 21:15:01 +00:00
bors
44d9601ad3 Auto merge of #30328 - sanxiyn:include-type-name, r=alexcrichton
Fix #30260.
2015-12-14 21:08:13 +00:00
bors
f150c178ea 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).
2015-12-14 19:14:37 +00:00
bors
9ea4b4f01f Auto merge of #30321 - sanxiyn:E0170, r=alexcrichton
Fix #30302.
2015-12-14 16:45:02 +00:00
bors
50a02b43ba 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.
2015-12-14 13:48:41 +00:00
bors
6b3a3f2702 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.
2015-12-14 01:33:58 +00:00
bors
110df043bf Auto merge of #30351 - tamird:remove-range-inclusive, r=alexcrichton
r? @alexcrichton
2015-12-13 23:40:12 +00:00
Richard Diamond
7bd69f2248 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).
2015-12-13 15:05:43 -06:00
jethrogb
6e46a0fb95 Make BinaryHeap Dijkstra example return Option 2015-12-13 11:40:27 -08:00
bors
2841cc0381 Auto merge of #30348 - shepmaster:box-any-docs, r=steveklabnik 2015-12-13 18:59:08 +00:00
bors
69adc883aa Auto merge of #30343 - Seeker14491:patch-1, r=bluss
The `MIN` link was broken. Reverts #29624.
2015-12-13 17:11:36 +00:00
bors
d5cdf0687e 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.
2015-12-13 15:22:03 +00:00
bors
33378f09fd Auto merge of #30339 - Manishearth:oops-i-did-it-again, r=eddyb
r? @eddyb
2015-12-13 13:34:46 +00:00
bors
5a1045699d Auto merge of #30332 - bluss:nomicon-variance, r=gankro
Update nomicon for variance typo & contravariance

Fixes #28704
Fixes #28100
2015-12-13 11:44:39 +00:00
bors
5de242f1b2 Auto merge of #30329 - salty-horse:punctuation, r=steveklabnik
Missing period at the end of a sentence.
2015-12-13 09:57:35 +00:00
bors
d382fcdb82 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.
2015-12-13 07:56:03 +00:00
Tamir Duberstein
d477708736 Remove duplicate test case
`match-arm-statics` covers this, but needs to be compiled with
debuginfo. However, that still produces an ICE. See #29696.
2015-12-13 01:02:23 -05:00
Tamir Duberstein
b964b1d043 remove deprecated APIs missed in #30182 2015-12-13 01:02:12 -05:00
Tamir Duberstein
722905fda0 restore tests accidentally removed in #30182 2015-12-13 01:02:12 -05:00
bors
c4c191afae 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.
2015-12-13 05:18:19 +00:00
bors
35b6461b6e 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?
2015-12-13 01:53:06 +00:00
bors
1ddaf8bdf4 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.
2015-12-12 23:50:03 +00:00
bors
8babb7db7e Auto merge of #30334 - dhuseby:FreeBSD_30333, r=alexcrichton
Removed the offending flag from the makefile.
2015-12-12 20:55:44 +00:00
Vadim Petrochenkov
67a978411a Support #[deprecated] in rustdoc 2015-12-12 23:01:27 +03:00
Vadim Petrochenkov
105bd15207 Address the review comments 2015-12-12 21:40:45 +03:00
bors
83eda08037 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.
2015-12-12 18:02:43 +00:00
Ariel Ben-Yehuda
08bffdd5c0 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).
2015-12-12 19:02:33 +02:00
Vadim Petrochenkov
e3ed7b0501 Implement #[deprecated] attribute (RFC 1270) 2015-12-12 19:39:37 +03:00