Commit Graph

62438 Commits

Author SHA1 Message Date
Tobias Schottdorf 7bfc64ab0f Improve wording in the -{W,A,F,D} options
Fixes #28708.
2017-03-12 06:12:05 -04:00
bors f84a517483 Auto merge of #40257 - pftbest:sret_msp430, r=alexcrichton
LLVM: Update submodule to include SRet support patch for MSP430.

This patch is needed to fix #38824 on MSP430.
I know that LLVM 4 is coming soon, but it would be great to have at least one working nightly before the update.

cc @awygle
r? @alexcrichton
2017-03-12 08:08:58 +00:00
Taylor Cramer b1aa99352a Add compile-fail tests for catch expr in match or condition 2017-03-11 22:26:57 -08:00
Taylor Cramer ea4e8b0a81 Temporarily prefix catch block with do keyword 2017-03-11 22:26:57 -08:00
Taylor Cramer d95c543722 Add catch expr to AST and disallow catch as a struct name 2017-03-11 22:26:52 -08:00
bors d9cf601ae8 Auto merge of #39770 - alexcrichton:configure-clean, r=brson
Delete more swaths of the configure script

This PR deletes more swaths of the `./configure` script which are either no longer necessary or already available in rustbuild (where an implementation is preferred)
2017-03-12 05:27:45 +00:00
Oliver Middleton 19e0505dc7 rustdoc: Fix string escaping in implementors js files
The generates HTML can contain quotes so we need to make sure they are
escaped before inserting into the js files.
2017-03-12 05:12:27 +00:00
Oliver Middleton 0e0bac914c rustbuild: Fix tests
Use the same step names as the actual build.
2017-03-12 05:09:10 +00:00
Oliver Middleton 74ccbec3ac Add doc attributes to proc_macro crate
This adds the same logo and favicon as the rest of the std docs.
2017-03-12 02:54:43 +00:00
bors 744e69663e Auto merge of #40446 - arielb1:rollup, r=alexcrichton
Rollup of 12 pull requests

- Successful merges: #40146, #40299, #40315, #40319, #40344, #40345, #40372, #40373, #40400, #40404, #40419, #40431
- Failed merges:
2017-03-12 02:50:17 +00:00
Alex Crichton 6a5fd0f7ee Merge branch 'more-sccache-debug' of https://github.com/alexcrichton/rust into rollup 2017-03-11 18:49:43 -08:00
Oliver Middleton 7b04f7fa63 rustbuild: Fix compiler docs
* Make sure std docs are generated before compiler docs so rustdoc uses
relative links.
* Don't document the rustc and rustdoc binary crates as they overwrite
the real rustc and rustdoc crates.
2017-03-12 02:45:20 +00:00
bors 1b19284ad9 Auto merge of #40220 - jseyfried:ast_macro_def, r=nrc
syntax: add `ast::ItemKind::MacroDef`, simplify hygiene info

This PR
 - adds a new variant `MacroDef` to `ast::ItemKind` for `macro_rules!` and eventually `macro` items,
 - [breaking-change] forbids macro defs without a name (`macro_rules! { () => {} }` compiles today),
 - removes `ast::MacroDef`, and
 - no longer uses `Mark` and `Invocation` to identify and characterize macro definitions.
   - We used to apply (at least) two `Mark`s to an expanded identifier's `SyntaxContext` -- the definition mark(s) and the expansion mark(s). We now only apply the latter.

r? @nrc
2017-03-11 22:48:14 +00:00
Esteban Küber 6ba494b68b Point to let when modifying field of immutable variable
Point at the immutable local variable when trying to modify one of its
fields.

Given a file:

```rust
struct Foo {
    pub v: Vec<String>
}

fn main() {
    let f = Foo { v: Vec::new() };
    f.v.push("cat".to_string());
}
```

present the following output:

