rust/src/libstd
bors 4b17d31f11 Auto merge of #51463 - estebank:error-codes, r=nikomatsakis
Various changes to existing diagnostics

* [Add code to `invalid ABI` error, add span label, move list to help to make message shorter](https://github.com/rust-lang/rust/pull/51463/commits/23ae5af274defa9ff884f593e44a2bbcaf814a02):
```
error[E0697]: invalid ABI: found `路濫狼á́́`
  --> $DIR/unicode.rs:11:8
   |
LL | extern "路濫狼á́́" fn foo() {} //~ ERROR invalid ABI
   |        ^^^^^^^^^ invalid ABI
   |
   = help: valid ABIs: cdecl, stdcall, fastcall, vectorcall, thiscall, aapcs, win64, sysv64, ptx-kernel, msp430-interrupt, x86-interrupt, Rust, C, system, rust-intrinsic, rust-call, platform-intrinsic, unadjusted
```
* [Add code to incorrect `pub` restriction error](https://github.com/rust-lang/rust/pull/51463/commits/e96fdea8a38f39f99f8b9a4000a689187a457e08)
* [Add message to `rustc_on_unimplemented` attributes in core to have them set a custom message _and_ label](https://github.com/rust-lang/rust/pull/51463/commits/2cc7e5ed307aee936c20479cfdc7409d6b52a464):
```
error[E0277]: `W` does not have a constant size known at compile-time
  --> $DIR/unsized-enum2.rs:33:8
   |
LL |     VA(W),
   |        ^ `W` does not have a constant size known at compile-time
   |
   = help: the trait `std::marker::Sized` is not implemented for `W`
   = help: consider adding a `where W: std::marker::Sized` bound
   = note: no field of an enum variant may have a dynamically sized type
```
```
error[E0277]: `Foo` cannot be sent between threads safely
  --> $DIR/E0277-2.rs:26:5
   |
LL |     is_send::<Foo>();
   |     ^^^^^^^^^^^^^^ `Foo` cannot be sent between threads safely
   |
   = help: the trait `std::marker::Send` is not implemented for `Foo`
```
```
error[E0277]: can't compare `{integer}` with `std::string::String`
  --> $DIR/binops.rs:16:7
   |
LL |     5 < String::new();
   |       ^ no implementation for `{integer} < std::string::String` and `{integer} > std::string::String`
   |
   = help: the trait `std::cmp::PartialOrd<std::string::String>` is not implemented for `{integer}`
```
```
error[E0277]: can't compare `{integer}` with `std::result::Result<{integer}, _>`
  --> $DIR/binops.rs:17:7
   |
LL |     6 == Ok(1);
   |       ^^ no implementation for `{integer} == std::result::Result<{integer}, _>`
   |
   = help: the trait `std::cmp::PartialEq<std::result::Result<{integer}, _>>` is not implemented for `{integer}`
```
```
error[E0277]: a collection of type `i32` cannot be built from an iterator over elements of type `i32`
  --> $DIR/type-check-defaults.rs:16:19
   |
LL | struct WellFormed<Z = Foo<i32, i32>>(Z);
   |                   ^ a collection of type `i32` cannot be built from `std::iter::Iterator<Item=i32>`
   |
   = help: the trait `std::iter::FromIterator<i32>` is not implemented for `i32`
note: required by `Foo`
  --> $DIR/type-check-defaults.rs:15:1
   |
LL | struct Foo<T, U: FromIterator<T>>(T, U);
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
```
* [Add link to book for `Sized` errors](https://github.com/rust-lang/rust/pull/51463/commits/1244dc7c283323aea1a3457a4458d590a3e160c8):
```
error[E0277]: `std::fmt::Debug + std::marker::Sync + 'static` does not have a constant size known at compile-time
  --> $DIR/const-unsized.rs:13:29
   |
LL | const CONST_0: Debug+Sync = *(&0 as &(Debug+Sync));
   |                             ^^^^^^^^^^^^^^^^^^^^^^ `std::fmt::Debug + std::marker::Sync + 'static` does not have a constant size known at compile-time
   |
   = help: the trait `std::marker::Sized` is not implemented for `std::fmt::Debug + std::marker::Sync + 'static`
   = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
   = note: constant expressions must have a statically known size
```
* [Point to previous line for single expected token not found](https://github.com/rust-lang/rust/pull/51463/commits/48165168fb0f059d8536cd4a2276b609d4a7f721) (if the current token is in a different line)
2018-06-22 03:24:36 +00:00
..
collections Auto merge of #51543 - SimonSapin:oom, r=SimonSapin 2018-06-19 19:22:12 +00:00
ffi Rollup merge of #50170 - burtonageo:more_cow_from, r=alexcrichton 2018-05-17 05:22:07 +08:00
io Remove erroneous example of main as a non-Result function. 2018-06-19 18:32:44 -04:00
net Remove the deprecated std::net::{lookup_host,LookupHost} 2018-05-03 16:24:21 -07:00
os Add doc links to std::os extension traits 2018-04-14 15:32:24 -07:00
prelude Revert "Add TryFrom and TryInto to the prelude" 2018-03-30 15:54:05 +02:00
sync libstd: add an RAII utility for sys_common::mutex::Mutex 2018-06-17 15:18:32 +08:00
sys Auto merge of #51529 - nodakai:improve-sys_common-mutex, r=oli-obk 2018-06-17 20:11:35 +00:00
sys_common libstd: add an RAII utility for sys_common::mutex::Mutex 2018-06-17 15:18:32 +08:00
tests Update Cargo submodule 2018-03-11 10:59:28 -07:00
thread libstd: add an RAII utility for sys_common::mutex::Mutex 2018-06-17 15:18:32 +08:00
alloc.rs Rename OOM to allocation error 2018-06-18 21:41:24 +02:00
ascii.rs Deprecate the AsciiExt trait in favor of inherent methods 2018-03-21 17:54:33 +01:00
build.rs [fuchsia] Migrate from launchpad to fdio_spawn_etc 2018-06-07 09:22:59 -07:00
Cargo.toml Replace libbacktrace with a submodule 2018-05-30 05:58:23 -07:00
env.rs env: remove unwrap in examples in favor of try op 2018-05-14 12:56:18 +02:00
error.rs Remove deprecated heap modules 2018-06-11 13:47:27 -07:00
f32.rs Switch to 1.26 bootstrap compiler 2018-05-17 08:47:25 -06:00
f64.rs Switch to 1.26 bootstrap compiler 2018-05-17 08:47:25 -06:00
fs.rs Remove feature flag from fs::read_to_string example 2018-06-01 08:24:36 -04:00
keyword_docs.rs Add doc for fn keyword 2018-06-15 23:23:11 +02:00
lib.rs Add doc for fn keyword 2018-06-15 23:23:11 +02:00
macros.rs Add documentation about env! second argument 2018-05-24 20:08:10 +02:00
memchr.rs Fix inconsistent doc headings 2017-08-24 18:42:53 +02:00
num.rs Stabilize num::NonZeroU* 2018-05-16 19:11:31 +02:00
panic.rs Add message to rustc_on_unimplemented attributes in core 2018-06-19 15:19:13 -07:00
panicking.rs remove #[unwind(allowed)] 2018-06-03 13:46:19 +02:00
path.rs Stabilize std::path::Path:ancestors 2018-06-18 19:49:45 +02:00
primitive_docs.rs make std::str link into See also link 2018-05-09 18:30:32 -04:00
process.rs Rollup merge of #49461 - andreastt:child-kill-exited, r=Mark-Simulacrum 2018-04-24 11:56:59 +08:00
rt.rs Address review comments 2018-03-19 11:41:28 +09:00
time.rs Stabilize SystemTime::UNIX_EPOCH 2018-05-28 18:24:01 -06:00