Skip to content

Commit 4b17d31

Browse files
committed
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](23ae5af): ``` 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](e96fdea) * [Add message to `rustc_on_unimplemented` attributes in core to have them set a custom message _and_ label](2cc7e5e): ``` 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](1244dc7): ``` 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](4816516) (if the current token is in a different line)
2 parents 0b8d817 + 28cea50 commit 4b17d31

File tree

117 files changed

+559
-376
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

117 files changed

+559
-376
lines changed

src/liballoc/vec.rs

+8-2
Original file line numberDiff line numberDiff line change
@@ -1693,7 +1693,10 @@ impl<T: Hash> Hash for Vec<T> {
16931693
}
16941694

16951695
#[stable(feature = "rust1", since = "1.0.0")]
1696-
#[rustc_on_unimplemented = "vector indices are of type `usize` or ranges of `usize`"]
1696+
#[rustc_on_unimplemented(
1697+
message="vector indices are of type `usize` or ranges of `usize`",
1698+
label="vector indices are of type `usize` or ranges of `usize`",
1699+
)]
16971700
impl<T, I> Index<I> for Vec<T>
16981701
where
16991702
I: ::core::slice::SliceIndex<[T]>,
@@ -1707,7 +1710,10 @@ where
17071710
}
17081711

17091712
#[stable(feature = "rust1", since = "1.0.0")]
1710-
#[rustc_on_unimplemented = "vector indices are of type `usize` or ranges of `usize`"]
1713+
#[rustc_on_unimplemented(
1714+
message="vector indices are of type `usize` or ranges of `usize`",
1715+
label="vector indices are of type `usize` or ranges of `usize`",
1716+
)]
17111717
impl<T, I> IndexMut<I> for Vec<T>
17121718
where
17131719
I: ::core::slice::SliceIndex<[T]>,

src/libcore/cmp.rs

+8-2
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,10 @@ use self::Ordering::*;
108108
#[stable(feature = "rust1", since = "1.0.0")]
109109
#[doc(alias = "==")]
110110
#[doc(alias = "!=")]
111-
#[rustc_on_unimplemented = "can't compare `{Self}` with `{Rhs}`"]
111+
#[rustc_on_unimplemented(
112+
message="can't compare `{Self}` with `{Rhs}`",
113+
label="no implementation for `{Self} == {Rhs}`",
114+
)]
112115
pub trait PartialEq<Rhs: ?Sized = Self> {
113116
/// This method tests for `self` and `other` values to be equal, and is used
114117
/// by `==`.
@@ -611,7 +614,10 @@ impl PartialOrd for Ordering {
611614
#[doc(alias = "<")]
612615
#[doc(alias = "<=")]
613616
#[doc(alias = ">=")]
614-
#[rustc_on_unimplemented = "can't compare `{Self}` with `{Rhs}`"]
617+
#[rustc_on_unimplemented(
618+
message="can't compare `{Self}` with `{Rhs}`",
619+
label="no implementation for `{Self} < {Rhs}` and `{Self} > {Rhs}`",
620+
)]
615621
pub trait PartialOrd<Rhs: ?Sized = Self>: PartialEq<Rhs> {
616622
/// This method returns an ordering between `self` and `other` values if one exists.
617623
///

src/libcore/iter/traits.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,11 @@ use super::LoopState;
104104
/// assert_eq!(c.0, vec![0, 1, 2, 3, 4]);
105105
/// ```
106106
#[stable(feature = "rust1", since = "1.0.0")]
107-
#[rustc_on_unimplemented="a collection of type `{Self}` cannot be \
108-
built from an iterator over elements of type `{A}`"]
107+
#[rustc_on_unimplemented(
108+
message="a collection of type `{Self}` cannot be built from an iterator \
109+
over elements of type `{A}`",
110+
label="a collection of type `{Self}` cannot be built from `std::iter::Iterator<Item={A}>`",
111+
)]
109112
pub trait FromIterator<A>: Sized {
110113
/// Creates a value from an iterator.
111114
///

src/libcore/marker.rs

+10-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,10 @@ use hash::Hasher;
3939
/// [arc]: ../../std/sync/struct.Arc.html
4040
/// [ub]: ../../reference/behavior-considered-undefined.html
4141
#[stable(feature = "rust1", since = "1.0.0")]
42-
#[rustc_on_unimplemented = "`{Self}` cannot be sent between threads safely"]
42+
#[rustc_on_unimplemented(
43+
message="`{Self}` cannot be sent between threads safely",
44+
label="`{Self}` cannot be sent between threads safely"
45+
)]
4346
pub unsafe auto trait Send {
4447
// empty.
4548
}
@@ -88,7 +91,12 @@ impl<T: ?Sized> !Send for *mut T { }
8891
/// [trait object]: ../../book/first-edition/trait-objects.html
8992
#[stable(feature = "rust1", since = "1.0.0")]
9093
#[lang = "sized"]
91-
#[rustc_on_unimplemented = "`{Self}` does not have a constant size known at compile-time"]
94+
#[rustc_on_unimplemented(
95+
message="the size for value values of type `{Self}` cannot be known at compilation time",
96+
label="doesn't have a size known at compile-time",
97+
note="to learn more, visit <https://doc.rust-lang.org/book/second-edition/\
98+
ch19-04-advanced-types.html#dynamically-sized-types--sized>",
99+
)]
92100
#[fundamental] // for Default, for example, which requires that `[T]: !Default` be evaluatable
93101
pub trait Sized {
94102
// Empty.

src/libcore/ops/index.rs

+8-2
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,10 @@
6060
/// assert_eq!(nucleotide_count[Nucleotide::T], 12);
6161
/// ```
6262
#[lang = "index"]
63-
#[rustc_on_unimplemented = "the type `{Self}` cannot be indexed by `{Idx}`"]
63+
#[rustc_on_unimplemented(
64+
message="the type `{Self}` cannot be indexed by `{Idx}`",
65+
label="`{Self}` cannot be indexed by `{Idx}`",
66+
)]
6467
#[stable(feature = "rust1", since = "1.0.0")]
6568
#[doc(alias = "]")]
6669
#[doc(alias = "[")]
@@ -147,7 +150,10 @@ pub trait Index<Idx: ?Sized> {
147150
/// balance[Side::Left] = Weight::Kilogram(3.0);
148151
/// ```
149152
#[lang = "index_mut"]
150-
#[rustc_on_unimplemented = "the type `{Self}` cannot be mutably indexed by `{Idx}`"]
153+
#[rustc_on_unimplemented(
154+
message="the type `{Self}` cannot be mutably indexed by `{Idx}`",
155+
label="`{Self}` cannot be mutably indexed by `{Idx}`",
156+
)]
151157
#[stable(feature = "rust1", since = "1.0.0")]
152158
#[doc(alias = "[")]
153159
#[doc(alias = "]")]

