]> git.lizzy.rs Git - rust.git/log
rust.git
8 years agoSet span for interpolated tokens correctly
Florian Hahn [Sat, 23 Jan 2016 23:52:43 +0000 (00:52 +0100)]
Set span for interpolated tokens correctly

8 years agoUpdate tests
Florian Hahn [Sat, 23 Jan 2016 23:51:15 +0000 (00:51 +0100)]
Update tests

8 years agoUpdate expression span when transcribing macro args
Florian Hahn [Thu, 21 Jan 2016 21:14:09 +0000 (22:14 +0100)]
Update expression span when transcribing macro args

closes #29084
closes #28308
closes #25385
closes #28288
closes #31011
closes #26480
closes #26093
closes #26094
closes #25386
closes #26237
closes #25793

8 years agoAuto merge of #31065 - nrc:ident-correct, r=pnkfelix
bors [Tue, 26 Jan 2016 00:42:08 +0000 (00:42 +0000)]
Auto merge of #31065 - nrc:ident-correct, r=pnkfelix

This PR adds some minor error correction to the parser - if there is a missing ident, we recover and carry on. It also makes compilation more robust so that non-fatal errors (which is still most of them, unfortunately) in parsing do not cause us to abort compilation. The effect is that a program with a missing or incorrect ident can get all the way to type checking.

8 years agoAuto merge of #31097 - DanielJCampbell:SaveAnalysis, r=nrc
bors [Mon, 25 Jan 2016 20:41:44 +0000 (20:41 +0000)]
Auto merge of #31097 - DanielJCampbell:SaveAnalysis, r=nrc

Also altered the format_args! syntax extension, and \#[derive(debug)], to maintain compatability.
r? @ nrc

8 years agoFix a rebasing issue and addressed reviewer comment
Nick Cameron [Thu, 21 Jan 2016 19:55:54 +0000 (08:55 +1300)]
Fix a rebasing issue and addressed reviewer comment

8 years agoAuto merge of #30899 - oli-obk:non-local-const-fn, r=pnkfelix
bors [Mon, 25 Jan 2016 16:42:41 +0000 (16:42 +0000)]
Auto merge of #30899 - oli-obk:non-local-const-fn, r=pnkfelix

Also got rid of some code repetition in `const_eval`

8 years agoAuto merge of #31182 - adrianheine:master, r=pnkfelix
bors [Mon, 25 Jan 2016 12:41:19 +0000 (12:41 +0000)]
Auto merge of #31182 - adrianheine:master, r=pnkfelix

In 95d904625b4d45af80b4e40d51a3a0fde1abaa8a output was accidentally moved
from STDERR to STDOUT.

This commit also changes the order of debug output. Previously, it was:

```
/* id 22: … */ {
  …
}
DEBUG:rustc::middle::dataflow:
```

Now, it is:

```
DEBUG:rustc::middle::dataflow: /* id 22: … */ {
  …
}
```

8 years agoAuto merge of #31176 - frewsxcv:incorrect-pass-kind, r=dotdash
bors [Mon, 25 Jan 2016 09:37:11 +0000 (09:37 +0000)]
Auto merge of #31176 - frewsxcv:incorrect-pass-kind, r=dotdash

Register LLVM passes with the correct LLVM pass manager.

LLVM was upgraded to a new version in this commit:

https://github.com/rust-lang/rust/commit/f9d4149c29e8b989fa3624993be379f380e48dcf

which was part of this pull request:

https://github.com/rust-lang/rust/issues/26025

Consider the following two lines from that commit:

https://github.com/rust-lang/rust/commit/f9d4149c29e8b989fa3624993be379f380e48dcf#diff-a3b24dbe2ea7c1981f9ac79f9745f40aL462

https://github.com/rust-lang/rust/commit/f9d4149c29e8b989fa3624993be379f380e48dcf#diff-a3b24dbe2ea7c1981f9ac79f9745f40aL469

The purpose of these lines is to register LLVM passes. Prior to the that
commit, the passes being handled were assumed to be ModulePasses (a
specific type of LLVM pass) since they were being added to a ModulePass
manager. After that commit, both lines were refactored (presumably in an
attempt to DRY out the code), but the ModulePasses were changed to be
registered to a FunctionPass manager. This change resulted in
ModulePasses being run, but a Function object was being passed as a
parameter to the pass instead of a Module, which resulted in
segmentation faults.

In this commit, I changed relevant sections of the code to check the
type of the passes being added and register them to the appropriate pass
manager.

Closes https://github.com/rust-lang/rust/issues/31067

8 years agolibrustc/middle/dataflow.rs: Debug to STDERR
Adrian Heine [Mon, 25 Jan 2016 08:59:52 +0000 (09:59 +0100)]
librustc/middle/dataflow.rs: Debug to STDERR

