Commit Graph

50732 Commits

Author SHA1 Message Date
Ulrik Sverdrup
63c4065af0 Use raw pointer casts for slice, str's .as_ptr()
We can now use raw pointer casts `*const [T] as *const T` and
`*const str as *const u8` instead of .repr() for getting the
pointer out of a slice.
2016-03-01 22:30:18 +01:00
bors
09130044ce Auto merge of #31834 - ubsan:copy_from_slice, r=alexcrichton
implements rust-lang/rfcs#1419

r? alexcrichton
2016-02-26 09:16:03 +00:00
Nicholas Mazzuca
e12b1f9424 Add unstable copy_from_slice 2016-02-25 21:20:41 -08:00
bors
9c6a0088fb Auto merge of #31857 - jseyfried:fix_scoping, r=nikomatsakis
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-26 04:38:28 +00:00
bors
15e9a95a4b Auto merge of #31749 - nikomatsakis:compiletest-subdir, r=alexcrichton
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-26 00:53:38 +00:00
bors
798ce4ab59 Auto merge of #30856 - mneumann:thread_local_extern, r=alexcrichton
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-25 20:37:38 +00:00
Niko Matsakis
d21434c9ca add comment and stop creating directories in runtest 2016-02-25 14:41:52 -05:00
Niko Matsakis
a04b4b6213 create the required directories while gathering tests rather than during
parallel execution
2016-02-25 14:40:26 -05:00
bors
c9852e2e55 Auto merge of #31882 - Manishearth:rollup, r=Manishearth
- Successful merges: #31362, #31793, #31800, #31809, #31818, #31827, #31831, #31835, #31837, #31846
- Failed merges:
2016-02-25 09:38:51 +00:00
Manish Goregaokar
e584a492f3 Rollup merge of #31837 - mitaa:rdoc-inherent-assoc, r=alexcrichton
This effectively only records associated items from either inherent impls or trait definitions in the search-index.

fixes #31808

r? @alexcrichton
2016-02-25 15:06:07 +05:30
Manish Goregaokar
6078a86e2d Rollup merge of #31835 - mitaa:rdoc-global-src, r=alexcrichton
fixes #26995

r? @alexcrichton
2016-02-25 15:06:07 +05:30
Manish Goregaokar
39f41c64f9 Rollup merge of #31831 - tormol:master, r=alexcrichton
The "A buffer that's too small" example was calling encode_utf**8**().
2016-02-25 15:06:07 +05:30
Manish Goregaokar
4cfa2ee2f1 Rollup merge of #31827 - teoryn:patch-1, r=brson 2016-02-25 15:06:06 +05:30
Manish Goregaokar
7731cdc18c Rollup merge of #31818 - GuillaumeGomez:error_display, r=brson
Fixes #31788
2016-02-25 15:06:06 +05:30
Niko Matsakis
588d5d1e3d translate backslashes to forward slashes in the expected strings 2016-02-25 03:26:41 -05:00
Manish Goregaokar
db86810a60 Rollup merge of #31800 - alexcrichton:armv6-plz, r=brson
Right now the compiler's we're using actually default to armv7/thumb2 I believe,
so this should help push them back to what the arm-unknown-linux-* targets are
for. This at least matches that clang does for the `arm-unknown-linux-gnueabihf`
target which is to map it to an armv6 architecture.

Closes #31787
2016-02-25 11:41:01 +05:30
Manish Goregaokar
05485be02f Rollup merge of #31793 - alexcrichton:add-real-option-gating, r=nikomatsakis
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-25 11:41:01 +05:30
Manish Goregaokar
a48f95879d Rollup merge of #31362 - jseyfried:fix_extern_crate_visibility, r=nikomatsakis
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-25 11:41:01 +05:30
Niko Matsakis
6660ad6f8d Move the borrowck run-pass/compile-fail tests into their own directories
as a test.
2016-02-24 18:40:39 -05:00
Niko Matsakis
1c850d8448 Add compiletest-ignore-dir to existing subdirectories. 2016-02-24 18:40:39 -05:00
Niko Matsakis
c1ec32d4f7 Recurse to find test files in any subdirectory of the base path. If a
subdirectory contains `compiletest-ignore-dir`, then ignore it.
2016-02-24 18:40:39 -05:00
Niko Matsakis
7c2e5e35a6 Generalize from passing around a single path to the test file to passing
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-24 18:40:38 -05:00
bors
f6f050d090 Auto merge of #31873 - Manishearth:rollup, r=Manishearth
- Successful merges: #31677, #31784, #31839, #31842, #31843, #31850, #31863, #31868, #31870
- Failed merges:
2016-02-24 22:58:28 +00:00
Manish Goregaokar
b660ca59ff Rollup merge of #31870 - ivan:filter-explain, r=steveklabnik
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-25 04:21:11 +05:30
Manish Goregaokar
a834cd1b70 Rollup merge of #31868 - fhahn:capitalize-Rust, r=steveklabnik 2016-02-25 04:21:11 +05:30
Manish Goregaokar
f28677506c Rollup merge of #31863 - matklad:clarify-reference, r=steveklabnik
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
2016-02-25 04:21:11 +05:30
Manish Goregaokar
901eca9e6c Rollup merge of #31850 - GuillaumeGomez:vec-doc, r=steveklabnik
r? @steveklabnik
cc @mbrubeck
2016-02-25 04:21:11 +05:30
Manish Goregaokar
b28debd91c Rollup merge of #31843 - Wafflespeanut:bool_docs, r=steveklabnik
fixes #29332