src/libstd/panic.rs

+10-5
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,10 @@ pub use core::panic::{PanicInfo, Location};
110110
///
111111
/// [`AssertUnwindSafe`]: ./struct.AssertUnwindSafe.html
112112
#[stable(feature = "catch_unwind", since = "1.9.0")]
113-
#[rustc_on_unimplemented = "the type {Self} may not be safely transferred \
114-
across an unwind boundary"]
113+
#[rustc_on_unimplemented(
114+
message="the type `{Self}` may not be safely transferred across an unwind boundary",
115+
label="`{Self}` may not be safely transferred across an unwind boundary",
116+
)]
115117
pub auto trait UnwindSafe {}
116118

117119
/// A marker trait representing types where a shared reference is considered
@@ -126,9 +128,12 @@ pub auto trait UnwindSafe {}
126128
/// [`UnsafeCell`]: ../cell/struct.UnsafeCell.html
127129
/// [`UnwindSafe`]: ./trait.UnwindSafe.html
128130
#[stable(feature = "catch_unwind", since = "1.9.0")]
129-
#[rustc_on_unimplemented = "the type {Self} may contain interior mutability \
130-
and a reference may not be safely transferrable \
131-
across a catch_unwind boundary"]
131+
#[rustc_on_unimplemented(
132+
message="the type `{Self}` may contain interior mutability and a reference may not be safely \
133+
transferrable across a catch_unwind boundary",
134+
label="`{Self}` may contain interior mutability and a reference may not be safely \
135+
transferrable across a catch_unwind boundary",
136+
)]
132137
pub auto trait RefUnwindSafe {}
133138

134139
/// A simple wrapper around a type to assert that it is unwind safe.

