Commit Graph

43577 Commits

Author SHA1 Message Date
Sébastien Marie
b804c241b3 inverse the logic in code inclusion
instead of enumerate the (long) list of platforms to exclude, use only
the short list of platforms to include.

should fixes __morestack symbol problem under openbsd
2015-06-14 07:08:10 +02:00
bors
043f93f278 Auto merge of #26285 - rick68:patch-3, r=alexcrichton
`FormatError` is not exist anymore.
2015-06-14 04:21:47 +00:00
Wei-Ming Yang
7f25185138 Update mod.rs
`FormatError` is not exist anymore.
2015-06-14 11:32:04 +08:00
bors
6e7fcc44ae Auto merge of #26278 - tamird:compiletest, r=alexcrichton 2015-06-13 23:35:28 +00:00
bors
5f3233f092 Auto merge of #26250 - steveklabnik:remove_html_literals_test, r=alexcrichton
This test now works again

Fixes #20673

r? @alexcrichton
2015-06-13 22:03:42 +00:00
bors
325066051f Auto merge of #26249 - steveklabnik:remove_extern_panic, r=alexcrichton
This test has an interesting history, because of fail -> panic. It was
originally called extern-fail.rs:
https://github.com/rust-lang/rust/commits/master/src/test/run-fail/extern-fail.rs

It lived for a while, but was disabled in August 2013:
ce95b01014

As you can see, that failure was not specific to this test, however,
this code does stuff with the runtime, which was removed. Given that
it hasn't even been able to compile in a long time, we should just
remove it.

r? @brson
2015-06-13 20:33:53 +00:00
Peter Atashian
ebbd90d28f Switch to direct HeapAlloc on Windows when not using jemalloc
Signed-off-by: Peter Atashian <retep998@gmail.com>
2015-06-13 15:13:16 -04:00
Markus
7721d46bd7 Utilize discriminant_value for more efficient deriving
The new code generated for deriving on enums looks something like this:

```rust
let __self0_vi = unsafe {
    std::intrinsics::discriminant_value(&self) } as i32;
let __self1_vi = unsafe {
    std::intrinsics::discriminant_value(&__arg1) } as i32;
let __self2_vi = unsafe {
    std::intrinsics::discriminant_value(&__arg2) } as i32;
///
if __self0_vi == __self1_vi && __self0_vi == __self2_vi && ... {
    match (...) {
        (Variant1, Variant1, ...) => Body1
        (Variant2, Variant2, ...) => Body2,
        ...
        _ => ::core::intrinsics::unreachable()
    }
}
else {
    ... // catch-all remainder can inspect above variant index values.
}
```
This helps massively for C-like enums since they will be compiled as a
single comparison giving observed speedups of up to 8x. For more complex
enums the speedup is more difficult to measure but it should not be
slower to generate code this way regardless.
2015-06-13 20:40:59 +02:00
bors
c43cdb8ffd Auto merge of #26277 - aidanhs:aphs-dont-make-random-directories, r=alexcrichton
The last commit is optional. If you opt not to take it I can improve on the 'this is magic' comment.
2015-06-13 17:14:51 +00:00
Tamir Duberstein
7f04b8ff07 compiletest: remove JIT 2015-06-13 12:53:07 -04:00
Aidan Hobson Sayers
fca66702a4 Replace nop hack, explain substitution reasoning 2015-06-13 17:27:12 +01:00
Aidan Hobson Sayers
b1e9ed3c19 nop hack required for PREPARE_DIR (PREPARE_MAN for safety)
Fixes #26274
2015-06-13 17:27:05 +01:00
Aidan Hobson Sayers
065c9ab59b No need to double-silence 2015-06-13 17:26:27 +01:00
Ariel Ben-Yehuda
3ca4d92cd6 Ensure projections are not counted as constraining type parameters.
Fixes #26262
2015-06-13 17:59:10 +03:00
bors
b850046ca1 Auto merge of #26272 - Manishearth:rollup, r=Manishearth
- Successful merges: #26255, #26256, #26257, #26259, #26260
- Failed merges:
2015-06-13 14:02:25 +00:00
Manish Goregaokar
023f66103d Rollup merge of #26260 - tshepang:improve-example, r=steveklabnik 2015-06-13 18:03:56 +05:30
Manish Goregaokar
4935ea92b1 Rollup merge of #26259 - tshepang:case-examples, r=steveklabnik 2015-06-13 18:03:56 +05:30
Manish Goregaokar
e7c10d5d31 Rollup merge of #26257 - Tonkpils:patch-1, r=alexcrichton 2015-06-13 18:03:55 +05:30
Manish Goregaokar
2b8e80914a Rollup merge of #26256 - steveklabnik:gh25915, r=alexcrichton
Fixes #25915
2015-06-13 18:03:55 +05:30
Manish Goregaokar
15aa3bbccc Rollup merge of #26255 - steveklabnik:gh25499, r=alexcrichton
Fixes #25499
2015-06-13 18:03:55 +05:30
petrochenkov
bddb685e73 Use assert_eq! instead of assert! in tests 2015-06-13 14:55:55 +03:00
bors
a27982623c Auto merge of #26267 - eefriedman:split-tyarray, r=eddyb
Arrays and slices are closely related, but not that closely; making the
separation more explicit is generally more clear.
2015-06-13 11:42:24 +00:00
bors
a9f1e29c4e Auto merge of #26253 - steveklabnik:remove_old_ignored_tests, r=brson
Two commits here: one which removes a bunch of tests, and re-enables a few that work.

