rust/src/libcore
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
..
benches Move deny(warnings) into rustbuild 2018-04-08 16:59:14 -06:00
char mod.rs isn't beautiful 2018-05-30 22:24:24 +03:00
fmt Reexport fmt::Alignment into std 2018-06-03 17:04:48 +02:00
hash impl Hash for ! 2018-06-14 23:26:38 -04:00
iter Auto merge of #51463 - estebank:error-codes, r=nikomatsakis 2018-06-22 03:24:36 +00:00
num add some docs to conversions 2018-06-10 13:16:34 +02:00
ops Add message to rustc_on_unimplemented attributes in core 2018-06-19 15:19:13 -07:00
prelude Switch to 1.26 bootstrap compiler 2018-05-17 08:47:25 -06:00
slice Be more precise about why references need to be non-null and aligned 2018-06-09 10:40:51 +02:00
str impl Default for &mut str 2018-06-03 00:29:50 +08:00
sync Auto merge of #48553 - seanmonstar:atomic-debug, r=alexcrichton 2018-04-19 23:08:16 +00:00
tests Auto merge of #51601 - Emerentius:step_by_range_diet, r=sfackler 2018-06-21 08:55:13 +00:00
unicode Regenerate character tables for Unicode 11 2018-06-11 10:54:30 -07:00
alloc.rs Rename OOM to allocation error 2018-06-18 21:41:24 +02:00
any.rs Fix up Any doc examples 2018-05-31 13:27:08 -07:00
array.rs Revert "Stabilize the TryFrom and TryInto traits" 2018-04-20 18:10:00 +02:00
ascii.rs Correct a few stability attributes 2018-04-05 15:39:29 +01:00
borrow.rs Fix formatting. 2018-03-18 13:05:00 +01:00
Cargo.toml Switch to 1.26 bootstrap compiler 2018-05-17 08:47:25 -06:00
cell.rs Add Ref/RefMut map_split method 2018-06-13 11:35:39 -07:00
clone.rs Switch to 1.26 bootstrap compiler 2018-05-17 08:47:25 -06:00
cmp.rs Add message to rustc_on_unimplemented attributes in core 2018-06-19 15:19:13 -07:00
convert.rs Revert "Stabilize the TryFrom and TryInto traits" 2018-04-20 18:10:00 +02:00
default.rs Fix "Quasi-quoting is inefficient" warning in incremental rustbuild. 2017-07-18 01:49:40 +08:00
future.rs add a few blanket future impls to std 2018-06-08 17:56:59 -04:00
hint.rs Stabilize core::hint::unreachable_unchecked. 2018-04-16 18:29:40 +08:00
internal_macros.rs Switch to 1.26 bootstrap compiler 2018-05-17 08:47:25 -06:00
intrinsics.rs Update nomicon link in transmute docs 2018-05-25 11:47:48 -07:00
iter_private.rs Various fixes to wording consistency in the docs 2017-03-22 17:19:52 +01:00
lib.rs Stabilize #[repr(transparent)] 2018-06-12 06:49:07 +02:00
macros.rs undo payload in core::panic! changes 2018-06-03 13:46:19 +02:00
marker.rs Update message for !Sized types 2018-06-19 17:32:33 -07:00
mem.rs Document size_of for 128-bit integers 2018-06-08 19:20:28 +00:00
nonzero.rs Make core::nonzero private 2018-05-16 19:08:41 +02:00
option.rs Add Option::as_pin_mut 2018-05-22 17:24:49 -07:00
panic.rs implement #[panic_implementation] 2018-06-03 13:46:19 +02:00
panicking.rs undo payload in core::panic! changes 2018-06-03 13:46:19 +02:00
ptr.rs Remove alloc::Opaque and use *mut u8 as pointer type for GlobalAlloc 2018-06-11 13:47:23 -07:00
raw.rs Fix up various links 2017-03-20 10:10:16 -04:00
result.rs Add explanation for #[must_use] on Result 2018-05-07 10:26:28 -07:00
task.rs Improve core::task::TaskObj 2018-06-13 09:32:59 +02:00
time.rs Rollup merge of #50167 - fintelia:duration-nanos, r=sfackler 2018-06-02 13:14:22 -06:00
tuple.rs Update bootstrap compiler 2017-08-31 06:58:58 -07:00
unit.rs impl FromIterator<()> for () 2017-10-18 23:12:37 -07:00