src/libsyntax/diagnostic_list.rs

+2
Original file line numberDiff line numberDiff line change
@@ -397,4 +397,6 @@ register_diagnostics! {
397397
E0630, // rustc_const_unstable attribute must be paired with stable/unstable attribute
398398
E0693, // incorrect `repr(align)` attribute format
399399
E0694, // an unknown tool name found in scoped attributes
400+
E0703, // invalid ABI
401+
E0704, // incorrect visibility restriction
400402
}

src/libsyntax/parse/parser.rs

+32-17
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,26 @@ impl<'a> Parser<'a> {
638638
let mut err = self.fatal(&format!("expected `{}`, found `{}`",
639639
token_str,
640640
this_token_str));
641-
err.span_label(self.span, format!("expected `{}`", token_str));
641+
642+
let sp = if self.token == token::Token::Eof {
643+
// EOF, don't want to point at the following char, but rather the last token
644+
self.prev_span
645+
} else {
646+
self.sess.codemap().next_point(self.prev_span)
647+
};
648+
let label_exp = format!("expected `{}`", token_str);
649+
let cm = self.sess.codemap();
650+
match (cm.lookup_line(self.span.lo()), cm.lookup_line(sp.lo())) {
651+
(Ok(ref a), Ok(ref b)) if a.line == b.line => {
652+
// When the spans are in the same line, it means that the only content
653+
// between them is whitespace, point only at the found token.
654+
err.span_label(self.span, label_exp);
655+
}
656+
_ => {
657+
err.span_label(sp, label_exp);
658+
err.span_label(self.span, "unexpected token");
659+
}
660+
}
642661
Err(err)
643662
}
644663
} else {
@@ -1205,14 +1224,6 @@ impl<'a> Parser<'a> {
12051224
fn span_fatal_err<S: Into<MultiSpan>>(&self, sp: S, err: Error) -> DiagnosticBuilder<'a> {
12061225
err.span_err(sp, self.diagnostic())
12071226
}
1208-
fn span_fatal_help<S: Into<MultiSpan>>(&self,
1209-
sp: S,
1210-
m: &str,
1211-
help: &str) -> DiagnosticBuilder<'a> {
1212-
let mut err = self.sess.span_diagnostic.struct_span_fatal(sp, m);
1213-
err.help(help);
1214-
err
1215-
}
12161227
fn bug(&self, m: &str) -> ! {
12171228
self.sess.span_diagnostic.span_bug(self.span, m)
12181229
}
@@ -5985,12 +5996,13 @@ impl<'a> Parser<'a> {
59855996
`pub(super)`: visible only in the current module's parent
59865997
`pub(in path::to::module)`: visible only on the specified path"##;
59875998
let path = self.parse_path(PathStyle::Mod)?;
5988-
let path_span = self.prev_span;
5999+
let sp = self.prev_span;
59896000
let help_msg = format!("make this visible only to module `{}` with `in`", path);
59906001
self.expect(&token::CloseDelim(token::Paren))?; // `)`
5991-
let mut err = self.span_fatal_help(path_span, msg, suggestion);
6002+
let mut err = struct_span_err!(self.sess.span_diagnostic, sp, E0704, "{}", msg);
6003+
err.help(suggestion);
59926004
err.span_suggestion_with_applicability(
5993-
path_span, &help_msg, format!("in {}", path), Applicability::MachineApplicable
6005+
sp, &help_msg, format!("in {}", path), Applicability::MachineApplicable
59946006
);
59956007
err.emit(); // emit diagnostic, but continue with public visibility
59966008
}
@@ -6534,12 +6546,15 @@ impl<'a> Parser<'a> {
65346546
Some(abi) => Ok(Some(abi)),
65356547
None => {
65366548
let prev_span = self.prev_span;
6537-
self.span_err(
6549+
let mut err = struct_span_err!(
6550+
self.sess.span_diagnostic,
65386551
prev_span,
6539-
&format!("invalid ABI: expected one of [{}], \
6540-
found `{}`",
6541-
abi::all_names().join(", "),
6542-
s));
6552+
E0703,
6553+
"invalid ABI: found `{}`",
6554+
s);
6555+
err.span_label(prev_span, "invalid ABI");
6556+
err.help(&format!("valid ABIs: {}", abi::all_names().join(", ")));
6557+
err.emit();
65436558
Ok(None)
65446559
}
65456560
}

