about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2016-02-27remove range lang itemsAlex Burka-10/+6
The range desugaring does not use the lang items. Hence I did not add lang items for inclusive ranges. This cleanup commit removes the old unused ones as well. Whether the desugaring _should_ use lang items is another question: see #30809. But if we decide on a strategy there we can add back these lang items, and new ones for inclusive ranges. For stage0 we need to keep the attributes as the lang items still exist even if they are never used. This is surprisingly not a breaking change. Unused #[lang] attributes do not even trigger a lint (see #30881).
2016-02-27fallout from removing hir::ExprRangeAlex Burka-217/+3
A whole bunch of stuff gets folded into struct handling! Plus, removes an ugly hack from trans and accidentally fixes a bug with constructing ranges from references (see later commits with tests).
2016-02-27HIR: add inclusive ranges, desugar all ranges (remove ExprRange)Alex Burka-5/+89
2016-02-27libsyntax: parse inclusive rangesAlex Burka-50/+81
2016-02-27core: add inclusive ranges to core::opsAlex Burka-91/+167
Since it removes the old iter::{range_inclusive, RangeInclusive} which were unstable and deprecated, this is a [breaking-change] on nightly.
2016-02-27Auto merge of #31914 - bluss:copy-from-slice-everywhere, r=alexcrichtonbors-18/+23
Use .copy_from_slice() where applicable .copy_from_slice() does the same job of .clone_from_slice(), but the former is explicitly for Copy elements and calls `memcpy` directly, and thus is it efficient without optimization too.
2016-02-26Auto merge of #31876 - ollie27:win_fill_bytes, r=brsonbors-7/+11
CryptGenRandom takes a DWORD (u32) for the length so it only supports writing u32::MAX bytes at a time. Casting the length from a usize caused truncation meaning the whole buffer was not always filled. cc #31841 This is the same as rust-lang-nursery/rand#99. I think it's a good idea to keep the implementations in sync. r? @alexcrichton
2016-02-26Auto merge of #31903 - mitaa:rdoc-ghostly-impls, r=alexcrichtonbors-11/+52
fixes #29584 r? @alexcrichton
2016-02-26Auto merge of #31858 - alexcrichton:fix-networking-cast, r=brsonbors-5/+10
Similar to #31825 where the read/write limits were capped for files, this implements similar limits when reading/writing networking types. On Unix this shouldn't affect anything because the write size is already a `usize`, but on Windows this will cap the read/write amounts to `i32::max_value`. cc #31841
2016-02-26Don't inline impls from `doc(hidden)` modulesmitaa-11/+52
2016-02-26Use .copy_from_slice() where applicableUlrik Sverdrup-18/+23
.copy_from_slice() does the same job of .clone_from_slice(), but the former is explicitly for Copy elements and calls `memcpy` directly, and thus is it efficient without optimization too.
2016-02-26fixup #31878Manish Goregaokar-1/+1
2016-02-26Rollup merge of #31904 - bluss:writer-formatter-error, r=alexcrichtonManish Goregaokar-1/+62
Make sure formatter errors are emitted by the default Write::write_fmt Previously, if an error was returned from the formatter that did not originate in an underlying writer error, Write::write_fmt would return successfully even if the formatting did not complete (was interrupted by an `fmt::Error` return). Now we choose to emit an io::Error with kind Other for formatter errors. Since this may reveal error returns from `write!()` and similar that previously passed silently, it's a kind of a [breaking-change]. Fixes #31879
2016-02-26Rollup merge of #31901 - bluss:suggest-use, r=sanxiynManish Goregaokar-9/+9
suggest: Put the `use` in suggested code inside the quotes Change import a trait suggestion from: help: candidate #1: use `std::io::Write` to help: candidate #1: `use std::io::Write` so that the code can be copied directly. Fixes #31864
2016-02-26Rollup merge of #31896 - tshepang:idiom, r=steveklabnikManish Goregaokar-1/+1
2016-02-26Rollup merge of #31894 - tshepang:more-clear, r=steveklabnikManish Goregaokar-2/+1
2016-02-26Rollup merge of #31893 - tshepang:comma, r=steveklabnikManish Goregaokar-1/+1
2016-02-26Rollup merge of #31883 - birkenfeld:doc-null-escape, r=blussManish Goregaokar-0/+4
It appears in the examples, but is not covered by any of the cases in the prose description.
2016-02-26Rollup merge of #31878 - frewsxcv:path-cleanup, r=alexcrichtonManish Goregaokar-6/+3
None
2016-02-26Auto merge of #31834 - ubsan:copy_from_slice, r=alexcrichtonbors-1/+63
implements rust-lang/rfcs#1419 r? alexcrichton
2016-02-25Add unstable copy_from_sliceNicholas Mazzuca-1/+63
2016-02-26Auto merge of #31857 - jseyfried:fix_scoping, r=nikomatsakisbors-19/+56
This fixes a bug (#31845) introduced in #31105 in which lexical scopes contain items from all anonymous module ancestors, even if the path to the anonymous module includes a normal module: ```rust fn f() { fn g() {} mod foo { fn h() { g(); // This erroneously resolves on nightly } } } ``` This is a [breaking-change] on nightly but not on stable or beta. r? @nikomatsakis
2016-02-26Make sure formatter errors are emitted by the default Write::write_fmtUlrik Sverdrup-1/+62
Previously, if an error was returned from the formatter that did not originate in an underlying writer error, Write::write_fmt would return successfully even if the formatting did not complete (was interrupted by an `fmt::Error` return). Now we choose to emit an io::Error with kind Other for formatter errors. Since this may reveal error returns from `write!()` and similar that previously passed silently, it's a kind of a [breaking-change].
2016-02-26Auto merge of #31749 - nikomatsakis:compiletest-subdir, r=alexcrichtonbors-185/+266
You can now group tests into directories like `run-pass/borrowck` or `compile-fail/borrowck`. By default, all `.rs` files within any directory are considered tests: to ignore some directory, create a placeholder file called `compiletest-ignore-dir` (I had to do this for several existing directories). r? @alexcrichton cc @brson
2016-02-26suggest: Put the `use` in suggested code inside the quotesUlrik Sverdrup-9/+9
Change import a trait suggestion from: help: candidate #1: use `std::io::Write` to help: candidate #1: `use std::io::Write` so that the code can be copied directly.
2016-02-25doc: follow the idiom of adding a trailing commaTshepang Lekhonkhobe-1/+1
2016-02-25doc: that explanation was a messTshepang Lekhonkhobe-2/+1
2016-02-25doc: add missing commaTshepang Lekhonkhobe-1/+1
2016-02-25Auto merge of #30856 - mneumann:thread_local_extern, r=alexcrichtonbors-2/+55
This will correctly add the thread_local attribute to the external static variable ```errno```: ```rust extern { #[thread_local] static errno: c_int; } ``` Before this commit, the thread_local attribute is ignored. Fixes #30795. Thanks @alexcrichton for pointing out the solution.
2016-02-25add comment and stop creating directories in runtestNiko Matsakis-1/+2
2016-02-25create the required directories while gathering tests rather than duringNiko Matsakis-0/+9
parallel execution
2016-02-25Rollup merge of #31837 - mitaa:rdoc-inherent-assoc, r=alexcrichtonManish Goregaokar-4/+34
This effectively only records associated items from either inherent impls or trait definitions in the search-index. fixes #31808 r? @alexcrichton
2016-02-25Rollup merge of #31835 - mitaa:rdoc-global-src, r=alexcrichtonManish Goregaokar-9/+36
fixes #26995 r? @alexcrichton
2016-02-25Rollup merge of #31831 - tormol:master, r=alexcrichtonManish Goregaokar-6/+6
The "A buffer that's too small" example was calling encode_utf**8**().
2016-02-25Rollup merge of #31827 - teoryn:patch-1, r=brsonManish Goregaokar-1/+1
2016-02-25Rollup merge of #31818 - GuillaumeGomez:error_display, r=brsonManish Goregaokar-2/+27
Fixes #31788
2016-02-25translate backslashes to forward slashes in the expected stringsNiko Matsakis-1/+3
2016-02-25Document the null-char/null-byte escape in the referenceGeorg Brandl-0/+4
It appears in the examples, but is not covered by any of the cases in the prose description.
2016-02-25Rollup merge of #31793 - alexcrichton:add-real-option-gating, r=nikomatsakisManish Goregaokar-116/+215
This commit adds support for *truly* unstable options in the compiler, as well as adding warnings for the start of the deprecation path of unstable-but-not-really options. Specifically, the following behavior is now in place for handling unstable options: * As before, an unconditional error is emitted if an unstable option is passed and the `-Z unstable-options` flag is not present. Note that passing another `-Z` flag does not require passing `-Z unstable-options` as well. * New flags added to the compiler will be in the `Unstable` category as opposed to the `UnstableButNotReally` category which means they will unconditionally emit an error when used on stable. * All current flags are in a category where they will emit warnings when used that the option will soon be a hard error. Also as before, it is intended that `-Z` is akin to `#![feature]` in a crate where it is required to unlock unstable functionality. A nightly compiler which is used without any `-Z` flags should only be exercising stable behavior.
2016-02-25Rollup merge of #31362 - jseyfried:fix_extern_crate_visibility, r=nikomatsakisManish Goregaokar-72/+140
This PR changes the visibility of extern crate declarations to match that of items (fixes #26775). To avoid breakage, the PR makes it a `public_in_private` lint to reexport a private extern crate, and it adds the lint `inaccessible_extern_crate` for uses of an inaccessible extern crate. The lints can be avoided by making the appropriate `extern crate` declaration public.
2016-02-24Prefer 'match' pattern guard over conditional within body.Corey Farwell-5/+2
2016-02-24Prefer `slice::get` over length check with indexing.Corey Farwell-1/+1
2016-02-25rand: Fix filling buffers 4 GiB or larger with OsRng::fill_bytes on WindowsOliver Middleton-7/+11
CryptGenRandom takes a DWORD (u32) for the length so it only supports writing u32::MAX bytes at a time. Casting the length from a usize caused truncation meaning the whole buffer was not always filled.
2016-02-24Move the borrowck run-pass/compile-fail tests into their own directoriesNiko Matsakis-0/+0
as a test.
2016-02-24Add compiletest-ignore-dir to existing subdirectories.Niko Matsakis-0/+0
2016-02-24Recurse to find test files in any subdirectory of the base path. If aNiko Matsakis-14/+46
subdirectory contains `compiletest-ignore-dir`, then ignore it.
2016-02-24Generalize from passing around a single path to the test file to passingNiko Matsakis-171/+208
around a set of paths called `TestPaths` This commit is not quite standalone; it basically contains all the borrowing plumbing bits, the interesting stuff comes in the next commit.
2016-02-25Rollup merge of #31870 - ivan:filter-explain, r=steveklabnikManish Goregaokar-4/+6
As a Rust newbie, I found the book's explanation for why the `filter` closure gets a reference very confusing, and tried to figure out why `filter` is somehow less consumptive than `map` -- but it isn't; that's controlled by `iter`/`into_iter`. I flailed around for a while until @habnabit explained it to me, and in retrospect it is quite obvious :-)
2016-02-25Rollup merge of #31868 - fhahn:capitalize-Rust, r=steveklabnikManish Goregaokar-3/+3
2016-02-25Rollup merge of #31863 - matklad:clarify-reference, r=steveklabnikManish Goregaokar-2/+2
Reference implied that use declarations may appear *only* at the top of blocks and modules, but it is not the case, and the following is valid: ```Rust fn foo() { let x = 92; use baz::bar; } ``` r? @steveklabnik