Commit Graph

49328 Commits

Author SHA1 Message Date
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
Ravi Shankar
51ff171948 Modify the Levenshtein-based suggestions to include imports 2015-12-16 16:33:24 +05:30
Aaron Keen
41cc365af9 Corrected formatting mistakes.
Changed bit manipulation to use supported - (set difference) instead
of explicit '& !'.
2015-12-16 11:53:36 +01:00
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
Geoffrey Thomas
cec2d144a1 Pass --enable-new-dtags to GNU ld
This causes the linker to emit DT_RUNPATH instead of DT_RPATH, which
fixes #30378.
2015-12-15 21:20:44 -05:00
Alex Burka
d91b256fe5 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 )
2015-12-15 20:48:25 -05:00
Alex Burka
74c384bc8e remove claim that $crate is a single identifier
Fixes #30217.
2015-12-15 20:26:10 -05:00
fbergr
b9005dd472 Book: Fix link anchor in Syntax Index 2015-12-15 21:47:21 +02:00
Jake Worth
2a1efca2f3 Fix typo 2015-12-15 12:51:08 -06: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
Simonas Kazlauskas
b3720ea933 Implement translation for ConstVal::{Array,Repeat} 2015-12-15 12:25:09 +02:00
Simonas Kazlauskas
a5e7a61c49 Implement references to functions and constants 2015-12-15 12:25:05 +02:00
Simonas Kazlauskas
59e6b20cf2 Const-eval more constants during MIR building 2015-12-15 12:23:37 +02: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
Christoffer Buchholz
5538c6b198 Clearer leading sentence 2015-12-15 08:49:57 +01: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
Manish Goregaokar
4423463465 Improve E0401 diagnostics to mention other items. 2015-12-15 10:25:29 +05:30
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
mitaa
6244314798 Remove emoji from docs 2015-12-15 01:55:14 +01:00
Wesley Wiser
2b15361298 Implement trans for the MIR Switch terminator
Fixes #29574
2015-12-14 19:00:10 -05: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
Alex Burka
e0a526015d evade unused_variables lint in for-loop desugaring 2015-12-14 17:51:52 -05:00
Alex Burka
4c0c4e5546 add failing run-pass test for #30371 2015-12-14 17:51:52 -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
Aaron Keen
35f2fe52c2 Corrects issue #28777 by removing, once a binary operator is found, the
RESTRICTION_STMT_EXPR restriction to allow subsequent expressions to
contain braces.

https://github.com/rust-lang/rust/issues/28777
2015-12-14 21:32:16 +01:00
Denis Kolodin
50b43f6bd8 E0283 error explain 2015-12-14 23:25:43 +03: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
Chris Buchholz
5cf6253da1 make scan() usage more explanatory 2015-12-14 18:42:24 +01: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
Zach Reizner
dc7c3cd5c7 fix copy-paste typo in docs for wrapping_shr 2015-12-13 12:00:00 -08: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