src/test/compile-fail/associated-types-unsized.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ trait Get {
1414
}
1515

1616
fn foo<T:Get>(t: T) {
17-
let x = t.get(); //~ ERROR `<T as Get>::Value: std::marker::Sized` is not
17+
let x = t.get(); //~ ERROR the size for value values of type
1818
}
1919

2020
fn main() {

src/test/compile-fail/bad-method-typaram-kind.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// except according to those terms.
1010

1111
fn foo<T:'static>() {
12-
1.bar::<T>(); //~ ERROR `T: std::marker::Send` is not satisfied
12+
1.bar::<T>(); //~ ERROR `T` cannot be sent between threads safely
1313
}
1414

1515
trait bar {

src/test/compile-fail/bad-sized.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ trait Trait {}
1313
pub fn main() {
1414
let x: Vec<Trait + Sized> = Vec::new();
1515
//~^ ERROR only auto traits can be used as additional traits in a trait object
16-
//~| ERROR the trait bound `Trait: std::marker::Sized` is not satisfied
17-
//~| ERROR the trait bound `Trait: std::marker::Sized` is not satisfied
16+
//~| ERROR the size for value values of type
17+
//~| ERROR the size for value values of type
1818
}

src/test/compile-fail/builtin-superkinds-double-superkind.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
trait Foo : Send+Sync { }
1515

1616
impl <T: Sync+'static> Foo for (T,) { }
17-
//~^ ERROR the trait bound `T: std::marker::Send` is not satisfied in `(T,)` [E0277]
17+
//~^ ERROR `T` cannot be sent between threads safely [E0277]
1818

1919
impl <T: Send> Foo for (T,T) { }
2020
//~^ ERROR `T` cannot be shared between threads safely [E0277]

src/test/compile-fail/builtin-superkinds-in-metadata.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ struct X<T>(T);
2222
impl <T:Sync> RequiresShare for X<T> { }
2323

2424
impl <T:Sync+'static> RequiresRequiresShareAndSend for X<T> { }
25-
//~^ ERROR `T: std::marker::Send` is not satisfied
25+
//~^ ERROR `T` cannot be sent between threads safely [E0277]
2626

2727
fn main() { }

src/test/compile-fail/builtin-superkinds-simple.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@
1414
trait Foo : Send { }
1515

1616
impl Foo for std::rc::Rc<i8> { }
17-
//~^ ERROR `std::rc::Rc<i8>: std::marker::Send` is not satisfied
17+
//~^ ERROR `std::rc::Rc<i8>` cannot be sent between threads safely
1818

1919
fn main() { }

src/test/compile-fail/builtin-superkinds-typaram-not-send.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
trait Foo : Send { }
1414

15-
impl <T: Sync+'static> Foo for T { } //~ ERROR `T: std::marker::Send` is not satisfied
15+
impl <T: Sync+'static> Foo for T { }
16+
//~^ ERROR `T` cannot be sent between threads safely
1617

1718
fn main() { }

src/test/compile-fail/closure-bounds-cant-promote-superkind-in-struct.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ struct X<F> where F: FnOnce() + 'static + Send {
1313
}
1414

1515
fn foo<F>(blk: F) -> X<F> where F: FnOnce() + 'static {
16-
//~^ ERROR `F: std::marker::Send` is not satisfied
16+
//~^ ERROR `F` cannot be sent between threads safely
1717
return X { field: blk };
1818
}
1919

src/test/compile-fail/dst-bad-assign-2.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,6 @@ pub fn main() {
4343
let f5: &mut Fat<ToBar> = &mut Fat { f1: 5, f2: "some str", ptr: Bar1 {f :42} };
4444
let z: Box<ToBar> = Box::new(Bar1 {f: 36});
4545
f5.ptr = *z;
46-
//~^ ERROR `ToBar: std::marker::Sized` is not satisfied
46+
//~^ ERROR the size for value values of type
47+
4748
}

src/test/compile-fail/dst-bad-assign-3.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,5 @@ pub fn main() {
4545
//~| expected type `ToBar`
4646
//~| found type `Bar1`
4747
//~| expected trait ToBar, found struct `Bar1`
48-
//~| ERROR `ToBar: std::marker::Sized` is not satisfied
48+
//~| ERROR the size for value values of type
4949
}

