Commit Graph

38237 Commits

Author SHA1 Message Date
GuillaumeGomez
8b12d3ddf9 Libsyntax has been updated 2015-02-06 11:59:10 +01:00
GuillaumeGomez
12f1f4c546 Update HEAD:master 2015-02-06 11:59:10 +01:00
GuillaumeGomez
d58c0a7597 Replace the get method by the deref one on InternedString 2015-02-06 11:59:10 +01:00
GuillaumeGomez
966e6c0c37 Add Str trait to InternedString, set get method deprecated 2015-02-06 11:59:09 +01:00
Manish Goregaokar
703364f214 Rollup merge of #21968 - nikomatsakis:issue-21965-duplicate-preds-in-env, r=pnkfelix
We were already building a hashset to check for duplicates, but we assumed that the initial vector had no duplicates. Fixes #21965.

r? @pnkfelix
2015-02-06 16:21:13 +05:30
Manish Goregaokar
dfc92656e5 Rollup merge of #21966 - scialex:fix-extern, r=alexcrichton
Also added test for it.

Fixes #21928
2015-02-06 16:21:12 +05:30
Manish Goregaokar
8e4c00b939 Rollup merge of #21958 - brson:stable-features, r=alexcrichton
....

The 'stable_features' lint helps people progress from unstable to
stable Rust by telling them when they no longer need a `feature`
attribute because upstream Rust has declared it stable.

This compares to the existing 'unstable_features' lint, which is used
to implement feature staging, and triggers on *any* use
of `#[feature]`.
2015-02-06 16:21:11 +05:30
Manish Goregaokar
6c28ad61a2 Rollup merge of #21926 - mzabaluev:raw-lifetime, r=alexcrichton
New functions, `slice::from_raw_parts` and `slice::from_raw_parts_mut`,
are added to implement the lifetime convention as agreed in rust-lang/rfcs#556.
The functions `slice::from_raw_buf` and `slice::from_raw_mut_buf` are
left deprecated for the time being.

Holding back on changing the signature of `std::ffi::c_str_to_bytes` as consensus in rust-lang/rfcs#592 is building to replace it with a composition of other functions.

Contribution to #21923.
2015-02-06 16:21:10 +05:30
Manish Goregaokar
f6d08b0b17 Rollup merge of #21969 - Gankro:collections-cleanup, r=alexcrichton
This is 99% burning ints to the ground, but I also got rid of useless annotations or made code more \"idiomatic\" as I went along. Mostly changes in tests.
2015-02-06 16:21:09 +05:30
Manish Goregaokar
60cb151be0 Rollup merge of #21924 - steveklabnik:fix_try_docs, r=huonw
This is now a Result, not an Option.
2015-02-06 16:21:09 +05:30
Manish Goregaokar
67b51291f0 Rollup merge of #21925 - sfackler:allow-missing-copy, r=alexcrichton
This was particularly helpful in the time just after OIBIT's
implementation to make sure things that were supposed to be Copy
continued to be, but it's now creates a lot of noise for types that
intentionally don't want to be Copy.

r? @alexcrichton
2015-02-06 16:21:08 +05:30
Manish Goregaokar
cfae247ce0 Rollup merge of #21941 - dotdash:with_cond_false, r=Aatch
Currently \"k / 2\" generates one (k: uint) or two (k: int) \"br false,
...\" instructions and the corresponding basic blocks, producing quite
some noise and making the code unnecessarily hard to read.

Additionally we can skip translation if the code would end up
unreachable anyway.
2015-02-06 16:21:08 +05:30
Manish Goregaokar
d1a1d339ef Rollup merge of #21951 - Gankro:entry, r=aturon
This also removes two erroneous re-exports of the Entry variants, and so is incidentally a [breaking-change], though presumably no one should have been using those.

r? @aturon
2015-02-06 16:21:07 +05:30
Manish Goregaokar
08a2bef632 Rollup merge of #21954 - jbcrail:fix-misspelled-comments, r=steveklabnik
The spelling corrections were made in both documentation comments and
regular comments.
2015-02-06 16:21:06 +05:30
Manish Goregaokar
6bf0cd8f00 Rollup merge of #21955 - jbcrail:fix-test-comments, r=steveklabnik
Just spelling corrections.
2015-02-06 16:21:05 +05:30
Manish Goregaokar
efdf16b72f Rollup merge of #21964 - semarie:openbsd-env, r=alexcrichton
- add `_SC_GETPW_R_SIZE_MAX` constant
- declare `struct passwd`
- convert `load_self` to `current_exe`