Second updates the syntax of one of the failing tests. It still doesn't pass, but at least it compiles.
2015-06-13 10:08:51 +00:00
bors
6d6f086928 Auto merge of #26118 - tshepang:define-trait, r=steveklabnik
I saw a variation of this definition in [an article](http://pcwalton.github.io/blog/2012/08/08/a-gentle-introduction-to-traits-in-rust) by @pcwalton.
2015-06-13 08:34:12 +00:00
bors
7c38de89d4 Auto merge of #26108 - Marwes:field_pun_docs, r=steveklabnik
Adds a mention for the short form pattern syntax. Now without creating a PR to my own fork!

#25779
2015-06-13 07:00:26 +00:00
bors
bfd70aaf77 Auto merge of #26248 - steveklabnik:remove_2061, r=alexcrichton
This test was added on Nov 1, 2012:
0069bd2f46 (diff-b516ff69faf8886c48e6f5e833c2548c)

and then ignored on the same day:
a90020fe8d (diff-b516ff69faf8886c48e6f5e833c2548c)

and never unignored again.
2015-06-13 03:29:40 +00:00
bors
bca2ea6c4a Auto merge of #26247 - steveklabnik:remove_4120, r=alexcrichton
This test originated from an ICE in Rust 0.4:
373504a7ac (diff-214656000770dff71c8165d051c3f027)

it was ignored one day later:
1fa2b9980f (diff-214656000770dff71c8165d051c3f027)

and then never enabled again. I think we're safe without it.
2015-06-13 01:23:26 +00:00
Eli Friedman
33b7386d39 Split TyArray into TyArray and TySlice.
Arrays and slices are closely related, but not that closely; making the
separation more explicit is generally more clear.
2015-06-12 16:50:13 -07:00
Ulrik Sverdrup
70269cd8ef mk: Build crates with relative paths to rustc
The path we pass to rustc will be visible in panic messages and
backtraces: they will be user visible!

Avoid junk in these paths by passing relative paths to rustc.

For most advanced users, `libcore` or `libstd` in the path will be
a clue to the location -- inside our code, not theirs.

Store both the relative path to the source as well as the absolute.
Use the relative path where it matters, compiling the main crates,
instead of changing all of the build process to cope with relative
paths.

Example output after this patch:

```
$ ./testunwrap
thread '<main>' panicked at 'called `Option::unwrap()` on a `None` value', ../src/libcore/option.rs:362
$ RUST_BACKTRACE=1 ./testunwrap
thread '<main>' panicked at 'called `Option::unwrap()` on a `None` value', ../src/libcore/option.rs:362
stack backtrace:
   1:     0x7ff59c1e9956 - sys::backtrace::write::h67a542fd2b201576des
                        at ../src/libstd/sys/unix/backtrace.rs:158
   2:     0x7ff59c1ed5b6 - panicking::on_panic::h3d21c41cdd5c12d41Xw
                        at ../src/libstd/panicking.rs:58
   3:     0x7ff59c1e7b6e - rt::unwind::begin_unwind_inner::h9f3a5440cebb8baeLDw
                        at ../src/libstd/rt/unwind/mod.rs:273
   4:     0x7ff59c1e7f84 - rt::unwind::begin_unwind_fmt::h4fe8a903e0c296b0RCw
                        at ../src/libstd/rt/unwind/mod.rs:212
   5:     0x7ff59c1eced7 - rust_begin_unwind
   6:     0x7ff59c22c11a - panicking::panic_fmt::h00b0cd49c98a9220i5B
                        at ../src/libcore/panicking.rs:64
   7:     0x7ff59c22b9e0 - panicking::panic::hf549420c0ee03339P3B
                        at ../src/libcore/panicking.rs:45
   8:     0x7ff59c1e621d - option::Option<T>::unwrap::h501963526474862829
   9:     0x7ff59c1e61b1 - main::hb5c91ce92347d1e6eaa
  10:     0x7ff59c1f1c18 - rust_try_inner
  11:     0x7ff59c1f1c05 - rust_try
  12:     0x7ff59c1ef374 - rt::lang_start::h7e51e19c6677cffe5Sw
                        at ../src/libstd/rt/unwind/mod.rs:147
                        at ../src/libstd/rt/unwind/mod.rs:130
                        at ../src/libstd/rt/mod.rs:128
  13:     0x7ff59c1e628e - main
  14:     0x7ff59b3f6b44 - __libc_start_main
  15:     0x7ff59c1e6078 - <unknown>
  16:                0x0 - <unknown>
```
2015-06-13 01:41:52 +02:00
bors
c6b1483377 Auto merge of #26160 - alexcrichton:revert-rc-as-ref, r=aturon
This is a revert of PR #26008 which caused the unintended breakage reported in #26096. We may want to add these implementations in the long run, but for now this revert allows us to take some more time to evaluate the impact of such a change (e.g. run it through crater).

Closes #26096
2015-06-12 23:05:06 +00:00
Tshepang Lekhonkhobe
667a246442 doc: make char::from_u32 example more brief 2015-06-13 00:57:13 +02:00
Tshepang Lekhonkhobe
2c08654e09 doc: 'c' feels more suitable than 'i' for representing characters 2015-06-13 00:01:16 +02:00
Tshepang Lekhonkhobe
50de1d6e71 doc: improve escape_unicode example
Looks better without all that wasted whitespace
2015-06-12 23:58:50 +02:00
Tshepang Lekhonkhobe
7c8440eb2f doc: add examples for to_uppercase and to_lowercase 2015-06-12 23:47:54 +02:00
bors
50ab23ddbd Auto merge of #25844 - alexcrichton:stabilize-fs-features, r=aturon
This commit stabilizes the following APIs, slating them all to be cherry-picked
into the 1.1 release.

* fs::FileType (and transitively the derived trait implementations)
* fs::Metadata::file_type
* fs::FileType::is_dir
* fs::FileType::is_file
* fs::FileType::is_symlink
* fs::DirEntry::metadata
* fs::DirEntry::file_type
* fs::DirEntry::file_name
* fs::set_permissions
* fs::symlink_metadata
* os::raw::{self, *}
* os::{android, bitrig, linux, ...}::raw::{self, *}
* os::{android, bitrig, linux, ...}::fs::MetadataExt
* os::{android, bitrig, linux, ...}::fs::MetadataExt::as_raw_stat
* os::unix::fs::PermissionsExt
* os::unix::fs::PermissionsExt::mode
* os::unix::fs::PermissionsExt::set_mode
* os::unix::fs::PermissionsExt::from_mode
* os::unix::fs::OpenOptionsExt
* os::unix::fs::OpenOptionsExt::mode
* os::unix::fs::DirEntryExt
* os::unix::fs::DirEntryExt::ino
* os::windows::fs::MetadataExt
* os::windows::fs::MetadataExt::file_attributes
* os::windows::fs::MetadataExt::creation_time
* os::windows::fs::MetadataExt::last_access_time
* os::windows::fs::MetadataExt::last_write_time
* os::windows::fs::MetadataExt::file_size

The `os::unix::fs::Metadata` structure was also removed entirely, moving all of
its associated methods into the `os::unix::fs::MetadataExt` trait instead. The
methods are all marked as `#[stable]` still.

As some minor cleanup, some deprecated and unstable fs apis were also removed:

* File::path
* Metadata::accessed
* Metadata::modified

Features that were explicitly left unstable include:

* fs::WalkDir - the semantics of this were not considered in the recent fs
  expansion RFC.
* fs::DirBuilder - it's still not 100% clear if the naming is right here and if
  the set of functionality exposed is appropriate.
* fs::canonicalize - the implementation on Windows here is specifically in
  question as it always returns a verbatim path. Additionally the Unix
  implementation is susceptible to buffer overflows on long paths unfortunately.
* fs::PathExt - as this is just a convenience trait, it is not stabilized at
  this time.
* fs::set_file_times - this funciton is still waiting on a time abstraction.
2015-06-12 21:31:37 +00:00
Leo Correa
57f1036ce9 usize -> u32 to match previous example 2015-06-12 15:59:39 -04:00
bors
85b5338e34 Auto merge of #26232 - eefriedman:rename-sty, r=nrc
Use camel-case naming, and use names which actually make sense in modern Rust.
2015-06-12 19:57:27 +00:00
Steve Klabnik
d46d229be7 Fix up wording in lifetime elision docs
Fixes #25915
2015-06-12 15:05:09 -04:00
Steve Klabnik
4500019783 Remove unstable feature from TRPL: iterators
Fixes #25499
2015-06-12 15:00:21 -04:00
bors
1671b9baec Auto merge of #26221 - sanxiyn:wf-span, r=arielb1
When checking field types of struct or enum definitions, use spans for field types instead of the entire item.
2015-06-12 18:25:55 +00:00
Steve Klabnik
49d8573dd2 Re-enable html literals test
It's now passing again.

Fixes #20673
2015-06-12 14:19:47 -04:00
Steve Klabnik
13b9a725ea Update dead-code-closure-bang
This stdlib function went away, so update it to use current syntax.
2015-06-12 14:16:49 -04:00
Steve Klabnik
bba934f19a ignore-test cleanup
Most of these are old, but some specific messages for specific tests:

* trait-contravariant-self.rs: failed due to a soundess hole:
  05e3248a79

* process-detatch: 15966c3c1f
  says "this test is being ignored until signals are implemented" That's
  not happening for a long time, and when it is, we'll write tests for
  it.

* deep-vector{,2}.rs: "too big for our poor macro infrastructure", and has
  been ignored over a year.

* borrowck-nested-calls.rs's FIXME #6268 was closed in favor of
  rust-lang/rfcs#811

* issue-15167.rs works properly now
* issue-9737.rs works properly now
* match-var-hygiene.rs works properly now

Addresses a chunk of #3965
2015-06-12 14:16:16 -04:00
Eli Friedman
3c69db4c3c Cleanup: rename middle::ty::sty and its variants.
Use camel-case naming, and use names which actually make sense in modern Rust.
2015-06-12 11:07:16 -07:00
Steve Klabnik
5a5499b36c Remove old runtime panic test
This test has an interesting history, because of fail -> panic. It was
originally called extern-fail.rs:
https://github.com/rust-lang/rust/commits/master/src/test/run-fail/extern-fail.rs

It lived for a while, but was disabled in August 2013:
ce95b01014

As you can see, that failure was not specific to this test, however,
this code does stuff with the runtime, which was removed. Given that
it hasn't even been able to compile in a long time, we should just
remove it.
2015-06-12 13:11:17 -04:00
Steve Klabnik
106a40885d Remove ignored test for #2061
This test was added on Nov 1, 2012:
0069bd2f46 (diff-b516ff69faf8886c48e6f5e833c2548c)

and then ignored on the same day:
a90020fe8d (diff-b516ff69faf8886c48e6f5e833c2548c)

and never unignored again.
2015-06-12 13:02:50 -04:00
Steve Klabnik
cae1d67406 Remove ignore'd test for old ICE
This test originated from an ICE in Rust 0.4:
373504a7ac (diff-214656000770dff71c8165d051c3f027)

it was ignored one day later:
1fa2b9980f (diff-214656000770dff71c8165d051c3f027)

and then never enabled again. I think we're safe without it.
2015-06-12 12:44:25 -04:00
Markus Westerlind
219ddd1f61 Mention the short form pattern syntax in the book
Explains short form pattern syntax and then introduces the longer
pattern matching as a rebinding of the fields instead.

 #25779
2015-06-12 18:18:45 +02:00
bors
4cc87c8acb Auto merge of #26245 - mbrubeck:extern, r=steveklabnik
r? @steveklabnik
2015-06-12 15:15:11 +00:00
Matt Brubeck
334ce91443 [reference] Fix typo in extern fn section 2015-06-12 08:08:48 -07:00