src/test/compile-fail/dst-bad-assign.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,5 +47,5 @@ pub fn main() {
4747
//~| expected type `ToBar`
4848
//~| found type `Bar1`
4949
//~| expected trait ToBar, found struct `Bar1`
50-
//~| ERROR `ToBar: std::marker::Sized` is not satisfied
50+
//~| ERROR the size for value values of type
5151
}

src/test/compile-fail/dst-bad-deep-2.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@ pub fn main() {
1919
let f: ([isize; 3],) = ([5, 6, 7],);
2020
let g: &([isize],) = &f;
2121
let h: &(([isize],),) = &(*g,);
22-
//~^ ERROR `[isize]: std::marker::Sized` is not satisfied
22+
//~^ ERROR the size for value values of type
2323
}

src/test/compile-fail/dst-bad-deep.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@ pub fn main() {
2121
let f: Fat<[isize; 3]> = Fat { ptr: [5, 6, 7] };
2222
let g: &Fat<[isize]> = &f;
2323
let h: &Fat<Fat<[isize]>> = &Fat { ptr: *g };
24-
//~^ ERROR `[isize]: std::marker::Sized` is not satisfied
24+
//~^ ERROR the size for value values of type
2525
}

src/test/compile-fail/dst-object-from-unsized-type.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,22 @@ impl Foo for [u8] {}
1616

1717
fn test1<T: ?Sized + Foo>(t: &T) {
1818
let u: &Foo = t;
19-
//~^ ERROR `T: std::marker::Sized` is not satisfied
19+
//~^ ERROR the size for value values of type
2020
}
2121

2222
fn test2<T: ?Sized + Foo>(t: &T) {
2323
let v: &Foo = t as &Foo;
24-
//~^ ERROR `T: std::marker::Sized` is not satisfied
24+
//~^ ERROR the size for value values of type
2525
}
2626

2727
fn test3() {
2828
let _: &[&Foo] = &["hi"];
29-
//~^ ERROR `str: std::marker::Sized` is not satisfied
29+
//~^ ERROR the size for value values of type
3030
}
3131

3232
fn test4(x: &[u8]) {
3333
let _: &Foo = x as &Foo;
34-
//~^ ERROR `[u8]: std::marker::Sized` is not satisfied
34+
//~^ ERROR the size for value values of type
3535
}
3636

3737
fn main() { }

src/test/compile-fail/dst-sized-trait-param.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
trait Foo<T> : Sized { fn take(self, x: &T) { } } // Note: T is sized
1616

1717
impl Foo<[isize]> for usize { }
18-
//~^ ERROR `[isize]: std::marker::Sized` is not satisfied
18+
//~^ ERROR the size for value values of type
1919

2020
impl Foo<isize> for [usize] { }
21-
//~^ ERROR `[usize]: std::marker::Sized` is not satisfied
21+
//~^ ERROR the size for value values of type
2222

2323
pub fn main() { }

src/test/compile-fail/extern-types-not-sync-send.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@ fn main() {
2424
//~^ ERROR `A` cannot be shared between threads safely [E0277]
2525

2626
assert_send::<A>();
27-
//~^ ERROR the trait bound `A: std::marker::Send` is not satisfied
27+
//~^ ERROR `A` cannot be sent between threads safely [E0277]
2828
}

src/test/compile-fail/extern-types-unsized.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@ fn assert_sized<T>() { }
3030

3131
fn main() {
3232
assert_sized::<A>();
33-
//~^ ERROR the trait bound `A: std::marker::Sized` is not satisfied
33+
//~^ ERROR the size for value values of type
3434

3535
assert_sized::<Foo>();
36-
//~^ ERROR the trait bound `A: std::marker::Sized` is not satisfied
36+
//~^ ERROR the size for value values of type
3737

3838
assert_sized::<Bar<A>>();
39-
//~^ ERROR the trait bound `A: std::marker::Sized` is not satisfied
39+
//~^ ERROR the size for value values of type
4040

4141
assert_sized::<Bar<Bar<A>>>();
42-
//~^ ERROR the trait bound `A: std::marker::Sized` is not satisfied
42+
//~^ ERROR the size for value values of type
4343
}

0 commit comments

Comments
 (0)