```
error: cannot borrow immutable field `f.v` as mutable
 --> file.rs:7:13
  |
6 |    let f = Foo { v: Vec::new() };
  |        - this should be `mut`
7 |    f.v.push("cat".to_string());
  |    ^^^

error: aborting due to previous error
```
2017-03-11 14:28:29 -08:00
Ariel Ben-Yehuda b1e03fe4bb Rollup merge of #40431 - fsasm:master, r=BurntSushi
rustc: Whitelist the FMA target feature

This commit adds the entry `"fma\0"` to the whitelist for the x86
target. LLVM already supports fma but rustc did not directly. Previously
rustc permitted `+fma` in the target-feature argument and enabled the use
of FMA instructions, but it did not list it in the configuration and
attributes.

fixes #40406
2017-03-11 21:57:50 +02:00
Ariel Ben-Yehuda 7b0caa58d9 Rollup merge of #40419 - GuillaumeGomez:fix-const-rendering, r=frewsxcv
Fix associated consts display

Fixes #40370.

r? @frewsxcv
2017-03-11 21:57:49 +02:00
Ariel Ben-Yehuda d208b2de10 Rollup merge of #40404 - cengizIO:master, r=nikomatsakis
fix #40294 obligation cause.body_id is not always a NodeExpr

Hello!

This fixes #40294 and moves tests related to #38812 to a much more sensible directory.

Thanks to @nikomatsakis and @eddyb
2017-03-11 21:57:48 +02:00
Ariel Ben-Yehuda 25dcbca0ad Rollup merge of #40400 - TimNN:gdbr-updates, r=alexcrichton
Update gdbr tests

gdb will now reliably detect the lanugage as rust even before any code is run.
2017-03-11 21:57:47 +02:00
Ariel Ben-Yehuda d75b9ad5f4 Rollup merge of #40373 - TimNN:test-ub-packed, r=arielb1
Fix UB in repr(packed) tests

r? @arielb1

cc #37609 and #27060
2017-03-11 21:57:46 +02:00
Ariel Ben-Yehuda 66436b5a2a Rollup merge of #40372 - nagisa:never-drop, r=eddyb
Do not bother creating StorageLive for TyNever

Keeps MIR cleaner, `StorageLive(_: !)` makes no sense anyway.

r? @eddyb
2017-03-11 21:57:45 +02:00
Ariel Ben-Yehuda 037e5067b1 Rollup merge of #40345 - Nashenas88:patch-1, r=estebank
Fix missing backtick typo

Fixes rendering of the end of the `Configure and Make` section.
2017-03-11 21:57:44 +02:00
Ariel Ben-Yehuda 8dc8f8fe53 Rollup merge of #40344 - nrc:save-container, r=eddyb
save-analysis: cope with lack of method data after a type error

Fixes #39957

r? @eddyb
2017-03-11 21:57:43 +02:00
Ariel Ben-Yehuda c886815e94 Rollup merge of #40319 - eddyb:it's-"unsize"-not-"unsound", r=nikomatsakis
Disallow subtyping between T and U in T: Unsize<U>.

Because `&mut T` can be coerced to `&mut U`, `T` and `U` must be unified invariantly. Fixes #40288.
E.g. coercing `&mut [&'a X; N]` to `&mut [&'b X]` must require `'a` be equal to `'b`, otherwise you can convert between `&'a X` and `&'b X` (in either direction), potentially unsoundly lengthening lifetimes.

Subtyping here was introduced with `Unsize` in #24619 (landed in 1.1, original PR is #23785).
2017-03-11 21:57:42 +02:00
Ariel Ben-Yehuda b49036c7d0 Rollup merge of #40315 - oli-obk:lint_body, r=eddyb
Allow lints to check Bodys directly

r? @eddyb

babysteps towards fixing https://github.com/Manishearth/rust-clippy/issues/1580 (disable certain lints in const environments, since they make no sense there (yet))
2017-03-11 21:57:41 +02:00
Ariel Ben-Yehuda b933bdc7c2 Rollup merge of #40299 - GuillaumeGomez:fmt-display-example, r=frewsxcv
Add missing example for Display::fmt