r? @steveklabnik
2016-02-25 04:21:10 +05:30
Manish Goregaokar
ac02f9c18d Rollup merge of #31842 - dileepbapat:master, r=alexcrichton
I have made changes and built it after that. Please advise,

https://github.com/rust-lang/rust/issues/31820
2016-02-25 04:21:10 +05:30
Manish Goregaokar
2e89dee639 Rollup merge of #31839 - mitaa:rdoc-idx-self, r=alexcrichton
fixes #31598

r? @alexcrichton
2016-02-25 04:21:10 +05:30
Manish Goregaokar
27990edb52 Rollup merge of #31784 - urschrei:chunks_doc, r=steveklabnik
Closes #31773

r? @steveklabnik
2016-02-25 04:21:10 +05:30
Manish Goregaokar
e928297a3b Rollup merge of #31677 - ivan:doc-vtable, r=steveklabnik
I sure hope this fix is right

cc @steveklabnik
2016-02-25 04:21:10 +05:30
Guillaume Gomez
df33fc352d Add more explanation on vec type 2016-02-24 21:47:58 +01:00
Ivan Kozik
7042c8ef8d book: Explain better why the filter closure gets a reference 2016-02-24 20:09:01 +00:00
Alex Crichton
1282833470 rustc: Refactor how unstable flags are handled
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-24 11:01:29 -08:00
Florian Hahn
145190bd2a Capitalize some occurences of Rust in documentation 2016-02-24 19:56:28 +01:00
mitaa
cf76fcf30d Fix source-links for files with absolute-paths
`clean_srcpath` tries to make the source-path relative to `src_root`,
but this didn't work since `src_root` itself wasn't absolute.
2016-02-24 19:43:02 +01:00
mitaa
27ca2507de Allow creation of src-links for device files 2016-02-24 19:41:56 +01:00
Aleksey Kladov
397ab315e7 reference: clarify use declaration location 2016-02-24 19:13:31 +03:00
bors
0ef8d42605 Auto merge of #31832 - mmatyas:update_libc_16f1c19, r=alexcrichton
This fixes the `aarch64-linux-android` build (#31595).
2016-02-24 13:32:24 +00:00
Jeffrey Seyfried
2942cf7b0a Improve unused import detection 2016-02-24 13:13:46 +00:00
Jeffrey Seyfried
7ad7065c35 Uncapitalize note messages 2016-02-24 13:12:13 +00:00
bors
360a165ed3 Auto merge of #31828 - frewsxcv:sepseq-associated-function, r=alexcrichton
None
2016-02-24 11:29:31 +00:00
tormol
d34c6eeed4 Use a character that requires two u16s in the examples for char.encode_utf16() 2016-02-24 08:39:53 +01:00
bors
df91cb9af6 Auto merge of #31782 - pitdicker:clean_out_windows_c, r=alexcrichton
I am not entirely sure I have got everything right, but if it compiles it is ok probably...
I tested it with msvc x86_64 and gnu.

Somehow a lot of `EXCEPTION-*` constants are dead code when running test, no idea why.
I have put `#![cfg_attr(test, allow(dead_code))]` at the top for this.
2016-02-24 07:21:44 +00:00
Jeffrey Seyfried
197326d17b Resolve: include normal modules in the ribs 2016-02-24 06:31:55 +00:00
bors
304c790fc2 Auto merge of #31778 - aturon:snapshot, r=alexcrichton
r? @alexcrichton
2016-02-24 04:42:09 +00:00
bors
a4574bd4a5 Auto merge of #31855 - alexcrichton:fix-tidy, r=nikomatsakis
The MinGW-based Python implementations would automatically do this, but if we
want to use Python from the official downloads our usage of `/` instead of `\`
can wreak havoc. In a few select locations just use `os.path.normpath` do do the
conversions properly for us.
2016-02-24 01:55:45 +00:00
Alex Crichton
622ec5d8d0 mk: Tweak tidy script to work on Windows python
The MinGW-based Python implementations would automatically do this, but if we
want to use Python from the official downloads our usage of `/` instead of `\`
can wreak havoc. In a few select locations just use `os.path.normpath` do do the
conversions properly for us.
2016-02-23 17:52:26 -08:00
Jeffrey Seyfried
5172745da7 Warn instead of error when using an inaccessable extern crate 2016-02-24 01:34:39 +00:00