Note: OpenBSD don't provide system function to return a valuable Path
for `env::current_exe`. The implementation is currently based on the
value of `argv[0]`, which couldn't be used when executable is called via
PATH.
2015-02-06 16:21:05 +05:30
Manish Goregaokar
5c172ad03c Rollup merge of #21976 - mzabaluev:fix-copy-mut-lifetime, r=alexcrichton
Part of #21923
2015-02-06 16:21:04 +05:30
Manish Goregaokar
ce3a4afd73 Rollup merge of #21980 - pnkfelix:more-robust-span-to-snippet, r=huonw
This can be considered partial work on #8256.

The main observable change: macro expansion sometimes results in spans where `lo > hi`; so for now, when we have such a span, do not attempt to return a snippet result.

(Longer term, we might think about whether we could still present a snippet for the cases where this arises, e.g. perhaps by showing the whole macro as the snippet, assuming that is the sole cause of such spans; or by somehow looking up the closest AST node that holds both `lo` and `hi`, and showing that.)

As a drive-by, revised the API to return a `Result` rather than an `Option`, with better information-packed error value that should help us (and maybe also our users) identify the causes of such problems in the future.  Ideally the call-sites that really want an actual snippet would be updated to catch the newly added `Err` case and print something meaningful about it, but that is not part of this PR.
2015-02-06 16:21:03 +05:30
Manish Goregaokar
60c9f56070 Rollup merge of #21981 - pnkfelix:improve-compile-test-malformed-option-handling, r=huonw
improve `compiletest` error message when path option missing.

I often run `compiletest` by hand by cut-and-pasting from what `make` runs, (which I observe via `remake --trace`), but then I need to tweak it (cut out options) and its useful to be told when I have removed an option that is actually required, such as `--android-cross-path=path`.)
2015-02-06 16:21:03 +05:30
Manish Goregaokar
05e45d094e Rollup merge of #21983 - pnkfelix:eschew-untyped-arena-in-regions-mock-tcx, r=huonw
Ported regions-mock-tcx to use TypedArena rather than Arena since it holds cyclic structure (which the Arena API updated for the Drop-Check-Rule cannot handle).

Plus, the use of `arena::Arena` here really is not justified; the allocated values are all the same type anyway.
2015-02-06 16:21:03 +05:30
Manish Goregaokar
114324f2ba Rollup merge of #21986 - LeoTestard:identical-statics, r=eddyb
Creating two identical static expressions involving casts of pointers to arrays
caused an assertion failure in librustc_trans.

cc @eddyb
2015-02-06 16:21:02 +05:30
Manish Goregaokar
cad96b541c Rollup merge of #21987 - pnkfelix:eschew-arena-in-variance-analysis, r=huonw
Use a TypedArena rather than an Arena for the backing storage of variance analysis.

(The code was not using the main feature of Arena in the first place, since all of the `alloc` calls were on the same type.)
2015-02-06 16:21:02 +05:30
Tom Jakubowski
abae840f45 rustdoc: Show non-Rust ABIs on methods
Fix #21621
2015-02-06 01:02:15 -08:00
Tom Jakubowski
43b8503568 rustdoc: Clean up some htmldocck tests
Fix #21740
2015-02-05 23:54:11 -08:00
Junseok Lee
310ada06f2 added example back in, with a modified, (hopefully) improved description 2015-02-05 23:50:51 -08:00
Junseok Lee
b6544fd352 removed weird example 2015-02-05 23:50:51 -08:00
bors
f3573aa834 Auto merge of #21609 - GarrettHeel:master, r=steveklabnik
Now that it's no longer feature gated, add docs for wildcard syntax.
2015-02-06 05:52:20 +00:00
Steve Klabnik
7d4f068919 Only accept xelatex for building PDF docs
None of the others work, so let's remove them.

Fixes #17220.
2015-02-05 23:21:12 -05:00
Kevin Yap
3df2fbe18e Fix name of variable referenced in featureck.py 2015-02-05 20:13:08 -08:00
bors
715f9a5e8d Auto merge of #21947 - bluss:full-range-syntax, r=brson
Implement step 1 of rust-lang/rfcs#702

Allows the expression `..` (without either endpoint) in general, can be
used in slicing syntax `&expr[..]` where we previously wrote `&expr[]`.

