Commit Graph

63039 Commits

Author SHA1 Message Date
topecongiro
018c5c9298 Make 'overlapping_inherent_impls' lint a hard error 2017-04-04 10:43:16 +09:00
Nathan Stocks
20cb7005b0 Handle options-with-arguments before subcommands such as './x.py -j 10 build' and detect pathological cases like './x.py --option-that-takes-argument clean build' 2017-04-03 19:15:31 -06:00
Bryan Tan
ab4f4428e7 Fix styling issues 2017-04-03 16:09:19 -07:00
Jeffrey Seyfried
6a9448b523 Fix bug parsing #[derive] macro invocations. 2017-04-03 23:02:49 +00:00
Josh Stone
4d32ff4e49 Loosen src_is_git to just check exists() 2017-04-03 15:28:06 -07:00
Guillaume Gomez
b02cb1978c Handle ordered lists as well 2017-04-04 00:24:08 +02:00
Tim Neumann
6dc8869f38 use fixed ip for vault.centos.org until updates have propagated to all mirrors 2017-04-03 22:51:06 +02:00
mandeep
5787808d07 Removed trailing whitespace on line 682 2017-04-03 15:48:12 -05:00
Josh Stone
e9cfc300a3 Only use cargo-vendor if building from git sources 2017-04-03 13:46:53 -07:00
Josh Stone
3fb1a849dd Add a common Build::src_is_git flag 2017-04-03 13:46:50 -07:00
Tim Neumann
802c11c33e switch to vault.centos.org 2017-04-03 22:14:45 +02:00
Alex Crichton
541512b0bf travis: Split all dist builders in two
Previously we would use one builder on Travis to produce two sets of host
compilers for two different targets. Unfortunately though we've recently
increased how much we're building for each target so this is starting to take
unnecessarily long (#40804). This commit splits the dist builders in two by
ensuring that we only dist one target on each builder, which should take a much
shorter amount of time. This should also unblock other work such as landing the
RLS (#40584).
2017-04-03 12:30:06 -07:00
Guillaume Gomez
7a07a73eb1 Replace ^ with <sup> html balise 2017-04-03 21:17:47 +02:00
Stjepan Glavina
13c744f30d Move libXtest into libX/tests
This change moves:

1. `libcoretest` into `libcore/tests`
2. `libcollectionstest` into `libcollections/tests`

This is a follow-up to #39561.
2017-04-03 20:49:39 +02:00
Esteban Küber
73f6f5e096 Sort enum suggestions 2017-04-03 10:57:45 -07:00
Guillaume Gomez
e7c2160f8a Fix mutex's docs inconsistency 2017-04-03 18:57:13 +02:00
mandeep
f74ca38686 Refactored swap_remove doc comment upon discussing with BurntSushi and steveklabnik 2017-04-03 09:51:34 -05:00
Cody P Schafer
9c1b7ae3f3 Revert "Implement AsRawFd/IntoRawFd for RawFd"
This reverts commit 2cf686f2cd (#40842)

RawFd is a type alias for c_int, which is itself a type alias for i32.
As a result, adding AsRawFd and IntoRawFd impls for RawFd actually adds
them for i32.

As a result, the reverted commit makes this valid:

```
use std::os::unix::io::AsRawFd;

fn arf<T: AsRawFd>(_: T) {}

fn main() {
    arf(32i32)
}
```

Implimenting AsRawFd and IntoRawFd for i32 breaks the promises of both
those traits that their methods return a valid RawFd.

r? @aturon
cc @Mic92 @kamalmarhubi
2017-04-03 10:17:59 -04:00
Esteban Küber
8f31e191c6 Merge branch 'master' into issue-40006 2017-04-03 05:07:49 -07:00
bors
5309a3e31d Auto merge of #40915 - nrc:save-assoc, r=eddyb
save-analysis: track associated types

r? @eddyb
2017-04-03 03:26:09 +00:00
Amanieu d'Antras
7b89bd7cca Add ptr::offset_to 2017-04-03 01:36:56 +01:00
Ulrik Sverdrup
74f8ea263e iter: Simplification in rfind's provided implementation
- Prefer simpler constructs instead of going through &mut I's Iterator
  implementation.
2017-04-03 02:03:19 +02:00
Ulrik Sverdrup
29a6a9e8d2 iter: Use underlying find/rfind for the same methods in Rev 2017-04-03 02:03:19 +02:00
Nathan Stocks
efd6eab366 Handle symlinks in src/bootstrap/clean.rs (mostly) -- resolves #40860.
The broken condition can be replicated with:

``shell
export MYARCH=x86_64-apple-darwin && mkdir -p build/$MYARCH/subdir &&
touch build/$MYARCH/subdir/file && ln -s build/$MYARCH/subdir/file
build/$MYARCH/subdir/symlink
``

`src/bootstrap/clean.rs` has a custom implementation of removing a tree
`fn rm_rf` that used `std::path::Path::{is_file, is_dir, exists}` while
recursively deleting directories and files.  Unfortunately, `Path`'s
implementation of `is_file()` and `is_dir()` and `exists()` always
unconditionally follow symlinks, which is the exact opposite of standard
implementations of deleting file trees.

It appears that this custom implementation is being used to workaround a
behavior in Windows where the files often get marked as read-only, which
prevents us from simply using something nice and simple like
`std::fs::remove_dir_all`, which properly deletes links instead of
following them.

So it looks like the fix is to use `.symlink_metadata()` to figure out
whether tree items are files/symlinks/directories.  The one corner case
this won't cover is if there is a broken symlink in the "root"
`build/$MYARCH` directory, because those initial entries are run through
`Path::canonicalize()`, which panics with broken symlinks.  So lets just
never use symlinks in that one directory. :-)
2017-04-02 16:26:43 -06:00
Nathan Stocks
1e5389853c Fix breaking the 'clean' subcommand caused replacing a single-letter variable with the same value in two contexts where it was used differently. That's why you don't use "m" as a variable for hundreds of lines in an outer function, and re-use it in closures several times in the same function. Sheesh. 2017-04-02 13:11:53 -06:00
Nathan Stocks
6b7258670f Simplify a "use" statement as per @grunweg's feedback. 2017-04-02 12:57:09 -06:00
Nathan Stocks
2c9ae48149 Oops, we can't parse options until all options have been defined. Tiny bit of manual arg-parsing. Fixed tidy stuff too. 2017-04-02 12:57:08 -06:00
Nathan Stocks
aa4bd0ec0e Finish the improvements I planned.
- No more manual args manipulation -- getopts used for everything.
  As a result, options can be in any position, now, even before the
  subcommand.
- The additional options for test, bench, and dist now appear in the
  help output.
- No more single-letter variable bindings used internally for large
  scopes.
- Don't output the time measurement when just invoking 'x.py'
- Logic is now much more linear.  We build strings up, and then print
  them.
2017-04-02 12:57:08 -06:00
Nathan Stocks
5ba579e7f4 Save my TODO's as comments, so I don't forget. 2017-04-02 12:57:08 -06:00
Nathan Stocks
992a59efc3 Using an untyped, one-letter variable binding as an argument to a function and then not using it until over 100 lines later is just mean. 2017-04-02 12:57:08 -06:00
Nathan Stocks
584b40578d Vastly improve the help output.
- Don't print 'unknown subcommand' at the top of the help message.  The help message now clearly instructs the user to provide a subcommand.
- Clarify the usage line.  Subcommand is required.  Don't echo invalid input back out in the usage line (what the...???).  args renamed to paths, because that's what all the args are referred to elsewhere.
- List the available subcommands immediately following the usage line.  It's the one required argument, after all.
- Slightly improve the extra documentation for the build, test, and doc commands.
- Don't print 'Available invocations:' at all.  It occurred immediately before 'Available paths:'.
- Clearly state that running with '-h -v' will produce a list of available paths.
2017-04-02 12:56:52 -06:00
bors
72ecd79a6c Auto merge of #40919 - GuillaumeGomez:fix-new-rustdoc, r=frewsxcv,steveklabnik
Add support for image, rules and footnotes

Part of #40912.

r? @rust-lang/docs

PS: the footnotes are waiting for https://github.com/google/pulldown-cmark/pull/21 to be merged to be fully working.
2017-04-02 18:16:09 +00:00
Esteban Küber
b83352e44c Introduce TyErr independent from TyInfer
Add a `TyErr` type to represent unknown types in places where
parse errors have happened, while still able to build the AST.

Initially only used to represent incorrectly written fn arguments and
avoid "expected X parameters, found Y" errors when called with the
appropriate amount of parameters. We cannot use `TyInfer` for this as
`_` is not allowed as a valid argument type.

Example output:

```rust
error: expected one of `:` or `@`, found `,`
  --> file.rs:12:9
   |
12 | fn bar(x, y: usize) {}
   |         ^

error[E0061]: this function takes 2 parameters but 3 parameters were supplied
  --> file.rs:19:9
   |
12 | fn bar(x, y) {}
   | --------------- defined here
...
19 |     bar(1, 2, 3);
   |         ^^^^^^^ expected 2 parameters
```
2017-04-02 09:45:57 -07:00
Esteban Küber
b946ecd020 Suggest using enum when a variant is used as a type
Given a file:

```rust
enum Fruit {
    Apple(i64),
    Orange(i64),
}

fn should_return_fruit() -> Apple {
    Apple(5)
}
```

Provide the following output:

```rust
error[E0412]: cannot find type `Apple` in this scope
  --> file.rs:16:29
   |
16 | fn should_return_fruit() -> Apple {
   |                             ^^^^^ not found in this scope
   |
help: there is an enum variant `Fruit::Apple`, did you mean to use `Fruit`?
  --> file.rs:12:5
   |
12 |     Apple(i64),
   |     ^^^^^^^^^^

error[E0425]: cannot find function `Apple` in this scope
  --> file.rs:17:5
   |
17 |     Apple(5)
   |     ^^^^^ not found in this scope
   |
   = help: possible candidate is found in another module, you can import it into scope:
             `use Fruit::Apple;`
```
2017-04-02 09:33:41 -07:00
mandeep
255d9191a9 Fixed typo in doc comments for swap_remove 2017-04-02 11:21:05 -05:00
Ariel Ben-Yehuda
09ac56d6ef mark build::cfg::start_new_block as inline(never)
LLVM has a bug - PR32488 - where it fails to deduplicate allocas in some
circumstances. The function `start_new_block` has allocas totalling 1216
bytes, and when LLVM inlines several copies of that function into
the recursive function `expr::into`, that function's stack space usage
goes into tens of kiBs, causing stack overflows.

Mark `start_new_block` as inline(never) to keep it from being inlined,
getting stack usage under control.

Fixes #40493.
Fixes #40573.
2017-04-02 16:18:39 +03:00
Simon Sapin
509ef4c496 std::thread docs: fix link to current() 2017-04-02 12:03:54 +02:00
Peter Gerber
ff4febf8ea Improve documentation for std::fs::DirBuilder 2017-04-02 04:06:29 +02:00
Corey Farwell
bd698b9e8b Don't panic if we have tidy errors.
Otherwise we get the standard Rust panic message alongside "some tidy
checks failed" which seems unnecessary.
2017-04-01 20:59:45 -04:00
Irfan Hudda
4c9f8ae4fd Minor changes to core::option docs 2017-04-02 06:10:34 +05:30
Irfan Hudda
c414628782 Improve docs of core::option::Iter 2017-04-01 22:17:48 +05:30
Irfan Hudda
029ace4071 Improve docs of core::option::IterMut 2017-04-01 22:09:10 +05:30
Irfan Hudda
128a313ee2 Improve docs of core::option::IntoIter 2017-04-01 21:58:30 +05:30
Alex Crichton
8ad8ba6194 Update cargo submodule
Pulls in a fix for rust-lang/rust#40956
2017-04-01 06:58:11 -07:00
Donnie Bishop
364241c709 Added links to types in from_utf8 description 2017-04-01 09:56:40 -04:00
Alex Crichton
34cf28826f rustc: Stabilize the #![windows_subsystem] attribute
This commit stabilizes the `#![windows_subsystem]` attribute which is a
conservative exposure of the `/SUBSYSTEM` linker flag on Widnows platforms. This
is useful for creating applications as well as console programs.

Closes #37499
2017-04-01 06:36:48 -07:00
Eugene Bulkin
a5d775d2b6 Add more std::ascii module-level docs. 2017-04-01 00:47:58 -07:00
Eugene Bulkin
d8fb322acc Clean up std::ascii sub-level docs.
* Change `utf8` variable names to `non_ascii` to be more clear, since
ASCII and UTF-8 are compatible.

* Fix `EscapeDefault` struct description to follow the typical iterator
method format with a link to the generating function.

* Add more `escape_default` examples to cover every case mentioned in
the function description itself.
2017-04-01 00:07:55 -07:00
Guillaume Gomez
ef01ae7fe0 Force footnote references to be sorted by id 2017-04-01 00:31:37 -06:00
Bryan Tan
dab8e8121f Fix warnings in examples 2017-03-31 23:22:59 -07:00