Commit Graph

65150 Commits

Author SHA1 Message Date
bors
17f493fffc Auto merge of #42394 - ollie27:rustdoc_deref_box, r=QuietMisdreavus
rustdoc: Hide `self: Box<Self>` in list of deref methods

These methods can never be called through deref so there is no point including them. For example you can't call [`into_boxed_bytes`](https://doc.rust-lang.org/nightly/std/string/struct.String.html#method.into_boxed_bytes) or [`into_string`](https://doc.rust-lang.org/nightly/std/string/struct.String.html#method.into_string) on `String`.
2017-06-06 06:18:17 +00:00
Corey Farwell
06f63f5edb Add doc example for CString::as_bytes. 2017-06-05 23:50:49 -04:00
Corey Farwell
ae4832d48a Add doc example for CString::as_bytes_with_nul. 2017-06-05 23:49:52 -04:00
Corey Farwell
815c12a765 Add doc example for CString::into_bytes_with_nul. 2017-06-05 23:48:13 -04:00
Corey Farwell
3ec1f61acc Add doc example for CString::into_bytes. 2017-06-05 23:46:44 -04:00
Corey Farwell
4db8c9f0ba Add doc example for CString::into_raw. 2017-06-05 23:43:25 -04:00
bors
e862695158 Auto merge of #41990 - qnighy:disallow-underscore-suffix-for-string-like-literals, r=nikomatsakis
Disallow underscore suffix for string-like literals.

This patch turns string/bytestring/char/byte literals followed by an underscore, like `"Foo"_`, to an error.

`scan_optional_raw_name` will parse `_` as a valid raw name, but it will be rejected by the parser. I also considered just stopping parsing when the suffix is `_`, but in that case `"Foo"_` will be lexed as two valid tokens.

Fixes the latter half of #41723.
2017-06-06 02:56:17 +00:00
Wesley Wiser
c47df30a0b syntax_pos::Symbol should not implement Sync
Fixes #42407
2017-06-05 21:52:34 -04:00
Marco Castelluccio
13b3c34e4b Spell profiler option correctly... 2017-06-06 00:42:09 +01:00
Marco Castelluccio
84d1626e51 Add basic documentation for the profile feature 2017-06-06 00:39:07 +01:00
Marco Castelluccio
26ad8d4ad3 Enable profiler on all builders 2017-06-05 23:56:59 +01:00
bors
ae79201533 Auto merge of #42452 - raphlinus:mx_job_default, r=alexcrichton
[fuchsia] Track change of mx_job_default

The implementation of mx_job_default changed from a macro which
accessed the __magenta_job_default global variable to a proper
function call. This patch tracks that change.
2017-06-05 21:42:19 +00:00
Alex Burka
9d67dfec12 tidy is an unnecessary roadblock to contributions 2017-06-05 21:02:55 +00:00
Ulysse Carion
1af0cb1650 Use single quotes, and doc the Rc struct itself. 2017-06-05 12:07:54 -07:00
Raph Levien
4e2a43f323 [fuchsia] Track change of mx_job_default
The implementation of mx_job_default changed from a macro which
accessed the __magenta_job_default global variable to a proper
function call. This patch tracks that change.
2017-06-05 11:27:31 -07:00
steveklabnik
9331f046f4 fix tests 2017-06-05 13:14:31 -04:00
steveklabnik
2f0dc04bb5 address review feedback 2017-06-05 13:09:19 -04:00
Oliver Middleton
02955f508e Add run-make test for Command::spawn on Windows
Make sure args aren't interpreted as part of the program name.
2017-06-05 17:57:32 +01:00
bors
d015610db7 Auto merge of #42414 - frewsxcv:frewsxcv/improve-cow-docs, r=QuietMisdreavus
Improve `Cow` method doc examples.

None
2017-06-05 15:38:24 +00:00
bors
13eb0ec9f1 Auto merge of #42383 - estebank:candidate-newline, r=arielb1
Use multiline note for trait suggestion
2017-06-05 13:07:38 +00:00
Tommy Ip
9cbb5f9a24 Add ui tests for issue 26046 2017-06-05 12:02:12 +01:00
Tommy Ip
9d188e680e Better closure error message
Use tracked data introduced in #42196 to provide a better closure
error message by showing why a closure implements `FnOnce`.

```
error[E0525]: expected a closure that implements the `Fn` trait, but
this closure only implements `FnOnce`
 --> $DIR/issue_26046.rs:4:19
  |
4 |       let closure = move || {
  |  ___________________^
5 | |         vec
6 | |     };
  | |_____^
  |
note: closure is `FnOnce` because it moves the variable `vec` out of
its environment
 --> $DIR/issue_26046.rs:5:9
  |
5 |         vec
  |         ^^^

error: aborting due to previous error(s)
```

