Commit Graph

49779 Commits

Author SHA1 Message Date
Robin Kruppe
a8dc1f974b Add the kind of input from #31109 to the expensive tests (not run by default) 2016-02-04 16:27:22 +01:00
Robin Kruppe
25c9ac3280 Use the right target ratio in Algorithm M quickstart.
Using f64's bit size probably wasn't actually *wrong*, but it would overshoot for no reason. This might have slowed down f32 parsing significantly.
2016-02-04 16:24:23 +01:00
bors
13b5edab63 Auto merge of #30402 - jooert:prettypanic, r=alexcrichton
This splits the output of panics into two lines as proposed in #15239 and adds a
note about how to get a backtrace. Because the default panic message consists of
multiple lines now, this changes the test runner's failure output to not indent
the first line anymore.

Fixes #15239 and fixes #11704.
2016-01-26 16:50:27 +00:00
bors
5d6e8fceda Auto merge of #31214 - Manishearth:rollup, r=Manishearth
- Successful merges: #31172, #31177, #31211
- Failed merges:
2016-01-26 13:26:08 +00:00
Manish Goregaokar
b6faae11f4 Rollup merge of #31211 - Manishearth:pr-30765, r=nrc
r? @eddyb or @nrc
2016-01-26 18:55:39 +05:30
Manish Goregaokar
ef96037f7e Rollup merge of #31177 - alexcrichton:no-stdio, r=sfackler
On all platforms, reading from stdin where the actual stdin isn't present should
return 0 bytes as having been read rather than the entire buffer.

On Windows, handle the case where we're inheriting stdio handles but one of them
isn't present. Currently the behavior is to fail returning an I/O error but
instead this commit corrects it to detecting this situation and propagating the
non-set handle.

Closes #31167
2016-01-26 18:55:39 +05:30
Manish Goregaokar
e9617dd0b8 Rollup merge of #31172 - SimonSapin:patch-17, r=sfackler
The previous example did not do what its description said. In it panicked on integer overflow in debug mode, and went into an infinite loop in release mode (wrapping back to 0 after printing 254).
2016-01-26 18:55:39 +05:30
Simon Sapin
70d4f263ba RangeFrom::step_by docs: fix example
The previous example did not do what its description said. In it panicked on integer overflow in debug mode, and went into an infinite loop in release mode (wrapping back to 0 after printing 254).
2016-01-26 14:23:38 +01:00
bors
43c1a173a8 Auto merge of #31105 - jseyfried:fix_lexical_scoping, r=nrc
This fixes #23880, a scoping bug in which items in a block are shadowed by local variables and type parameters that are in scope.

After this PR, an item in a block will shadow any local variables or type parameters above the item in the scope hierarchy. Items in a block will continue to be shadowed by local variables in the same block (even if the item is defined after the local variable).