In 95d904625b4d45af80b4e40d51a3a0fde1abaa8a output was accidentally moved
from STDERR to STDOUT.

This commit also changes the order of debug output. Previously, it was:

```
/* id 22: … */ {
  …
}
DEBUG:rustc::middle::dataflow:
```

Now, it is:

```
DEBUG:rustc::middle::dataflow: /* id 22: … */ {
  …
}
```

8 years agoRegister LLVM passes with the correct LLVM pass manager.
Corey Farwell [Mon, 25 Jan 2016 01:22:24 +0000 (20:22 -0500)]
Register LLVM passes with the correct LLVM pass manager.

LLVM was upgraded to a new version in this commit:

https://github.com/rust-lang/rust/commit/f9d4149c29e8b989fa3624993be379f380e48dcf

which was part of this pull request:

https://github.com/rust-lang/rust/issues/26025

Consider the following two lines from that commit:

https://github.com/rust-lang/rust/commit/f9d4149c29e8b989fa3624993be379f380e48dcf#diff-a3b24dbe2ea7c1981f9ac79f9745f40aL462

https://github.com/rust-lang/rust/commit/f9d4149c29e8b989fa3624993be379f380e48dcf#diff-a3b24dbe2ea7c1981f9ac79f9745f40aL469

The purpose of these lines is to register LLVM passes. Prior to the that
commit, the passes being handled were assumed to be ModulePasses (a
specific type of LLVM pass) since they were being added to a ModulePass
manager. After that commit, both lines were refactored (presumably in an
attempt to DRY out the code), but the ModulePasses were changed to be
registered to a FunctionPass manager. This change resulted in
ModulePasses being run, but a Function object was being passed as a
parameter to the pass instead of a Module, which resulted in
segmentation faults.

In this commit, I changed relevant sections of the code to check the
type of the passes being added and register them to the appropriate pass
manager.

Closes https://github.com/rust-lang/rust/issues/31067

8 years agoAuto merge of #31159 - dirk:dirk/clarify-cargo-lock, r=steveklabnik
bors [Mon, 25 Jan 2016 01:16:45 +0000 (01:16 +0000)]
Auto merge of #31159 - dirk:dirk/clarify-cargo-lock, r=steveklabnik

Also remove a "finally" in the section about building for release to make it feel a bit friendlier.

8 years agoAuto merge of #31166 - geofft:process-comments, r=alexcrichton
bors [Sun, 24 Jan 2016 23:27:10 +0000 (23:27 +0000)]
Auto merge of #31166 - geofft:process-comments, r=alexcrichton

The implementation changed in 33a2191d, but the comments did not change to match.

r? @alexcrichton

8 years agoAuto merge of #31093 - tshepang:misc-doc-improvements, r=steveklabnik
bors [Sun, 24 Jan 2016 20:13:14 +0000 (20:13 +0000)]
Auto merge of #31093 - tshepang:misc-doc-improvements, r=steveklabnik

8 years agoAuto merge of #31162 - mopp:fix_configure_for_new_clang, r=alexcrichton
bors [Sun, 24 Jan 2016 18:09:51 +0000 (18:09 +0000)]
Auto merge of #31162 - mopp:fix_configure_for_new_clang, r=alexcrichton

Version of Clang in repository is 3.9

So, error is caused by
```
./configure --enable-dist-host-only --enable-clang
```
Then, I got
```
configure: error: bad CLANG version: 3.9.0 (http://llvm.org/git/clang.git 3d5d4c39659f11dfbe8e11c857cadf5c449b559b) (http://llvm.org/git/llvm.git, need >=3.0svn
```

I fixed this issue by appending 3.9* in the if sentence.
Thanks.

8 years agosys/unix/process.rs: Update comments in make_argv and make_envp
Geoffrey Thomas [Wed, 20 Jan 2016 22:12:28 +0000 (17:12 -0500)]
sys/unix/process.rs: Update comments in make_argv and make_envp

The implementation changed in 33a2191d, but the comments did not change
to match.

8 years agoAuto merge of #30932 - arielb1:raw-const-errors, r=nagisa
bors [Sun, 24 Jan 2016 15:16:20 +0000 (15:16 +0000)]
Auto merge of #30932 - arielb1:raw-const-errors, r=nagisa

Fixes #30705

r? @nagisa

8 years ago Improve the error explanations for check_const
Ariel Ben-Yehuda [Sun, 24 Jan 2016 15:16:04 +0000 (17:16 +0200)]
 Improve the error explanations for check_const

Fixes #30705

8 years agofix condition for clang
mopp [Sun, 24 Jan 2016 10:36:02 +0000 (19:36 +0900)]
fix condition for clang