r? @frewsxcv
2017-03-11 21:57:40 +02:00
Ariel Ben-Yehuda 45de0f90d6 Rollup merge of #40146 - bjorn3:few-infer-changes, r=pnkfelix
Better docs of rusty parts of typeck
2017-03-11 21:57:39 +02:00
bors e4eb964dd9 Auto merge of #40443 - alexcrichton:fix-nightlies-again, r=alexcrichton
rustbuild: Fix a bug when manifesting with Cargo

The wrong Cargo version was passed down so it ended up panicking the
build-manifest script as it couldn't find the right tarball.
2017-03-11 19:10:10 +00:00
Alex Crichton 8db566ee96 rustbuild: Fix a bug when manifesting with Cargo
The wrong Cargo version was passed down so it ended up panicking the
build-manifest script as it couldn't find the right tarball.
2017-03-11 09:30:51 -08:00
Alex Crichton c60a58b6d1 Attempt to debug sccache in more locations
This should hopefully add support for debugging OSX and Windows presumed sccache
failures instead of just the Linux ones.
2017-03-11 09:07:50 -08:00
Alex Crichton f8ca805422 configure: Remove --build detection
This commit removes detection of CFG_OSTYPE and CFG_CPUTYPE from the configure
script, which means that the default value of `--build` is no longer present in
the configure script. All this logic is now available in rustbuild itself, so
there's no need to duplicate it.
2017-03-11 08:41:36 -08:00
Alex Crichton 51a4238dcc configure: Remove misc unused vars
None of this is used by rustbuild any more
2017-03-11 08:41:11 -08:00
Alex Crichton 748e2de7cc configure: Remove SUPPORTED_TARGET support
This is not used any more
2017-03-11 08:41:11 -08:00
Alex Crichton e82bcabf07 configure: Remove some lldb-specific logic
All of this should already be vendored in rustbuild if necessary or otherwise
it's just not used.
2017-03-11 08:41:10 -08:00
Alex Crichton e019f133a0 configure: Remove miscellaneous program probes
All of these should be handled by rustbuild in sanity.rs right now.
2017-03-11 08:41:10 -08:00
Alex Crichton b326bd31e5 configure: Remove md5 probing logic
This is all not used any more
2017-03-11 08:41:10 -08:00
Alex Crichton 3308bd54b2 configure: Remove git probing logic
This is all in rustbuild already.
2017-03-11 08:41:10 -08:00
bors 4b1dfbd86c Auto merge of #40308 - nikomatsakis:incr-comp-isolate-task, r=mw
first pass at isolating dep-graph tasks

This intentionally leaves `DepGraph::in_task()`, the more common form,
alone. Eventually all uses of `DepGraph::in_task()` should be ported
to `with_task()`, but I wanted to start with a smaller subset.

I also used `AssertDepGraphSafe` on the closures that are found in
trans. This is because the types there are non-trivial and I wanted to
lay down the mechanism and come back to the more subtle cases.

The current approach taken in this PR has a downside: it is necessary
to manually "reify" fn types into fn pointers when starting a task,
like so:

    dep_graph.with_task(..., task_fn as fn(_))

this is because `with_task` takes some type `T` that implements
`DepGraphTask` rather than taking a `fn()` type directly. *This* is so
that we can accept closure and also so that we can accept fns with
multiple arities. I am not sure this is the right approach.

Originally I wanted to use closures bound by an auto trait, but that
approach has some limitations:

- the trait cannot have a `read()` method; since the current method
  is unused, that may not be a problem.
- more importantly, we would want the auto trait to be "undefined" for all types
  *by default* -- that is, this use case doesn't really fit the typical
  auto trait scenario. For example, imagine that there is a `u32` loaded
  out of a `hir::Node` -- we don't really want to be passing that
  `u32` into the task!
2017-03-11 15:50:33 +00:00
steveklabnik 80d3f3a1e3 Update mdbook to new version
This brings back playpen integration for the books.
2017-03-11 09:54:47 -05:00
Charlie Fan 584c79888b Implement placement-in protocol for `HashMap` 2017-03-11 21:08:18 +08:00
bors 5d0be0d72a Auto merge of #40199 - alexcrichton:doc-proc-macro, r=brson
rustbuild: Build documentation for `proc_macro`

