Commit Graph

43599 Commits

Author SHA1 Message Date
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
Seo Sanghyeon
793d9fcb52 Add tests for tuple-like structs and dictionary-like enum variants 2015-06-12 21:09:17 +09:00
Seo Sanghyeon
16d5c83d5f Use more precise span when checking type definitions 2015-06-12 20:28:09 +09:00
bors
a2f2a64763 Auto merge of #26238 - Manishearth:rollup, r=Manishearth
- Successful merges: #24495, #26229, #26231
- Failed merges:
2015-06-12 06:25:49 +00:00
Manish Goregaokar
a9ea380523 Rollup merge of #26231 - reem:patch-2, r=Gankro
r? @steveklabnik
2015-06-12 11:55:37 +05:30
Manish Goregaokar
8f841b24ca Rollup merge of #26229 - Stebalien:versionless-book, r=steveklabnik
They're forever doomed to be out-of-date. Also, don't assume the user is
installing a particular version.

r? @steveklabnik
2015-06-12 11:55:37 +05:30
Manish Goregaokar
18f70e3498 Rollup merge of #24495 - nathanl:nathanl-explain-bin-flag, r=steveklabnik
Explain the --bin flag in terms of the difference
between shipping binary and library code

I'm not sure if my explanation is even quite correct, but as a newbie coming from Ruby, this is my best guess. (In Rubyland, libraries always ship with the source code because there's no other form you can ship. :) )
2015-06-12 11:55:37 +05:30
bors
69db64f304 Auto merge of #26224 - mcast:doc-travis2buildbot, r=steveklabnik
Suggesting this because I was confused by what is now visible from the Travis CI / buildbot split.

Found the hint  in bors comments on d911936d
Couldn't find anything on https://internals.rust-lang.org/
2015-06-12 04:38:02 +00:00
bors
0da58cc361 Auto merge of #26226 - alexcrichton:fix-msvc-dist, r=brson
Right now the distribution tarball for MSVC only includes the *.dll files for
the supporting libraries, but not the corresponding *.lib files which allow
actually linking to the dll. This means that the current MSVC nightlies cannot
produce dynamically linked binaries as the *.lib files are not available to link
against.

This commit modifies the `LIB_GLOB` used to copy the files around to include the
`lib` variant of the `dll`.
2015-06-12 01:36:55 +00:00
bors
7648776503 Auto merge of #26225 - arielb1:raw-self, r=eddyb
This can't be made to work with the current setup.

Technically a [breaking-change], but a simple bug fix.

Fixes #26194.
2015-06-12 00:00:27 +00:00
Jonathan Reem
3c6dcea985 Add Terminal.com to the list of companies using rust in production. 2015-06-11 16:07:34 -07:00
bors
400e955d8b Auto merge of #26199 - swgillespie:issue-26092, r=alexcrichton
`driver::build_output_filenames` calls `file_stem` on a PathBuf obtained from the output file compiler flag. It's possible to pass the empty string to this compiler flag. When file_stem is called on an empty Path, it returns None, which is unwrapped and the compiler panics.

This change modifies the `unwrap` to an `unwrap_or` so that the empty string is passed through the compilation pipeline until it reaches `trans:🔙:write_output_file`, which will emit an appropriate error.

Instead of panicking, the error that is emitted now is:

```
$ rustc -o "" thing.rs
error: could not write output to : No such file or directory
```

The `:` is a little strange, but it /is/ reporting the filename (the empty string) correctly, I suppose. Both gcc and clang hand the output file to ld, which emits a similar error message when faced with the empty string as an output file:

```
$ clang -o "" thing.c
ld: can't open output file for writing: , errno=2 for architecture x86_64
```

This PR also adds a test for this, in `run-make`. This fixes issue #26092.
2015-06-11 21:35:10 +00:00
Steven Allen
e2e292cc00 Don't link to specific versions of rust in the book.
They're forever doomed to be out-of-date. Also, don't assume the user is
installing a particular version.
2015-06-11 17:33:18 -04:00
Alex Crichton
6fee2690cf mk: Tweak the LIB_GLOB for MSVC
Right now the distribution tarball for MSVC only includes the *.dll files for
the supporting libraries, but not the corresponding *.lib files which allow
actually linking to the dll. This means that the current MSVC nightlies cannot
produce dynamically linked binaries as the *.lib files are not available to link
against.