8 years agodoc: miscellaneous OpenOptions:append improvements
Tshepang Lekhonkhobe [Thu, 21 Jan 2016 21:41:06 +0000 (23:41 +0200)]
doc: miscellaneous OpenOptions:append improvements

8 years agoClarify when `Cargo.lock` is created by `cargo build` in the book
Dirk Gadsden [Sun, 24 Jan 2016 04:39:38 +0000 (23:39 -0500)]
Clarify when `Cargo.lock` is created by `cargo build` in the book

Also remove a "finally" in the section about building for release
to make it feel a bit friendlier.

8 years agoAuto merge of #31148 - steveklabnik:rollup, r=steveklabnik
bors [Sat, 23 Jan 2016 16:21:07 +0000 (16:21 +0000)]
Auto merge of #31148 - steveklabnik:rollup, r=steveklabnik

- Successful merges: #30997, #31019, #31031, #31035, #31045, #31050, #31054, #31055, #31061, #31088, #31090, #31111, #31113, #31128, #31130, #31136, #31145, #31146
- Failed merges: #30932

8 years agoRollup merge of #31146 - angelsl:patch-1, r=steveklabnik
Steve Klabnik [Sat, 23 Jan 2016 14:38:44 +0000 (09:38 -0500)]
Rollup merge of #31146 - angelsl:patch-1, r=steveklabnik

8 years agoRollup merge of #31145 - D101101:patch-1, r=steveklabnik
Steve Klabnik [Sat, 23 Jan 2016 14:38:44 +0000 (09:38 -0500)]
Rollup merge of #31145 - D101101:patch-1, r=steveklabnik

r? @steveklabnik

8 years agoRollup merge of #31136 - mbrubeck:btree-doc, r=steveklabnik
Steve Klabnik [Sat, 23 Jan 2016 14:38:44 +0000 (09:38 -0500)]
Rollup merge of #31136 - mbrubeck:btree-doc, r=steveklabnik

Also change the examples to make this more obvious. Fixes #31129.

8 years agoRollup merge of #31130 - marcbowes:master, r=nrc
Steve Klabnik [Sat, 23 Jan 2016 14:38:44 +0000 (09:38 -0500)]
Rollup merge of #31130 - marcbowes:master, r=nrc

E0210 explains about orphan rules and suggests using a local type as a workaround. It wasn't obvious to me that I couldn't use a type alias, so I added a note.

8 years agoRollup merge of #31128 - kamalmarhubi:book-trait-impl-clarify, r=steveklabnik
Steve Klabnik [Sat, 23 Jan 2016 14:38:44 +0000 (09:38 -0500)]
Rollup merge of #31128 - kamalmarhubi:book-trait-impl-clarify, r=steveklabnik

8 years agoRollup merge of #31113 - steveklabnik:master, r=alexcrichton
Steve Klabnik [Sat, 23 Jan 2016 14:38:43 +0000 (09:38 -0500)]
Rollup merge of #31113 - steveklabnik:master, r=alexcrichton

r? @alexcrichton

8 years agoRollup merge of #31111 - apasel422:issue-31103, r=steveklabnik
Steve Klabnik [Sat, 23 Jan 2016 14:38:43 +0000 (09:38 -0500)]
Rollup merge of #31111 - apasel422:issue-31103, r=steveklabnik

Closes #31103

r? @steveklabnik

8 years agoRollup merge of #31090 - tshepang:improve-sentence, r=brson
Steve Klabnik [Sat, 23 Jan 2016 14:38:43 +0000 (09:38 -0500)]
Rollup merge of #31090 - tshepang:improve-sentence, r=brson

8 years agoRollup merge of #31088 - tshepang:grammar, r=brson
Steve Klabnik [Sat, 23 Jan 2016 14:38:43 +0000 (09:38 -0500)]
Rollup merge of #31088 - tshepang:grammar, r=brson

8 years agoRollup merge of #31061 - brson:bib, r=steveklabnik
Steve Klabnik [Sat, 23 Jan 2016 14:38:42 +0000 (09:38 -0500)]
Rollup merge of #31061 - brson:bib, r=steveklabnik

8 years agoRollup merge of #31055 - steveklabnik:alt-tags, r=alexcrichton
Steve Klabnik [Sat, 23 Jan 2016 14:38:42 +0000 (09:38 -0500)]
Rollup merge of #31055 - steveklabnik:alt-tags, r=alexcrichton

8 years agoRollup merge of #31054 - steveklabnik:a11y, r=alexcrichton
Steve Klabnik [Sat, 23 Jan 2016 14:38:42 +0000 (09:38 -0500)]
Rollup merge of #31054 - steveklabnik:a11y, r=alexcrichton

I've been interested in the accessibility of Rustdoc's output, but never did anything about it. Today, I ran a tool, and it suggested adjusting some colors.