This commit fixes #38749 by building documentation for the `proc_macro` crate by
default for configured hosts. Unfortunately did not turn out to be a trivial
fix. Currently rustbuild generates documentation into multiple locations: one
for std, one for test, and one for rustc. The initial fix for this issue simply
actually executed `cargo doc -p proc_macro` which was otherwise completely
elided before.

Unfortunately rustbuild was the left to merge two documentation trees together.
One for the standard library and one for the rustc tree (which only had docs for
the `proc_macro` crate). Rustdoc itself knows how to merge documentation files
(specifically around search indexes, etc) but rustbuild was unaware of this, so
an initial fix ended up destroying the sidebar and the search bar from the
libstd docs.

To solve this issue the method of documentation has been tweaked slightly in
rustbuild. The build system will not use symlinks (or directory junctions on
Windows) to generate all documentation into the same location initially. This'll
rely on rustdoc's logic to weave together all the output and ensure that it ends
up all consistent.

Closes #38749
2017-03-11 11:42:09 +00:00
Tatsuyuki Ishi d4040c3a3f rustbuild: Add save-analysis to install 2017-03-11 20:00:06 +09:00
Tatsuyuki Ishi 5a88c7e5a1 rustbuild: Skip saving analysis when disabled 2017-03-11 20:00:06 +09:00
Tatsuyuki Ishi e31e264c55 rustbuild: Make save-analysis an option 2017-03-11 20:00:05 +09:00
bors 8c72b7651f Auto merge of #39648 - Aatch:mir-inlining-2, r=eddyb
[MIR] Implement Inlining

Fairly basic implementation of inlining for MIR. Uses conservative
heuristics for inlining.

Doesn't handle a number of cases, but can be extended later. This is basically the same as the previous inlining PR, but without the span-related changes (as the bugs it was dealing with have since been fixed).

/cc @rust-lang/compiler
2017-03-11 08:25:44 +00:00
bors 1727b23317 Auto merge of #40432 - alexcrichton:rollup, r=alexcrichton
Rollup of 38 pull requests

- Successful merges: #39202, #39820, #39918, #39921, #40092, #40146, #40199, #40225, #40239, #40257, #40259, #40261, #40277, #40278, #40287, #40297, #40311, #40315, #40319, #40324, #40336, #40340, #40344, #40345, #40367, #40369, #40372, #40373, #40379, #40385, #40386, #40389, #40400, #40404, #40410, #40422, #40423, #40424
- Failed merges: #40220, #40329, #40426
2017-03-11 05:41:41 +00:00
Alex Crichton 3493d91a18 Test fixes and rebase conflicts 2017-03-10 20:05:06 -08:00
Alex Crichton d03b6b3ea0 Rollup merge of #40424 - alexcrichton:faster-travis-osx, r=brson
travis: Remove compiling OpenSSL through homebrew

I don't believe that we need this any more now that `cargo-vendor` isn't
installed to create a source tarball (that only happens on Linux)
2017-03-10 20:05:06 -08:00
Alex Crichton b32393c889 Rollup merge of #40423 - DirkyJerky:patch-2, r=BurntSushi
Clarify docs in `VecDeque::resize`
2017-03-10 20:05:06 -08:00
Alex Crichton f4b4e097a6 Rollup merge of #40410 - clarcharr:os_string_shrink_to_fit, r=alexcrichton
OsString::shrink_to_fit.

Considering how the other capacity-related methods are there, I found it odd that this one wasn't included.

Will create a tracking issue once I get an OK on this.
2017-03-10 20:05:06 -08:00
Alex Crichton dcf41821b8 Rollup merge of #40389 - F001:placementVecDeque, r=nagisa
Implement placement-in protocol for `VecDeque`

CC #30172

r? @nagisa
2017-03-10 20:05:04 -08:00