Commit Graph

53802 Commits

Author SHA1 Message Date
Alex Crichton
b64c9d5670 std: Clean out old unstable + deprecated APIs
These should all have been deprecated for at least one cycle, so this commit
cleans them all out.
2016-05-30 20:46:32 -07:00
bors
a967611d8f Auto merge of #33968 - srinivasreddy:slice.rs, r=Manishearth
Correct grammar; and remove redundant comment
2016-05-30 16:34:34 -07:00
Zack M. Davis
06c9e0f5f8 stable features lint warning mentions version stabilized
To accomplish this, we alter the checks in `rustc::middle::stability` to
use the `StabilityLevel` defined in `syntax::attr` (which includes the
version in which the feature was stabilized) rather than the local
`StabilityLevel` in the same module, and make the
`declared_stable_lang_features` field of
`syntax::feature_gate::Features` hold a Vec of feature-name, span
tuples (in analogy to the `declared_lib_features` field) rather than
just spans.

This is in the matter of issue #33394.
2016-05-30 15:17:13 -07:00
bors
b522b25a41 Auto merge of #33909 - michaelwoerister:frame-pointer-fix, r=nikomatsakis
Emit "no-frame-pointer-elim" attribute for closures, shims, and glue.

This will hopefully let `perf` give better backtraces.
r? @nikomatsakis
2016-05-30 11:01:55 -07:00
Srinivas Reddy Thatiparthy
87bc04f45c Correct grammar; and remove redundant comment 2016-05-30 22:38:07 +05:30
Daan Sprenkels
cde0f94a52 librustc_resolve: make sure pattern def gets recorded if resolve_path returns Err(true)
In 1a374b8, (pr #33046) fixed the error reporting of a specific
case, but the change that was introduced did not make sure that
`record_def` was called in all cases, which lead to an ICE in [1].
This change restores the original `else` case, but keeps the changes
that were committed in 1a374b8.

This commit fixes issue #33293.

[1] `rustc::middle::mem_categorization::MemCategorizationContext::cat_pattern_`
2016-05-30 18:31:01 +02:00
bors
f3bfa313ec Auto merge of #33965 - Manishearth:rollup, r=Manishearth
Rollup of 5 pull requests

- Successful merges: #33867, #33926, #33942, #33958, #33964
- Failed merges:
2016-05-30 08:13:08 -07:00
Manish Goregaokar
26c209897f Rollup merge of #33964 - Ms2ger:refcell-resolutions, r=Manishearth
Move driver::Resolutions::def_map out of its RefCell.
2016-05-30 20:35:47 +05:30
Manish Goregaokar
5ef7c43a76 Rollup merge of #33958 - kennytm:patch-1, r=GuillaumeGomez
Use Path::is_dir() in fs::read_dir()'s example.

Basically reverts #25508. The `is_dir()` function has been stable since 1.5.0.
2016-05-30 20:35:47 +05:30
Manish Goregaokar
066fc8d9a6 Rollup merge of #33942 - srinivasreddy:rustfmt_llvm_folder, r=nrc
run rustfmt on librustc_llvm folder
2016-05-30 20:35:46 +05:30
Manish Goregaokar
2b5724f0c4 Rollup merge of #33926 - jseyfried:fix_derive_span, r=nrc
Fix the span of generated `#[derive_*]` attributes

Fixes #33571.
r? @nrc
2016-05-30 20:35:46 +05:30
Manish Goregaokar
653ce3e525 Rollup merge of #33867 - oli-obk:rustdoc_variant_types, r=GuillaumeGomez
print enum variant fields in docs

Right now we are repeating enum variants at the top, because the fields aren't shown with the actual docs. It's very annoying to have to scroll up and down to have both docs and field info. For struct variants we already list the fields.

enum docs look like this after this PR:

![screenshot from 2016-05-25 14-02-42](https://cloud.githubusercontent.com/assets/332036/15539231/84b018cc-2281-11e6-9666-1063655931f4.png)

There are degenerate cases for enum tuple variants with lots of fields:

![screenshot from 2016-05-25 14-01-00](https://cloud.githubusercontent.com/assets/332036/15539260/91e537ca-2281-11e6-8bf1-a3d6b2e78f65.png)

I was thinking that we could move the docs below the variant (slightly indented) or list the variant fields vertically instead of horizontally

r? @steveklabnik
2016-05-30 20:35:46 +05:30
Oliver Schneider
b0c7033042
print enum variant fields in docs 2016-05-30 16:11:53 +02:00
Ms2ger
989a3034db Move driver::Resolutions::def_map out of its RefCell. 2016-05-30 15:17:16 +02:00
bors
5da602bda3 Auto merge of #33959 - Manishearth:rollup, r=Manishearth
Rollup of 8 pull requests

- Successful merges: #33793, #33893, #33912, #33913, #33914, #33917, #33937, #33938
- Failed merges:
2016-05-30 02:54:00 -07:00
Manish Goregaokar
9d2ec40b74 Rollup merge of #33938 - srinivasreddy:rustfmt_libunwind, r=Manishearth
run rustfmt on libunwind
2016-05-30 15:19:01 +05:30
Manish Goregaokar
21dc6c2678 Rollup merge of #33937 - srinivasreddy:rustfmt_librand, r=GuillaumeGomez
run rustfmt on librand folder
2016-05-30 15:19:01 +05:30
Manish Goregaokar
0072e6b9e3 Rollup merge of #33917 - srinivasreddy:rustfmt_liballoc, r=GuillaumeGomez
rustfmt liballoc folder
2016-05-30 15:19:00 +05:30
Manish Goregaokar
c41e9d9f40 Rollup merge of #33914 - GuillaumeGomez:improve_err_expl, r=GuillaumeGomez
Improve err expl

r? @steveklabnik
2016-05-30 15:19:00 +05:30
Manish Goregaokar
6c6dcc9539 Rollup merge of #33913 - GuillaumeGomez:improve_e0133, r=GuillaumeGomez
Improve E0133 error explanation

r? @steveklabnik
2016-05-30 15:19:00 +05:30
Manish Goregaokar
11549f0206 Rollup merge of #33912 - GuillaumeGomez:improve_E0132, r=steveklabnik
Improve E0132 error explanation

r? @steveklabnik
2016-05-30 15:19:00 +05:30
Manish Goregaokar
400b9b3242 Rollup merge of #33893 - Ophirr33:docs_string_split_fix, r=GuillaumeGomez
Added examples/docs to split in str.rs

Added documentation clarifying the behavior of split when used with the empty string and contiguous separators. Addresses issue [33882](https://github.com/rust-lang/rust/issues/33882). This is my first time contributing to rust, so forgive me if I'm skipping any of the contribution steps.
Fixes #33882
2016-05-30 15:19:00 +05:30
Manish Goregaokar
10e1e6a7a2 Rollup merge of #33793 - GuillaumeGomez:compile_fail, r=GuillaumeGomez
Fix compile_fail tag

Fixes #33780

r? @steveklabnik
2016-05-30 15:18:59 +05:30
kennytm
048f37254c Use Path::is_dir() in fs::read_dir()'s example.
Basically reverts #25508. The `is_dir()` function has been stable since 1.5.0.
2016-05-30 17:12:01 +08:00
Tobias Bucher
ef60c7cd49 Prevent the borrow counter from overflowing in Ref::clone
Fixes #33880.
2016-05-30 09:53:09 +02:00
bors
bf9c60c9a6 Auto merge of #33929 - petrochenkov:pathir, r=eddyb
Separate bindings from other patterns in HIR

Now when name resolution is done on AST, we can avoid dumping everything that looks like an identifier into `PatKind::Ident` in HIR.
`hir::PatKind::Ident` is removed, fresh bindings are now called `hir::PatKind::Binding`, everything else goes to `hir::PatKind::Path`.

I intend to do something with `PatKind::Path`/`PatKind::QPath` as well using resolution results, but it requires some audit and maybe some deeper refactoring of relevant resolution/type checking code to do it properly.
I'm submitting this part of the patch earlier to notify interested parties that I'm working on this.

cc @jseyfried
r? @eddyb
2016-05-29 21:28:50 -07:00
bors
6e00b55568 Auto merge of #33860 - doomrobo:fix-grammar-verification, r=nagisa
antlr grammar verification script now compiles under latest nightly

This is kind of a moving target, since none of libsyntax is stable, but at least this compiles for the time being.
2016-05-29 16:43:09 -07:00
Guillaume Gomez
31b9060ede Improve E0161 error explanation 2016-05-29 21:39:55 +02:00
bors
a2a8694128 Auto merge of #33859 - nrc:save-field-sub, r=pnkfelix
save-analysis: be a bit more defensive with field sub-expressions

Prevents an ice with `(...).f` since the sub-expression is in the AST but not the HIR.

We could actually do better in this specific case, but it doesn't seem worth it.
2016-05-29 11:23:00 -07:00
Guillaume Gomez
bb5a7a42b1 Add new error code tests 2016-05-29 18:51:13 +02:00
bors
8f3e8c7863 Auto merge of #33902 - flo-l:fix-save-temps, r=dotdash
save-temps was moved under the -C switch

I stumbled across this..
2016-05-29 07:01:51 -07:00
bors
aee3073bd9 Auto merge of #33934 - Byron:libsyntex-ring-buffer-size, r=pnkfelix
Prevent overflows by increasing ring buffer size

Please note that this change is just done to prevent
issues as currently seen by syntex_syntax in future.
See https://github.com/serde-rs/syntex/pull/47 for details.

As shown in https://github.com/serde-rs/syntex/issues/33,
complex code can easily overflow the ring-buffer and
cause an assertion error.
2016-05-29 03:02:46 -07:00
Srinivas Reddy Thatiparthy
593e1567ca run rustfmt on librustc_llvm folder 2016-05-29 14:57:34 +05:30
Srinivas Reddy Thatiparthy
5ed45ef354 run rustfmt on libunwind 2016-05-29 08:47:51 +05:30
Srinivas Reddy Thatiparthy
72baa41b88 run rustfmt on librand folder 2016-05-29 08:40:34 +05:30
bors
397cfaec0c Auto merge of #33848 - alexcrichton:android-gdb-sysroot, r=michaelwoerister
test: Use `set sysroot` for more NDK compatibility

Recent versions of the Android NDK no longer ship debuggers like
`arm-linux-androideabi-gdb`, but instead one prebuilt binary `gdb`. We can
symlink this into place at least to get our detection still working, but it now
needs to be told what the sysroot is so it can correctly do... something. Long
story short, tests didn't pass with this change and after this change they pass.
2016-05-28 19:19:27 -07:00
bors
7746a334da Auto merge of #33825 - alexcrichton:fix-beta, r=aturon
mk: Fix bootstrapping cross-hosts on beta

The beta builds are currently failing, unfortunately, due to what is presumably
some odd behavior with our makefiles. The wrong bootstrap key is being used to
generate the stage1 cross-compiled libraries, which fails the build.
Interestingly enough if the targets are directly specified as part of the build
then it works just fine! Just a bare `make` fails...

Instead of trying to understand what's happening in the makefiles instead just
tweak how we configure the bootstrap key in a way that's more likely to work.
2016-05-28 16:21:53 -07:00
bors
90d9a515af Auto merge of #33824 - alexcrichton:rustbuild-fix-local-rust, r=nikomatsakis
rustbuild: Add support for --enable-local-rust

This commit adds support for the `--enable-local-rust` `./configure` switch
which uses the locally installed `rustc` to bootstrap the compiler.
2016-05-28 13:24:51 -07:00
Sebastian Thiel
406378b6bb Prevent overflows by increasing ring buffer size
Please note that this change is just done to prevent
issues as currently seen by syntex_syntax in future.
See https://github.com/serde-rs/syntex/pull/47 for details.

As shown in https://github.com/serde-rs/syntex/issues/33,
complex code can easily overflow the ring-buffer and
cause an assertion error.
2016-05-28 21:29:14 +02:00
Vadim Petrochenkov
731144b95a sanity -> validation
Add test for `::super` in import prefix
2016-05-28 20:52:49 +03:00
Vadim Petrochenkov
c02c6e88e6 Move some other checks to AST sanity pass 2016-05-28 20:27:57 +03:00
Vadim Petrochenkov
2abdf96344 Add an AST sanity checking pass and use it to catch some illegal lifetime/label names 2016-05-28 20:27:57 +03:00
bors
623af22b9a Auto merge of #33821 - sanxiyn:cfg-test, r=nikomatsakis
Do not inject test harness for --cfg test

Fix #33670.
2016-05-28 10:24:01 -07:00
Vadim Petrochenkov
ae999e9c8f Address review comments 2016-05-28 19:58:06 +03:00
Vadim Petrochenkov
cf46820694 Refactor away some functions from hir::pat_util 2016-05-28 17:37:58 +03:00
bors
f1776fe244 Auto merge of #33927 - Manishearth:rollup, r=Manishearth
Rollup of 15 pull requests

- Successful merges: #33820, #33821, #33822, #33824, #33825, #33831, #33832, #33848, #33849, #33852, #33854, #33856, #33859, #33860, #33861
- Failed merges:
2016-05-28 07:22:51 -07:00
Manish Goregaokar
fe9a91589e Rollup merge of #33856 - GuillaumeGomez:fmt_error, r=alexcrichton
Implement Error trait for fmt::Error type

Fixes #33827.

r? @alexcrichton

Just one last thing: I added a feature name, but don't hesitate to ask me to change it if you think it doesn't fit well.
2016-05-28 19:52:16 +05:30
Manish Goregaokar
81aeb0cdde Rollup merge of #33854 - petrochenkov:prefvis, r=eddyb
Apply visit_path to import prefixes by default

Overriding `visit_path` is not enough to visit all paths, some import prefixes are not visited and `visit_path_list_item` need to be overridden as well. This PR removes this catch, it should be less error prone this way. Also, the prefix is visited once now, not repeatedly for each path list item.

r? @eddyb
2016-05-28 19:52:16 +05:30
Manish Goregaokar
edd7d422b7 Rollup merge of #33852 - arielb1:autoderef-iterator, r=eddyb
refactor autoderef to avoid prematurely registering obligations

Refactor `FnCtxt::autoderef` to use an external iterator and to not
register any obligation from the main autoderef loop, but rather to
register them after (and if) the loop successfully completes.

Fixes #24819
Fixes #25801
Fixes #27631
Fixes #31258
Fixes #31964
Fixes #32320
Fixes #33515
Fixes #33755

r? @eddyb
2016-05-28 19:52:16 +05:30
Manish Goregaokar
6e897d78ae Rollup merge of #33849 - ranma42:escape-iters-count, r=alexcrichton
Implement `count` for `EscapeUnicode`

and cleanup the code for `count` for `EscapeDefault` (instead of repeating the `match` for `size_hint` and `count`).

This PR marks EscapeUnicode and EscapeDefault as ExactSizeIterator. The constraints for the trait implementations held even before this PR, but I am not sure if this is something we want to guarantee/expose (I would love feedback on this, especially on what would be the appropriate way to handle stabilisation, if needed).

Part of #24214, split from #31049.

The test for `count` was added in #33103.
2016-05-28 19:52:16 +05:30