Fixes #26046
2017-06-05 12:01:58 +01:00
Michael Kohl
867ed2e17d Doc changes for assert macros
See #29381
2017-06-05 16:46:12 +07:00
king6cong
018722e485 doc rewording 2017-06-05 11:02:38 +08:00
Mark Simulacrum
dd1d75e9ec Skip documentation files without ``` when running markdown tests.
This should reduce the 'running 0 tests' noise in builds, and is a good
heuristic for us to use.
2017-06-04 17:55:50 -06:00
bors
c94a9ac8ae Auto merge of #42426 - arthurprs:io_error, r=sfackler
Inline io::Error creation from ErrorKind

Faster and smaller code for mio and tokio (PRs on those to follow)
2017-06-04 23:35:21 +00:00
Oliver Middleton
7afcf51fe4 Always quote program name in Command::spawn on Windows
`CreateProcess` will interpret args as part of the binary name if it
doesn't find the binary using just the unquoted name. For example if
`foo.exe` doesn't exist, `Command::new("foo").arg("bar").spawn()` will
try to launch `foo bar.exe` which is clearly not desired.
2017-06-04 21:47:24 +01:00
bors
0418fa9d38 Auto merge of #42362 - estebank:type, r=arielb1
Show trait method signature when impl differs

When the trait's span is available, it is already being used, add a
`note` for the cases where the span isn't available:

<pre>
error[E0053]: <b>method `fmt` has an incompatible type for trait</b>
  --> $DIR/trait_type.rs:17:4
   |
17 |    fn fmt(&self, x: &str) -> () { }
   |    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ types differ in mutability
   |
   = note: expected type `<b>fn(&MyType, &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error></b>`
              found type `<b>fn(&MyType, &str)</b>`

error[E0050]: <b>method `fmt` has 1 parameter but the declaration in trait `std::fmt::Display::fmt` has 2</b>
  --> $DIR/trait_type.rs:21:11
   |
21 |    fn fmt(&self) -> () { }
   |           ^^^^^ expected 2 parameters, found 1
   |
   = note: `fmt` from trait: `<b>fn(&Self, &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error></b>`

error[E0186]: <b>method `fmt` has a `&self` declaration in the trait, but not in the impl</b>
  --> $DIR/trait_type.rs:25:4
   |
25 |    fn fmt() -> () { }
   |    ^^^^^^^^^^^^^^^^^^ expected `&self` in impl
   |
   = note: `fmt` from trait: `<b>fn(&Self, &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error></b>`

error[E0046]: <b>not all trait items implemented, missing: `fmt`</b>
  --> $DIR/trait_type.rs:28:1
   |
28 | impl std::fmt::Display for MyType4 {}
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `fmt` in implementation
   |
   = note: `fmt` from trait: `<b>fn(&Self, &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error></b>`
</code></pre>

Fix #28011.
2017-06-04 20:16:09 +00:00
Esteban Küber
397972f5b0 Separate suggestion in a help and a note 2017-06-04 12:56:57 -07:00
Esteban Küber
e324919ec5 Show trait method signature when impl differs
When the trait's span is available, it is already being used, add a
`note` for the cases where the span isn't available:

```
error[E0053]: method `fmt` has an incompatible type for trait
  --> $DIR/trait_type.rs:17:4
   |
17 |    fn fmt(&self, x: &str) -> () { }
   |    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ types differ in mutability
   |
   = note: expected type `fn(&MyType, &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error>`
              found type `fn(&MyType, &str)`

error[E0050]: method `fmt` has 1 parameter but the declaration in trait `std::fmt::Display::fmt` has 2
  --> $DIR/trait_type.rs:21:11
   |
21 |    fn fmt(&self) -> () { }
   |           ^^^^^ expected 2 parameters, found 1
   |
   = note: `fmt` from trait: `fn(&Self, &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error>`

error[E0186]: method `fmt` has a `&self` declaration in the trait, but not in the impl
  --> $DIR/trait_type.rs:25:4
   |
25 |    fn fmt() -> () { }
   |    ^^^^^^^^^^^^^^^^^^ expected `&self` in impl
   |
   = note: `fmt` from trait: `fn(&Self, &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error>`

error[E0046]: not all trait items implemented, missing: `fmt`
  --> $DIR/trait_type.rs:28:1
   |
28 | impl std::fmt::Display for MyType4 {}
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `fmt` in implementation
   |
   = note: `fmt` from trait: `fn(&Self, &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error>`
```
2017-06-04 12:52:55 -07:00
Marco Castelluccio
8b7826ffb9 Use the three-element variant of the 'llvm.gcov' metadata 2017-06-04 19:53:42 +01:00
Venkata Giri Reddy
40f8536449 rustc_llvm: re-run build script if config.toml changes 2017-06-04 18:35:57 +00:00
Scott McMurray
808a08a363 Add overflow checking for str::get with inclusive ranges
Fixes #42401
2017-06-04 11:08:25 -07:00
Marco Castelluccio
0b0a5ac032 Run profiler test only if built with profiler support 2017-06-04 19:05:03 +01:00
bors
9a4e13f5c4 Auto merge of #42402 - citizen428:create-dump-mir-dir, r=Mark-Simulacrum
Create directory for dump-mir-dir automatically

Fixes #35543 r? @Mark-Simulacrum

@Mark-Simulacrum I know someone else said that they'll work on this, but it has been 3+ weeks and I had nothing to do and wanted to contribute a bit.

I now added the call to automatically create the directory as discussed, but was wondering how you feel about the suggestion to set a default directory, i.e. `target/mir`?
2017-06-04 17:51:46 +00:00
arthurprs
4bda94d0d8 inline io::Error creation from ErrorKind 2017-06-04 19:45:44 +02:00
Marco Castelluccio
a1ca5f689f Add llvm.gcov metadata only if profiler is enabled 2017-06-04 17:50:25 +01:00
bjorn3
949b2a3f84 Update mod.rs 2017-06-04 18:16:24 +02:00
bjorn3
d1bdcbc8e5 Update lowering.rs 2017-06-04 18:15:42 +02:00
bjorn3
a9c2cdc720 Update def.rs 2017-06-04 18:15:19 +02:00
Marco Castelluccio
60524c55e9 Stop checking uses_std 2017-06-04 17:12:47 +01:00
bors
341f453448 Auto merge of #42418 - tomprince:try-deploy, r=Mark-Simulacrum
Upload linux-x86_64 artifacts on try branch.

This is an experiment to explore generating artifacts for testing with cargobmomb. See brson/cargobomb#64.
2017-06-04 15:35:37 +00:00
Marco Castelluccio
ecba8d6a23 Merge branch 'profiling' of github.com:whitequark/rust into profiling 2017-06-04 15:54:39 +01:00
bors
0da9721ab4 Auto merge of #42406 - bjorn3:patch-1, r=eddyb
Some doc comments
2017-06-04 12:36:11 +00:00
Scott McMurray
18612b21d0 Delegate str:Index(Mut) to SliceIndex<str>
Move any extra logic that the former had into the latter, so they're consistent.
2017-06-04 01:47:21 -07:00
Mark Simulacrum
d2ff798f3a Don't run travis tests on master.
This saves us builders for more helpful purposes.
2017-06-04 00:00:22 -06:00
bors
0b17b4c084 Auto merge of #42265 - Zoxc:for-sugar, r=eddyb
Change for-loop desugar to not borrow the iterator during the loop

This is enables the use of suspend points inside for-loops in movable generators. This is illegal in the current desugaring as `iter` is borrowed across the body.
2017-06-04 05:44:39 +00:00
Ulysse Carion
8d9df99fbb Explicate what "Rc" and "Arc" stand for. 2017-06-03 21:47:26 -07:00
bors
1b5a923001 Auto merge of #41968 - kennytm:fix-unreadable-json-test-output-36516, r=nikomatsakis
Introduce 'run-pass' header to 'ui' tests in compiletest. Fix issue #36516.

<del>`ui-run` test is a combination of `ui` test and `run-pass` test. It is used to test lint output.</del>

Added support of `// run-pass` header to `ui` tests.

The compiler message of each test must match the corresponding `*.stderr` file like the traditional `ui` tests. Additionally, the compiled output must be executed successfully like the `run-pass` test.

12 `run-pass`/`run-pass-fulldeps` tests are moved to `ui`/`ui-fulldeps` plus the headers. After this move, no `run-pass`/`run-pass-fulldeps` tests should rely on the compiler's JSON message. This allows us to stop passing `--error-format json` in run-pass tests, thus fixing #36516.
2017-06-04 03:23:39 +00:00
Michael Kohl
82caf2132d Create directory for dump-mir-dir automatically
Fixes #35543
2017-06-04 10:08:42 +07:00