This commit modifies the `LIB_GLOB` used to copy the files around to include the
`lib` variant of the `dll`.
2015-06-11 14:15:36 -07:00
Ariel Ben-Yehuda
3be18f0edc Prevent raw pointers from being used as an explicit self
This can't be made to work with the current setup.

Fixes #26194.
2015-06-11 23:45:27 +03:00
Matthew Astley
512b105b15 point to buildbot
Since 7b6ecc00
2015-06-11 19:57:16 +01:00
bors
b5b3a99f84 Auto merge of #26190 - Veedrac:no-iter, r=alexcrichton
Pull request for #26188.
2015-06-11 18:10:08 +00:00
bors
deff2f50a9 Auto merge of #26212 - Manishearth:rollup, r=Manishearth
- Successful merges: #26181, #26184, #26189, #26191, #26195, #26202
- Failed merges:
2015-06-11 16:33:53 +00:00
bors
c85f307369 Auto merge of #26197 - dhuseby:fixing_morestack_breakage, r=brson
Revision 021e483 broke the BSD builds.  This fixes it for Bitrig and probably the others.
2015-06-11 14:57:13 +00:00
Nathan Long
a47d7a752e Explain the --bin flag more clearly 2015-06-11 09:20:14 -04:00
bors
acfcb15e09 Auto merge of #26184 - aepsil0n:error-desc-funcargs, r=alexcrichton
These errors all relate to type checking, specifically the number of function arguments, and occur in librustc_typeck::check::check_argument_types.

Resolves part of #24407.
2015-06-11 13:17:19 +00:00
Joshua Landau
d7f5fa4636 Conver reborrows to .iter() calls where appropriate 2015-06-11 13:56:07 +01:00
bors
7e9a8e322a Auto merge of #26177 - jooert:fix26169, r=alexcrichton
Closes #26169.

r? @steveklabnik
2015-06-11 11:41:24 +00:00
bors
fc9e424550 Auto merge of #26172 - nham:add_E0116, r=alexcrichton
Also improves the wording of the E0133 description.

cc #24407
2015-06-11 10:06:38 +00:00
bors
f6341a878e Auto merge of #26159 - alexcrichton:tweak-process-lowering-raising, r=brson
* Slate these features to be stable in 1.2 instead of 1.1 (not being backported)
* Have the `FromRawFd` implementations follow the contract of the `FromRawFd`
  trait by taking ownership of the primitive specified.
* Refactor the implementations slightly to remove the `unreachable!` blocks as
  well as separating the stdio representation of `std::process` from
  `std::sys::process`.

cc #25494
2015-06-11 08:22:39 +00:00
Manish Goregaokar
e50675d549 Rollup merge of #26202 - nham:revise_E0072, r=alexcrichton
Converts the size calculation in the explanation from a fenced code block to an indented one. I think it looks better when not rendered, and is the same rendered.
2015-06-11 12:50:54 +05:30
Manish Goregaokar
cf3e79d558 Rollup merge of #26195 - tshepang:patch-1, r=alexcrichton 2015-06-11 12:50:53 +05:30
Manish Goregaokar
95407cc627 Rollup merge of #26191 - jimblandy:master, r=steveklabnik
In the discussion of returning closures, it seems like the example code got simplified, but only the later copies got fixed. The final working code has `factory` returning `|x| x + num`, but the earlier code has `|x| vec.push(x)`.

The first form seemed to have more distracting characteristics, and the code wasn't right anyway, so I changed them to all use the second form, and updated the error messages.

r? @steveklabnik
2015-06-11 12:50:53 +05:30
Manish Goregaokar
ea4949d449 Rollup merge of #26189 - bluss:iter-once-clone, r=Gankro
core: impl Clone for option::IntoIter and iter::Once
2015-06-11 12:50:53 +05:30
Manish Goregaokar
cf685cb8f8 Rollup merge of #26184 - aepsil0n:error-desc-funcargs, r=alexcrichton
These errors all relate to type checking, specifically the number of function arguments, and occur in librustc_typeck::check::check_argument_types.

Resolves part of #24407.
2015-06-11 12:50:53 +05:30