}
#[stable(feature = "rust1", since = "1.0.0")]
-#[rustc_on_unimplemented = "vector indices are of type `usize` or ranges of `usize`"]
+#[rustc_on_unimplemented(
+ message="vector indices are of type `usize` or ranges of `usize`",
+ label="vector indices are of type `usize` or ranges of `usize`",
+)]
impl<T, I> Index<I> for Vec<T>
where
I: ::core::slice::SliceIndex<[T]>,
}
#[stable(feature = "rust1", since = "1.0.0")]
-#[rustc_on_unimplemented = "vector indices are of type `usize` or ranges of `usize`"]
+#[rustc_on_unimplemented(
+ message="vector indices are of type `usize` or ranges of `usize`",
+ label="vector indices are of type `usize` or ranges of `usize`",
+)]
impl<T, I> IndexMut<I> for Vec<T>
where
I: ::core::slice::SliceIndex<[T]>,
#[stable(feature = "rust1", since = "1.0.0")]
#[doc(alias = "==")]
#[doc(alias = "!=")]
-#[rustc_on_unimplemented = "can't compare `{Self}` with `{Rhs}`"]
+#[rustc_on_unimplemented(
+ message="can't compare `{Self}` with `{Rhs}`",
+ label="no implementation for `{Self} == {Rhs}`",
+)]
pub trait PartialEq<Rhs: ?Sized = Self> {
/// This method tests for `self` and `other` values to be equal, and is used
/// by `==`.
#[doc(alias = "<")]
#[doc(alias = "<=")]
#[doc(alias = ">=")]
-#[rustc_on_unimplemented = "can't compare `{Self}` with `{Rhs}`"]
+#[rustc_on_unimplemented(
+ message="can't compare `{Self}` with `{Rhs}`",
+ label="no implementation for `{Self} < {Rhs}` and `{Self} > {Rhs}`",
+)]
pub trait PartialOrd<Rhs: ?Sized = Self>: PartialEq<Rhs> {
/// This method returns an ordering between `self` and `other` values if one exists.
///
/// assert_eq!(c.0, vec![0, 1, 2, 3, 4]);
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
-#[rustc_on_unimplemented="a collection of type `{Self}` cannot be \
- built from an iterator over elements of type `{A}`"]
+#[rustc_on_unimplemented(
+ message="a collection of type `{Self}` cannot be built from an iterator \
+ over elements of type `{A}`",
+ label="a collection of type `{Self}` cannot be built from `std::iter::Iterator<Item={A}>`",
+)]
pub trait FromIterator<A>: Sized {
/// Creates a value from an iterator.
///
/// [arc]: ../../std/sync/struct.Arc.html
/// [ub]: ../../reference/behavior-considered-undefined.html
#[stable(feature = "rust1", since = "1.0.0")]
-#[rustc_on_unimplemented = "`{Self}` cannot be sent between threads safely"]
+#[rustc_on_unimplemented(
+ message="`{Self}` cannot be sent between threads safely",
+ label="`{Self}` cannot be sent between threads safely"
+)]
pub unsafe auto trait Send {
// empty.
}
/// [trait object]: ../../book/first-edition/trait-objects.html
#[stable(feature = "rust1", since = "1.0.0")]
#[lang = "sized"]
-#[rustc_on_unimplemented = "`{Self}` does not have a constant size known at compile-time"]
+#[rustc_on_unimplemented(
+ message="the size for value values of type `{Self}` cannot be known at compilation time",
+ label="doesn't have a size known at compile-time",
+ note="to learn more, visit <https://doc.rust-lang.org/book/second-edition/\
+ ch19-04-advanced-types.html#dynamically-sized-types--sized>",
+)]
#[fundamental] // for Default, for example, which requires that `[T]: !Default` be evaluatable
pub trait Sized {
// Empty.
/// assert_eq!(nucleotide_count[Nucleotide::T], 12);
/// ```
#[lang = "index"]
-#[rustc_on_unimplemented = "the type `{Self}` cannot be indexed by `{Idx}`"]
+#[rustc_on_unimplemented(
+ message="the type `{Self}` cannot be indexed by `{Idx}`",
+ label="`{Self}` cannot be indexed by `{Idx}`",
+)]
#[stable(feature = "rust1", since = "1.0.0")]
#[doc(alias = "]")]
#[doc(alias = "[")]
/// balance[Side::Left] = Weight::Kilogram(3.0);
/// ```
#[lang = "index_mut"]
-#[rustc_on_unimplemented = "the type `{Self}` cannot be mutably indexed by `{Idx}`"]
+#[rustc_on_unimplemented(
+ message="the type `{Self}` cannot be mutably indexed by `{Idx}`",
+ label="`{Self}` cannot be mutably indexed by `{Idx}`",
+)]
#[stable(feature = "rust1", since = "1.0.0")]
#[doc(alias = "[")]
#[doc(alias = "]")]
///
/// [`AssertUnwindSafe`]: ./struct.AssertUnwindSafe.html
#[stable(feature = "catch_unwind", since = "1.9.0")]
-#[rustc_on_unimplemented = "the type {Self} may not be safely transferred \
- across an unwind boundary"]
+#[rustc_on_unimplemented(
+ message="the type `{Self}` may not be safely transferred across an unwind boundary",
+ label="`{Self}` may not be safely transferred across an unwind boundary",
+)]
pub auto trait UnwindSafe {}
/// A marker trait representing types where a shared reference is considered
/// [`UnsafeCell`]: ../cell/struct.UnsafeCell.html
/// [`UnwindSafe`]: ./trait.UnwindSafe.html
#[stable(feature = "catch_unwind", since = "1.9.0")]
-#[rustc_on_unimplemented = "the type {Self} may contain interior mutability \
- and a reference may not be safely transferrable \
- across a catch_unwind boundary"]
+#[rustc_on_unimplemented(
+ message="the type `{Self}` may contain interior mutability and a reference may not be safely \
+ transferrable across a catch_unwind boundary",
+ label="`{Self}` may contain interior mutability and a reference may not be safely \
+ transferrable across a catch_unwind boundary",
+)]
pub auto trait RefUnwindSafe {}
/// A simple wrapper around a type to assert that it is unwind safe.
E0630, // rustc_const_unstable attribute must be paired with stable/unstable attribute
E0693, // incorrect `repr(align)` attribute format
E0694, // an unknown tool name found in scoped attributes
+ E0703, // invalid ABI
+ E0704, // incorrect visibility restriction
}
let mut err = self.fatal(&format!("expected `{}`, found `{}`",
token_str,
this_token_str));
- err.span_label(self.span, format!("expected `{}`", token_str));
+
+ let sp = if self.token == token::Token::Eof {
+ // EOF, don't want to point at the following char, but rather the last token
+ self.prev_span
+ } else {
+ self.sess.codemap().next_point(self.prev_span)
+ };
+ let label_exp = format!("expected `{}`", token_str);
+ let cm = self.sess.codemap();
+ match (cm.lookup_line(self.span.lo()), cm.lookup_line(sp.lo())) {
+ (Ok(ref a), Ok(ref b)) if a.line == b.line => {
+ // When the spans are in the same line, it means that the only content
+ // between them is whitespace, point only at the found token.
+ err.span_label(self.span, label_exp);
+ }
+ _ => {
+ err.span_label(sp, label_exp);
+ err.span_label(self.span, "unexpected token");
+ }
+ }
Err(err)
}
} else {
fn span_fatal_err<S: Into<MultiSpan>>(&self, sp: S, err: Error) -> DiagnosticBuilder<'a> {
err.span_err(sp, self.diagnostic())
}
- fn span_fatal_help<S: Into<MultiSpan>>(&self,
- sp: S,
- m: &str,
- help: &str) -> DiagnosticBuilder<'a> {
- let mut err = self.sess.span_diagnostic.struct_span_fatal(sp, m);
- err.help(help);
- err
- }
fn bug(&self, m: &str) -> ! {
self.sess.span_diagnostic.span_bug(self.span, m)
}
`pub(super)`: visible only in the current module's parent
`pub(in path::to::module)`: visible only on the specified path"##;
let path = self.parse_path(PathStyle::Mod)?;
- let path_span = self.prev_span;
+ let sp = self.prev_span;
let help_msg = format!("make this visible only to module `{}` with `in`", path);
self.expect(&token::CloseDelim(token::Paren))?; // `)`
- let mut err = self.span_fatal_help(path_span, msg, suggestion);
+ let mut err = struct_span_err!(self.sess.span_diagnostic, sp, E0704, "{}", msg);
+ err.help(suggestion);
err.span_suggestion_with_applicability(
- path_span, &help_msg, format!("in {}", path), Applicability::MachineApplicable
+ sp, &help_msg, format!("in {}", path), Applicability::MachineApplicable
);
err.emit(); // emit diagnostic, but continue with public visibility
}
Some(abi) => Ok(Some(abi)),
None => {
let prev_span = self.prev_span;
- self.span_err(
+ let mut err = struct_span_err!(
+ self.sess.span_diagnostic,
prev_span,
- &format!("invalid ABI: expected one of [{}], \
- found `{}`",
- abi::all_names().join(", "),
- s));
+ E0703,
+ "invalid ABI: found `{}`",
+ s);
+ err.span_label(prev_span, "invalid ABI");
+ err.help(&format!("valid ABIs: {}", abi::all_names().join(", ")));
+ err.emit();
Ok(None)
}
}
}
fn foo<T:Get>(t: T) {
- let x = t.get(); //~ ERROR `<T as Get>::Value: std::marker::Sized` is not
+ let x = t.get(); //~ ERROR the size for value values of type
}
fn main() {
// except according to those terms.
fn foo<T:'static>() {
- 1.bar::<T>(); //~ ERROR `T: std::marker::Send` is not satisfied
+ 1.bar::<T>(); //~ ERROR `T` cannot be sent between threads safely
}
trait bar {
pub fn main() {
let x: Vec<Trait + Sized> = Vec::new();
//~^ ERROR only auto traits can be used as additional traits in a trait object
- //~| ERROR the trait bound `Trait: std::marker::Sized` is not satisfied
- //~| ERROR the trait bound `Trait: std::marker::Sized` is not satisfied
+ //~| ERROR the size for value values of type
+ //~| ERROR the size for value values of type
}
trait Foo : Send+Sync { }
impl <T: Sync+'static> Foo for (T,) { }
-//~^ ERROR the trait bound `T: std::marker::Send` is not satisfied in `(T,)` [E0277]
+//~^ ERROR `T` cannot be sent between threads safely [E0277]
impl <T: Send> Foo for (T,T) { }
//~^ ERROR `T` cannot be shared between threads safely [E0277]
impl <T:Sync> RequiresShare for X<T> { }
impl <T:Sync+'static> RequiresRequiresShareAndSend for X<T> { }
-//~^ ERROR `T: std::marker::Send` is not satisfied
+//~^ ERROR `T` cannot be sent between threads safely [E0277]
fn main() { }
trait Foo : Send { }
impl Foo for std::rc::Rc<i8> { }
-//~^ ERROR `std::rc::Rc<i8>: std::marker::Send` is not satisfied
+//~^ ERROR `std::rc::Rc<i8>` cannot be sent between threads safely
fn main() { }
trait Foo : Send { }
-impl <T: Sync+'static> Foo for T { } //~ ERROR `T: std::marker::Send` is not satisfied
+impl <T: Sync+'static> Foo for T { }
+//~^ ERROR `T` cannot be sent between threads safely
fn main() { }
}
fn foo<F>(blk: F) -> X<F> where F: FnOnce() + 'static {
- //~^ ERROR `F: std::marker::Send` is not satisfied
+ //~^ ERROR `F` cannot be sent between threads safely
return X { field: blk };
}
let f5: &mut Fat<ToBar> = &mut Fat { f1: 5, f2: "some str", ptr: Bar1 {f :42} };
let z: Box<ToBar> = Box::new(Bar1 {f: 36});
f5.ptr = *z;
- //~^ ERROR `ToBar: std::marker::Sized` is not satisfied
+ //~^ ERROR the size for value values of type
+
}
//~| expected type `ToBar`
//~| found type `Bar1`
//~| expected trait ToBar, found struct `Bar1`
- //~| ERROR `ToBar: std::marker::Sized` is not satisfied
+ //~| ERROR the size for value values of type
}
//~| expected type `ToBar`
//~| found type `Bar1`
//~| expected trait ToBar, found struct `Bar1`
- //~| ERROR `ToBar: std::marker::Sized` is not satisfied
+ //~| ERROR the size for value values of type
}
let f: ([isize; 3],) = ([5, 6, 7],);
let g: &([isize],) = &f;
let h: &(([isize],),) = &(*g,);
- //~^ ERROR `[isize]: std::marker::Sized` is not satisfied
+ //~^ ERROR the size for value values of type
}
let f: Fat<[isize; 3]> = Fat { ptr: [5, 6, 7] };
let g: &Fat<[isize]> = &f;
let h: &Fat<Fat<[isize]>> = &Fat { ptr: *g };
- //~^ ERROR `[isize]: std::marker::Sized` is not satisfied
+ //~^ ERROR the size for value values of type
}
fn test1<T: ?Sized + Foo>(t: &T) {
let u: &Foo = t;
- //~^ ERROR `T: std::marker::Sized` is not satisfied
+ //~^ ERROR the size for value values of type
}
fn test2<T: ?Sized + Foo>(t: &T) {
let v: &Foo = t as &Foo;
- //~^ ERROR `T: std::marker::Sized` is not satisfied
+ //~^ ERROR the size for value values of type
}
fn test3() {
let _: &[&Foo] = &["hi"];
- //~^ ERROR `str: std::marker::Sized` is not satisfied
+ //~^ ERROR the size for value values of type
}
fn test4(x: &[u8]) {
let _: &Foo = x as &Foo;
- //~^ ERROR `[u8]: std::marker::Sized` is not satisfied
+ //~^ ERROR the size for value values of type
}
fn main() { }
trait Foo<T> : Sized { fn take(self, x: &T) { } } // Note: T is sized
impl Foo<[isize]> for usize { }
-//~^ ERROR `[isize]: std::marker::Sized` is not satisfied
+//~^ ERROR the size for value values of type
impl Foo<isize> for [usize] { }
-//~^ ERROR `[usize]: std::marker::Sized` is not satisfied
+//~^ ERROR the size for value values of type
pub fn main() { }
//~^ ERROR `A` cannot be shared between threads safely [E0277]
assert_send::<A>();
- //~^ ERROR the trait bound `A: std::marker::Send` is not satisfied
+ //~^ ERROR `A` cannot be sent between threads safely [E0277]
}
fn main() {
assert_sized::<A>();
- //~^ ERROR the trait bound `A: std::marker::Sized` is not satisfied
+ //~^ ERROR the size for value values of type
assert_sized::<Foo>();
- //~^ ERROR the trait bound `A: std::marker::Sized` is not satisfied
+ //~^ ERROR the size for value values of type
assert_sized::<Bar<A>>();
- //~^ ERROR the trait bound `A: std::marker::Sized` is not satisfied
+ //~^ ERROR the size for value values of type
assert_sized::<Bar<Bar<A>>>();
- //~^ ERROR the trait bound `A: std::marker::Sized` is not satisfied
+ //~^ ERROR the size for value values of type
}
fn main() {
let _x = "test" as &::std::any::Any;
-//~^ ERROR `str: std::marker::Sized` is not satisfied
+ //~^ ERROR the size for value values of type
}
{
for
&mut something
-//~^ ERROR `[T]: std::marker::Sized` is not satisfied
+ //~^ ERROR the size for value values of type
in arg2
{
}
fn main() {
(|| Box::new(*(&[0][..])))();
- //~^ ERROR `[{integer}]: std::marker::Sized` is not satisfied
+ //~^ ERROR the size for value values of type
}
fn _create_render(_: &()) ->
AbstractRenderer
-//~^ ERROR: `AbstractRenderer + 'static: std::marker::Sized` is not satisfied
+//~^ ERROR the size for value values of type
{
match 0 {
_ => unimplemented!()
type FuncType<'f> = Fn(&isize) -> isize + 'f;
fn ho_func(f: Option<FuncType>) {
- //~^ ERROR: `for<'r> std::ops::Fn(&'r isize) -> isize: std::marker::Sized` is not satisfied
+ //~^ ERROR the size for value values of type
}
fn main() {}
}
trait To {
- fn to<Dst>( //~ ERROR `Self: std::marker::Sized` is not satisfied
+ fn to<Dst>( //~ ERROR the size for value values of type
self
) -> <Dst as From<Self>>::Result where Dst: From<Self> {
From::from(self)
impl The {
fn iceman(c: Vec<[i32]>) {}
- //~^ ERROR the trait bound `[i32]: std::marker::Sized` is not satisfied
+ //~^ ERROR the size for value values of type
}
fn changer<'a>(mut things: Box<Iterator<Item=&'a mut u8>>) {
for item in *things { *item = 0 }
-//~^ ERROR the trait bound `std::iter::Iterator<Item=&mut u8>: std::marker::Sized` is not satisfied
+//~^ ERROR the size for value values of type
}
fn main() {}
fn main() {
foo::<HashMap<Rc<()>, Rc<()>>>();
- //~^ ERROR: `std::rc::Rc<()>: std::marker::Send` is not satisfied
+ //~^ ERROR `std::rc::Rc<()>` cannot be sent between threads safely
}
struct Table {
rows: [[String]],
- //~^ ERROR the trait bound `[std::string::String]: std::marker::Sized` is not satisfied [E0277]
+ //~^ ERROR the size for value values of type
}
fn f(table: &Table) -> &[String] {
impl Struct {
pub fn function(funs: Vec<Fn() -> ()>) {}
- //~^ ERROR the trait bound `std::ops::Fn() + 'static: std::marker::Sized` is not satisfied
+ //~^ ERROR the size for value values of type
}
fn main() {}
fn main() {
static foo: Fn() -> u32 = || -> u32 {
- //~^ ERROR: mismatched types
- //~| ERROR: `std::ops::Fn() -> u32 + 'static: std::marker::Sized` is not satisfied
+ //~^ ERROR mismatched types
+ //~| ERROR the size for value values of type
0
};
}
#[repr(packed)]
pub struct Bad<T: ?Sized> {
- data: T, //~ ERROR `T: std::marker::Sized` is not satisfied
+ data: T, //~ ERROR the size for value values of type
}
fn main() {}
trait Foo {
const BAR: i32;
fn foo(self) -> &'static i32 {
- //~^ ERROR the trait bound `Self: std::marker::Sized` is not satisfied
+ //~^ ERROR the size for value values of type
&<Self>::BAR
}
}
enum E {
V([Box<E>]),
- //~^ ERROR the trait bound `[std::boxed::Box<E>]: std::marker::Sized` is not satisfied [E0277]
+ //~^ ERROR the size for value values of type
}
fn main() {}
// except according to those terms.
fn _test(ref _p: str) {}
-//~^ ERROR the trait bound `str: std::marker::Sized` is not satisfied [E0277]
+//~^ ERROR the size for value values of type
fn main() { }
// except according to those terms.
pub fn example(ref s: str) {}
-//~^ ERROR the trait bound `str: std::marker::Sized` is not satisfied
-//~| `str` does not have a constant size known at compile-time
-//~| the trait `std::marker::Sized` is not implemented for `str`
+//~^ ERROR the size for value values of type
fn main() {}
pub trait Foo {
fn baz(_: Self::Target) where Self: Deref {}
- //~^ ERROR `<Self as std::ops::Deref>::Target: std::marker::Sized` is not satisfied
+ //~^ ERROR the size for value values of type
}
pub fn f(_: ToString) {}
-//~^ ERROR the trait bound `std::string::ToString + 'static: std::marker::Sized` is not satisfied
+//~^ ERROR the size for value values of type
fn main() { }
}
fn new_struct(r: A+'static)
- -> Struct { //~^ ERROR `A + 'static: std::marker::Sized` is not satisfied
- //~^ ERROR `A + 'static: std::marker::Sized` is not satisfied
+ -> Struct { //~^ ERROR the size for value values of type
+ //~^ ERROR the size for value values of type
Struct { r: r }
}
fn main() {
let a = A {v: box B{v: None} as Box<Foo+Send>};
- //~^ ERROR `std::rc::Rc<std::cell::RefCell<A>>: std::marker::Send` is not satisfied
+ //~^ ERROR `std::rc::Rc<std::cell::RefCell<A>>` cannot be sent between threads safely
}
fn f<T>(val: T) {
let t: S<T> = S(marker::PhantomData);
let a = &t as &Gettable<T>;
- //~^ ERROR : std::marker::Send` is not satisfied
- //~^^ ERROR : std::marker::Copy` is not satisfied
+ //~^ ERROR `T` cannot be sent between threads safely
+ //~| ERROR : std::marker::Copy` is not satisfied
}
fn g<T>(val: T) {
let t: S<T> = S(marker::PhantomData);
let a: &Gettable<T> = &t;
- //~^ ERROR : std::marker::Send` is not satisfied
- //~^^ ERROR : std::marker::Copy` is not satisfied
+ //~^ ERROR `T` cannot be sent between threads safely
+ //~| ERROR : std::marker::Copy` is not satisfied
}
fn foo<'a>() {
fn main() {
let x = Rc::new(3);
bar(move|| foo(x));
- //~^ ERROR : std::marker::Send` is not satisfied
+ //~^ ERROR `std::rc::Rc<usize>` cannot be sent between threads safely
}
}
fn box_object_with_no_bound_not_ok<'a>() {
- assert_send::<Box<Dummy>>(); //~ ERROR : std::marker::Send` is not satisfied
+ assert_send::<Box<Dummy>>();
+ //~^ ERROR `Dummy` cannot be sent between threads safely
}
fn object_with_send_bound_ok() {
// them not ok
fn test_71<'a>() {
assert_send::<Box<Dummy+'a>>();
- //~^ ERROR : std::marker::Send` is not satisfied
+ //~^ ERROR `Dummy + 'a` cannot be sent between threads safely
}
fn main() { }
}
fn test53() {
- assert_send::<Box<Dummy>>(); //~ ERROR : std::marker::Send` is not satisfied
+ assert_send::<Box<Dummy>>();
+ //~^ ERROR `Dummy` cannot be sent between threads safely
}
// ...unless they are properly bounded
// but not if they own a bad thing
fn test40() {
- assert_send::<Box<*mut u8>>(); //~ ERROR : std::marker::Send` is not satisfied
+ assert_send::<Box<*mut u8>>();
+ //~^ ERROR `*mut u8` cannot be sent between threads safely
}
fn main() { }
fn test71<'a>() {
assert_send::<*mut &'a isize>();
- //~^ ERROR `*mut &'a isize: std::marker::Send` is not satisfied
+ //~^ ERROR `*mut &'a isize` cannot be sent between threads safely
}
fn main() {
let x = foo(Port(Rc::new(())));
thread::spawn(move|| {
- //~^ ERROR `std::rc::Rc<()>: std::marker::Send` is not satisfied
+ //~^ ERROR `std::rc::Rc<()>` cannot be sent between threads safely
let y = x;
println!("{:?}", y);
});
fn main() {
let x = Foo::A(NoSend);
bar(x);
- //~^ ERROR `NoSend: std::marker::Send` is not satisfied
+ //~^ ERROR `NoSend` cannot be sent between threads safely
}
fn main() {
let x = Rc::new(5);
bar(x);
- //~^ ERROR `std::rc::Rc<{integer}>: std::marker::Send` is not satisfied
+ //~^ ERROR `std::rc::Rc<{integer}>` cannot be sent between threads safely
}
fn main() {
let x = Foo { a: 5 };
bar(x);
- //~^ ERROR `Foo: std::marker::Send` is not satisfied
+ //~^ ERROR `Foo` cannot be sent between threads safely
}
fn main() {
assert::<Rc<RefCell<i32>>>();
- //~^ ERROR `std::cell::UnsafeCell<i32>: std::panic::RefUnwindSafe` is not satisfied
- //~^^ ERROR `std::cell::UnsafeCell<usize>: std::panic::RefUnwindSafe` is not satisfied
+ //~^ ERROR the type `std::cell::UnsafeCell<i32>` may contain interior mutability and a
+ //~| ERROR the type `std::cell::UnsafeCell<usize>` may contain interior mutability and a
}
fn main() {
assert::<Arc<RefCell<i32>>>();
- //~^ ERROR `std::cell::UnsafeCell<i32>: std::panic::RefUnwindSafe` is not satisfied
- //~^^ ERROR `std::cell::UnsafeCell<usize>: std::panic::RefUnwindSafe` is not satisfied
+ //~^ ERROR the type `std::cell::UnsafeCell<i32>` may contain interior mutability and a
+ //~| ERROR the type `std::cell::UnsafeCell<usize>` may contain interior mutability and a
}
fn main() {
assert::<&RefCell<i32>>();
- //~^ ERROR `std::cell::UnsafeCell<i32>: std::panic::RefUnwindSafe` is not satisfied
- //~^^ ERROR `std::cell::UnsafeCell<usize>: std::panic::RefUnwindSafe` is not satisfied
+ //~^ ERROR the type `std::cell::UnsafeCell<i32>` may contain interior mutability and a
+ //~| ERROR the type `std::cell::UnsafeCell<usize>` may contain interior mutability and a
}
fn main() {
assert::<*mut RefCell<i32>>();
- //~^ ERROR `std::cell::UnsafeCell<i32>: std::panic::RefUnwindSafe` is not satisfied
- //~^^ ERROR `std::cell::UnsafeCell<usize>: std::panic::RefUnwindSafe` is not satisfied
+ //~^ ERROR the type `std::cell::UnsafeCell<i32>` may contain interior mutability and a
+ //~| ERROR the type `std::cell::UnsafeCell<usize>` may contain interior mutability and a
}
fn assert<T: UnwindSafe + ?Sized>() {}
fn main() {
- assert::<&mut i32>(); //~ ERROR: UnwindSafe` is not satisfied
+ assert::<&mut i32>();
+ //~^ ERROR the type `&mut i32` may not be safely transferred across an unwind boundary
}
// Unsized type.
let arr: &[_] = &[1, 2, 3];
let range = *arr..;
- //~^ ERROR `[{integer}]: std::marker::Sized` is not satisfied
+ //~^ ERROR the size for value values of type
}
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)]
struct AllTheRanges {
a: Range<usize>,
- //~^ ERROR PartialOrd
- //~^^ ERROR Ord
+ //~^ ERROR can't compare
+ //~| ERROR Ord
b: RangeTo<usize>,
- //~^ ERROR PartialOrd
- //~^^ ERROR Ord
+ //~^ ERROR can't compare
+ //~| ERROR Ord
c: RangeFrom<usize>,
- //~^ ERROR PartialOrd
- //~^^ ERROR Ord
+ //~^ ERROR can't compare
+ //~| ERROR Ord
d: RangeFull,
- //~^ ERROR PartialOrd
- //~^^ ERROR Ord
+ //~^ ERROR can't compare
+ //~| ERROR Ord
e: RangeInclusive<usize>,
- //~^ ERROR PartialOrd
- //~^^ ERROR Ord
+ //~^ ERROR can't compare
+ //~| ERROR Ord
f: RangeToInclusive<usize>,
- //~^ ERROR PartialOrd
- //~^^ ERROR Ord
+ //~^ ERROR can't compare
+ //~| ERROR Ord
}
fn main() {}
pub fn main() {
let s: &str = "hello";
- let c: u8 = s[4]; //~ ERROR `str: std::ops::Index<{integer}>` is not satisfied
+ let c: u8 = s[4]; //~ ERROR the type `str` cannot be indexed by `{integer}`
}
fn mutate(s: &mut str) {
s[1..2] = bot();
- //~^ ERROR `str: std::marker::Sized` is not satisfied
- //~| ERROR `str: std::marker::Sized` is not satisfied
+ //~^ ERROR the size for value values of type
+ //~| ERROR the size for value values of type
s[1usize] = bot();
- //~^ ERROR `str: std::ops::IndexMut<usize>` is not satisfied
+ //~^ ERROR the type `str` cannot be mutably indexed by `usize`
}
pub fn main() {}
//[normal]~| found type `fn() {foo::<'static>}`
<str as Foo<u8>>::bar;
- //[verbose]~^ ERROR `str: std::marker::Sized` is not satisfied
- //[normal]~^^ ERROR `str: std::marker::Sized` is not satisfied
+ //[verbose]~^ ERROR the size for value values of type
+ //[normal]~^^ ERROR the size for value values of type
}
// This should emit the less confusing error, not the more confusing one.
fn foo(_x: Foo + Send) {
- //~^ ERROR the trait bound `Foo + std::marker::Send + 'static: std::marker::Sized` is not
+ //~^ ERROR the size for value values of type
}
fn main() { }
impl !Send for TestType {}
Outer(TestType);
- //~^ ERROR `dummy::TestType: std::marker::Send` is not satisfied
- //~| ERROR `dummy::TestType: std::marker::Send` is not satisfied
+ //~^ ERROR `dummy::TestType` cannot be sent between threads safely
+ //~| ERROR `dummy::TestType` cannot be sent between threads safely
}
fn dummy1b() {
impl !Send for TestType {}
is_send(TestType);
- //~^ ERROR `dummy1b::TestType: std::marker::Send` is not satisfied
+ //~^ ERROR `dummy1b::TestType` cannot be sent between threads safely
}
fn dummy1c() {
impl !Send for TestType {}
is_send((8, TestType));
- //~^ ERROR `dummy1c::TestType: std::marker::Send` is not satisfied
+ //~^ ERROR `dummy1c::TestType` cannot be sent between threads safely
}
fn dummy2() {
impl !Send for TestType {}
is_send(Box::new(TestType));
- //~^ ERROR `dummy2::TestType: std::marker::Send` is not satisfied
+ //~^ ERROR `dummy2::TestType` cannot be sent between threads safely
}
fn dummy3() {
impl !Send for TestType {}
is_send(Box::new(Outer2(TestType)));
- //~^ ERROR `dummy3::TestType: std::marker::Send` is not satisfied
+ //~^ ERROR `dummy3::TestType` cannot be sent between threads safely
}
fn main() {
// This will complain about a missing Send impl because `Sync` is implement *just*
// for T that are `Send`. Look at #20366 and #19950
is_sync(Outer2(TestType));
- //~^ ERROR `main::TestType: std::marker::Send` is not satisfied
+ //~^ ERROR `main::TestType` cannot be sent between threads safely
}
fn main() {
is_send::<MySendable>();
is_send::<MyNotSendable>();
- //~^ ERROR `MyNotSendable: std::marker::Send` is not satisfied
+ //~^ ERROR `MyNotSendable` cannot be sent between threads safely
}
#![feature(untagged_unions)]
union U {
- a: str, //~ ERROR the trait bound `str: std::marker::Sized` is not satisfied
+ a: str,
+ //~^ ERROR the size for value values of type
+
b: u8,
}
union W {
a: u8,
- b: str, //~ ERROR the trait bound `str: std::marker::Sized` is not satisfied
+ b: str,
+ //~^ ERROR the size for value values of type
}
fn main() {}
// except according to those terms.
fn bar<T: Sized>() { }
-fn foo<T: ?Sized>() { bar::<T>() } //~ ERROR `T: std::marker::Sized` is not satisfied
+fn foo<T: ?Sized>() { bar::<T>() }
+//~^ ERROR the size for value values of type
fn main() { }
enum Foo<U> { FooSome(U), FooNone }
fn foo1<T>() { not_sized::<Foo<T>>() } // Hunky dory.
fn foo2<T: ?Sized>() { not_sized::<Foo<T>>() }
-//~^ ERROR `T: std::marker::Sized` is not satisfied
+//~^ ERROR the size for value values of type
//
// Not OK: `T` is not sized.
struct S5<Y>(Y);
-impl<X: ?Sized> S5<X> { //~ ERROR E0277
+impl<X: ?Sized> S5<X> {
+ //~^ ERROR the size for value values of type
}
fn main() { }
struct Foo<T> { data: T }
fn foo1<T>() { not_sized::<Foo<T>>() } // Hunky dory.
fn foo2<T: ?Sized>() { not_sized::<Foo<T>>() }
-//~^ ERROR `T: std::marker::Sized` is not satisfied
+//~^ ERROR the size for value values of type
//
// Not OK: `T` is not sized.
struct Bar<T: ?Sized> { data: T }
fn bar1<T: ?Sized>() { not_sized::<Bar<T>>() }
fn bar2<T: ?Sized>() { is_sized::<Bar<T>>() }
-//~^ ERROR `T: std::marker::Sized` is not satisfied
+//~^ ERROR the size for value values of type
//
// Not OK: `Bar<T>` is not sized, but it should be.
struct S5<Y>(Y);
-impl<X: ?Sized> T3<X> for S5<X> { //~ ERROR E0277
+impl<X: ?Sized> T3<X> for S5<X> {
+ //~^ ERROR the size for value values of type
}
fn main() { }
}
struct S4<Y: ?Sized>(Box<Y>);
impl<X: ?Sized> T2<X> for S4<X> {
- //~^ ERROR `X: std::marker::Sized` is not satisfied
+ //~^ ERROR the size for value values of type
}
fn main() { }
// Unbounded.
fn f1<X: ?Sized>(x: &X) {
f2::<X>(x);
- //~^ ERROR `X: std::marker::Sized` is not satisfied
+ //~^ ERROR the size for value values of type
}
fn f2<X>(x: &X) {
}
}
fn f3<X: ?Sized + T>(x: &X) {
f4::<X>(x);
- //~^ ERROR `X: std::marker::Sized` is not satisfied
+ //~^ ERROR the size for value values of type
}
fn f4<X: T>(x: &X) {
}
fn f8<X: ?Sized>(x1: &S<X>, x2: &S<X>) {
f5(x1);
- //~^ ERROR `X: std::marker::Sized` is not satisfied
+ //~^ ERROR the size for value values of type
f6(x2); // ok
}
// Test some tuples.
fn f9<X: ?Sized>(x1: Box<S<X>>) {
f5(&(*x1, 34));
- //~^ ERROR `X: std::marker::Sized` is not satisfied
+ //~^ ERROR the size for value values of type
}
fn f10<X: ?Sized>(x1: Box<S<X>>) {
f5(&(32, *x1));
- //~^ ERROR `X: std::marker::Sized` is not satisfied
- //~| ERROR `X: std::marker::Sized` is not satisfied
+ //~^ ERROR the size for value values of type
+ //~| ERROR the size for value values of type
}
pub fn main() {
// Test `?Sized` types not allowed in fields (except the last one).
struct S1<X: ?Sized> {
- f1: X, //~ ERROR `X: std::marker::Sized` is not satisfied
+ f1: X,
+ //~^ ERROR the size for value values of type
f2: isize,
}
struct S2<X: ?Sized> {
f: isize,
- g: X, //~ ERROR `X: std::marker::Sized` is not satisfied
+ g: X,
+ //~^ ERROR the size for value values of type
h: isize,
}
struct S3 {
- f: str, //~ ERROR `str: std::marker::Sized` is not satisfied
+ f: str,
+ //~^ ERROR the size for value values of type
g: [usize]
}
struct S4 {
- f: [u8], //~ ERROR `[u8]: std::marker::Sized` is not satisfied
+ f: [u8],
+ //~^ ERROR the size for value values of type
g: usize
}
enum E<X: ?Sized> {
- V1(X, isize), //~ERROR `X: std::marker::Sized` is not satisfied
+ V1(X, isize),
+ //~^ ERROR the size for value values of type
}
enum F<X: ?Sized> {
- V2{f1: X, f: isize}, //~ERROR `X: std::marker::Sized` is not satisfied
+ V2{f1: X, f: isize},
+ //~^ ERROR the size for value values of type
}
pub fn main() {
fn f1<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized>(x: &X) {
let _: W; // <-- this is OK, no bindings created, no initializer.
- let _: (isize, (X, isize)); //~ERROR `X: std::marker::Sized` is not satisfie
- let y: Y; //~ERROR `Y: std::marker::Sized` is not satisfied
- let y: (isize, (Z, usize)); //~ERROR `Z: std::marker::Sized` is not satisfied
+ let _: (isize, (X, isize));
+ //~^ ERROR the size for value values of type
+ let y: Y;
+ //~^ ERROR the size for value values of type
+ let y: (isize, (Z, usize));
+ //~^ ERROR the size for value values of type
}
fn f2<X: ?Sized, Y: ?Sized>(x: &X) {
- let y: X; //~ERROR `X: std::marker::Sized` is not satisfied
- let y: (isize, (Y, isize)); //~ERROR `Y: std::marker::Sized` is not satisfied
+ let y: X;
+ //~^ ERROR the size for value values of type
+ let y: (isize, (Y, isize));
+ //~^ ERROR the size for value values of type
}
fn f3<X: ?Sized>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
- let y: X = *x1; //~ERROR `X: std::marker::Sized` is not satisfied
- let y = *x2; //~ERROR `X: std::marker::Sized` is not satisfied
- let (y, z) = (*x3, 4); //~ERROR `X: std::marker::Sized` is not satisfied
+ let y: X = *x1;
+ //~^ ERROR the size for value values of type
+ let y = *x2;
+ //~^ ERROR the size for value values of type
+ let (y, z) = (*x3, 4);
+ //~^ ERROR the size for value values of type
}
fn f4<X: ?Sized + T>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
- let y: X = *x1; //~ERROR `X: std::marker::Sized` is not satisfied
- let y = *x2; //~ERROR `X: std::marker::Sized` is not satisfied
- let (y, z) = (*x3, 4); //~ERROR `X: std::marker::Sized` is not satisfied
+ let y: X = *x1;
+ //~^ ERROR the size for value values of type
+ let y = *x2;
+ //~^ ERROR the size for value values of type
+ let (y, z) = (*x3, 4);
+ //~^ ERROR the size for value values of type
}
-fn g1<X: ?Sized>(x: X) {} //~ERROR `X: std::marker::Sized` is not satisfied
-fn g2<X: ?Sized + T>(x: X) {} //~ERROR `X: std::marker::Sized` is not satisfied
+fn g1<X: ?Sized>(x: X) {}
+//~^ ERROR the size for value values of type
+fn g2<X: ?Sized + T>(x: X) {}
+//~^ ERROR the size for value values of type
pub fn main() {
}
struct S3<Y: ?Sized>(Box<Y>);
impl<X: ?Sized + T> T1<X> for S3<X> {
- //~^ ERROR `X: std::marker::Sized` is not satisfied
+ //~^ ERROR the size for value values of type
}
fn main() { }
-error: invalid ABI: expected one of [cdecl, stdcall, fastcall, vectorcall, thiscall, aapcs, win64, sysv64, ptx-kernel, msp430-interrupt, x86-interrupt, Rust, C, system, rust-intrinsic, rust-call, platform-intrinsic, unadjusted], found `路濫狼á́́`
+error[E0703]: 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
error: aborting due to previous error
+For more information about this error, try `rustc --explain E0703`.
use std::fmt::Debug;
const CONST_0: Debug+Sync = *(&0 as &(Debug+Sync));
-//~^ ERROR `std::fmt::Debug + std::marker::Sync + 'static: std::marker::Sized` is not satisfied
+//~^ ERROR the size for value values of type
const CONST_FOO: str = *"foo";
-//~^ ERROR `str: std::marker::Sized` is not satisfied
+//~^ ERROR the size for value values of type
static STATIC_1: Debug+Sync = *(&1 as &(Debug+Sync));
-//~^ ERROR `std::fmt::Debug + std::marker::Sync + 'static: std::marker::Sized` is not satisfied
+//~^ ERROR the size for value values of type
static STATIC_BAR: str = *"bar";
-//~^ ERROR `str: std::marker::Sized` is not satisfied
+//~^ ERROR the size for value values of type
fn main() {
println!("{:?} {:?} {:?} {:?}", &CONST_0, &CONST_FOO, &STATIC_1, &STATIC_BAR);
-error[E0277]: the trait bound `std::fmt::Debug + std::marker::Sync + 'static: std::marker::Sized` is not satisfied
+error[E0277]: the size for value values of type `std::fmt::Debug + std::marker::Sync + 'static` cannot be known at compilation 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
+ | ^^^^^^^^^^^^^^^^^^^^^^ doesn't have a 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
-error[E0277]: the trait bound `str: std::marker::Sized` is not satisfied
+error[E0277]: the size for value values of type `str` cannot be known at compilation time
--> $DIR/const-unsized.rs:16:24
|
LL | const CONST_FOO: str = *"foo";
- | ^^^^^^ `str` does not have a constant size known at compile-time
+ | ^^^^^^ doesn't have a size known at compile-time
|
= help: the trait `std::marker::Sized` is not implemented for `str`
+ = 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
-error[E0277]: the trait bound `std::fmt::Debug + std::marker::Sync + 'static: std::marker::Sized` is not satisfied
+error[E0277]: the size for value values of type `std::fmt::Debug + std::marker::Sync + 'static` cannot be known at compilation time
--> $DIR/const-unsized.rs:19:31
|
LL | static STATIC_1: Debug+Sync = *(&1 as &(Debug+Sync));
- | ^^^^^^^^^^^^^^^^^^^^^^ `std::fmt::Debug + std::marker::Sync + 'static` does not have a constant size known at compile-time
+ | ^^^^^^^^^^^^^^^^^^^^^^ doesn't have a 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
-error[E0277]: the trait bound `str: std::marker::Sized` is not satisfied
+error[E0277]: the size for value values of type `str` cannot be known at compilation time
--> $DIR/const-unsized.rs:22:26
|
LL | static STATIC_BAR: str = *"bar";
- | ^^^^^^ `str` does not have a constant size known at compile-time
+ | ^^^^^^ doesn't have a size known at compile-time
|
= help: the trait `std::marker::Sized` is not implemented for `str`
+ = 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
error: aborting due to 4 previous errors
fn main() {
is_send::<Foo>();
- //~^ ERROR the trait bound `*const u8: std::marker::Send` is not satisfied in `Foo`
+ //~^ ERROR `*const u8` cannot be sent between threads safely
}
-error[E0277]: the trait bound `*const u8: std::marker::Send` is not satisfied in `Foo`
+error[E0277]: `*const u8` cannot be sent between threads safely
--> $DIR/E0277-2.rs:26:5
|
LL | is_send::<Foo>();
}
fn f(p: Path) { }
-//~^ ERROR the trait bound `[u8]: std::marker::Sized` is not satisfied in `std::path::Path`
+//~^ ERROR the size for value values of type
fn main() {
some_func(5i32);
-error[E0277]: the trait bound `[u8]: std::marker::Sized` is not satisfied in `std::path::Path`
+error[E0277]: the size for value values of type `[u8]` cannot be known at compilation time
--> $DIR/E0277.rs:23:6
|
LL | fn f(p: Path) { }
- | ^ `[u8]` does not have a constant size known at compile-time
+ | ^ doesn't have a size known at compile-time
|
= help: within `std::path::Path`, the trait `std::marker::Sized` is not implemented for `[u8]`
+ = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
= note: required because it appears within the type `std::path::Path`
= note: all local variables must have a statically known size
= help: see issue #48214
= help: add #![feature(trivial_bounds)] to the crate attributes to enable
-error[E0277]: the trait bound `str: std::marker::Sized` is not satisfied
+error[E0277]: the size for value values of type `str` cannot be known at compilation time
--> $DIR/feature-gate-trivial_bounds.rs:62:1
|
LL | struct TwoStrs(str, str) where str: Sized; //~ ERROR
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `str` does not have a constant size known at compile-time
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
= help: the trait `std::marker::Sized` is not implemented for `str`
+ = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
= help: see issue #48214
= help: add #![feature(trivial_bounds)] to the crate attributes to enable
-error[E0277]: the trait bound `A + 'static: std::marker::Sized` is not satisfied in `Dst<A + 'static>`
+error[E0277]: the size for value values of type `A + 'static` cannot be known at compilation time
--> $DIR/feature-gate-trivial_bounds.rs:65:1
|
LL | / fn unsized_local() where Dst<A>: Sized { //~ ERROR
LL | | let x: Dst<A> = *(Box::new(Dst { x: 1 }) as Box<Dst<A>>);
LL | | }
- | |_^ `A + 'static` does not have a constant size known at compile-time
+ | |_^ doesn't have a size known at compile-time
|
= help: within `Dst<A + 'static>`, the trait `std::marker::Sized` is not implemented for `A + 'static`
+ = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
= note: required because it appears within the type `Dst<A + 'static>`
= help: see issue #48214
= help: add #![feature(trivial_bounds)] to the crate attributes to enable
-error[E0277]: the trait bound `str: std::marker::Sized` is not satisfied
+error[E0277]: the size for value values of type `str` cannot be known at compilation time
--> $DIR/feature-gate-trivial_bounds.rs:69:1
|
LL | / fn return_str() -> str where str: Sized { //~ ERROR
LL | | *"Sized".to_string().into_boxed_str()
LL | | }
- | |_^ `str` does not have a constant size known at compile-time
+ | |_^ doesn't have a size known at compile-time
|
= help: the trait `std::marker::Sized` is not implemented for `str`
+ = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
= help: see issue #48214
= help: add #![feature(trivial_bounds)] to the crate attributes to enable
fn main() {
let s = String::from("foo");
- let mut gen = move || { //~ ERROR the trait bound `str: std::marker::Sized` is not satisfied
+ let mut gen = move || {
+ //~^ ERROR the size for value values of type
yield s[..];
};
- unsafe { gen.resume(); } //~ ERROR the trait bound `str: std::marker::Sized` is not satisfied
+ unsafe { gen.resume(); }
+ //~^ ERROR the size for value values of type
}
-error[E0277]: the trait bound `str: std::marker::Sized` is not satisfied
+error[E0277]: the size for value values of type `str` cannot be known at compilation time
--> $DIR/sized-yield.rs:17:26
|
-LL | let mut gen = move || { //~ ERROR the trait bound `str: std::marker::Sized` is not satisfied
+LL | let mut gen = move || {
| __________________________^
+LL | | //~^ ERROR the size for value values of type
LL | | yield s[..];
LL | | };
- | |____^ `str` does not have a constant size known at compile-time
+ | |____^ doesn't have a size known at compile-time
|
= help: the trait `std::marker::Sized` is not implemented for `str`
+ = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
= note: the yield type of a generator must have a statically known size
-error[E0277]: the trait bound `str: std::marker::Sized` is not satisfied
- --> $DIR/sized-yield.rs:20:17
+error[E0277]: the size for value values of type `str` cannot be known at compilation time
+ --> $DIR/sized-yield.rs:21:17
|
-LL | unsafe { gen.resume(); } //~ ERROR the trait bound `str: std::marker::Sized` is not satisfied
- | ^^^^^^ `str` does not have a constant size known at compile-time
+LL | unsafe { gen.resume(); }
+ | ^^^^^^ doesn't have a size known at compile-time
|
= help: the trait `std::marker::Sized` is not implemented for `str`
+ = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
error: aborting due to 2 previous errors
//~^ ERROR cycle detected
//~| ERROR cycle detected
send(cycle2().clone());
- //~^ ERROR Send` is not satisfied
+ //~^ ERROR `std::rc::Rc<std::string::String>` cannot be sent between threads safely
Rc::new(Cell::new(5))
}
| ^^^^^^^^^^^^^^^^^^^^^^^^^
= note: ...which again requires processing `cycle1::{{exist-impl-Trait}}`, completing the cycle
-error[E0277]: the trait bound `std::rc::Rc<std::string::String>: std::marker::Send` is not satisfied in `impl std::clone::Clone`
+error[E0277]: `std::rc::Rc<std::string::String>` cannot be sent between threads safely
--> $DIR/auto-trait-leak.rs:27:5
|
LL | send(cycle2().clone());
fn main() {
send(before());
- //~^ ERROR the trait bound `std::rc::Rc<std::cell::Cell<i32>>: std::marker::Send` is not satisfied
+ //~^ ERROR `std::rc::Rc<std::cell::Cell<i32>>` cannot be sent between threads safely
send(after());
- //~^ ERROR the trait bound `std::rc::Rc<std::cell::Cell<i32>>: std::marker::Send` is not satisfied
+ //~^ ERROR `std::rc::Rc<std::cell::Cell<i32>>` cannot be sent between threads safely
}
// Deferred path, main has to wait until typeck finishes,
-error[E0277]: the trait bound `std::rc::Rc<std::cell::Cell<i32>>: std::marker::Send` is not satisfied in `impl std::ops::Fn<(i32,)>`
+error[E0277]: `std::rc::Rc<std::cell::Cell<i32>>` cannot be sent between threads safely
--> $DIR/auto-trait-leak2.rs:25:5
|
LL | send(before());
LL | fn send<T: Send>(_: T) {}
| ^^^^^^^^^^^^^^^^^^^^^^
-error[E0277]: the trait bound `std::rc::Rc<std::cell::Cell<i32>>: std::marker::Send` is not satisfied in `impl std::ops::Fn<(i32,)>`
+error[E0277]: `std::rc::Rc<std::cell::Cell<i32>>` cannot be sent between threads safely
--> $DIR/auto-trait-leak2.rs:28:5
|
LL | send(after());
use std::panic::catch_unwind;
fn main() {
let mut x = Cell::new(22);
- catch_unwind(|| { x.set(23); }); //~ ERROR the trait bound
+ catch_unwind(|| { x.set(23); });
+ //~^ ERROR the type `std::cell::UnsafeCell<i32>` may contain interior mutability and a
}
-error[E0277]: the trait bound `std::cell::UnsafeCell<i32>: std::panic::RefUnwindSafe` is not satisfied in `std::cell::Cell<i32>`
+error[E0277]: the type `std::cell::UnsafeCell<i32>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
--> $DIR/interior-mutability.rs:15:5
|
-LL | catch_unwind(|| { x.set(23); }); //~ ERROR the trait bound
- | ^^^^^^^^^^^^ the type std::cell::UnsafeCell<i32> may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
+LL | catch_unwind(|| { x.set(23); });
+ | ^^^^^^^^^^^^ `std::cell::UnsafeCell<i32>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
|
= help: within `std::cell::Cell<i32>`, the trait `std::panic::RefUnwindSafe` is not implemented for `std::cell::UnsafeCell<i32>`
= note: required because it appears within the type `std::cell::Cell<i32>`
2 as usize - Some(1); //~ ERROR cannot subtract `std::option::Option<{integer}>` from `usize`
3 * (); //~ ERROR cannot multiply `()` to `{integer}`
4 / ""; //~ ERROR cannot divide `{integer}` by `&str`
- 5 < String::new(); //~ ERROR is not satisfied
- 6 == Ok(1); //~ ERROR is not satisfied
+ 5 < String::new(); //~ ERROR can't compare `{integer}` with `std::string::String`
+ 6 == Ok(1); //~ ERROR can't compare `{integer}` with `std::result::Result<{integer}, _>`
}
|
= help: the trait `std::ops::Div<&str>` is not implemented for `{integer}`
-error[E0277]: the trait bound `{integer}: std::cmp::PartialOrd<std::string::String>` is not satisfied
+error[E0277]: can't compare `{integer}` with `std::string::String`
--> $DIR/binops.rs:16:7
|
-LL | 5 < String::new(); //~ ERROR is not satisfied
- | ^ can't compare `{integer}` with `std::string::String`
+LL | 5 < String::new(); //~ ERROR can't compare `{integer}` with `std::string::String`
+ | ^ 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]: the trait bound `{integer}: std::cmp::PartialEq<std::result::Result<{integer}, _>>` is not satisfied
+error[E0277]: can't compare `{integer}` with `std::result::Result<{integer}, _>`
--> $DIR/binops.rs:17:7
|
-LL | 6 == Ok(1); //~ ERROR is not satisfied
- | ^^ can't compare `{integer}` with `std::result::Result<{integer}, _>`
+LL | 6 == Ok(1); //~ ERROR can't compare `{integer}` with `std::result::Result<{integer}, _>`
+ | ^^ no implementation for `{integer} == std::result::Result<{integer}, _>`
|
= help: the trait `std::cmp::PartialEq<std::result::Result<{integer}, _>>` is not implemented for `{integer}`
let _ = 42usize as *const [u8]; //~ ERROR is invalid
let _ = v as *const [u8]; //~ ERROR cannot cast
- let _ = fat_v as *const Foo; //~ ERROR is not satisfied
+ let _ = fat_v as *const Foo; //~ ERROR the size for value values of type
let _ = foo as *const str; //~ ERROR is invalid
let _ = foo as *mut str; //~ ERROR is invalid
let _ = main as *mut str; //~ ERROR is invalid
let _ = fat_sv as usize; //~ ERROR is invalid
let a : *const str = "hello";
- let _ = a as *const Foo; //~ ERROR is not satisfied
+ let _ = a as *const Foo; //~ ERROR the size for value values of type
// check no error cascade
let _ = main.f as *const u32; //~ ERROR no field
|
= note: vtable kinds may not match
-error[E0277]: the trait bound `[u8]: std::marker::Sized` is not satisfied
+error[E0277]: the size for value values of type `[u8]` cannot be known at compilation time
--> $DIR/cast-rfc0401.rs:63:13
|
-LL | let _ = fat_v as *const Foo; //~ ERROR is not satisfied
- | ^^^^^ `[u8]` does not have a constant size known at compile-time
+LL | let _ = fat_v as *const Foo; //~ ERROR the size for value values of type
+ | ^^^^^ doesn't have a size known at compile-time
|
= help: the trait `std::marker::Sized` is not implemented for `[u8]`
+ = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
= note: required for the cast to the object type `Foo`
-error[E0277]: the trait bound `str: std::marker::Sized` is not satisfied
+error[E0277]: the size for value values of type `str` cannot be known at compilation time
--> $DIR/cast-rfc0401.rs:72:13
|
-LL | let _ = a as *const Foo; //~ ERROR is not satisfied
- | ^ `str` does not have a constant size known at compile-time
+LL | let _ = a as *const Foo; //~ ERROR the size for value values of type
+ | ^ doesn't have a size known at compile-time
|
= help: the trait `std::marker::Sized` is not implemented for `str`
+ = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
= note: required for the cast to the object type `Foo`
error[E0606]: casting `&{float}` as `f32` is invalid
--- /dev/null
+// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// Tests that two closures cannot simultaneously have mutable
+// access to the variable, whether that mutable access be used
+// for direct assignment or for taking mutable ref. Issue #6801.
+
+#![feature(on_unimplemented)]
+
+#[rustc_on_unimplemented(
+ message="the message"
+ label="the label"
+)]
+trait T {}
+//~^^^ ERROR expected one of `)` or `,`, found `label`
--- /dev/null
+error: expected one of `)` or `,`, found `label`
+ --> $DIR/expected-comma-found-token.rs:19:5
+ |
+LL | message="the message"
+ | - expected one of `)` or `,` here
+LL | label="the label"
+ | ^^^^^ unexpected token
+
+error: aborting due to previous error
+
-error[E0277]: the trait bound `&T: std::cmp::PartialEq<T>` is not satisfied
+error[E0277]: can't compare `&T` with `T`
--> $DIR/partialeq_help.rs:12:7
|
LL | a == b; //~ ERROR E0277
- | ^^ can't compare `&T` with `T`
+ | ^^ no implementation for `&T == T`
|
= help: the trait `std::cmp::PartialEq<T>` is not implemented for `&T`
= help: consider adding a `where &T: std::cmp::PartialEq<T>` bound
-error: incorrect visibility restriction
+error[E0704]: incorrect visibility restriction
--> $DIR/pub-restricted.rs:15:6
|
LL | pub (a) fn afn() {} //~ incorrect visibility restriction
`pub(super)`: visible only in the current module's parent
`pub(in path::to::module)`: visible only on the specified path
-error: incorrect visibility restriction
+error[E0704]: incorrect visibility restriction
--> $DIR/pub-restricted.rs:16:6
|
LL | pub (b) fn bfn() {} //~ incorrect visibility restriction
`pub(super)`: visible only in the current module's parent
`pub(in path::to::module)`: visible only on the specified path
-error: incorrect visibility restriction
+error[E0704]: incorrect visibility restriction
--> $DIR/pub-restricted.rs:32:14
|
LL | pub (a) invalid: usize, //~ incorrect visibility restriction
`pub(super)`: visible only in the current module's parent
`pub(in path::to::module)`: visible only on the specified path
-error: incorrect visibility restriction
+error[E0704]: incorrect visibility restriction
--> $DIR/pub-restricted.rs:41:6
|
LL | pub (xyz) fn xyz() {} //~ incorrect visibility restriction
error: aborting due to 5 previous errors
+For more information about this error, try `rustc --explain E0704`.
trait I {}
type K = I+'static;
-fn foo(_x: K) {} //~ ERROR: `I + 'static: std::marker::Sized` is not satisfied
+fn foo(_x: K) {}
+//~^ ERROR the size for value values of type
fn main() {}
-error[E0277]: the trait bound `I + 'static: std::marker::Sized` is not satisfied
+error[E0277]: the size for value values of type `I + 'static` cannot be known at compilation time
--> $DIR/issue-5035-2.rs:14:8
|
-LL | fn foo(_x: K) {} //~ ERROR: `I + 'static: std::marker::Sized` is not satisfied
- | ^^ `I + 'static` does not have a constant size known at compile-time
+LL | fn foo(_x: K) {}
+ | ^^ doesn't have a size known at compile-time
|
= help: the trait `std::marker::Sized` is not implemented for `I + 'static`
+ = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
= note: all local variables must have a statically known size
error: aborting due to previous error
let u: &str = if true { s[..2] } else { s };
//~^ ERROR mismatched types
let v = s[..2];
- //~^ ERROR the trait bound `str: std::marker::Sized` is not satisfied
+ //~^ ERROR the size for value values of type
let w: &str = s[..2];
//~^ ERROR mismatched types
}
= note: expected type `&str`
found type `str`
-error[E0277]: the trait bound `str: std::marker::Sized` is not satisfied
+error[E0277]: the size for value values of type `str` cannot be known at compilation time
--> $DIR/str-array-assignment.rs:17:7
|
LL | let v = s[..2];
| ^ ------ help: consider borrowing here: `&s[..2]`
| |
- | `str` does not have a constant size known at compile-time
+ | doesn't have a size known at compile-time
|
= help: the trait `std::marker::Sized` is not implemented for `str`
+ = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
= note: all local variables must have a statically known size
error[E0308]: mismatched types
fn check<T: Iterator, U: ?Sized>() {
// suggest a where-clause, if needed
mem::size_of::<U>();
- //~^ ERROR `U: std::marker::Sized` is not satisfied
+ //~^ ERROR the size for value values of type
mem::size_of::<Misc<U>>();
- //~^ ERROR `U: std::marker::Sized` is not satisfied
+ //~^ ERROR the size for value values of type
// ... even if T occurs as a type parameter
// ... and also not if the error is not related to the type
mem::size_of::<[T]>();
- //~^ ERROR `[T]: std::marker::Sized` is not satisfied
+ //~^ ERROR the size for value values of type
mem::size_of::<[&U]>();
- //~^ ERROR `[&U]: std::marker::Sized` is not satisfied
+ //~^ ERROR the size for value values of type
}
fn main() {
-error[E0277]: the trait bound `U: std::marker::Sized` is not satisfied
+error[E0277]: the size for value values of type `U` cannot be known at compilation time
--> $DIR/trait-suggest-where-clause.rs:17:5
|
LL | mem::size_of::<U>();
- | ^^^^^^^^^^^^^^^^^ `U` does not have a constant size known at compile-time
+ | ^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
= help: the trait `std::marker::Sized` is not implemented for `U`
+ = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
= help: consider adding a `where U: std::marker::Sized` bound
= note: required by `std::mem::size_of`
-error[E0277]: the trait bound `U: std::marker::Sized` is not satisfied in `Misc<U>`
+error[E0277]: the size for value values of type `U` cannot be known at compilation time
--> $DIR/trait-suggest-where-clause.rs:20:5
|
LL | mem::size_of::<Misc<U>>();
- | ^^^^^^^^^^^^^^^^^^^^^^^ `U` does not have a constant size known at compile-time
+ | ^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
= help: within `Misc<U>`, the trait `std::marker::Sized` is not implemented for `U`
+ = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
= help: consider adding a `where U: std::marker::Sized` bound
= note: required because it appears within the type `Misc<U>`
= note: required by `std::mem::size_of`
|
= note: required by `std::convert::From::from`
-error[E0277]: the trait bound `[T]: std::marker::Sized` is not satisfied
+error[E0277]: the size for value values of type `[T]` cannot be known at compilation time
--> $DIR/trait-suggest-where-clause.rs:38:5
|
LL | mem::size_of::<[T]>();
- | ^^^^^^^^^^^^^^^^^^^ `[T]` does not have a constant size known at compile-time
+ | ^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
= help: the trait `std::marker::Sized` is not implemented for `[T]`
+ = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
= note: required by `std::mem::size_of`
-error[E0277]: the trait bound `[&U]: std::marker::Sized` is not satisfied
+error[E0277]: the size for value values of type `[&U]` cannot be known at compilation time
--> $DIR/trait-suggest-where-clause.rs:41:5
|
LL | mem::size_of::<[&U]>();
- | ^^^^^^^^^^^^^^^^^^^^ `[&U]` does not have a constant size known at compile-time
+ | ^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
= help: the trait `std::marker::Sized` is not implemented for `[&U]`
+ = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
= note: required by `std::mem::size_of`
error: aborting due to 7 previous errors
-error[E0277]: the trait bound `str: std::marker::Sized` is not satisfied
+error[E0277]: the size for value values of type `str` cannot be known at compilation time
--> $DIR/trivial-bounds-leak.rs:22:25
|
LL | fn cant_return_str() -> str { //~ ERROR
- | ^^^ `str` does not have a constant size known at compile-time
+ | ^^^ doesn't have a size known at compile-time
|
= help: the trait `std::marker::Sized` is not implemented for `str`
+ = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
= note: the return type of a function must have a statically known size
error[E0599]: no method named `test` found for type `i32` in the current scope
struct Foo<T, U: FromIterator<T>>(T, U);
struct WellFormed<Z = Foo<i32, i32>>(Z);
-//~^ error: the trait bound `i32: std::iter::FromIterator<i32>` is not satisfied [E0277]
+//~^ ERROR a collection of type `i32` cannot be built from an iterator over elements of type `i32`
struct WellFormedNoBounds<Z:?Sized = Foo<i32, i32>>(Z);
-//~^ error: the trait bound `i32: std::iter::FromIterator<i32>` is not satisfied [E0277]
+//~^ ERROR a collection of type `i32` cannot be built from an iterator over elements of type `i32`
struct Bounds<T:Copy=String>(T);
-//~^ error: the trait bound `std::string::String: std::marker::Copy` is not satisfied [E0277]
+//~^ ERROR the trait bound `std::string::String: std::marker::Copy` is not satisfied [E0277]
struct WhereClause<T=String>(T) where T: Copy;
-//~^ error: the trait bound `std::string::String: std::marker::Copy` is not satisfied [E0277]
+//~^ ERROR the trait bound `std::string::String: std::marker::Copy` is not satisfied [E0277]
trait TraitBound<T:Copy=String> {}
-//~^ error: the trait bound `std::string::String: std::marker::Copy` is not satisfied [E0277]
+//~^ ERROR the trait bound `std::string::String: std::marker::Copy` is not satisfied [E0277]
trait Super<T: Copy> { }
trait Base<T = String>: Super<T> { }
-//~^ error: the trait bound `T: std::marker::Copy` is not satisfied [E0277]
+//~^ ERROR the trait bound `T: std::marker::Copy` is not satisfied [E0277]
trait ProjectionPred<T:Iterator = IntoIter<i32>> where T::Item : Add<u8> {}
-//~^ error: cannot add `u8` to `i32` [E0277]
+//~^ ERROR cannot add `u8` to `i32` [E0277]
fn main() { }
-error[E0277]: the trait bound `i32: std::iter::FromIterator<i32>` is not satisfied
+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 an iterator over elements of type `i32`
+ | ^ 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`
LL | struct Foo<T, U: FromIterator<T>>(T, U);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-error[E0277]: the trait bound `i32: std::iter::FromIterator<i32>` is not satisfied
+error[E0277]: a collection of type `i32` cannot be built from an iterator over elements of type `i32`
--> $DIR/type-check-defaults.rs:18:27
|
LL | struct WellFormedNoBounds<Z:?Sized = Foo<i32, i32>>(Z);
- | ^ a collection of type `i32` cannot be built from an iterator over elements of type `i32`
+ | ^ 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`
#![feature(untagged_unions)]
union Foo<T: ?Sized> {
- value: T, //~ ERROR the trait bound `T: std::marker::Sized` is not satisfied
+ value: T,
+ //~^ ERROR the size for value values of type
}
struct Foo2<T: ?Sized> {
- value: T, //~ ERROR the trait bound `T: std::marker::Sized` is not satisfied
+ value: T,
+ //~^ ERROR the size for value values of type
t: u32,
}
enum Foo3<T: ?Sized> {
- Value(T), //~ ERROR the trait bound `T: std::marker::Sized` is not satisfied
+ Value(T),
+ //~^ ERROR the size for value values of type
}
fn main() {}
-error[E0277]: the trait bound `T: std::marker::Sized` is not satisfied
+error[E0277]: the size for value values of type `T` cannot be known at compilation time
--> $DIR/union-sized-field.rs:14:5
|
-LL | value: T, //~ ERROR the trait bound `T: std::marker::Sized` is not satisfied
- | ^^^^^^^^ `T` does not have a constant size known at compile-time
+LL | value: T,
+ | ^^^^^^^^ doesn't have a size known at compile-time
|
= help: the trait `std::marker::Sized` is not implemented for `T`
+ = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
= help: consider adding a `where T: std::marker::Sized` bound
= note: no field of a union may have a dynamically sized type
-error[E0277]: the trait bound `T: std::marker::Sized` is not satisfied
- --> $DIR/union-sized-field.rs:18:5
+error[E0277]: the size for value values of type `T` cannot be known at compilation time
+ --> $DIR/union-sized-field.rs:19:5
|
-LL | value: T, //~ ERROR the trait bound `T: std::marker::Sized` is not satisfied
- | ^^^^^^^^ `T` does not have a constant size known at compile-time
+LL | value: T,
+ | ^^^^^^^^ doesn't have a size known at compile-time
|
= help: the trait `std::marker::Sized` is not implemented for `T`
+ = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
= help: consider adding a `where T: std::marker::Sized` bound
= note: only the last field of a struct may have a dynamically sized type
-error[E0277]: the trait bound `T: std::marker::Sized` is not satisfied
- --> $DIR/union-sized-field.rs:23:11
+error[E0277]: the size for value values of type `T` cannot be known at compilation time
+ --> $DIR/union-sized-field.rs:25:11
|
-LL | Value(T), //~ ERROR the trait bound `T: std::marker::Sized` is not satisfied
- | ^ `T` does not have a constant size known at compile-time
+LL | Value(T),
+ | ^ doesn't have a size known at compile-time
|
= help: the trait `std::marker::Sized` is not implemented for `T`
+ = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
= help: consider adding a `where T: std::marker::Sized` bound
= note: no field of an enum variant may have a dynamically sized type
enum E<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized> {
// parameter
- VA(W), //~ ERROR `W: std::marker::Sized` is not satisfied
- VB{x: X}, //~ ERROR `X: std::marker::Sized` is not satisfied
- VC(isize, Y), //~ ERROR `Y: std::marker::Sized` is not satisfied
- VD{u: isize, x: Z}, //~ ERROR `Z: std::marker::Sized` is not satisfied
+ VA(W),
+ //~^ ERROR the size for value values of type
+ VB{x: X},
+ //~^ ERROR the size for value values of type
+ VC(isize, Y),
+ //~^ ERROR the size for value values of type
+ VD{u: isize, x: Z},
+ //~^ ERROR the size for value values of type
// slice / str
- VE([u8]), //~ ERROR `[u8]: std::marker::Sized` is not satisfied
- VF{x: str}, //~ ERROR `str: std::marker::Sized` is not satisfied
- VG(isize, [f32]), //~ ERROR `[f32]: std::marker::Sized` is not satisfied
- VH{u: isize, x: [u32]}, //~ ERROR `[u32]: std::marker::Sized` is not satisfied
+ VE([u8]),
+ //~^ ERROR the size for value values of type
+ VF{x: str},
+ //~^ ERROR the size for value values of type
+ VG(isize, [f32]),
+ //~^ ERROR the size for value values of type
+ VH{u: isize, x: [u32]},
+ //~^ ERROR the size for value values of type
// unsized struct
- VI(Path1), //~ ERROR `PathHelper1 + 'static: std::marker::Sized` is not satisfied
- VJ{x: Path2}, //~ ERROR `PathHelper2 + 'static: std::marker::Sized` is not satisfied
- VK(isize, Path3), //~ ERROR `PathHelper3 + 'static: std::marker::Sized` is not satisfied
- VL{u: isize, x: Path4}, //~ ERROR `PathHelper4 + 'static: std::marker::Sized` is not satisfied
+ VI(Path1),
+ //~^ ERROR the size for value values of type
+ VJ{x: Path2},
+ //~^ ERROR the size for value values of type
+ VK(isize, Path3),
+ //~^ ERROR the size for value values of type
+ VL{u: isize, x: Path4},
+ //~^ ERROR the size for value values of type
// plain trait
- VM(Foo), //~ ERROR `Foo + 'static: std::marker::Sized` is not satisfied
- VN{x: Bar}, //~ ERROR `Bar + 'static: std::marker::Sized` is not satisfied
- VO(isize, FooBar), //~ ERROR `FooBar + 'static: std::marker::Sized` is not satisfied
- VP{u: isize, x: BarFoo}, //~ ERROR `BarFoo + 'static: std::marker::Sized` is not satisfied
+ VM(Foo),
+ //~^ ERROR the size for value values of type
+ VN{x: Bar},
+ //~^ ERROR the size for value values of type
+ VO(isize, FooBar),
+ //~^ ERROR the size for value values of type
+ VP{u: isize, x: BarFoo},
+ //~^ ERROR the size for value values of type
// projected
- VQ(<&'static [i8] as Deref>::Target), //~ ERROR `[i8]: std::marker::Sized` is not satisfied
+ VQ(<&'static [i8] as Deref>::Target),
+ //~^ ERROR the size for value values of type
VR{x: <&'static [char] as Deref>::Target},
- //~^ ERROR `[char]: std::marker::Sized` is not satisfied
+ //~^ ERROR the size for value values of type
VS(isize, <&'static [f64] as Deref>::Target),
- //~^ ERROR `[f64]: std::marker::Sized` is not satisfied
+ //~^ ERROR the size for value values of type
VT{u: isize, x: <&'static [i32] as Deref>::Target},
- //~^ ERROR `[i32]: std::marker::Sized` is not satisfied
+ //~^ ERROR the size for value values of type
}
-error[E0277]: the trait bound `W: std::marker::Sized` is not satisfied
+error[E0277]: the size for value values of type `W` cannot be known at compilation time
--> $DIR/unsized-enum2.rs:33:8
|
-LL | VA(W), //~ ERROR `W: std::marker::Sized` is not satisfied
- | ^ `W` does not have a constant size known at compile-time
+LL | VA(W),
+ | ^ doesn't have a size known at compile-time
|
= help: the trait `std::marker::Sized` is not implemented for `W`
+ = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
= 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]: the trait bound `X: std::marker::Sized` is not satisfied
- --> $DIR/unsized-enum2.rs:34:8
+error[E0277]: the size for value values of type `X` cannot be known at compilation time
+ --> $DIR/unsized-enum2.rs:35:8
|
-LL | VB{x: X}, //~ ERROR `X: std::marker::Sized` is not satisfied
- | ^^^^ `X` does not have a constant size known at compile-time
+LL | VB{x: X},
+ | ^^^^ doesn't have a size known at compile-time
|
= help: the trait `std::marker::Sized` is not implemented for `X`
+ = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
= help: consider adding a `where X: std::marker::Sized` bound
= note: no field of an enum variant may have a dynamically sized type
-error[E0277]: the trait bound `Y: std::marker::Sized` is not satisfied
- --> $DIR/unsized-enum2.rs:35:15
+error[E0277]: the size for value values of type `Y` cannot be known at compilation time
+ --> $DIR/unsized-enum2.rs:37:15
|
-LL | VC(isize, Y), //~ ERROR `Y: std::marker::Sized` is not satisfied
- | ^ `Y` does not have a constant size known at compile-time
+LL | VC(isize, Y),
+ | ^ doesn't have a size known at compile-time
|
= help: the trait `std::marker::Sized` is not implemented for `Y`
+ = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
= help: consider adding a `where Y: std::marker::Sized` bound
= note: no field of an enum variant may have a dynamically sized type
-error[E0277]: the trait bound `Z: std::marker::Sized` is not satisfied
- --> $DIR/unsized-enum2.rs:36:18
+error[E0277]: the size for value values of type `Z` cannot be known at compilation time
+ --> $DIR/unsized-enum2.rs:39:18
|
-LL | VD{u: isize, x: Z}, //~ ERROR `Z: std::marker::Sized` is not satisfied
- | ^^^^ `Z` does not have a constant size known at compile-time
+LL | VD{u: isize, x: Z},
+ | ^^^^ doesn't have a size known at compile-time
|
= help: the trait `std::marker::Sized` is not implemented for `Z`
+ = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
= help: consider adding a `where Z: std::marker::Sized` bound
= note: no field of an enum variant may have a dynamically sized type
-error[E0277]: the trait bound `[u8]: std::marker::Sized` is not satisfied
- --> $DIR/unsized-enum2.rs:39:8
+error[E0277]: the size for value values of type `[u8]` cannot be known at compilation time
+ --> $DIR/unsized-enum2.rs:43:8
|
-LL | VE([u8]), //~ ERROR `[u8]: std::marker::Sized` is not satisfied
- | ^^^^ `[u8]` does not have a constant size known at compile-time
+LL | VE([u8]),
+ | ^^^^ doesn't have a size known at compile-time
|
= help: the trait `std::marker::Sized` is not implemented for `[u8]`
+ = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
= note: no field of an enum variant may have a dynamically sized type
-error[E0277]: the trait bound `str: std::marker::Sized` is not satisfied
- --> $DIR/unsized-enum2.rs:40:8
+error[E0277]: the size for value values of type `str` cannot be known at compilation time
+ --> $DIR/unsized-enum2.rs:45:8
|
-LL | VF{x: str}, //~ ERROR `str: std::marker::Sized` is not satisfied
- | ^^^^^^ `str` does not have a constant size known at compile-time
+LL | VF{x: str},
+ | ^^^^^^ doesn't have a size known at compile-time
|
= help: the trait `std::marker::Sized` is not implemented for `str`
+ = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
= note: no field of an enum variant may have a dynamically sized type
-error[E0277]: the trait bound `[f32]: std::marker::Sized` is not satisfied
- --> $DIR/unsized-enum2.rs:41:15
+error[E0277]: the size for value values of type `[f32]` cannot be known at compilation time
+ --> $DIR/unsized-enum2.rs:47:15
|
-LL | VG(isize, [f32]), //~ ERROR `[f32]: std::marker::Sized` is not satisfied
- | ^^^^^ `[f32]` does not have a constant size known at compile-time
+LL | VG(isize, [f32]),
+ | ^^^^^ doesn't have a size known at compile-time
|
= help: the trait `std::marker::Sized` is not implemented for `[f32]`
+ = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
= note: no field of an enum variant may have a dynamically sized type
-error[E0277]: the trait bound `[u32]: std::marker::Sized` is not satisfied
- --> $DIR/unsized-enum2.rs:42:18
+error[E0277]: the size for value values of type `[u32]` cannot be known at compilation time
+ --> $DIR/unsized-enum2.rs:49:18
|
-LL | VH{u: isize, x: [u32]}, //~ ERROR `[u32]: std::marker::Sized` is not satisfied
- | ^^^^^^^^ `[u32]` does not have a constant size known at compile-time
+LL | VH{u: isize, x: [u32]},
+ | ^^^^^^^^ doesn't have a size known at compile-time
|
= help: the trait `std::marker::Sized` is not implemented for `[u32]`
+ = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
= note: no field of an enum variant may have a dynamically sized type
-error[E0277]: the trait bound `Foo + 'static: std::marker::Sized` is not satisfied
- --> $DIR/unsized-enum2.rs:51:8
+error[E0277]: the size for value values of type `Foo + 'static` cannot be known at compilation time
+ --> $DIR/unsized-enum2.rs:63:8
|
-LL | VM(Foo), //~ ERROR `Foo + 'static: std::marker::Sized` is not satisfied
- | ^^^ `Foo + 'static` does not have a constant size known at compile-time
+LL | VM(Foo),
+ | ^^^ doesn't have a size known at compile-time
|
= help: the trait `std::marker::Sized` is not implemented for `Foo + 'static`
+ = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
= note: no field of an enum variant may have a dynamically sized type
-error[E0277]: the trait bound `Bar + 'static: std::marker::Sized` is not satisfied
- --> $DIR/unsized-enum2.rs:52:8
+error[E0277]: the size for value values of type `Bar + 'static` cannot be known at compilation time
+ --> $DIR/unsized-enum2.rs:65:8
|
-LL | VN{x: Bar}, //~ ERROR `Bar + 'static: std::marker::Sized` is not satisfied
- | ^^^^^^ `Bar + 'static` does not have a constant size known at compile-time
+LL | VN{x: Bar},
+ | ^^^^^^ doesn't have a size known at compile-time
|
= help: the trait `std::marker::Sized` is not implemented for `Bar + 'static`
+ = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
= note: no field of an enum variant may have a dynamically sized type
-error[E0277]: the trait bound `FooBar + 'static: std::marker::Sized` is not satisfied
- --> $DIR/unsized-enum2.rs:53:15
+error[E0277]: the size for value values of type `FooBar + 'static` cannot be known at compilation time
+ --> $DIR/unsized-enum2.rs:67:15
|
-LL | VO(isize, FooBar), //~ ERROR `FooBar + 'static: std::marker::Sized` is not satisfied
- | ^^^^^^ `FooBar + 'static` does not have a constant size known at compile-time
+LL | VO(isize, FooBar),
+ | ^^^^^^ doesn't have a size known at compile-time
|
= help: the trait `std::marker::Sized` is not implemented for `FooBar + 'static`
+ = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
= note: no field of an enum variant may have a dynamically sized type
-error[E0277]: the trait bound `BarFoo + 'static: std::marker::Sized` is not satisfied
- --> $DIR/unsized-enum2.rs:54:18
+error[E0277]: the size for value values of type `BarFoo + 'static` cannot be known at compilation time
+ --> $DIR/unsized-enum2.rs:69:18
|
-LL | VP{u: isize, x: BarFoo}, //~ ERROR `BarFoo + 'static: std::marker::Sized` is not satisfied
- | ^^^^^^^^^ `BarFoo + 'static` does not have a constant size known at compile-time
+LL | VP{u: isize, x: BarFoo},
+ | ^^^^^^^^^ doesn't have a size known at compile-time
|
= help: the trait `std::marker::Sized` is not implemented for `BarFoo + 'static`
+ = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
= note: no field of an enum variant may have a dynamically sized type
-error[E0277]: the trait bound `[i8]: std::marker::Sized` is not satisfied
- --> $DIR/unsized-enum2.rs:57:8
+error[E0277]: the size for value values of type `[i8]` cannot be known at compilation time
+ --> $DIR/unsized-enum2.rs:73:8
|
-LL | VQ(<&'static [i8] as Deref>::Target), //~ ERROR `[i8]: std::marker::Sized` is not satisfied
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `[i8]` does not have a constant size known at compile-time
+LL | VQ(<&'static [i8] as Deref>::Target),
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
= help: the trait `std::marker::Sized` is not implemented for `[i8]`
+ = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
= note: no field of an enum variant may have a dynamically sized type
-error[E0277]: the trait bound `[char]: std::marker::Sized` is not satisfied
- --> $DIR/unsized-enum2.rs:58:8
+error[E0277]: the size for value values of type `[char]` cannot be known at compilation time
+ --> $DIR/unsized-enum2.rs:75:8
|
LL | VR{x: <&'static [char] as Deref>::Target},
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `[char]` does not have a constant size known at compile-time
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
= help: the trait `std::marker::Sized` is not implemented for `[char]`
+ = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
= note: no field of an enum variant may have a dynamically sized type
-error[E0277]: the trait bound `[f64]: std::marker::Sized` is not satisfied
- --> $DIR/unsized-enum2.rs:60:15
+error[E0277]: the size for value values of type `[f64]` cannot be known at compilation time
+ --> $DIR/unsized-enum2.rs:77:15
|
LL | VS(isize, <&'static [f64] as Deref>::Target),
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `[f64]` does not have a constant size known at compile-time
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
= help: the trait `std::marker::Sized` is not implemented for `[f64]`
+ = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
= note: no field of an enum variant may have a dynamically sized type
-error[E0277]: the trait bound `[i32]: std::marker::Sized` is not satisfied
- --> $DIR/unsized-enum2.rs:62:18
+error[E0277]: the size for value values of type `[i32]` cannot be known at compilation time
+ --> $DIR/unsized-enum2.rs:79:18
|
LL | VT{u: isize, x: <&'static [i32] as Deref>::Target},
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `[i32]` does not have a constant size known at compile-time
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
= help: the trait `std::marker::Sized` is not implemented for `[i32]`
+ = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
= note: no field of an enum variant may have a dynamically sized type
-error[E0277]: the trait bound `PathHelper1 + 'static: std::marker::Sized` is not satisfied in `Path1`
- --> $DIR/unsized-enum2.rs:45:8
+error[E0277]: the size for value values of type `PathHelper1 + 'static` cannot be known at compilation time
+ --> $DIR/unsized-enum2.rs:53:8
|
-LL | VI(Path1), //~ ERROR `PathHelper1 + 'static: std::marker::Sized` is not satisfied
- | ^^^^^ `PathHelper1 + 'static` does not have a constant size known at compile-time
+LL | VI(Path1),
+ | ^^^^^ doesn't have a size known at compile-time
|
= help: within `Path1`, the trait `std::marker::Sized` is not implemented for `PathHelper1 + 'static`
+ = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
= note: required because it appears within the type `Path1`
= note: no field of an enum variant may have a dynamically sized type
-error[E0277]: the trait bound `PathHelper2 + 'static: std::marker::Sized` is not satisfied in `Path2`
- --> $DIR/unsized-enum2.rs:46:8
+error[E0277]: the size for value values of type `PathHelper2 + 'static` cannot be known at compilation time
+ --> $DIR/unsized-enum2.rs:55:8
|
-LL | VJ{x: Path2}, //~ ERROR `PathHelper2 + 'static: std::marker::Sized` is not satisfied
- | ^^^^^^^^ `PathHelper2 + 'static` does not have a constant size known at compile-time
+LL | VJ{x: Path2},
+ | ^^^^^^^^ doesn't have a size known at compile-time
|
= help: within `Path2`, the trait `std::marker::Sized` is not implemented for `PathHelper2 + 'static`
+ = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
= note: required because it appears within the type `Path2`
= note: no field of an enum variant may have a dynamically sized type
-error[E0277]: the trait bound `PathHelper3 + 'static: std::marker::Sized` is not satisfied in `Path3`
- --> $DIR/unsized-enum2.rs:47:15
+error[E0277]: the size for value values of type `PathHelper3 + 'static` cannot be known at compilation time
+ --> $DIR/unsized-enum2.rs:57:15
|
-LL | VK(isize, Path3), //~ ERROR `PathHelper3 + 'static: std::marker::Sized` is not satisfied
- | ^^^^^ `PathHelper3 + 'static` does not have a constant size known at compile-time
+LL | VK(isize, Path3),
+ | ^^^^^ doesn't have a size known at compile-time
|
= help: within `Path3`, the trait `std::marker::Sized` is not implemented for `PathHelper3 + 'static`
+ = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
= note: required because it appears within the type `Path3`
= note: no field of an enum variant may have a dynamically sized type
-error[E0277]: the trait bound `PathHelper4 + 'static: std::marker::Sized` is not satisfied in `Path4`
- --> $DIR/unsized-enum2.rs:48:18
+error[E0277]: the size for value values of type `PathHelper4 + 'static` cannot be known at compilation time
+ --> $DIR/unsized-enum2.rs:59:18
|
-LL | VL{u: isize, x: Path4}, //~ ERROR `PathHelper4 + 'static: std::marker::Sized` is not satisfied
- | ^^^^^^^^ `PathHelper4 + 'static` does not have a constant size known at compile-time
+LL | VL{u: isize, x: Path4},
+ | ^^^^^^^^ doesn't have a size known at compile-time
|
= help: within `Path4`, the trait `std::marker::Sized` is not implemented for `PathHelper4 + 'static`
+ = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
= note: required because it appears within the type `Path4`
= note: no field of an enum variant may have a dynamically sized type