This is a [breaking-change]. For example, the following code breaks:
```rust
fn foo() {
    let mut f = 1;
    {
        fn f() {}
        f += 1; // This will resolve to the function instead of the local variable
    }
}
2016-01-26 11:24:18 +00:00
Johannes Oertel
c07413c204 Add message about RUST_BACKTRACE to default output of panic!
The note will only be shown on the first panic.
2016-01-26 10:37:12 +01:00
bors
1972c50b9e Auto merge of #31160 - nxnfufunezn:ppwild-31073, r=eddyb
Fixes #31073
r? @eddyb
2016-01-26 09:33:18 +00:00
Manish Goregaokar
065e47eb3b Improve error message for let-in-expr-position 2016-01-26 13:55:46 +05:30
Manish Goregaokar
d829019ff4 Make emitter handle DUMMY_SP correctly 2016-01-26 13:49:21 +05:30
bors
acf4aeeda0 Auto merge of #31210 - Manishearth:rollup, r=Manishearth
- Successful merges: #31152, #31184, #31189, #31192, #31197, #31199, #31201
- Failed merges:
2016-01-26 07:42:10 +00:00
Manish Goregaokar
79157b3fb5 Rollup merge of #31201 - steveklabnik:gh30633, r=alexcrichton
Fixes #30633
2016-01-26 13:11:58 +05:30
Manish Goregaokar
486fd89b34 Rollup merge of #31199 - steveklabnik:gh31181, r=Manishearth
Fixes #31181
2016-01-26 13:11:58 +05:30
Manish Goregaokar
24931a32e8 Rollup merge of #31197 - apasel422:issue-31195, r=steveklabnik
Closes #31195

r? @steveklabnik
2016-01-26 13:11:57 +05:30
Manish Goregaokar
37b48edb53 Rollup merge of #31192 - frewsxcv:patch-27, r=alexcrichton 2016-01-26 13:11:57 +05:30
Manish Goregaokar
74ef5aa45c Rollup merge of #31189 - ollie27:book_links, r=steveklabnik
r? @steveklabnik
2016-01-26 13:11:57 +05:30
Manish Goregaokar
ced313cf19 Rollup merge of #31184 - arielb1:remove-implicator, r=nikomatsakis
it is pre-RFC1214 junk and completely useless.

r? @nikomatsakis
2016-01-26 13:11:57 +05:30
Manish Goregaokar
b46bd2fb29 Rollup merge of #31152 - durka:ty-follow-bracket, r=pnkfelix
cc #31135 rust-lang/rfcs#1462 #30923 @retep998
r? @pnkfelix
2016-01-26 13:11:57 +05:30
Jeffrey Seyfried
faf0852fc1 Resolve: fix #23880, a scoping bug
This fixes a bug in which items in a block are shadowed by local variables and type parameters that are in scope.
It is a [breaking-change]. For example, the following code breaks:

```rust
fn foo() {
    let mut f = 1;
    {
        fn f() {}
        f += 1; // This will now resolve to the function instead of the local variable
    }
}
```

Any breakage can be fixed by renaming the item that is no longer shadowed.
2016-01-26 04:16:58 +00:00
Steve Klabnik
2d0e4ed0aa Describe next_back() wrt Iterator protocol
Fixes #30633
2016-01-25 22:37:00 -05:00
Steve Klabnik
6c56260b30 Mention the need for a linker
Fixes #31181
2016-01-25 22:26:56 -05:00
Andrew Paseltiner
b3ebe949e2 Fix typo in "Loops" section of the book
Closes #31195
2016-01-25 21:33:23 -05:00
Alex Crichton
fee457d3af std: Fix some behavior without stdio handles
On all platforms, reading from stdin where the actual stdin isn't present should
return 0 bytes as having been read rather than the entire buffer.

On Windows, handle the case where we're inheriting stdio handles but one of them
isn't present. Currently the behavior is to fail returning an I/O error but
instead this commit corrects it to detecting this situation and propagating the
non-set handle.

Closes #31167
2016-01-25 17:48:27 -08:00
bors
faf6d1e873 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.
2016-01-26 00:42:08 +00:00
Corey Farwell
a19353643b RefCell::borrow_mut example should demonstrate mut 2016-01-25 17:24:45 -05:00
bors
eceb96b40d Auto merge of #31097 - DanielJCampbell:SaveAnalysis, r=nrc
Also altered the format_args! syntax extension, and \#[derive(debug)], to maintain compatability.
r? @ nrc
2016-01-25 20:41:44 +00:00
Oliver Middleton
ace39cbc15 Replace link to learn-rust in the book
It was removed in #30595.
Also delete the old learn-rust.md.
2016-01-25 18:40:28 +00:00
Oliver Middleton
03681b16ce Fix link to hello-cargo in the book
It was moved in #29538.
2016-01-25 18:34:34 +00:00
Nick Cameron
43b3681588 Fix a rebasing issue and addressed reviewer comment 2016-01-26 07:00:18 +13:00
bors
62a3a6ecc0 Auto merge of #30899 - oli-obk:non-local-const-fn, r=pnkfelix
Also got rid of some code repetition in `const_eval`
2016-01-25 16:42:41 +00:00
nxnfufunezn
014fc0235a Fix pretty_printer to print omitted type _ marker 2016-01-25 21:36:06 +05:30
Daan Sprenkels
1745153eae do not additionally note about unexpected identifier after unexpected let
error, by moving unexpected let check into the proper if-else clause
2016-01-25 20:56:13 +05:30
Daan Sprenkels
2b1e273293 Update qquote.rs test case and make unexpected let error fatal 2016-01-25 20:56:12 +05:30
Daan Sprenkels
79f2cff44e libsyntax: move check for keyword Let to a more logical spot 2016-01-25 20:56:10 +05:30
Daan Sprenkels
082c03b078 libsyntax: note that let a = (let b = something) is invalid
in parse_bottom_expr (parser.rs)
2016-01-25 20:52:53 +05:30
Ariel Ben-Yehuda
e0fd9c3b00 remove implicator
it is pre-RFC1214 junk
2016-01-25 15:17:31 +02:00
bors
86ffe5d18f Auto merge of #31182 - adrianheine:master, r=pnkfelix
In 95d904625b 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: … */ {
  …
}
```
2016-01-25 12:41:19 +00:00
bors
c22cb5359f 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:

f9d4149c29

which was part of this pull request:

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

Consider the following two lines from that commit:

f9d4149c29 (diff-a3b24dbe2ea7c1981f9ac79f9745f40aL462)

f9d4149c29 (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
2016-01-25 09:37:11 +00:00
Adrian Heine
71656d2e6f librustc/middle/dataflow.rs: Debug to STDERR
In 95d904625b 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: … */ {
  …
}
```
2016-01-25 10:04:57 +01:00
Corey Farwell
d9426210b1 Register LLVM passes with the correct LLVM pass manager.
LLVM was upgraded to a new version in this commit:

f9d4149c29

which was part of this pull request:

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

Consider the following two lines from that commit:

f9d4149c29 (diff-a3b24dbe2ea7c1981f9ac79f9745f40aL462)

f9d4149c29 (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
2016-01-25 00:15:39 -05:00
bors
6866f1361d 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.
2016-01-25 01:16:45 +00:00
bors
ba356ffbc4 Auto merge of #31166 - geofft:process-comments, r=alexcrichton
The implementation changed in 33a2191d, but the comments did not change to match.

r? @alexcrichton
2016-01-24 23:27:10 +00:00
bors
4043c0247e Auto merge of #31093 - tshepang:misc-doc-improvements, r=steveklabnik 2016-01-24 20:13:14 +00:00
bors
289020b21c 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.
2016-01-24 18:09:51 +00:00
Geoffrey Thomas
73854b1619 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.
2016-01-24 11:18:02 -05:00
bors
5a81d9aa6d Auto merge of #30932 - arielb1:raw-const-errors, r=nagisa
Fixes #30705

r? @nagisa
2016-01-24 15:16:20 +00:00
Ariel Ben-Yehuda
47593dade7 Improve the error explanations for check_const
Fixes #30705
2016-01-24 17:16:04 +02:00