The old syntax &expr[] is not yet removed or warned for.
2015-02-06 03:11:34 +00:00
Steve Klabnik
ef0bbaac6b Mention the queueueue-ness of mpsc.
Fixes #21915
2015-02-05 22:07:47 -05:00
Potpourri
8e3df865cc Improve error message, when found staticlib instead crate 2015-02-06 04:41:49 +03:00
Kevin Yap
00d1873c47 Use for instead of while in ascii.rs tests 2015-02-05 17:23:03 -08:00
Steve Klabnik
ccb513e582 Improve ptr::read docs
Fixes #21491
2015-02-05 19:57:28 -05:00
Leo Testard
47c2091f26 Fix an ICE when translating some static expressions.
Creating two identical static expressions involving casts of pointers to arrays
caused an assertion failure in librustc_trans.
2015-02-06 00:25:32 +01:00
Alexis
15fb06d730 remove int_uint feature from libcollections 2015-02-05 18:25:03 -05:00
Alexis
1420cebebd remove unecessary lifetimes from a bunch of collections code 2015-02-05 18:25:03 -05:00
Alexis
e250fe388b misc collections code cleanup 2015-02-05 18:22:03 -05:00
bors
706be5ba1f Auto merge of #21619 - brson:featureck-tidy, r=alexcrichton
Builds on my [feature staging PR](https://github.com/rust-lang/rust/pull/21248) to clean up the tidy scripts a bit, and make them much faster (6s vs ~40s).

Adds make rules 'tidy-basic', 'tidy-binaries', 'tidy-errors' and 'tidy-features'.

This is the output of `make tidy` here:

```
cfg: version 1.0.0-dev (a8c878d41 2015-01-25 01:49:14 -0800)
cfg: build triple x86_64-unknown-linux-gnu
cfg: host triples x86_64-unknown-linux-gnu
cfg: target triples x86_64-unknown-linux-gnu
cfg: host for x86_64-unknown-linux-gnu is x86_64
cfg: os for x86_64-unknown-linux-gnu is unknown-linux-gnu
cfg: good valgrind for x86_64-unknown-linux-gnu is 1
cfg: using CC=gcc (CFG_CC)
cfg: enabling valgrind run-pass tests (CFG_ENABLE_VALGRIND_RPASS)
cfg: valgrind-rpass command set to "/usr/bin/valgrind" --error-exitcode=100 --soname-synonyms=somalloc=NONE --quiet --suppressions=/home/brian/dev/rust3/src/etc/x86.supp  --tool=memcheck --leak-check=full
cfg: no lualatex found, deferring to xelatex
cfg: no xelatex found, deferring to pdflatex
cfg: no pdflatex found, disabling LaTeX docs
cfg: no pandoc found, omitting PDF and EPUB docs
cfg: including test rules
cfg: javac not available, skipping lexer test...
check: formatting

* linted .rs files: 4948
* linted .py files: 27
* linted .js files: 2
* linted .sh files: 5
* linted .pl files: 0
* linted .c files: 28
* linted .h files: 3
* other linted files: 0
* total lines of code: 481217
* total non-blank lines of code: 423682

check: binaries
check: extended errors

* 249 error codes
* highest error code: E0315

check: feature sanity

* advanced_slice_patterns         lang    unstable    None    
* alloc                           lib     unstable    None    
* asm                             lang    unstable    None    
* associated_types                lang    stable      1.0.0   
* box_syntax                      lang    unstable    None    
* collections                     lib     unstable    None    
* concat_idents                   lang    unstable    None    
* core                            lib     unstable    None    
* default_type_params             lang    stable      1.0.0   
* globs                           lang    stable      1.0.0   
* hash                            lib     unstable    None    
* if_let                          lang    stable      1.0.0   
* import_shadowing                lang    unstable    None    
* int_uint                        lang    unstable    None    
* intrinsics                      lang    unstable    None    
* io                              lib     unstable    None    
* issue_5723_bootstrap            lang    stable      1.0.0   
* lang_items                      lang    unstable    None    
* link_args                       lang    unstable    None    
* link_llvm_intrinsics            lang    unstable    None    
* linkage                         lang    unstable    None    
* log_syntax                      lang    unstable    None    
* macro_rules                     lang    stable      1.0.0   
* main                            lang    unstable    None    
* managed_boxes                   lang    unstable    None    
* non_ascii_idents                lang    unstable    None    
* old_impl_check                  lang    unstable    None    
* old_orphan_check                lang    unstable    None    
* on_unimplemented                lang    unstable    None    
* opt_out_copy                    lang    unstable    None    
* optin_builtin_traits            lang    unstable    None    
* os                              lib     unstable    None    
* path                            lib     unstable    None    
* phase                           lang    unstable    None    
* plugin                          lang    unstable    None    
* plugin_registrar                lang    unstable    None    
* quad_precision_float            lang    unstable    None    
* quote                           lang    unstable    None    
* rand                            lib     unstable    None    
* rust1                           lib     stable      1.0.0   
* rustc_diagnostic_macros         lang    unstable    None    
* rustc_private                   lib     unstable    None    
* rustdoc                         lib     unstable    None    
* simd                            lang    unstable    None    
* simd_ffi                        lang    unstable    None    
* slicing_syntax                  lang    unstable    None    
* staged_api                      lang    unstable    None    
* start                           lang    unstable    None    
* std_misc                        lib     unstable    None    
* struct_inherit                  lang    unstable    None    
* struct_variant                  lang    stable      1.0.0   
* test                            lib     unstable    None    
* test_accepted_feature           lang    stable      1.0.0   
* test_removed_feature            lang    unstable    None    
* thread_local                    lang    unstable    None    
* trace_macros                    lang    unstable    None    
* tuple_indexing                  lang    stable      1.0.0   
* unboxed_closures                lang    unstable    None    
* unicode                         lib     unstable    None    
* unsafe_destructor               lang    unstable    None    
* visible_private_types           lang    unstable    None    
* while_let                       lang    stable      1.0.0   
```

There's a lot of informational output now, which comes after things like 'NOTE's.
2015-02-05 23:14:28 +00:00
Felix S. Klock II
50c6742113 Use a TypedArena rather than an Arena for the backing storage of variance analysis.
(The code was not using the main feature of Arena in the first place,
since all of the `alloc` calls were on the same type.
2015-02-06 00:14:17 +01:00
Felix S. Klock II
b445bf2bd1 make for PAT in ITER_EXPR { ... } a terminating-scope for ITER_EXPR.
In effect, temporary anonymous values created during the evaluation of
ITER_EXPR no longer not live for the entirety of the block surrounding
the for-loop; instead they only live for the extent of the for-loop
itself, and no longer.

----

There is one case I know of that this breaks, demonstrated to me by
niko (but it is also a corner-case that is useless in practice).  Here
is that case:

```
fn main() {
    let mut foo: Vec<&i8> = Vec::new();
    for i in &[1, 2, 3] { foo.push(i) }
}
```

Note that if you add any code following the for-loop above, or even a
semicolon to the end of it, then the code will stop compiling (i.e.,
it gathers a vector of references but the gathered vector cannot
actually be used.)

(The above code, despite being useless, did occur in one run-pass test
by accident; that test is updated here to accommodate the new
striction.)

----

So, technically this is a:

[breaking-change]
2015-02-06 00:07:37 +01:00
Felix S. Klock II
e4a678ddab Ported regions-mock-tcx to use TypedArena rather than Arena since it holds
cyclic structure (which the Arena API updated for dropck cannot handle).
2015-02-06 00:04:32 +01:00
Felix S. Klock II
576ba8fe57 Extend region-inference graphviz rendering with enclosing relationship
as well as the constraint edges.
2015-02-06 00:01:28 +01:00
Felix S. Klock II
1e8e7dcdd0 improve compiletest error message when path option missing.
(I often run `compiletest` by hand by cut-and-pasting from what `make`
runs, but then I need to tweak it (cut out options) and its useful to
be told when I have removed an option that is actually required, such
as `--android-cross-path=path`.)
2015-02-05 23:58:32 +01:00
Felix S. Klock II
fa9d2230a6 make codemap more robust in face of ill-formed spans.
This can be considered partial work on #8256.

The main observable change: macro expansion sometimes results in spans
where `lo > hi`; so for now, when we have such a span, do not attempt
to return a snippet result.

(Longer term, we might think about whether we could still present a
snippet for the cases where this arises, e.g. perhaps by showing the
whole macro as the snippet, assuming that is the sole cause of such
spans; or by somehow looking up the closest AST node that holds both
`lo` and `hi`, and showing that.)

As a drive-by, revised the API to return a `Result` rather than an
`Option`, with better information-packed error value that should help
us (and maybe also our users) identify the causes of such problems in
the future.  Ideally the call-sites that really want an actual snippet
would be updated to catch the newly added `Err` case and print
something meaningful about it, but that is not part of this PR.
2015-02-05 23:47:17 +01:00
Brian Anderson
d0e82a68a9 Tidy fixes 2015-02-05 14:38:56 -08:00
Brian Anderson
3454c504cf Address review feedback 2015-02-05 14:37:17 -08:00
Brian Anderson
1364919b6c mk: Print test summary after tidy when running 'make check' 2015-02-05 14:37:17 -08:00
Brian Anderson
68ddd73257 testparser has long lines 2015-02-05 14:37:16 -08:00
Brian Anderson
4368f6161c mk: Add version number to output. Useful for logs 2015-02-05 14:37:16 -08:00