Here's some screen shots. Before:
![2016-01-20-114944_443x199_scrot](https://cloud.githubusercontent.com/assets/27786/12455979/d84d7ae8-bf6b-11e5-9aea-0602fb1a8cfa.png)

After:

![2016-01-20-114516_453x204_scrot](https://cloud.githubusercontent.com/assets/27786/12455841/36a55d14-bf6b-11e5-8014-239594c12e46.png)

As you can see, the link text is just a _shade_ darker.

Browsable: http://www.steveklabnik.com/rust-a11y-doc-testing/doc/std/

8 years agoRollup merge of #31050 - apasel422:issue-31048, r=Manishearth
Steve Klabnik [Sat, 23 Jan 2016 14:38:42 +0000 (09:38 -0500)]
Rollup merge of #31050 - apasel422:issue-31048, r=Manishearth

Closes #31048

r? @Manishearth

8 years agoRollup merge of #31045 - Manishearth:diag-prim-shadow, r=steveklabnik
Steve Klabnik [Sat, 23 Jan 2016 14:38:42 +0000 (09:38 -0500)]
Rollup merge of #31045 - Manishearth:diag-prim-shadow, r=steveklabnik

I tried to add an inline `span_suggestion()` to the error as well, but since generics don't have their own span it becomes too fragile/complicated to work.

r? @steveklabnik

fixes #19477

8 years agoRollup merge of #31035 - nathankleyn:improve-visibility-of-entry-api, r=steveklabnik
Steve Klabnik [Sat, 23 Jan 2016 14:38:41 +0000 (09:38 -0500)]
Rollup merge of #31035 - nathankleyn:improve-visibility-of-entry-api, r=steveklabnik

Responding to [a thread of discussion on the Rust subreddit](https://www.reddit.com/r/rust/comments/3racik/mutable_lifetimes_are_too_long_when_matching_an/),
it was identified that the presence of the Entry API is not duly
publicised. This commit aims to add some reasonable examples of
common usages of this API to the main example secion of the `HashMap`
documentation.

This is part of issue #29348.

8 years agoRollup merge of #31031 - brson:issue-30123, r=nikomatsakis
Steve Klabnik [Sat, 23 Jan 2016 14:38:41 +0000 (09:38 -0500)]
Rollup merge of #31031 - brson:issue-30123, r=nikomatsakis

This was fixed in passing. Adding a regression test.

8 years agoRollup merge of #31019 - andreabedini:patch-1, r=alexcrichton
Steve Klabnik [Sat, 23 Jan 2016 14:38:41 +0000 (09:38 -0500)]
Rollup merge of #31019 - andreabedini:patch-1, r=alexcrichton

Documentation of `CStr::from_ptr` suggests using `str::from_utf8(slice.to_bytes()).unwrap()`
to obtain a `&str` but `CStr` has `CStr::to_str` that does exactly that.

(First PR, be nice :)

8 years agoRollup merge of #30997 - bluss:trait-default, r=nikomatsakis
Steve Klabnik [Sat, 23 Jan 2016 14:38:41 +0000 (09:38 -0500)]
Rollup merge of #30997 - bluss:trait-default, r=nikomatsakis

Fix type parameter default error to mention type and trait definitions

Introduced in PR #30724, needs to mention that type parameter defaults
are legal in trait and type definitions too.

8 years agoAuto merge of #30997 - bluss:trait-default, r=nikomatsakis
bors [Sat, 23 Jan 2016 14:31:26 +0000 (14:31 +0000)]
Auto merge of #30997 - bluss:trait-default, r=nikomatsakis

Fix type parameter default error to mention type and trait definitions

Introduced in PR #30724, needs to mention that type parameter defaults
are legal in trait and type definitions too.

8 years agoSemaphore not sempahore
angelsl [Sat, 23 Jan 2016 14:15:59 +0000 (22:15 +0800)]
Semaphore not sempahore

8 years agoAuto merge of #31121 - Manishearth:prim-link, r=alexcrichton
bors [Sat, 23 Jan 2016 11:38:43 +0000 (11:38 +0000)]
Auto merge of #31121 - Manishearth:prim-link, r=alexcrichton

We currently nest `<a>` tags which is doubleplusungood. So, for example, `(u8, u8)` will show up
with the left paren linked to the tuple primitive page, and the right paren unlinked, which looks ugly.

8 years agoHandle generics in raw pointers
Manish Goregaokar [Sat, 23 Jan 2016 09:31:17 +0000 (15:01 +0530)]
Handle generics in raw pointers

8 years agoAuto merge of #30958 - dhodder:master, r=brson
bors [Sat, 23 Jan 2016 09:49:34 +0000 (09:49 +0000)]
Auto merge of #30958 - dhodder:master, r=brson

The COPYRIGHT file should be updated to note that Rust no longer ships with AUTHORS.txt.

    $ git log -1 -- AUTHORS.txt
    commit 402749c539edcbc2d850ac3a782cace8661c68e6
    Author: Brian Anderson <banderson@mozilla.com>
    Date:   Wed Dec 2 22:16:08 2015 +0000

        Remove AUTHORS.txt and add-authors.sh

        Keeping this file up to date requires hours of work every release,
        even with the script. It is a fool's errand and we shall not do it
        any longer.

8 years agoFix the missing line in the guessing-game.md
Sergey Veselkov [Sat, 23 Jan 2016 09:19:11 +0000 (12:19 +0300)]
Fix the missing line in the guessing-game.md

r? @steveklabnik

8 years agoAuto merge of #30807 - kolloch:patch-1, r=steveklabnik
bors [Sat, 23 Jan 2016 07:44:17 +0000 (07:44 +0000)]
Auto merge of #30807 - kolloch:patch-1, r=steveklabnik

When I read the book, the following sentence of the reference documentation helped me greatly to understand slices:

"Slices are a view into a block of memory represented as a pointer and a length."

In this commit, I tried to integrate the gist of that into the slice section inside of "primitive-types.md". I am not a native speaker, so feel very free to improve the wording.

r? @steveklabnik

8 years agoAuto merge of #31126 - arielb1:remote-errors, r=eddyb
bors [Sat, 23 Jan 2016 05:54:38 +0000 (05:54 +0000)]
Auto merge of #31126 - arielb1:remote-errors, r=eddyb

Also removed an unused and similarly buggy error path.

Fixes #30535

r? @eddyb

8 years agoAuto merge of #31124 - dirk:dirk/display-and-error-impls-for-string-parse-error,...
bors [Sat, 23 Jan 2016 04:04:26 +0000 (04:04 +0000)]
Auto merge of #31124 - dirk:dirk/display-and-error-impls-for-string-parse-error, r=alexcrichton

Fixes #31106.

- [ ] I wasn't sure of the correct `#[stable(...)]` definition to use here. Happy to fix it if it's incorrect.
- [ ] `ParseError` is sort of an ephemeral non-error, but do let me know if the implementation of `error::Error` for it should return something more descriptive than "parse error".

8 years agoAuto merge of #31116 - bluss:expect-out-cold, r=alexcrichton
bors [Sat, 23 Jan 2016 00:33:23 +0000 (00:33 +0000)]
Auto merge of #31116 - bluss:expect-out-cold, r=alexcrichton

Use cold functions for panic formatting Option::expect, Result::unwrap, expect

These methods are marked inline, but insert a big chunk of formatting
code, as well as other error path related code, such as
deallocating a std::io::Error if you have one.

We can explicitly separate out that code path into a function that is
never inline, since the panicking case should always be rare.

8 years agoAuto merge of #31104 - nrc:save-fix-variant-data, r=alexcrichton
bors [Fri, 22 Jan 2016 22:42:33 +0000 (22:42 +0000)]
Auto merge of #31104 - nrc:save-fix-variant-data, r=alexcrichton

8 years agoDocument that BTreeMap iteration is in order
Matt Brubeck [Fri, 22 Jan 2016 22:10:59 +0000 (14:10 -0800)]
Document that BTreeMap iteration is in order

Also change the examples to make this more obvious. Fixes #31129.

8 years agoAuto merge of #31095 - alexcrichton:remove-old-files, r=brson
bors [Fri, 22 Jan 2016 20:51:38 +0000 (20:51 +0000)]
Auto merge of #31095 - alexcrichton:remove-old-files, r=brson

These are either not used at all today or they're super old and haven't been used in ages, so clean them out.

8 years agoE0210: Add a warning about type aliases
Marc Bowes [Fri, 22 Jan 2016 20:20:36 +0000 (22:20 +0200)]
E0210: Add a warning about type aliases

E0210 explains about orphan rules and suggests using a local type as a
workaround. It wasn't obvious to me that I couldn't use a type
alias, so I added a note.

8 years agoForward reference crates and modules chapter
Kamal Marhubi [Fri, 22 Jan 2016 20:18:00 +0000 (15:18 -0500)]
Forward reference crates and modules chapter

8 years agobook: Clarify that trait or type must be in same crate as impl
Kamal Marhubi [Fri, 22 Jan 2016 19:37:37 +0000 (14:37 -0500)]
book: Clarify that trait or type must be in same crate as impl

8 years agoSimplify return for error::Error impl for string::ParseError
Dirk Gadsden [Fri, 22 Jan 2016 19:34:39 +0000 (14:34 -0500)]
Simplify return for error::Error impl for string::ParseError

8 years agoastconv: don't use as_local_node_id for ids in a Def
Ariel Ben-Yehuda [Fri, 22 Jan 2016 19:23:51 +0000 (21:23 +0200)]
astconv: don't use as_local_node_id for ids in a Def

Fixes #30535

8 years agoImplement error::Error and fmt::Display for string::ParseError
Dirk Gadsden [Fri, 22 Jan 2016 18:38:28 +0000 (13:38 -0500)]
Implement error::Error and fmt::Display for string::ParseError

Fixes #31106.

8 years agoAuto merge of #30917 - arthurprs:bs_bounds_check, r=alexcrichton
bors [Fri, 22 Jan 2016 19:00:15 +0000 (19:00 +0000)]
Auto merge of #30917 - arthurprs:bs_bounds_check, r=alexcrichton

Avoid bounds checking for binary search. All calculated indexes are safe and the branch is useless.

8 years agoMove cold panic functions in Option and Result
Ulrik Sverdrup [Fri, 22 Jan 2016 17:19:00 +0000 (18:19 +0100)]
Move cold panic functions in Option and Result

Move functions out of their impl blocks; avoids unnecessary
monomorphization by type parameters that are irrelevant to the message
output.

8 years agoUse cold functions for panic formatting Option::expect, Result::unwrap etc
Ulrik Sverdrup [Fri, 22 Jan 2016 16:06:34 +0000 (17:06 +0100)]
Use cold functions for panic formatting Option::expect, Result::unwrap etc

Option::expect, Result::unwrap, unwrap_err, expect

These methods are marked inline, but insert a big chunk of formatting
code, as well as other error path related code, such as deallocating
a std::io::Error if you have one.

We can explicitly separate out that code path into a function that is
never inline, since the panicking case should always be rare.

8 years agoCorrectly output links for primitive types which enclose their contents
Manish Goregaokar [Fri, 22 Jan 2016 17:45:47 +0000 (23:15 +0530)]
Correctly output links for primitive types which enclose their contents

8 years agoAuto merge of #31087 - nikomatsakis:incr-comp-fulfillment-cache, r=arielb1
bors [Fri, 22 Jan 2016 17:09:37 +0000 (17:09 +0000)]
Auto merge of #31087 - nikomatsakis:incr-comp-fulfillment-cache, r=arielb1

This is a fix for #30741. It simplifies dep-graph tracking for trait matching. I was experimenting with having a greater resolution here, but decided to pare back to just have one dep node for "trait resolutions on trait `Foo`", which means that adding an impl to the trait `Foo` will invalidate all fns that had to do any trait matching at all on `Foo`. This seems like a reasonable starting place.

Independently, I realized I had neglected to record a dependency from trans on typeck -- this is obviously needed, since trans consumes a bunch of data structures that typeck produces (but which are not currently individually tracked) -- and because trans assumes that typeck has been done. Eventually those are going to go away and be replaced with MIR, which will be tracked, so this edge would presumably be derived automatically then, but it's an obvious enough thing to want for now.

r? @arielb1

cc @michaelwoerister -- this might indirectly fix the problem you observed with the trans cache, though it'd be nice to try and craft an independent test case for that.

8 years agoAvoid bounds check for slice binary search
arthurprs [Thu, 14 Jan 2016 20:05:00 +0000 (18:05 -0200)]
Avoid bounds check for slice binary search

8 years agoAuto merge of #31084 - ranma42:cmd-no-unsafe, r=alexcrichton
bors [Fri, 22 Jan 2016 15:18:10 +0000 (15:18 +0000)]
Auto merge of #31084 - ranma42:cmd-no-unsafe, r=alexcrichton

Instead of transmuting, use a match; the compiler has learnt how to
optimize it.

8 years agoupdate link to unwind in book
Steve Klabnik [Fri, 22 Jan 2016 14:50:43 +0000 (09:50 -0500)]
update link to unwind in book

8 years agoFix typo in "Getting Started" section of the book
Andrew Paseltiner [Fri, 22 Jan 2016 13:59:05 +0000 (08:59 -0500)]
Fix typo in "Getting Started" section of the book

Closes #31103

8 years agoAuto merge of #31080 - dhuseby:updating_libc_dep, r=alexcrichton
bors [Fri, 22 Jan 2016 13:27:22 +0000 (13:27 +0000)]
Auto merge of #31080 - dhuseby:updating_libc_dep, r=alexcrichton

this pulls in a fix for the missing O_ACCMODE that was breaking the bsd builds.

8 years agoAuto merge of #31077 - nagisa:mir-temp-promotion, r=dotdash
bors [Fri, 22 Jan 2016 11:36:50 +0000 (11:36 +0000)]
Auto merge of #31077 - nagisa:mir-temp-promotion, r=dotdash

Fixes #31002

r? @nikomatsakis

8 years agoAuto merge of #31074 - gmbonnet:stage0-libdir, r=alexcrichton
bors [Fri, 22 Jan 2016 09:46:17 +0000 (09:46 +0000)]
Auto merge of #31074 - gmbonnet:stage0-libdir, r=alexcrichton

This fixes #27254.

On a 64-bit Linux machine, for example, `configure --libdir=/usr/local/lib64` was creating both `x86_64-unknown-linux-gnu/stage0/lib/rustlib` and `x86_64-unknown-linux-gnu/stage0/lib64/rustlib`. Crates from the stage0 snapshot, like `libcore`, are extracted to `x86_64-unknown-linux-gnu/stage0/lib/rustlib`, but the stage0 compiler was attempting to find them in `x86_64-unknown-linux-gnu/stage0/lib64/rustlib`, which has the highest priority on a 64-bit system.

The issue can be fixed by creating only `x86_64-unknown-linux-gnu/stage0/lib/rustlib`, since this is the only rustlib directory needed for stage0 anyways.

8 years agoAuto merge of #31072 - arielb1:method-callee-cleanup, r=michaelwoerister
bors [Fri, 22 Jan 2016 07:55:13 +0000 (07:55 +0000)]
Auto merge of #31072 - arielb1:method-callee-cleanup, r=michaelwoerister

The old code was terribly ugly and was duplicated in several places.

r? @michaelwoerister

8 years agoExtended save-analysis to support generated code, alterned some spans in format_args...
Daniel Campbell [Thu, 21 Jan 2016 22:58:09 +0000 (11:58 +1300)]
Extended save-analysis to support generated code, alterned some spans in format_args! and derive to maintain compatability

8 years agoAuto merge of #31070 - sfackler:bufreader-box-slice, r=alexcrichton
bors [Fri, 22 Jan 2016 06:04:50 +0000 (06:04 +0000)]
Auto merge of #31070 - sfackler:bufreader-box-slice, r=alexcrichton

Saves a word, and also prevents the impl from accidentally changing the
buffer length.

r? @alexcrichton

8 years agosave-analysis: emit the right kind of variant
Nick Cameron [Fri, 22 Jan 2016 05:53:23 +0000 (18:53 +1300)]
save-analysis: emit the right kind of variant

8 years agoAuto merge of #31068 - sfackler:bufwriter-panic, r=alexcrichton
bors [Fri, 22 Jan 2016 04:13:26 +0000 (04:13 +0000)]
Auto merge of #31068 - sfackler:bufwriter-panic, r=alexcrichton

We don't want to write the same data twice.

Closes #30888

r? @alexcrichton

8 years agoAuto merge of #31064 - retep998:msvc-host-dlls, r=alexcrichton
bors [Fri, 22 Jan 2016 02:22:54 +0000 (02:22 +0000)]
Auto merge of #31064 - retep998:msvc-host-dlls, r=alexcrichton

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

r? @alexcrichton

8 years agoAuto merge of #30944 - fhahn:issue-29789-use-constant2, r=nagisa
bors [Fri, 22 Jan 2016 00:31:29 +0000 (00:31 +0000)]
Auto merge of #30944 - fhahn:issue-29789-use-constant2, r=nagisa

This PR for  #29789 uses `rustc::repr::mir::Constant` in `ExprKind::Repeat`, which seems to fit quite nicely. Is there a reason for not re-using that type?

8 years agoetc: Remove old num/libc generation code
Alex Crichton [Thu, 21 Jan 2016 22:48:18 +0000 (14:48 -0800)]
etc: Remove old num/libc generation code

8 years agoetc: Remove the mingw-fix-include directory
Alex Crichton [Thu, 21 Jan 2016 22:47:03 +0000 (14:47 -0800)]
etc: Remove the mingw-fix-include directory

This isn't used anywhere

8 years agoetc: Remove old mklldef.py script
Alex Crichton [Thu, 21 Jan 2016 22:45:53 +0000 (14:45 -0800)]
etc: Remove old mklldef.py script

The compiler has since gained better support for this, so the script is no
longer necessary

8 years agomk: Remove all perf-related targets
Alex Crichton [Thu, 21 Jan 2016 22:45:23 +0000 (14:45 -0800)]
mk: Remove all perf-related targets

I don't believe these have been used at all recently, and I doubt many of them
still work, so remove the stale support.

8 years agoAuto merge of #30882 - petrochenkov:varnamesp, r=nrc
bors [Thu, 21 Jan 2016 22:41:37 +0000 (22:41 +0000)]
Auto merge of #30882 - petrochenkov:varnamesp, r=nrc

Tuple and unit variants from other crates weren't put into type namespace.
Now variant namespacing is aligned with struct namespacing and is not affected by the variant's crate of origin (struct -> type, tuple/unit -> type/value).
Additionally, struct variants from other crates are put into value namespace (struct variants from local crate were already in it). This is not a necessity, but a future proofing measure.

This fix can result in some new shadowing errors in cross-crate scenarios, crater reports [three regressions](https://github.com/rust-lang/rust/pull/30882#issuecomment-172369883).
[breaking-change]

8 years agoAdd Debug impl and erase region for TypedConstVal
Florian Hahn [Thu, 21 Jan 2016 21:49:26 +0000 (22:49 +0100)]
Add Debug impl and erase region for TypedConstVal

8 years agoIntroduce and use TypedConstVal for Repeat
Florian Hahn [Wed, 20 Jan 2016 22:14:00 +0000 (23:14 +0100)]
Introduce and use TypedConstVal for Repeat

8 years ago[MIR] use mir::repr::Constant in ExprKind::Repeat, close #29789
Florian Hahn [Fri, 15 Jan 2016 21:44:53 +0000 (22:44 +0100)]
[MIR] use mir::repr::Constant in ExprKind::Repeat, close #29789

8 years agodoc: this sentence did not read well
Tshepang Lekhonkhobe [Thu, 21 Jan 2016 21:27:18 +0000 (23:27 +0200)]
doc: this sentence did not read well

8 years agodoc: improve grammar
Tshepang Lekhonkhobe [Thu, 21 Jan 2016 21:14:47 +0000 (23:14 +0200)]
doc: improve grammar

8 years agoAuto merge of #31052 - bluss:split-at-mut-str, r=alexcrichton
bors [Thu, 21 Jan 2016 20:51:34 +0000 (20:51 +0000)]
Auto merge of #31052 - bluss:split-at-mut-str, r=alexcrichton

Use raw pointers to avoid aliasing in str::split_at_mut

Introduce private function  from_raw_parts_mut for str to factor out the logic.

We want to use raw pointers here instead of duplicating a &mut str, to
be on safer ground w.r.t rust aliasing rules.

This has already been fixed for slices in PR #27358, issue #27357

8 years agoresolve: Fix variant namespacing
Vadim Petrochenkov [Thu, 21 Jan 2016 20:22:01 +0000 (23:22 +0300)]
resolve: Fix variant namespacing

8 years agoadd fixme
Ariel Ben-Yehuda [Thu, 21 Jan 2016 20:07:15 +0000 (22:07 +0200)]
add fixme

8 years agoRemove `unsafe` code from `core::cmp`
Andrea Canciani [Thu, 21 Jan 2016 19:20:22 +0000 (20:20 +0100)]
Remove `unsafe` code from `core::cmp`

Instead of transmuting, use a match; the compiler has learnt how to
optimize it.

8 years agoIndicate that trans is always dependent on typeck
Niko Matsakis [Thu, 21 Jan 2016 19:24:01 +0000 (14:24 -0500)]
Indicate that trans is always dependent on typeck

8 years agoRevamp the fulfillment cache tracking to only cache trait-refs, which
Niko Matsakis [Wed, 20 Jan 2016 21:56:29 +0000 (16:56 -0500)]
Revamp the fulfillment cache tracking to only cache trait-refs, which
was the major use-case, and to update the dep-graph. Other kinds of
predicates are now excluded from the cache because there is no easy way
to make a good dep-graph node for them, and because they are not
believed to be that useful. :)

Fixes #30741. (However, the test still gives wrong result for trans,
for an independent reason which is fixed in the next commit.)

8 years agotest
Nick Cameron [Wed, 20 Jan 2016 23:32:56 +0000 (12:32 +1300)]
test

8 years agotest fallout
Nick Cameron [Wed, 20 Jan 2016 23:16:59 +0000 (12:16 +1300)]
test fallout

8 years agoPrevent missing idents from causing problems down the line
Nick Cameron [Wed, 20 Jan 2016 09:29:47 +0000 (22:29 +1300)]
Prevent missing idents from causing problems down the line

8 years agoThe war on abort_if_errors
Nick Cameron [Wed, 20 Jan 2016 09:07:33 +0000 (22:07 +1300)]
The war on abort_if_errors

8 years agoSome basic error correction in the parser after a dot
Nick Cameron [Wed, 20 Jan 2016 04:15:03 +0000 (17:15 +1300)]
Some basic error correction in the parser after a dot

8 years agoAuto merge of #31028 - erickt:ast-json, r=michaelwoerister
bors [Thu, 21 Jan 2016 19:01:24 +0000 (19:01 +0000)]
Auto merge of #31028 - erickt:ast-json, r=michaelwoerister

The protocol for `serialize::{En,De}code` doesn't allow for two integers to be serialized next to each other.

Closes #31025.

cc @michaelwoerister