Various diagnostics clean ups/tweaks

* Always point at macros, including derive macros
* Point at non-local items that introduce a trait requirement
* On private associated item, point at definition
This commit is contained in:
Esteban Küber 2021-07-17 11:13:50 -07:00
parent c78ebb7bdc
commit ba052bd8de
163 changed files with 1474 additions and 398 deletions

View File

@ -84,8 +84,10 @@ fn report_bad_target(sess: &Session, item: &Annotatable, span: Span) -> bool {
sess,
span,
E0774,
"`derive` may only be applied to structs, enums and unions",
"`derive` may only be applied to `struct`s, `enum`s and `union`s",
)
.span_label(span, "not applicable here")
.span_label(item.span(), "not a `struct`, `enum` or `union`")
.emit();
}
bad_target
@ -99,6 +101,7 @@ fn report_unexpected_literal(sess: &Session, lit: &ast::Lit) {
_ => "for example, write `#[derive(Debug)]` for `Debug`".to_string(),
};
struct_span_err!(sess, lit.span, E0777, "expected path to a trait, found literal",)
.span_label(lit.span, "not a trait")
.help(&help_msg)
.emit();
}

View File

@ -148,11 +148,7 @@ fn cs_clone_shallow(
}
_ => cx.span_bug(
trait_span,
&format!(
"unexpected substructure in \
shallow `derive({})`",
name
),
&format!("unexpected substructure in shallow `derive({})`", name),
),
}
}

View File

@ -365,10 +365,7 @@ pub trait Emitter {
continue;
}
if matches!(trace.kind, ExpnKind::Inlined) {
new_labels
.push((trace.call_site, "in the inlined copy of this code".to_string()));
} else if always_backtrace {
if always_backtrace && !matches!(trace.kind, ExpnKind::Inlined) {
new_labels.push((
trace.def_site,
format!(
@ -398,13 +395,27 @@ pub trait Emitter {
// and it needs an "in this macro invocation" label to match that.
let redundant_span = trace.call_site.contains(sp);
if !redundant_span && matches!(trace.kind, ExpnKind::Macro(MacroKind::Bang, _))
|| always_backtrace
{
if !redundant_span || always_backtrace {
let msg: Cow<'static, _> = match trace.kind {
ExpnKind::Macro(MacroKind::Attr, _) => {
"this procedural macro expansion".into()
}
ExpnKind::Macro(MacroKind::Derive, _) => {
"this derive macro expansion".into()
}
ExpnKind::Macro(MacroKind::Bang, _) => "this macro invocation".into(),
ExpnKind::Inlined => "the inlined copy of this code".into(),
ExpnKind::Root => "in the crate root".into(),
ExpnKind::AstPass(kind) => kind.descr().into(),
ExpnKind::Desugaring(kind) => {
format!("this {} desugaring", kind.descr()).into()
}
};
new_labels.push((
trace.call_site,
format!(
"in this macro invocation{}",
"in {}{}",
msg,
if macro_backtrace.len() > 1 && always_backtrace {
// only specify order when the macro
// backtrace is multiple levels deep

View File

@ -952,7 +952,7 @@ pub enum AstPass {
}
impl AstPass {
fn descr(self) -> &'static str {
pub fn descr(self) -> &'static str {
match self {
AstPass::StdImports => "standard library imports",
AstPass::TestHarness => "test harness",
@ -989,7 +989,7 @@ pub enum ForLoopLoc {
impl DesugaringKind {
/// The description wording should combine well with "desugaring of {}".
fn descr(self) -> &'static str {
pub fn descr(self) -> &'static str {
match self {
DesugaringKind::CondTemporary => "`if` or `while` condition",
DesugaringKind::Async => "`async` block or function",

View File

@ -1928,12 +1928,12 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
ObligationCauseCode::ItemObligation(item_def_id) => {
let item_name = tcx.def_path_str(item_def_id);
let msg = format!("required by `{}`", item_name);
if let Some(sp) = tcx.hir().span_if_local(item_def_id) {
let sp = tcx.sess.source_map().guess_head_span(sp);
err.span_label(sp, &msg);
} else {
err.note(&msg);
}
let sp = tcx
.hir()
.span_if_local(item_def_id)
.unwrap_or_else(|| tcx.def_span(item_def_id));
let sp = tcx.sess.source_map().guess_head_span(sp);
err.span_note(sp, &msg);
}
ObligationCauseCode::BindingObligation(item_def_id, span) => {
let item_name = tcx.def_path_str(item_def_id);
@ -1952,7 +1952,10 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
if span != DUMMY_SP {
err.span_label(span, &msg);
} else {
err.note(&msg);
err.span_note(
tcx.def_span(item_def_id),
&format!("required by a bound in `{}`", item_name),
);
}
}
ObligationCauseCode::ObjectCastObligation(object_ty) => {
@ -1979,9 +1982,8 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
if self.tcx.sess.is_nightly_build() && is_const_fn {
err.help(
"create an inline `const` block, see RFC \
#2920 <https://github.com/rust-lang/rfcs/pull/2920> \
for more information",
"create an inline `const` block, see RFC #2920 \
<https://github.com/rust-lang/rfcs/pull/2920> for more information",
);
}
}
@ -2168,8 +2170,14 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
self.tcx.for_each_relevant_impl(
parent_def_id,
parent_trait_ref.self_ty().skip_binder(),
|impl_def_id| {
candidates.push(impl_def_id);
|impl_def_id| match self.tcx.hir().get_if_local(impl_def_id) {
Some(Node::Item(hir::Item {
kind: hir::ItemKind::Impl(hir::Impl { .. }),
..
})) => {
candidates.push(impl_def_id);
}
_ => {}
},
);
match &candidates[..] {

View File

@ -933,6 +933,12 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
item_name
);
err.span_label(item_name.span, &format!("private {}", kind));
let sp = self
.tcx
.hir()
.span_if_local(def_id)
.unwrap_or_else(|| self.tcx.def_span(def_id));
err.span_label(sp, &format!("private {} defined here", kind));
self.suggest_valid_traits(&mut err, out_of_scope_traits);
err.emit();
}

View File

@ -56,6 +56,8 @@ LL | #[message = "This error has a field, and references {name}"]
error: invalid format string: expected `'}'` but string was terminated
--> $DIR/session-derive-errors.rs:116:1
|
LL | #[derive(SessionDiagnostic)]
| ----------------- in this derive macro expansion
LL | #[error = "E0123"]
| - because of this opening brace
LL | #[message = "This is missing a closing brace: {name"]
@ -67,6 +69,9 @@ LL | #[message = "This is missing a closing brace: {name"]
error: invalid format string: unmatched `}` found
--> $DIR/session-derive-errors.rs:125:1
|
LL | #[derive(SessionDiagnostic)]
| ----------------- in this derive macro expansion
LL | #[error = "E0123"]
LL | #[message = "This is missing an opening brace: name}"]
| ^ unmatched `}` in format string
|

View File

@ -1,37 +1,61 @@
error[E0277]: the trait bound `usize: GlobalAlloc` is not satisfied
--> $DIR/not-an-allocator.rs:2:1
|
LL | #[global_allocator]
| ------------------- in this procedural macro expansion
LL | static A: usize = 0;
| ^^^^^^^^^^^^^^^^^^^^ the trait `GlobalAlloc` is not implemented for `usize`
|
= note: required by `std::alloc::GlobalAlloc::alloc`
note: required by `std::alloc::GlobalAlloc::alloc`
--> $SRC_DIR/core/src/alloc/global.rs:LL:COL
|
LL | unsafe fn alloc(&self, layout: Layout) -> *mut u8;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: this error originates in the attribute macro `global_allocator` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `usize: GlobalAlloc` is not satisfied
--> $DIR/not-an-allocator.rs:2:1
|
LL | #[global_allocator]
| ------------------- in this procedural macro expansion
LL | static A: usize = 0;
| ^^^^^^^^^^^^^^^^^^^^ the trait `GlobalAlloc` is not implemented for `usize`
|
= note: required by `std::alloc::GlobalAlloc::dealloc`
note: required by `std::alloc::GlobalAlloc::dealloc`
--> $SRC_DIR/core/src/alloc/global.rs:LL:COL
|
LL | unsafe fn dealloc(&self, ptr: *mut u8, layout: Layout);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: this error originates in the attribute macro `global_allocator` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `usize: GlobalAlloc` is not satisfied
--> $DIR/not-an-allocator.rs:2:1
|
LL | #[global_allocator]
| ------------------- in this procedural macro expansion
LL | static A: usize = 0;
| ^^^^^^^^^^^^^^^^^^^^ the trait `GlobalAlloc` is not implemented for `usize`
|
= note: required by `std::alloc::GlobalAlloc::realloc`
note: required by `std::alloc::GlobalAlloc::realloc`
--> $SRC_DIR/core/src/alloc/global.rs:LL:COL
|
LL | unsafe fn realloc(&self, ptr: *mut u8, layout: Layout, new_size: usize) -> *mut u8 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: this error originates in the attribute macro `global_allocator` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `usize: GlobalAlloc` is not satisfied
--> $DIR/not-an-allocator.rs:2:1
|
LL | #[global_allocator]
| ------------------- in this procedural macro expansion
LL | static A: usize = 0;
| ^^^^^^^^^^^^^^^^^^^^ the trait `GlobalAlloc` is not implemented for `usize`
|
= note: required by `std::alloc::GlobalAlloc::alloc_zeroed`
note: required by `std::alloc::GlobalAlloc::alloc_zeroed`
--> $SRC_DIR/core/src/alloc/global.rs:LL:COL
|
LL | unsafe fn alloc_zeroed(&self, layout: Layout) -> *mut u8 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: this error originates in the attribute macro `global_allocator` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to 4 previous errors

View File

@ -4,6 +4,7 @@ error: cannot define multiple global allocators
LL | static A: System = System;
| -------------------------- previous global allocator defined here
LL | #[global_allocator]
| ------------------- in this procedural macro expansion
LL | static B: System = System;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot define a new global allocator
|

View File

@ -1,11 +1,14 @@
error[E0277]: the trait bound `i32: Foo` is not satisfied
--> $DIR/associated-const-array-len.rs:5:16
|
LL | const ID: usize;
| ---------------- required by `Foo::ID`
...
LL | const X: [i32; <i32 as Foo>::ID] = [0, 1, 2];
| ^^^^^^^^^^^^^^^^ the trait `Foo` is not implemented for `i32`
|
note: required by `Foo::ID`
--> $DIR/associated-const-array-len.rs:2:5
|
LL | const ID: usize;
| ^^^^^^^^^^^^^^^^
error: aborting due to previous error

View File

@ -1,6 +1,9 @@
error[E0624]: associated constant `ID` is private
--> $DIR/associated-const-private-impl.rs:13:30
|
LL | const ID: i32 = 1;
| ------------------ private associated constant defined here
...
LL | assert_eq!(1, bar1::Foo::ID);
| ^^ private associated constant

View File

@ -1,9 +1,6 @@
error[E0283]: type annotations needed
--> $DIR/issue-63496.rs:4:21
|
LL | const C: usize;
| --------------- required by `A::C`
LL |
LL | fn f() -> ([u8; A::C], [u8; A::C]);
| ^^^^
| |
@ -12,13 +9,15 @@ LL | fn f() -> ([u8; A::C], [u8; A::C]);
|
= note: cannot satisfy `_: A`
= note: associated constants cannot be accessed directly on a `trait`, they can only be accessed through a specific `impl`
note: required by `A::C`
--> $DIR/issue-63496.rs:2:5
|
LL | const C: usize;
| ^^^^^^^^^^^^^^^
error[E0283]: type annotations needed
--> $DIR/issue-63496.rs:4:33
|
LL | const C: usize;
| --------------- required by `A::C`
LL |
LL | fn f() -> ([u8; A::C], [u8; A::C]);
| ^^^^
| |
@ -27,6 +26,11 @@ LL | fn f() -> ([u8; A::C], [u8; A::C]);
|
= note: cannot satisfy `_: A`
= note: associated constants cannot be accessed directly on a `trait`, they can only be accessed through a specific `impl`
note: required by `A::C`
--> $DIR/issue-63496.rs:2:5
|
LL | const C: usize;
| ^^^^^^^^^^^^^^^
error: aborting due to 2 previous errors

View File

@ -16,8 +16,6 @@ LL | const X: usize;
error[E0283]: type annotations needed
--> $DIR/issue-48027.rs:3:32
|
LL | const X: usize;
| --------------- required by `Bar::X`
LL | fn return_n(&self) -> [u8; Bar::X];
| ^^^^^^
| |
@ -26,6 +24,11 @@ LL | fn return_n(&self) -> [u8; Bar::X];
|
= note: cannot satisfy `_: Bar`
= note: associated constants cannot be accessed directly on a `trait`, they can only be accessed through a specific `impl`
note: required by `Bar::X`
--> $DIR/issue-48027.rs:2:5
|
LL | const X: usize;
| ^^^^^^^^^^^^^^^
error: aborting due to 2 previous errors

View File

@ -1,12 +1,14 @@
error[E0277]: the trait bound `<G as GetToInt>::R: ToInt` is not satisfied
--> $DIR/associated-types-bound-failure.rs:19:19
|
LL | fn to_int(&self) -> isize;
| -------------------------- required by `ToInt::to_int`
...
LL | ToInt::to_int(&g.get())
| ^^^^^^^^ the trait `ToInt` is not implemented for `<G as GetToInt>::R`
|
note: required by `ToInt::to_int`
--> $DIR/associated-types-bound-failure.rs:6:5
|
LL | fn to_int(&self) -> isize;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
help: consider further restricting the associated type
|
LL | where G : GetToInt, <G as GetToInt>::R: ToInt

View File

@ -1,13 +1,15 @@
error[E0283]: type annotations needed
--> $DIR/associated-types-unconstrained.rs:14:20
|
LL | fn bar() -> isize;
| ------------------ required by `Foo::bar`
...
LL | let x: isize = Foo::bar();
| ^^^^^^^^ cannot infer type
|
= note: cannot satisfy `_: Foo`
note: required by `Foo::bar`
--> $DIR/associated-types-unconstrained.rs:5:5
|
LL | fn bar() -> isize;
| ^^^^^^^^^^^^^^^^^^
error: aborting due to previous error

View File

@ -1,9 +1,6 @@
error[E0271]: type mismatch resolving `<() as Array>::Element == &()`
--> $DIR/issue-44153.rs:18:5
|
LL | fn visit() {}
| ---------- required by `Visit::visit`
...
LL | <() as Visit>::visit();
| ^^^^^^^^^^^^^^^^^^^^ expected `&()`, found `()`
|
@ -12,6 +9,11 @@ note: required because of the requirements on the impl of `Visit` for `()`
|
LL | impl<'a> Visit for () where
| ^^^^^ ^^
note: required by `Visit::visit`
--> $DIR/issue-44153.rs:6:5
|
LL | fn visit() {}
| ^^^^^^^^^^
error: aborting due to previous error

View File

@ -5,7 +5,11 @@ LL | foo()?;
| ^^^^^^ the `?` operator cannot be applied to type `impl Future`
|
= help: the trait `Try` is not implemented for `impl Future`
= note: required by `branch`
note: required by `branch`
--> $SRC_DIR/core/src/ops/try_trait.rs:LL:COL
|
LL | fn branch(self) -> ControlFlow<Self::Residual, Self::Output>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: consider `await`ing on the `Future`
|
LL | foo().await?;
@ -18,7 +22,11 @@ LL | t?;
| ^^ the `?` operator cannot be applied to type `T`
|
= help: the trait `Try` is not implemented for `T`
= note: required by `branch`
note: required by `branch`
--> $SRC_DIR/core/src/ops/try_trait.rs:LL:COL
|
LL | fn branch(self) -> ControlFlow<Self::Residual, Self::Output>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: consider `await`ing on the `Future`
|
LL | t.await?;

View File

@ -25,7 +25,11 @@ LL | [1; ().await];
| ^^^^^^^^ `()` is not a future
|
= help: the trait `Future` is not implemented for `()`
= note: required by `poll`
note: required by `poll`
--> $SRC_DIR/core/src/future/future.rs:LL:COL
|
LL | fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to 4 previous errors

View File

@ -5,7 +5,11 @@ LL | test()?;
| ^^^^^^^ the `?` operator cannot be applied to type `impl Future`
|
= help: the trait `Try` is not implemented for `impl Future`
= note: required by `branch`
note: required by `branch`
--> $SRC_DIR/core/src/ops/try_trait.rs:LL:COL
|
LL | fn branch(self) -> ControlFlow<Self::Residual, Self::Output>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0277]: the `?` operator can only be used in an async function that returns `Result` or `Option` (or another type that implements `FromResidual`)
--> $DIR/issue-84841.rs:9:11
@ -21,7 +25,11 @@ LL | | }
| |_- this function should return `Result` or `Option` to accept `?`
|
= help: the trait `FromResidual<_>` is not implemented for `()`
= note: required by `from_residual`
note: required by `from_residual`
--> $SRC_DIR/core/src/ops/try_trait.rs:LL:COL
|
LL | fn from_residual(residual: R) -> Self;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to 2 previous errors

View File

@ -34,7 +34,11 @@ LL | (|_| 2333).await;
| ^^^^^^^^^^^^^^^^ `[closure@$DIR/issue-62009-1.rs:12:5: 12:15]` is not a future
|
= help: the trait `Future` is not implemented for `[closure@$DIR/issue-62009-1.rs:12:5: 12:15]`
= note: required by `poll`
note: required by `poll`
--> $SRC_DIR/core/src/future/future.rs:LL:COL
|
LL | fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to 4 previous errors

View File

@ -10,7 +10,11 @@ note: required because it appears within the type `Sleep`
|
LL | struct Sleep(std::marker::PhantomPinned);
| ^^^^^
= note: required by `Pin::<P>::new`
note: required by `Pin::<P>::new`
--> $SRC_DIR/core/src/pin.rs:LL:COL
|
LL | pub const fn new(pointer: P) -> Pin<P> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error

View File

@ -11,7 +11,11 @@ LL | | }
| |_____- this function should return `Result` or `Option` to accept `?`
|
= help: the trait `FromResidual<Option<Infallible>>` is not implemented for `{integer}`
= note: required by `from_residual`
note: required by `from_residual`
--> $SRC_DIR/core/src/ops/try_trait.rs:LL:COL
|
LL | fn from_residual(residual: R) -> Self;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0277]: the `?` operator can only be used in an async closure that returns `Result` or `Option` (or another type that implements `FromResidual`)
--> $DIR/try-on-option-in-async.rs:17:10
@ -26,7 +30,11 @@ LL | | };
| |_____- this function should return `Result` or `Option` to accept `?`
|
= help: the trait `FromResidual<Option<Infallible>>` is not implemented for `u32`
= note: required by `from_residual`
note: required by `from_residual`
--> $SRC_DIR/core/src/ops/try_trait.rs:LL:COL
|
LL | fn from_residual(residual: R) -> Self;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0277]: the `?` operator can only be used in an async function that returns `Result` or `Option` (or another type that implements `FromResidual`)
--> $DIR/try-on-option-in-async.rs:26:6
@ -41,7 +49,11 @@ LL | | }
| |_- this function should return `Result` or `Option` to accept `?`
|
= help: the trait `FromResidual<Option<Infallible>>` is not implemented for `u32`
= note: required by `from_residual`
note: required by `from_residual`
--> $SRC_DIR/core/src/ops/try_trait.rs:LL:COL
|
LL | fn from_residual(residual: R) -> Self;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to 3 previous errors

View File

@ -5,7 +5,11 @@ LL | let _ = Box::into_boxed_slice(boxed_slice);
| ^^^^^^^^^^^ doesn't have a size known at compile-time
|
= help: the trait `Sized` is not implemented for `[u8]`
= note: required by `Box::<T, A>::into_boxed_slice`
note: required by `Box::<T, A>::into_boxed_slice`
--> $SRC_DIR/alloc/src/boxed.rs:LL:COL
|
LL | pub fn into_boxed_slice(boxed: Self) -> Box<[T], A> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
--> $DIR/into-boxed-slice-fail.rs:7:13
@ -23,7 +27,11 @@ LL | let _ = Box::into_boxed_slice(boxed_trait);
| ^^^^^^^^^^^ doesn't have a size known at compile-time
|
= help: the trait `Sized` is not implemented for `dyn Debug`
= note: required by `Box::<T, A>::into_boxed_slice`
note: required by `Box::<T, A>::into_boxed_slice`
--> $SRC_DIR/alloc/src/boxed.rs:LL:COL
|
LL | pub fn into_boxed_slice(boxed: Self) -> Box<[T], A> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0277]: the size for values of type `dyn Debug` cannot be known at compilation time
--> $DIR/into-boxed-slice-fail.rs:11:13

View File

@ -1,15 +1,17 @@
error[E0277]: the trait bound `{float}: Foo` is not satisfied
--> $DIR/type_wf.rs:18:13
|
LL | struct S<T: Foo> {
| ---------------- required by `S`
...
LL | let s = S {
| ^ the trait `Foo` is not implemented for `{float}`
|
= help: the following implementations were found:
<Option<T> as Foo>
<i32 as Foo>
note: required by `S`
--> $DIR/type_wf.rs:6:1
|
LL | struct S<T: Foo> {
| ^^^^^^^^^^^^^^^^
error: aborting due to previous error

View File

@ -3,9 +3,12 @@ error[E0277]: the trait bound `[Adt; _]: Foo` is not satisfied
|
LL | <[Adt; std::mem::size_of::<Self::Assoc>()] as Foo>::bar()
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Foo` is not implemented for `[Adt; _]`
...
|
note: required by `Foo::bar`
--> $DIR/dont-evaluate-array-len-on-err-1.rs:19:5
|
LL | fn bar() {}
| -------- required by `Foo::bar`
| ^^^^^^^^
error: aborting due to previous error

View File

@ -1,9 +1,6 @@
error[E0277]: the trait bound `(): Foo<N>` is not satisfied
--> $DIR/exhaustive-value.rs:266:5
|
LL | fn test() {}
| --------- required by `Foo::test`
...
LL | <() as Foo<N>>::test()
| ^^^^^^^^^^^^^^^^^^^^ the trait `Foo<N>` is not implemented for `()`
|
@ -13,6 +10,11 @@ LL | <() as Foo<N>>::test()
<() as Foo<101_u8>>
<() as Foo<102_u8>>
and 252 others
note: required by `Foo::test`
--> $DIR/exhaustive-value.rs:6:5
|
LL | fn test() {}
| ^^^^^^^^^
error: aborting due to previous error

View File

@ -1,9 +1,6 @@
error[E0277]: the trait bound `(): Foo<N>` is not satisfied
--> $DIR/exhaustive-value.rs:266:5
|
LL | fn test() {}
| --------- required by `Foo::test`
...
LL | <() as Foo<N>>::test()
| ^^^^^^^^^^^^^^^^^^^^ the trait `Foo<N>` is not implemented for `()`
|
@ -13,6 +10,11 @@ LL | <() as Foo<N>>::test()
<() as Foo<101_u8>>
<() as Foo<102_u8>>
and 252 others
note: required by `Foo::test`
--> $DIR/exhaustive-value.rs:6:5
|
LL | fn test() {}
| ^^^^^^^^^
error: aborting due to previous error

View File

@ -1,16 +1,18 @@
error[E0277]: the trait bound `A<{_: usize}>: Bar<{_: usize}>` is not satisfied
--> $DIR/unused-substs-1.rs:12:13
|
LL | let _ = A;
| ^ the trait `Bar<{_: usize}>` is not implemented for `A<{_: usize}>`
|
= help: the following implementations were found:
<A<7_usize> as Bar<N>>
note: required by `A`
--> $DIR/unused-substs-1.rs:7:1
|
LL | / struct A<const N: usize>
LL | | where
LL | | A<N>: Bar<N>;
| |_________________- required by `A`
...
LL | let _ = A;
| ^ the trait `Bar<{_: usize}>` is not implemented for `A<{_: usize}>`
|
= help: the following implementations were found:
<A<7_usize> as Bar<N>>
| |_________________^
error: aborting due to previous error

View File

@ -1,6 +1,8 @@
error[E0277]: the trait bound `TestDescAndFn: Testable` is not satisfied
--> $DIR/mismatch.rs:9:1
|
LL | #[test]
| ------- in this procedural macro expansion
LL | fn wrong_kind(){}
| ^^^^^^^^^^^^^^^^^ the trait `Testable` is not implemented for `TestDescAndFn`
|

View File

@ -1,6 +1,6 @@
trait Foo {
#[derive(Clone)]
//~^ ERROR `derive` may only be applied to structs, enums and unions
//~^ ERROR `derive` may only be applied to `struct`s, `enum`s and `union`s
type Bar;
}
@ -8,7 +8,7 @@ struct Bar;
impl Bar {
#[derive(Clone)]
//~^ ERROR `derive` may only be applied to structs, enums and unions
//~^ ERROR `derive` may only be applied to `struct`s, `enum`s and `union`s
fn bar(&self) {}
}

View File

@ -1,14 +1,20 @@
error[E0774]: `derive` may only be applied to structs, enums and unions
error[E0774]: `derive` may only be applied to `struct`s, `enum`s and `union`s
--> $DIR/derive-on-trait-item-or-impl-item.rs:2:5
|
LL | #[derive(Clone)]
| ^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^ not applicable here
LL |
LL | type Bar;
| --------- not a `struct`, `enum` or `union`
error[E0774]: `derive` may only be applied to structs, enums and unions
error[E0774]: `derive` may only be applied to `struct`s, `enum`s and `union`s
--> $DIR/derive-on-trait-item-or-impl-item.rs:10:5
|
LL | #[derive(Clone)]
| ^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^ not applicable here
LL |
LL | fn bar(&self) {}
| ---------------- not a `struct`, `enum` or `union`
error: aborting due to 2 previous errors

View File

@ -1,10 +1,17 @@
error[E0277]: the trait bound `Error: Clone` is not satisfied
--> $DIR/derives-span-Clone-enum-struct-variant.rs:9:6
|
LL | #[derive(Clone)]
| ----- in this derive macro expansion
...
LL | x: Error
| ^^^^^^^^ the trait `Clone` is not implemented for `Error`
|
= note: required by `clone`
note: required by `clone`
--> $SRC_DIR/core/src/clone.rs:LL:COL
|
LL | fn clone(&self) -> Self;
| ^^^^^^^^^^^^^^^^^^^^^^^^
= note: this error originates in the derive macro `Clone` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error

View File

@ -1,10 +1,17 @@
error[E0277]: the trait bound `Error: Clone` is not satisfied
--> $DIR/derives-span-Clone-enum.rs:9:6
|
LL | #[derive(Clone)]
| ----- in this derive macro expansion
...
LL | Error
| ^^^^^ the trait `Clone` is not implemented for `Error`
|
= note: required by `clone`
note: required by `clone`
--> $SRC_DIR/core/src/clone.rs:LL:COL
|
LL | fn clone(&self) -> Self;
| ^^^^^^^^^^^^^^^^^^^^^^^^
= note: this error originates in the derive macro `Clone` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error

View File

@ -1,10 +1,17 @@
error[E0277]: the trait bound `Error: Clone` is not satisfied
--> $DIR/derives-span-Clone-struct.rs:8:5
|
LL | #[derive(Clone)]
| ----- in this derive macro expansion
LL | struct Struct {
LL | x: Error
| ^^^^^^^^ the trait `Clone` is not implemented for `Error`
|
= note: required by `clone`
note: required by `clone`
--> $SRC_DIR/core/src/clone.rs:LL:COL
|
LL | fn clone(&self) -> Self;
| ^^^^^^^^^^^^^^^^^^^^^^^^
= note: this error originates in the derive macro `Clone` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error

View File

@ -1,10 +1,17 @@
error[E0277]: the trait bound `Error: Clone` is not satisfied
--> $DIR/derives-span-Clone-tuple-struct.rs:8:5
|
LL | #[derive(Clone)]
| ----- in this derive macro expansion
LL | struct Struct(
LL | Error
| ^^^^^ the trait `Clone` is not implemented for `Error`
|
= note: required by `clone`
note: required by `clone`
--> $SRC_DIR/core/src/clone.rs:LL:COL
|
LL | fn clone(&self) -> Self;
| ^^^^^^^^^^^^^^^^^^^^^^^^
= note: this error originates in the derive macro `Clone` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error

View File

@ -1,6 +1,9 @@
error[E0277]: `Error` doesn't implement `Debug`
--> $DIR/derives-span-Debug-enum-struct-variant.rs:9:6
|
LL | #[derive(Debug)]
| ----- in this derive macro expansion
...
LL | x: Error
| ^^^^^^^^ `Error` cannot be formatted using `{:?}`
|

View File

@ -1,6 +1,9 @@
error[E0277]: `Error` doesn't implement `Debug`
--> $DIR/derives-span-Debug-enum.rs:9:6
|
LL | #[derive(Debug)]
| ----- in this derive macro expansion
...
LL | Error
| ^^^^^ `Error` cannot be formatted using `{:?}`
|

View File

@ -1,6 +1,9 @@
error[E0277]: `Error` doesn't implement `Debug`
--> $DIR/derives-span-Debug-struct.rs:8:5
|
LL | #[derive(Debug)]
| ----- in this derive macro expansion
LL | struct Struct {
LL | x: Error
| ^^^^^^^^ `Error` cannot be formatted using `{:?}`
|

View File

@ -1,6 +1,9 @@
error[E0277]: `Error` doesn't implement `Debug`
--> $DIR/derives-span-Debug-tuple-struct.rs:8:5
|
LL | #[derive(Debug)]
| ----- in this derive macro expansion
LL | struct Struct(
LL | Error
| ^^^^^ `Error` cannot be formatted using `{:?}`
|

View File

@ -1,10 +1,17 @@
error[E0277]: the trait bound `Error: Default` is not satisfied
--> $DIR/derives-span-Default-struct.rs:8:5
|
LL | #[derive(Default)]
| ------- in this derive macro expansion
LL | struct Struct {
LL | x: Error
| ^^^^^^^^ the trait `Default` is not implemented for `Error`
|
= note: required by `std::default::Default::default`
note: required by `std::default::Default::default`
--> $SRC_DIR/core/src/default.rs:LL:COL
|
LL | fn default() -> Self;
| ^^^^^^^^^^^^^^^^^^^^^
= note: this error originates in the derive macro `Default` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error

View File

@ -1,10 +1,17 @@
error[E0277]: the trait bound `Error: Default` is not satisfied
--> $DIR/derives-span-Default-tuple-struct.rs:8:5
|
LL | #[derive(Default)]
| ------- in this derive macro expansion
LL | struct Struct(
LL | Error
| ^^^^^ the trait `Default` is not implemented for `Error`
|
= note: required by `std::default::Default::default`
note: required by `std::default::Default::default`
--> $SRC_DIR/core/src/default.rs:LL:COL
|
LL | fn default() -> Self;
| ^^^^^^^^^^^^^^^^^^^^^
= note: this error originates in the derive macro `Default` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error

View File

@ -1,6 +1,9 @@
error[E0277]: the trait bound `Error: Eq` is not satisfied
--> $DIR/derives-span-Eq-enum-struct-variant.rs:9:6
|
LL | #[derive(Eq,PartialEq)]
| -- in this derive macro expansion
...
LL | x: Error
| ^^^^^^^^ the trait `Eq` is not implemented for `Error`
|

View File

@ -1,6 +1,9 @@
error[E0277]: the trait bound `Error: Eq` is not satisfied
--> $DIR/derives-span-Eq-enum.rs:9:6
|
LL | #[derive(Eq,PartialEq)]
| -- in this derive macro expansion
...
LL | Error
| ^^^^^ the trait `Eq` is not implemented for `Error`
|

View File

@ -1,6 +1,9 @@
error[E0277]: the trait bound `Error: Eq` is not satisfied
--> $DIR/derives-span-Eq-struct.rs:8:5
|
LL | #[derive(Eq,PartialEq)]
| -- in this derive macro expansion
LL | struct Struct {
LL | x: Error
| ^^^^^^^^ the trait `Eq` is not implemented for `Error`
|

View File

@ -1,6 +1,9 @@
error[E0277]: the trait bound `Error: Eq` is not satisfied
--> $DIR/derives-span-Eq-tuple-struct.rs:8:5
|
LL | #[derive(Eq,PartialEq)]
| -- in this derive macro expansion
LL | struct Struct(
LL | Error
| ^^^^^ the trait `Eq` is not implemented for `Error`
|

View File

@ -1,6 +1,9 @@
error[E0277]: the trait bound `Error: Hash` is not satisfied
--> $DIR/derives-span-Hash-enum-struct-variant.rs:9:6
|
LL | #[derive(Hash)]
| ---- in this derive macro expansion
...
LL | x: Error
| ^^^^^^^^ the trait `Hash` is not implemented for `Error`
|

View File

@ -1,6 +1,9 @@
error[E0277]: the trait bound `Error: Hash` is not satisfied
--> $DIR/derives-span-Hash-enum.rs:8:6
|
LL | #[derive(Hash)]
| ---- in this derive macro expansion
...
LL | Error
| ^^^^^ the trait `Hash` is not implemented for `Error`
|

View File

@ -1,6 +1,9 @@
error[E0277]: the trait bound `Error: Hash` is not satisfied
--> $DIR/derives-span-Hash-struct.rs:8:5
|
LL | #[derive(Hash)]
| ---- in this derive macro expansion
LL | struct Struct {
LL | x: Error
| ^^^^^^^^ the trait `Hash` is not implemented for `Error`
|

View File

@ -1,6 +1,9 @@
error[E0277]: the trait bound `Error: Hash` is not satisfied
--> $DIR/derives-span-Hash-tuple-struct.rs:8:5
|
LL | #[derive(Hash)]
| ---- in this derive macro expansion
LL | struct Struct(
LL | Error
| ^^^^^ the trait `Hash` is not implemented for `Error`
|

View File

@ -1,10 +1,17 @@
error[E0277]: the trait bound `Error: Ord` is not satisfied
--> $DIR/derives-span-Ord-enum-struct-variant.rs:9:6
|
LL | #[derive(Ord,Eq,PartialOrd,PartialEq)]
| --- in this derive macro expansion
...
LL | x: Error
| ^^^^^^^^ the trait `Ord` is not implemented for `Error`
|
= note: required by `std::cmp::Ord::cmp`
note: required by `std::cmp::Ord::cmp`
--> $SRC_DIR/core/src/cmp.rs:LL:COL
|
LL | fn cmp(&self, other: &Self) -> Ordering;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: this error originates in the derive macro `Ord` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error

View File

@ -1,10 +1,17 @@
error[E0277]: the trait bound `Error: Ord` is not satisfied
--> $DIR/derives-span-Ord-enum.rs:9:6
|
LL | #[derive(Ord,Eq,PartialOrd,PartialEq)]
| --- in this derive macro expansion
...
LL | Error
| ^^^^^ the trait `Ord` is not implemented for `Error`
|
= note: required by `std::cmp::Ord::cmp`
note: required by `std::cmp::Ord::cmp`
--> $SRC_DIR/core/src/cmp.rs:LL:COL
|
LL | fn cmp(&self, other: &Self) -> Ordering;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: this error originates in the derive macro `Ord` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error

View File

@ -1,10 +1,17 @@
error[E0277]: the trait bound `Error: Ord` is not satisfied
--> $DIR/derives-span-Ord-struct.rs:8:5
|
LL | #[derive(Ord,Eq,PartialOrd,PartialEq)]
| --- in this derive macro expansion
LL | struct Struct {
LL | x: Error
| ^^^^^^^^ the trait `Ord` is not implemented for `Error`
|
= note: required by `std::cmp::Ord::cmp`
note: required by `std::cmp::Ord::cmp`
--> $SRC_DIR/core/src/cmp.rs:LL:COL
|
LL | fn cmp(&self, other: &Self) -> Ordering;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: this error originates in the derive macro `Ord` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error

View File

@ -1,10 +1,17 @@
error[E0277]: the trait bound `Error: Ord` is not satisfied
--> $DIR/derives-span-Ord-tuple-struct.rs:8:5
|
LL | #[derive(Ord,Eq,PartialOrd,PartialEq)]
| --- in this derive macro expansion
LL | struct Struct(
LL | Error
| ^^^^^ the trait `Ord` is not implemented for `Error`
|
= note: required by `std::cmp::Ord::cmp`
note: required by `std::cmp::Ord::cmp`
--> $SRC_DIR/core/src/cmp.rs:LL:COL
|
LL | fn cmp(&self, other: &Self) -> Ordering;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: this error originates in the derive macro `Ord` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error

View File

@ -1,6 +1,9 @@
error[E0369]: binary operation `==` cannot be applied to type `Error`
--> $DIR/derives-span-PartialEq-enum-struct-variant.rs:9:6
|
LL | #[derive(PartialEq)]
| --------- in this derive macro expansion
...
LL | x: Error
| ^^^^^^^^
|
@ -10,6 +13,9 @@ LL | x: Error
error[E0369]: binary operation `!=` cannot be applied to type `Error`
--> $DIR/derives-span-PartialEq-enum-struct-variant.rs:9:6
|
LL | #[derive(PartialEq)]
| --------- in this derive macro expansion
...
LL | x: Error
| ^^^^^^^^
|

View File

@ -1,6 +1,9 @@
error[E0369]: binary operation `==` cannot be applied to type `Error`
--> $DIR/derives-span-PartialEq-enum.rs:9:6
|
LL | #[derive(PartialEq)]
| --------- in this derive macro expansion
...
LL | Error
| ^^^^^
|
@ -10,6 +13,9 @@ LL | Error
error[E0369]: binary operation `!=` cannot be applied to type `Error`
--> $DIR/derives-span-PartialEq-enum.rs:9:6
|
LL | #[derive(PartialEq)]
| --------- in this derive macro expansion
...
LL | Error
| ^^^^^
|

View File

@ -1,6 +1,9 @@
error[E0369]: binary operation `==` cannot be applied to type `Error`
--> $DIR/derives-span-PartialEq-struct.rs:8:5
|
LL | #[derive(PartialEq)]
| --------- in this derive macro expansion
LL | struct Struct {
LL | x: Error
| ^^^^^^^^
|
@ -10,6 +13,9 @@ LL | x: Error
error[E0369]: binary operation `!=` cannot be applied to type `Error`
--> $DIR/derives-span-PartialEq-struct.rs:8:5
|
LL | #[derive(PartialEq)]
| --------- in this derive macro expansion
LL | struct Struct {
LL | x: Error
| ^^^^^^^^
|

View File

@ -1,6 +1,9 @@
error[E0369]: binary operation `==` cannot be applied to type `Error`
--> $DIR/derives-span-PartialEq-tuple-struct.rs:8:5
|
LL | #[derive(PartialEq)]
| --------- in this derive macro expansion
LL | struct Struct(
LL | Error
| ^^^^^
|
@ -10,6 +13,9 @@ LL | Error
error[E0369]: binary operation `!=` cannot be applied to type `Error`
--> $DIR/derives-span-PartialEq-tuple-struct.rs:8:5
|
LL | #[derive(PartialEq)]
| --------- in this derive macro expansion
LL | struct Struct(
LL | Error
| ^^^^^
|

View File

@ -1,11 +1,18 @@
error[E0277]: can't compare `Error` with `Error`
--> $DIR/derives-span-PartialOrd-enum-struct-variant.rs:9:6
|
LL | #[derive(PartialOrd,PartialEq)]
| ---------- in this derive macro expansion
...
LL | x: Error
| ^^^^^^^^ no implementation for `Error < Error` and `Error > Error`
|
= help: the trait `PartialOrd` is not implemented for `Error`
= note: required by `std::cmp::PartialOrd::partial_cmp`
note: required by `std::cmp::PartialOrd::partial_cmp`
--> $SRC_DIR/core/src/cmp.rs:LL:COL
|
LL | fn partial_cmp(&self, other: &Rhs) -> Option<Ordering>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: this error originates in the derive macro `PartialOrd` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error

View File

@ -1,11 +1,18 @@
error[E0277]: can't compare `Error` with `Error`
--> $DIR/derives-span-PartialOrd-enum.rs:9:6
|
LL | #[derive(PartialOrd,PartialEq)]
| ---------- in this derive macro expansion
...
LL | Error
| ^^^^^ no implementation for `Error < Error` and `Error > Error`
|
= help: the trait `PartialOrd` is not implemented for `Error`
= note: required by `std::cmp::PartialOrd::partial_cmp`
note: required by `std::cmp::PartialOrd::partial_cmp`
--> $SRC_DIR/core/src/cmp.rs:LL:COL
|
LL | fn partial_cmp(&self, other: &Rhs) -> Option<Ordering>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: this error originates in the derive macro `PartialOrd` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error

View File

@ -1,11 +1,18 @@
error[E0277]: can't compare `Error` with `Error`
--> $DIR/derives-span-PartialOrd-struct.rs:8:5
|
LL | #[derive(PartialOrd,PartialEq)]
| ---------- in this derive macro expansion
LL | struct Struct {
LL | x: Error
| ^^^^^^^^ no implementation for `Error < Error` and `Error > Error`
|
= help: the trait `PartialOrd` is not implemented for `Error`
= note: required by `std::cmp::PartialOrd::partial_cmp`
note: required by `std::cmp::PartialOrd::partial_cmp`
--> $SRC_DIR/core/src/cmp.rs:LL:COL
|
LL | fn partial_cmp(&self, other: &Rhs) -> Option<Ordering>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: this error originates in the derive macro `PartialOrd` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error

View File

@ -1,11 +1,18 @@
error[E0277]: can't compare `Error` with `Error`
--> $DIR/derives-span-PartialOrd-tuple-struct.rs:8:5
|
LL | #[derive(PartialOrd,PartialEq)]
| ---------- in this derive macro expansion
LL | struct Struct(
LL | Error
| ^^^^^ no implementation for `Error < Error` and `Error > Error`
|
= help: the trait `PartialOrd` is not implemented for `Error`
= note: required by `std::cmp::PartialOrd::partial_cmp`
note: required by `std::cmp::PartialOrd::partial_cmp`
--> $SRC_DIR/core/src/cmp.rs:LL:COL
|
LL | fn partial_cmp(&self, other: &Rhs) -> Option<Ordering>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: this error originates in the derive macro `PartialOrd` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error

View File

@ -10,7 +10,12 @@ LL | is_copy(B { a: 1, b: C });
| expected an implementor of trait `Copy`
| help: consider borrowing here: `&B { a: 1, b: C }`
|
= note: required because of the requirements on the impl of `Copy` for `B<C>`
note: required because of the requirements on the impl of `Copy` for `B<C>`
--> $DIR/deriving-copyclone.rs:9:10
|
LL | #[derive(Copy, Clone)]
| ^^^^
= note: this error originates in the derive macro `Copy` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `C: Clone` is not satisfied
--> $DIR/deriving-copyclone.rs:32:14
@ -24,7 +29,12 @@ LL | is_clone(B { a: 1, b: C });
| expected an implementor of trait `Clone`
| help: consider borrowing here: `&B { a: 1, b: C }`
|
= note: required because of the requirements on the impl of `Clone` for `B<C>`
note: required because of the requirements on the impl of `Clone` for `B<C>`
--> $DIR/deriving-copyclone.rs:9:16
|
LL | #[derive(Copy, Clone)]
| ^^^^^
= note: this error originates in the derive macro `Clone` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `D: Copy` is not satisfied
--> $DIR/deriving-copyclone.rs:35:13
@ -38,7 +48,12 @@ LL | is_copy(B { a: 1, b: D });
| expected an implementor of trait `Copy`
| help: consider borrowing here: `&B { a: 1, b: D }`
|
= note: required because of the requirements on the impl of `Copy` for `B<D>`
note: required because of the requirements on the impl of `Copy` for `B<D>`
--> $DIR/deriving-copyclone.rs:9:10
|
LL | #[derive(Copy, Clone)]
| ^^^^
= note: this error originates in the derive macro `Copy` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to 3 previous errors

View File

@ -1,6 +1,9 @@
error[E0369]: binary operation `==` cannot be applied to type `NoCloneOrEq`
--> $DIR/deriving-no-inner-impl-error-message.rs:5:5
|
LL | #[derive(PartialEq)]
| --------- in this derive macro expansion
LL | struct E {
LL | x: NoCloneOrEq
| ^^^^^^^^^^^^^^
|
@ -10,6 +13,9 @@ LL | x: NoCloneOrEq
error[E0369]: binary operation `!=` cannot be applied to type `NoCloneOrEq`
--> $DIR/deriving-no-inner-impl-error-message.rs:5:5
|
LL | #[derive(PartialEq)]
| --------- in this derive macro expansion
LL | struct E {
LL | x: NoCloneOrEq
| ^^^^^^^^^^^^^^
|
@ -19,10 +25,17 @@ LL | x: NoCloneOrEq
error[E0277]: the trait bound `NoCloneOrEq: Clone` is not satisfied
--> $DIR/deriving-no-inner-impl-error-message.rs:10:5
|
LL | #[derive(Clone)]
| ----- in this derive macro expansion
LL | struct C {
LL | x: NoCloneOrEq
| ^^^^^^^^^^^^^^ the trait `Clone` is not implemented for `NoCloneOrEq`
|
= note: required by `clone`
note: required by `clone`
--> $SRC_DIR/core/src/clone.rs:LL:COL
|
LL | fn clone(&self) -> Self;
| ^^^^^^^^^^^^^^^^^^^^^^^^
= note: this error originates in the derive macro `Clone` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to 3 previous errors

View File

@ -2,29 +2,29 @@
struct S;
#[derive(PartialEq)] //~ ERROR: `derive` may only be applied to structs, enums and unions
#[derive(PartialEq)] //~ ERROR: `derive` may only be applied to `struct`s, `enum`s and `union`s
trait T { }
#[derive(PartialEq)] //~ ERROR: `derive` may only be applied to structs, enums and unions
#[derive(PartialEq)] //~ ERROR: `derive` may only be applied to `struct`s, `enum`s and `union`s
impl S { }
#[derive(PartialEq)] //~ ERROR: `derive` may only be applied to structs, enums and unions
#[derive(PartialEq)] //~ ERROR: `derive` may only be applied to `struct`s, `enum`s and `union`s
impl T for S { }
#[derive(PartialEq)] //~ ERROR: `derive` may only be applied to structs, enums and unions
#[derive(PartialEq)] //~ ERROR: `derive` may only be applied to `struct`s, `enum`s and `union`s
static s: usize = 0;
#[derive(PartialEq)] //~ ERROR: `derive` may only be applied to structs, enums and unions
#[derive(PartialEq)] //~ ERROR: `derive` may only be applied to `struct`s, `enum`s and `union`s
const c: usize = 0;
#[derive(PartialEq)] //~ ERROR: `derive` may only be applied to structs, enums and unions
#[derive(PartialEq)] //~ ERROR: `derive` may only be applied to `struct`s, `enum`s and `union`s
mod m { }
#[derive(PartialEq)] //~ ERROR: `derive` may only be applied to structs, enums and unions
#[derive(PartialEq)] //~ ERROR: `derive` may only be applied to `struct`s, `enum`s and `union`s
extern "C" { }
#[derive(PartialEq)] //~ ERROR: `derive` may only be applied to structs, enums and unions
#[derive(PartialEq)] //~ ERROR: `derive` may only be applied to `struct`s, `enum`s and `union`s
type A = usize;
#[derive(PartialEq)] //~ ERROR: `derive` may only be applied to structs, enums and unions
#[derive(PartialEq)] //~ ERROR: `derive` may only be applied to `struct`s, `enum`s and `union`s
fn main() { }

View File

@ -1,56 +1,74 @@
error[E0774]: `derive` may only be applied to structs, enums and unions
error[E0774]: `derive` may only be applied to `struct`s, `enum`s and `union`s
--> $DIR/deriving-non-type.rs:5:1
|
LL | #[derive(PartialEq)]
| ^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^ not applicable here
LL | trait T { }
| ----------- not a `struct`, `enum` or `union`
error[E0774]: `derive` may only be applied to structs, enums and unions
error[E0774]: `derive` may only be applied to `struct`s, `enum`s and `union`s
--> $DIR/deriving-non-type.rs:8:1
|
LL | #[derive(PartialEq)]
| ^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^ not applicable here
LL | impl S { }
| ---------- not a `struct`, `enum` or `union`
error[E0774]: `derive` may only be applied to structs, enums and unions
error[E0774]: `derive` may only be applied to `struct`s, `enum`s and `union`s
--> $DIR/deriving-non-type.rs:11:1
|
LL | #[derive(PartialEq)]
| ^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^ not applicable here
LL | impl T for S { }
| ---------------- not a `struct`, `enum` or `union`
error[E0774]: `derive` may only be applied to structs, enums and unions
error[E0774]: `derive` may only be applied to `struct`s, `enum`s and `union`s
--> $DIR/deriving-non-type.rs:14:1
|
LL | #[derive(PartialEq)]
| ^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^ not applicable here
LL | static s: usize = 0;
| -------------------- not a `struct`, `enum` or `union`
error[E0774]: `derive` may only be applied to structs, enums and unions
error[E0774]: `derive` may only be applied to `struct`s, `enum`s and `union`s
--> $DIR/deriving-non-type.rs:17:1
|
LL | #[derive(PartialEq)]
| ^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^ not applicable here
LL | const c: usize = 0;
| ------------------- not a `struct`, `enum` or `union`
error[E0774]: `derive` may only be applied to structs, enums and unions
error[E0774]: `derive` may only be applied to `struct`s, `enum`s and `union`s
--> $DIR/deriving-non-type.rs:20:1
|
LL | #[derive(PartialEq)]
| ^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^ not applicable here
LL | mod m { }
| --------- not a `struct`, `enum` or `union`
error[E0774]: `derive` may only be applied to structs, enums and unions
error[E0774]: `derive` may only be applied to `struct`s, `enum`s and `union`s
--> $DIR/deriving-non-type.rs:23:1
|
LL | #[derive(PartialEq)]
| ^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^ not applicable here
LL | extern "C" { }
| -------------- not a `struct`, `enum` or `union`
error[E0774]: `derive` may only be applied to structs, enums and unions
error[E0774]: `derive` may only be applied to `struct`s, `enum`s and `union`s
--> $DIR/deriving-non-type.rs:26:1
|
LL | #[derive(PartialEq)]
| ^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^ not applicable here
LL | type A = usize;
| --------------- not a `struct`, `enum` or `union`
error[E0774]: `derive` may only be applied to structs, enums and unions
error[E0774]: `derive` may only be applied to `struct`s, `enum`s and `union`s
--> $DIR/deriving-non-type.rs:29:1
|
LL | #[derive(PartialEq)]
| ^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^ not applicable here
LL | fn main() { }
| ------------- not a `struct`, `enum` or `union`
error: aborting due to 9 previous errors

View File

@ -1,9 +1,6 @@
error[E0277]: the trait bound `i8: Foo<i32>` is not satisfied
--> $DIR/issue-39802-show-5-trait-impls.rs:24:21
|
LL | fn bar(&self){}
| ------------- required by `Foo::bar`
...
LL | Foo::<i32>::bar(&1i8);
| ^^^^ the trait `Foo<i32>` is not implemented for `i8`
|
@ -13,13 +10,15 @@ LL | Foo::<i32>::bar(&1i8);
<i8 as Foo<u32>>
<i8 as Foo<u64>>
<i8 as Foo<u8>>
note: required by `Foo::bar`
--> $DIR/issue-39802-show-5-trait-impls.rs:2:5
|
LL | fn bar(&self){}
| ^^^^^^^^^^^^^
error[E0277]: the trait bound `u8: Foo<i32>` is not satisfied
--> $DIR/issue-39802-show-5-trait-impls.rs:25:21
|
LL | fn bar(&self){}
| ------------- required by `Foo::bar`
...
LL | Foo::<i32>::bar(&1u8);
| ^^^^ the trait `Foo<i32>` is not implemented for `u8`
|
@ -28,13 +27,15 @@ LL | Foo::<i32>::bar(&1u8);
<u8 as Foo<u16>>
<u8 as Foo<u32>>
<u8 as Foo<u64>>
note: required by `Foo::bar`
--> $DIR/issue-39802-show-5-trait-impls.rs:2:5
|
LL | fn bar(&self){}
| ^^^^^^^^^^^^^
error[E0277]: the trait bound `bool: Foo<i32>` is not satisfied
--> $DIR/issue-39802-show-5-trait-impls.rs:26:21
|
LL | fn bar(&self){}
| ------------- required by `Foo::bar`
...
LL | Foo::<i32>::bar(&true);
| ^^^^^ the trait `Foo<i32>` is not implemented for `bool`
|
@ -44,6 +45,11 @@ LL | Foo::<i32>::bar(&true);
<bool as Foo<u16>>
<bool as Foo<u32>>
and 2 others
note: required by `Foo::bar`
--> $DIR/issue-39802-show-5-trait-impls.rs:2:5
|
LL | fn bar(&self){}
| ^^^^^^^^^^^^^
error: aborting due to 3 previous errors

View File

@ -1,13 +1,15 @@
error[E0283]: type annotations needed
--> $DIR/E0283.rs:30:21
|
LL | fn create() -> u32;
| ------------------- required by `Generator::create`
...
LL | let cont: u32 = Generator::create();
| ^^^^^^^^^^^^^^^^^ cannot infer type
|
= note: cannot satisfy `_: Generator`
note: required by `Generator::create`
--> $DIR/E0283.rs:2:5
|
LL | fn create() -> u32;
| ^^^^^^^^^^^^^^^^^^^
error[E0283]: type annotations needed
--> $DIR/E0283.rs:35:24

View File

@ -1,6 +1,9 @@
error[E0624]: associated function `method` is private
--> $DIR/E0624.rs:11:9
|
LL | fn method(&self) {}
| ---------------- private associated function defined here
...
LL | foo.method();
| ^^^^^^ private associated function

View File

@ -2,7 +2,7 @@ error[E0777]: expected path to a trait, found literal
--> $DIR/E0777.rs:1:10
|
LL | #[derive("Clone")]
| ^^^^^^^
| ^^^^^^^ not a trait
|
= help: try using `#[derive(Clone)]`
@ -12,7 +12,7 @@ error[E0777]: expected path to a trait, found literal
LL | #[derive("Clone
| __________^
LL | | ")]
| |_^
| |_^ not a trait
|
= help: for example, write `#[derive(Debug)]` for `Debug`

View File

@ -84,18 +84,33 @@ error[E0624]: associated function `pub_crate` is private
|
LL | r.pub_crate();
| ^^^^^^^^^ private associated function
|
::: $DIR/auxiliary/pub-and-stability.rs:114:9
|
LL | pub(crate) fn pub_crate(&self) -> i32 { self.d_priv }
| ------------------------------------- private associated function defined here
error[E0624]: associated function `pub_mod` is private
--> $DIR/explore-issue-38412.rs:51:7
|
LL | r.pub_mod();
| ^^^^^^^ private associated function
|
::: $DIR/auxiliary/pub-and-stability.rs:116:9
|
LL | pub(in m) fn pub_mod(&self) -> i32 { self.d_priv }
| ---------------------------------- private associated function defined here
error[E0624]: associated function `private` is private
--> $DIR/explore-issue-38412.rs:52:7
|
LL | r.private();
| ^^^^^^^ private associated function
|
::: $DIR/auxiliary/pub-and-stability.rs:118:9
|
LL | fn private(&self) -> i32 { self.d_priv }
| ------------------------ private associated function defined here
error[E0658]: use of unstable library feature 'unstable_undeclared'
--> $DIR/explore-issue-38412.rs:57:7
@ -120,18 +135,33 @@ error[E0624]: associated function `pub_crate` is private
|
LL | t.pub_crate();
| ^^^^^^^^^ private associated function
|
::: $DIR/auxiliary/pub-and-stability.rs:129:9
|
LL | pub(crate) fn pub_crate(&self) -> i32 { self.0 }
| ------------------------------------- private associated function defined here
error[E0624]: associated function `pub_mod` is private
--> $DIR/explore-issue-38412.rs:64:7
|
LL | t.pub_mod();
| ^^^^^^^ private associated function
|
::: $DIR/auxiliary/pub-and-stability.rs:130:9
|
LL | pub(in m) fn pub_mod(&self) -> i32 { self.0 }
| ---------------------------------- private associated function defined here
error[E0624]: associated function `private` is private
--> $DIR/explore-issue-38412.rs:65:7
|
LL | t.private();
| ^^^^^^^ private associated function
|
::: $DIR/auxiliary/pub-and-stability.rs:131:9
|
LL | fn private(&self) -> i32 { self.0 }
| ------------------------ private associated function defined here
error: aborting due to 19 previous errors

View File

@ -2,14 +2,14 @@
// definitions.
#[derive(Debug)]
//~^ ERROR `derive` may only be applied to structs, enums and unions
//~^ ERROR `derive` may only be applied to `struct`s, `enum`s and `union`s
mod derive {
mod inner { #![derive(Debug)] }
//~^ ERROR `derive` may only be applied to structs, enums and unions
//~^ ERROR `derive` may only be applied to `struct`s, `enum`s and `union`s
//~| ERROR inner macro attributes are unstable
#[derive(Debug)]
//~^ ERROR `derive` may only be applied to structs, enums and unions
//~^ ERROR `derive` may only be applied to `struct`s, `enum`s and `union`s
fn derive() { }
#[derive(Copy, Clone)] // (can't derive Debug for unions)
@ -22,11 +22,11 @@ mod derive {
enum E { }
#[derive(Debug)]
//~^ ERROR `derive` may only be applied to structs, enums and unions
//~^ ERROR `derive` may only be applied to `struct`s, `enum`s and `union`s
type T = S;
#[derive(Debug)]
//~^ ERROR `derive` may only be applied to structs, enums and unions
//~^ ERROR `derive` may only be applied to `struct`s, `enum`s and `union`s
impl S { }
}

View File

@ -1,8 +1,17 @@
error[E0774]: `derive` may only be applied to structs, enums and unions
error[E0774]: `derive` may only be applied to `struct`s, `enum`s and `union`s
--> $DIR/issue-43106-gating-of-derive.rs:4:1
|
LL | #[derive(Debug)]
| ^^^^^^^^^^^^^^^^
LL | #[derive(Debug)]
| ^^^^^^^^^^^^^^^^ not applicable here
LL |
LL | / mod derive {
LL | | mod inner { #![derive(Debug)] }
LL | |
LL | |
... |
LL | | impl S { }
LL | | }
| |_- not a `struct`, `enum` or `union`
error[E0658]: inner macro attributes are unstable
--> $DIR/issue-43106-gating-of-derive.rs:7:20
@ -13,29 +22,41 @@ LL | mod inner { #![derive(Debug)] }
= note: see issue #54726 <https://github.com/rust-lang/rust/issues/54726> for more information
= help: add `#![feature(custom_inner_attributes)]` to the crate attributes to enable
error[E0774]: `derive` may only be applied to structs, enums and unions
error[E0774]: `derive` may only be applied to `struct`s, `enum`s and `union`s
--> $DIR/issue-43106-gating-of-derive.rs:7:17
|
LL | mod inner { #![derive(Debug)] }
| ^^^^^^^^^^^^^^^^^
| ------------^^^^^^^^^^^^^^^^^--
| | |
| | not applicable here
| not a `struct`, `enum` or `union`
error[E0774]: `derive` may only be applied to structs, enums and unions
error[E0774]: `derive` may only be applied to `struct`s, `enum`s and `union`s
--> $DIR/issue-43106-gating-of-derive.rs:11:5
|
LL | #[derive(Debug)]
| ^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^ not applicable here
LL |
LL | fn derive() { }
| --------------- not a `struct`, `enum` or `union`
error[E0774]: `derive` may only be applied to structs, enums and unions
error[E0774]: `derive` may only be applied to `struct`s, `enum`s and `union`s
--> $DIR/issue-43106-gating-of-derive.rs:24:5
|
LL | #[derive(Debug)]
| ^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^ not applicable here
LL |
LL | type T = S;
| ----------- not a `struct`, `enum` or `union`
error[E0774]: `derive` may only be applied to structs, enums and unions
error[E0774]: `derive` may only be applied to `struct`s, `enum`s and `union`s
--> $DIR/issue-43106-gating-of-derive.rs:28:5
|
LL | #[derive(Debug)]
| ^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^ not applicable here
LL |
LL | impl S { }
| ---------- not a `struct`, `enum` or `union`
error: aborting due to 6 previous errors

View File

@ -5,7 +5,11 @@ LL | format!("{:X}", "3");
| ^^^ the trait `UpperHex` is not implemented for `str`
|
= note: required because of the requirements on the impl of `UpperHex` for `&str`
= note: required by `std::fmt::UpperHex::fmt`
note: required by `std::fmt::UpperHex::fmt`
--> $SRC_DIR/core/src/fmt/mod.rs:LL:COL
|
LL | fn fmt(&self, f: &mut Formatter<'_>) -> Result;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: this error originates in the macro `$crate::__export::format_args` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error

View File

@ -6,7 +6,11 @@ LL | for c in "asdf" {
|
= help: the trait `Iterator` is not implemented for `&str`
= note: required because of the requirements on the impl of `IntoIterator` for `&str`
= note: required by `into_iter`
note: required by `into_iter`
--> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL
|
LL | fn into_iter(self) -> Self::IntoIter;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error

View File

@ -6,7 +6,11 @@ LL | for x in bogus {
|
= help: the trait `Iterator` is not implemented for `MyStruct`
= note: required because of the requirements on the impl of `IntoIterator` for `MyStruct`
= note: required by `into_iter`
note: required by `into_iter`
--> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL
|
LL | fn into_iter(self) -> Self::IntoIter;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error

View File

@ -13,7 +13,11 @@ LL | yield || for i in 0 { }
= help: the trait `Iterator` is not implemented for `{integer}`
= note: if you want to iterate between `start` until a value `end`, use the exclusive range syntax `start..end` or the inclusive range syntax `start..=end`
= note: required because of the requirements on the impl of `IntoIterator` for `{integer}`
= note: required by `into_iter`
note: required by `into_iter`
--> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL
|
LL | fn into_iter(self) -> Self::IntoIter;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to 2 previous errors

View File

@ -47,7 +47,11 @@ error[E0277]: the trait bound `T: Copy` is not satisfied
LL | type C where Self: Copy = String;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `T`
|
= note: required because of the requirements on the impl of `Copy` for `Fooy<T>`
note: required because of the requirements on the impl of `Copy` for `Fooy<T>`
--> $DIR/impl_bounds.rs:11:10
|
LL | #[derive(Copy, Clone)]
| ^^^^
note: the requirement `Fooy<T>: Copy` appears on the associated impl type `C` but not on the corresponding associated trait type
--> $DIR/impl_bounds.rs:7:5
|
@ -56,6 +60,7 @@ LL | trait Foo {
...
LL | type C where Self: Clone;
| ^^^^^^^^^^^^^^^^^^^^^^^^^ this trait associated type doesn't have the requirement `Fooy<T>: Copy`
= note: this error originates in the derive macro `Copy` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider restricting type parameter `T`
|
LL | impl<T: std::marker::Copy> Foo for Fooy<T> {
@ -67,7 +72,11 @@ error[E0277]: the trait bound `T: Copy` is not satisfied
LL | fn d() where Self: Copy {}
| ^^^^^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `T`
|
= note: required because of the requirements on the impl of `Copy` for `Fooy<T>`
note: required because of the requirements on the impl of `Copy` for `Fooy<T>`
--> $DIR/impl_bounds.rs:11:10
|
LL | #[derive(Copy, Clone)]
| ^^^^
note: the requirement `Fooy<T>: Copy` appears on the impl method `d` but not on the corresponding trait method
--> $DIR/impl_bounds.rs:8:8
|
@ -76,6 +85,7 @@ LL | trait Foo {
...
LL | fn d() where Self: Clone;
| ^ this trait method doesn't have the requirement `Fooy<T>: Copy`
= note: this error originates in the derive macro `Copy` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider restricting type parameter `T`
|
LL | impl<T: std::marker::Copy> Foo for Fooy<T> {

View File

@ -1,6 +1,8 @@
error[E0308]: mismatched types
--> $DIR/issue-12997-2.rs:8:1
|
LL | #[bench]
| -------- in this procedural macro expansion
LL | fn bar(x: isize) { }
| ^^^^^^^^^^^^^^^^^^^^ expected `isize`, found `&mut Bencher`
|

View File

@ -5,7 +5,11 @@ LL | (|| Box::new(*(&[0][..])))();
| ^^^^^^^^^^^ doesn't have a size known at compile-time
|
= help: the trait `Sized` is not implemented for `[{integer}]`
= note: required by `Box::<T>::new`
note: required by `Box::<T>::new`
--> $SRC_DIR/alloc/src/boxed.rs:LL:COL
|
LL | pub fn new(x: T) -> Self {
| ^^^^^^^^^^^^^^^^^^^^^^^^
error[E0277]: the size for values of type `[{integer}]` cannot be known at compilation time
--> $DIR/issue-17651.rs:5:9

View File

@ -6,7 +6,11 @@ LL | for item in *things { *item = 0 }
|
= help: the trait `Sized` is not implemented for `dyn Iterator<Item = &'a mut u8>`
= note: required because of the requirements on the impl of `IntoIterator` for `dyn Iterator<Item = &'a mut u8>`
= note: required by `into_iter`
note: required by `into_iter`
--> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL
|
LL | fn into_iter(self) -> Self::IntoIter;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error

View File

@ -1,6 +1,8 @@
error[E0277]: the trait bound `Bar: Hash` is not satisfied
--> $DIR/issue-21160.rs:8:12
|
LL | #[derive(Hash)]
| ---- in this derive macro expansion
LL | struct Foo(Bar);
| ^^^ the trait `Hash` is not implemented for `Bar`
|

View File

@ -3,6 +3,11 @@ error[E0624]: associated function `foo` is private
|
LL | Foo::foo(&f);
| ^^^ private associated function
|
::: $DIR/auxiliary/issue-21202.rs:4:9
|
LL | fn foo(&self) { }
| ------------- private associated function defined here
error: aborting due to previous error

View File

@ -5,7 +5,11 @@ LL | let _ = Iterator::next(&mut ());
| ^^^^^^^ `()` is not an iterator
|
= help: the trait `Iterator` is not implemented for `()`
= note: required by `std::iter::Iterator::next`
note: required by `std::iter::Iterator::next`
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
|
LL | fn next(&mut self) -> Option<Self::Item>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0277]: `bool` is not an iterator
--> $DIR/issue-28098.rs:6:14
@ -15,7 +19,11 @@ LL | for _ in false {}
|
= help: the trait `Iterator` is not implemented for `bool`
= note: required because of the requirements on the impl of `IntoIterator` for `bool`
= note: required by `into_iter`
note: required by `into_iter`
--> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL
|
LL | fn into_iter(self) -> Self::IntoIter;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0277]: `()` is not an iterator
--> $DIR/issue-28098.rs:9:28
@ -24,7 +32,11 @@ LL | let _ = Iterator::next(&mut ());
| ^^^^^^^ `()` is not an iterator
|
= help: the trait `Iterator` is not implemented for `()`
= note: required by `std::iter::Iterator::next`
note: required by `std::iter::Iterator::next`
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
|
LL | fn next(&mut self) -> Option<Self::Item>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0277]: `()` is not an iterator
--> $DIR/issue-28098.rs:2:13
@ -41,7 +53,11 @@ LL | let _ = Iterator::next(&mut ());
| ^^^^^^^ `()` is not an iterator
|
= help: the trait `Iterator` is not implemented for `()`
= note: required by `std::iter::Iterator::next`
note: required by `std::iter::Iterator::next`
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
|
LL | fn next(&mut self) -> Option<Self::Item>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0277]: `()` is not an iterator
--> $DIR/issue-28098.rs:22:28
@ -50,7 +66,11 @@ LL | let _ = Iterator::next(&mut ());
| ^^^^^^^ `()` is not an iterator
|
= help: the trait `Iterator` is not implemented for `()`
= note: required by `std::iter::Iterator::next`
note: required by `std::iter::Iterator::next`
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
|
LL | fn next(&mut self) -> Option<Self::Item>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0277]: `bool` is not an iterator
--> $DIR/issue-28098.rs:25:14
@ -60,7 +80,11 @@ LL | for _ in false {}
|
= help: the trait `Iterator` is not implemented for `bool`
= note: required because of the requirements on the impl of `IntoIterator` for `bool`
= note: required by `into_iter`
note: required by `into_iter`
--> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL
|
LL | fn into_iter(self) -> Self::IntoIter;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0277]: `()` is not an iterator
--> $DIR/issue-28098.rs:18:13

View File

@ -1,13 +1,15 @@
error[E0283]: type annotations needed
--> $DIR/issue-29147.rs:21:13
|
LL | trait Foo { fn xxx(&self); }
| -------------- required by `Foo::xxx`
...
LL | let _ = <S5<_>>::xxx;
| ^^^^^^^^^^^^ cannot infer type for struct `S5<_>`
|
= note: cannot satisfy `S5<_>: Foo`
note: required by `Foo::xxx`
--> $DIR/issue-29147.rs:10:13
|
LL | trait Foo { fn xxx(&self); }
| ^^^^^^^^^^^^^^
error: aborting due to previous error

View File

@ -8,7 +8,11 @@ LL | Err(5)?;
|
= note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait
= note: required because of the requirements on the impl of `FromResidual<Result<Infallible, {integer}>>` for `Result<i32, ()>`
= note: required by `from_residual`
note: required by `from_residual`
--> $SRC_DIR/core/src/ops/try_trait.rs:LL:COL
|
LL | fn from_residual(residual: R) -> Self;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error

View File

@ -17,7 +17,11 @@ LL | for _ in HashMap::new().iter().cloned() {}
found tuple `(&_, &_)`
= note: required because of the requirements on the impl of `Iterator` for `Cloned<std::collections::hash_map::Iter<'_, _, _>>`
= note: required because of the requirements on the impl of `IntoIterator` for `Cloned<std::collections::hash_map::Iter<'_, _, _>>`
= note: required by `into_iter`
note: required by `into_iter`
--> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL
|
LL | fn into_iter(self) -> Self::IntoIter;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0271]: type mismatch resolving `<std::collections::hash_map::Iter<'_, _, _> as Iterator>::Item == &_`
--> $DIR/issue-33941.rs:4:14
@ -28,7 +32,11 @@ LL | for _ in HashMap::new().iter().cloned() {}
= note: expected reference `&_`
found tuple `(&_, &_)`
= note: required because of the requirements on the impl of `Iterator` for `Cloned<std::collections::hash_map::Iter<'_, _, _>>`
= note: required by `std::iter::Iterator::next`
note: required by `std::iter::Iterator::next`
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
|
LL | fn next(&mut self) -> Option<Self::Item>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to 3 previous errors

View File

@ -2,10 +2,16 @@ error[E0277]: can't compare `Comparable` with `Comparable`
--> $DIR/issue-34229.rs:2:46
|
LL | #[derive(PartialEq, PartialOrd)] struct Nope(Comparable);
| ^^^^^^^^^^ no implementation for `Comparable < Comparable` and `Comparable > Comparable`
| ---------- ^^^^^^^^^^ no implementation for `Comparable < Comparable` and `Comparable > Comparable`
| |
| in this derive macro expansion
|
= help: the trait `PartialOrd` is not implemented for `Comparable`
= note: required by `std::cmp::PartialOrd::partial_cmp`
note: required by `std::cmp::PartialOrd::partial_cmp`
--> $SRC_DIR/core/src/cmp.rs:LL:COL
|
LL | fn partial_cmp(&self, other: &Rhs) -> Option<Ordering>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: this error originates in the derive macro `PartialOrd` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error

View File

@ -13,12 +13,18 @@ LL | let _woohoo = (Box::new(my_struct)).priv_field;
error[E0624]: associated function `happyfun` is private
--> $DIR/issue-3763.rs:24:18
|
LL | fn happyfun(&self) {}
| ------------------ private associated function defined here
...
LL | (&my_struct).happyfun();
| ^^^^^^^^ private associated function
error[E0624]: associated function `happyfun` is private
--> $DIR/issue-3763.rs:26:27
|
LL | fn happyfun(&self) {}
| ------------------ private associated function defined here
...
LL | (Box::new(my_struct)).happyfun();
| ^^^^^^^^ private associated function

View File

@ -1,9 +1,6 @@
error[E0271]: type mismatch resolving `for<'a> <() as Array<'a>>::Element == ()`
--> $DIR/issue-39970.rs:19:5
|
LL | fn visit() {}
| ---------- required by `Visit::visit`
...
LL | <() as Visit>::visit();
| ^^^^^^^^^^^^^^^^^^^^ expected `()`, found `&()`
|
@ -12,6 +9,11 @@ note: required because of the requirements on the impl of `Visit` for `()`
|
LL | impl Visit for () where
| ^^^^^ ^^
note: required by `Visit::visit`
--> $DIR/issue-39970.rs:6:5
|
LL | fn visit() {}
| ^^^^^^^^^^
error: aborting due to previous error

View File

@ -1,19 +1,19 @@
struct S;
impl S {
#[derive(Debug)] //~ ERROR `derive` may only be applied to structs, enums and unions
#[derive(Debug)] //~ ERROR `derive` may only be applied to `struct`s, `enum`s and `union`s
fn f() {
file!();
}
}
trait Tr1 {
#[derive(Debug)] //~ ERROR `derive` may only be applied to structs, enums and unions
#[derive(Debug)] //~ ERROR `derive` may only be applied to `struct`s, `enum`s and `union`s
fn f();
}
trait Tr2 {
#[derive(Debug)] //~ ERROR `derive` may only be applied to structs, enums and unions
#[derive(Debug)] //~ ERROR `derive` may only be applied to `struct`s, `enum`s and `union`s
type F;
}

View File

@ -1,20 +1,28 @@
error[E0774]: `derive` may only be applied to structs, enums and unions
error[E0774]: `derive` may only be applied to `struct`s, `enum`s and `union`s
--> $DIR/issue-43023.rs:4:5
|
LL | #[derive(Debug)]
| ^^^^^^^^^^^^^^^^
LL | #[derive(Debug)]
| ^^^^^^^^^^^^^^^^ not applicable here
LL | / fn f() {
LL | | file!();
LL | | }
| |_____- not a `struct`, `enum` or `union`
error[E0774]: `derive` may only be applied to structs, enums and unions
error[E0774]: `derive` may only be applied to `struct`s, `enum`s and `union`s
--> $DIR/issue-43023.rs:11:5
|
LL | #[derive(Debug)]
| ^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^ not applicable here
LL | fn f();
| ------- not a `struct`, `enum` or `union`
error[E0774]: `derive` may only be applied to structs, enums and unions
error[E0774]: `derive` may only be applied to `struct`s, `enum`s and `union`s
--> $DIR/issue-43023.rs:16:5
|
LL | #[derive(Debug)]
| ^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^ not applicable here
LL | type F;
| ------- not a `struct`, `enum` or `union`
error: aborting due to 3 previous errors

View File

@ -7,24 +7,24 @@ fn main() {
struct Foo;
// fold_stmt (Mac)
#[derive(Debug)] //~ ERROR `derive` may only be applied to structs, enums and unions
#[derive(Debug)] //~ ERROR `derive` may only be applied to `struct`s, `enum`s and `union`s
println!("Hello, world!");
// fold_stmt (Semi)
#[derive(Debug)] //~ ERROR `derive` may only be applied to structs, enums and unions
#[derive(Debug)] //~ ERROR `derive` may only be applied to `struct`s, `enum`s and `union`s
"Hello, world!";
// fold_stmt (Local)
#[derive(Debug)] //~ ERROR `derive` may only be applied to structs, enums and unions
#[derive(Debug)] //~ ERROR `derive` may only be applied to `struct`s, `enum`s and `union`s
let _ = "Hello, world!";
// visit_expr
let _ = #[derive(Debug)] "Hello, world!";
//~^ ERROR `derive` may only be applied to structs, enums and unions
//~^ ERROR `derive` may only be applied to `struct`s, `enum`s and `union`s
let _ = [
// filter_map_expr
#[derive(Debug)] //~ ERROR `derive` may only be applied to structs, enums and unions
#[derive(Debug)] //~ ERROR `derive` may only be applied to `struct`s, `enum`s and `union`s
"Hello, world!",
];
}

View File

@ -1,32 +1,42 @@
error[E0774]: `derive` may only be applied to structs, enums and unions
error[E0774]: `derive` may only be applied to `struct`s, `enum`s and `union`s
--> $DIR/issue-49934.rs:10:5
|
LL | #[derive(Debug)]
| ^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^ not applicable here
LL | println!("Hello, world!");
| -------------------------- not a `struct`, `enum` or `union`
error[E0774]: `derive` may only be applied to structs, enums and unions
error[E0774]: `derive` may only be applied to `struct`s, `enum`s and `union`s
--> $DIR/issue-49934.rs:14:5
|
LL | #[derive(Debug)]
| ^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^ not applicable here
LL | "Hello, world!";
| ---------------- not a `struct`, `enum` or `union`
error[E0774]: `derive` may only be applied to structs, enums and unions
error[E0774]: `derive` may only be applied to `struct`s, `enum`s and `union`s
--> $DIR/issue-49934.rs:18:5
|
LL | #[derive(Debug)]
| ^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^ not applicable here
LL | let _ = "Hello, world!";
| ------------------------ not a `struct`, `enum` or `union`
error[E0774]: `derive` may only be applied to structs, enums and unions
error[E0774]: `derive` may only be applied to `struct`s, `enum`s and `union`s
--> $DIR/issue-49934.rs:22:13
|
LL | let _ = #[derive(Debug)] "Hello, world!";
| ^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^ --------------- not a `struct`, `enum` or `union`
| |
| not applicable here
error[E0774]: `derive` may only be applied to structs, enums and unions
error[E0774]: `derive` may only be applied to `struct`s, `enum`s and `union`s
--> $DIR/issue-49934.rs:27:9
|
LL | #[derive(Debug)]
| ^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^ not applicable here
LL | "Hello, world!",
| --------------- not a `struct`, `enum` or `union`
error: aborting due to 5 previous errors

View File

@ -1,6 +1,9 @@
error[E0624]: associated function `foo` is private
--> $DIR/issue-53498.rs:16:27
|
LL | fn foo() {}
| -------- private associated function defined here
...
LL | test::Foo::<test::B>::foo();
| ^^^ private associated function

View File

@ -7,9 +7,6 @@ LL | Foo(Box::new(*slice))
error[E0283]: type annotations needed
--> $DIR/issue-58022.rs:4:25
|
LL | const SIZE: usize;
| ------------------ required by `Foo::SIZE`
LL |
LL | fn new(slice: &[u8; Foo::SIZE]) -> Self;
| ^^^^^^^^^
| |
@ -18,6 +15,11 @@ LL | fn new(slice: &[u8; Foo::SIZE]) -> Self;
|
= note: cannot satisfy `_: Foo`
= note: associated constants cannot be accessed directly on a `trait`, they can only be accessed through a specific `impl`
note: required by `Foo::SIZE`
--> $DIR/issue-58022.rs:2:5
|
LL | const SIZE: usize;
| ^^^^^^^^^^^^^^^^^^
error: aborting due to 2 previous errors

View File

@ -7,11 +7,14 @@ LL | _Func::< <() as _A>::AssocT >::func(());
error[E0277]: the trait bound `(): _Func<_>` is not satisfied
--> $DIR/issue-66353.rs:12:41
|
LL | fn func(_: Self);
| ----------------- required by `_Func::func`
...
LL | _Func::< <() as _A>::AssocT >::func(());
| ^^ the trait `_Func<_>` is not implemented for `()`
|
note: required by `_Func::func`
--> $DIR/issue-66353.rs:4:5
|
LL | fn func(_: Self);
| ^^^^^^^^^^^^^^^^^
error: aborting due to 2 previous errors

View File

@ -5,7 +5,11 @@ LL | String::from("x".as_ref());
| ^^^^^^^^^^^^ cannot infer type for reference `&_`
|
= note: cannot satisfy `String: From<&_>`
= note: required by `from`
note: required by `from`
--> $SRC_DIR/core/src/convert/mod.rs:LL:COL
|
LL | fn from(_: T) -> Self;
| ^^^^^^^^^^^^^^^^^^^^^^
error[E0282]: type annotations needed
--> $DIR/issue-72690.rs:11:6
@ -30,7 +34,11 @@ LL | String::from("x".as_ref());
| ^^^^^^^^^^^^ cannot infer type for reference `&_`
|
= note: cannot satisfy `String: From<&_>`
= note: required by `from`
note: required by `from`
--> $SRC_DIR/core/src/convert/mod.rs:LL:COL
|
LL | fn from(_: T) -> Self;
| ^^^^^^^^^^^^^^^^^^^^^^
error[E0283]: type annotations needed
--> $DIR/issue-72690.rs:25:5
@ -39,7 +47,11 @@ LL | String::from("x".as_ref());
| ^^^^^^^^^^^^ cannot infer type for reference `&_`
|
= note: cannot satisfy `String: From<&_>`
= note: required by `from`
note: required by `from`
--> $SRC_DIR/core/src/convert/mod.rs:LL:COL
|
LL | fn from(_: T) -> Self;
| ^^^^^^^^^^^^^^^^^^^^^^
error[E0283]: type annotations needed
--> $DIR/issue-72690.rs:33:5
@ -48,7 +60,11 @@ LL | String::from("x".as_ref());
| ^^^^^^^^^^^^ cannot infer type for reference `&_`
|
= note: cannot satisfy `String: From<&_>`
= note: required by `from`
note: required by `from`
--> $SRC_DIR/core/src/convert/mod.rs:LL:COL
|
LL | fn from(_: T) -> Self;
| ^^^^^^^^^^^^^^^^^^^^^^
error[E0283]: type annotations needed
--> $DIR/issue-72690.rs:41:5
@ -57,7 +73,11 @@ LL | String::from("x".as_ref());
| ^^^^^^^^^^^^ cannot infer type for reference `&_`
|
= note: cannot satisfy `String: From<&_>`
= note: required by `from`
note: required by `from`
--> $SRC_DIR/core/src/convert/mod.rs:LL:COL
|
LL | fn from(_: T) -> Self;
| ^^^^^^^^^^^^^^^^^^^^^^
error[E0283]: type annotations needed
--> $DIR/issue-72690.rs:47:5
@ -66,7 +86,11 @@ LL | String::from("x".as_ref());
| ^^^^^^^^^^^^ cannot infer type for reference `&_`
|
= note: cannot satisfy `String: From<&_>`
= note: required by `from`
note: required by `from`
--> $SRC_DIR/core/src/convert/mod.rs:LL:COL
|
LL | fn from(_: T) -> Self;
| ^^^^^^^^^^^^^^^^^^^^^^
error[E0283]: type annotations needed
--> $DIR/issue-72690.rs:55:5
@ -75,7 +99,11 @@ LL | String::from("x".as_ref());
| ^^^^^^^^^^^^ cannot infer type for reference `&_`
|
= note: cannot satisfy `String: From<&_>`
= note: required by `from`
note: required by `from`
--> $SRC_DIR/core/src/convert/mod.rs:LL:COL
|
LL | fn from(_: T) -> Self;
| ^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to 9 previous errors

View File

@ -7,7 +7,11 @@ LL | for _ in 42 {}
= help: the trait `Iterator` is not implemented for `{integer}`
= note: if you want to iterate between `start` until a value `end`, use the exclusive range syntax `start..end` or the inclusive range syntax `start..=end`
= note: required because of the requirements on the impl of `IntoIterator` for `{integer}`
= note: required by `into_iter`
note: required by `into_iter`
--> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL
|
LL | fn into_iter(self) -> Self::IntoIter;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0277]: `u8` is not an iterator
--> $DIR/integral.rs:4:14
@ -18,7 +22,11 @@ LL | for _ in 42 as u8 {}
= help: the trait `Iterator` is not implemented for `u8`
= note: if you want to iterate between `start` until a value `end`, use the exclusive range syntax `start..end` or the inclusive range syntax `start..=end`
= note: required because of the requirements on the impl of `IntoIterator` for `u8`
= note: required by `into_iter`
note: required by `into_iter`
--> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL
|
LL | fn into_iter(self) -> Self::IntoIter;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0277]: `i8` is not an iterator
--> $DIR/integral.rs:6:14
@ -29,7 +37,11 @@ LL | for _ in 42 as i8 {}
= help: the trait `Iterator` is not implemented for `i8`
= note: if you want to iterate between `start` until a value `end`, use the exclusive range syntax `start..end` or the inclusive range syntax `start..=end`
= note: required because of the requirements on the impl of `IntoIterator` for `i8`
= note: required by `into_iter`
note: required by `into_iter`
--> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL
|
LL | fn into_iter(self) -> Self::IntoIter;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0277]: `u16` is not an iterator
--> $DIR/integral.rs:8:14
@ -40,7 +52,11 @@ LL | for _ in 42 as u16 {}
= help: the trait `Iterator` is not implemented for `u16`
= note: if you want to iterate between `start` until a value `end`, use the exclusive range syntax `start..end` or the inclusive range syntax `start..=end`
= note: required because of the requirements on the impl of `IntoIterator` for `u16`
= note: required by `into_iter`
note: required by `into_iter`
--> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL
|
LL | fn into_iter(self) -> Self::IntoIter;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0277]: `i16` is not an iterator
--> $DIR/integral.rs:10:14
@ -51,7 +67,11 @@ LL | for _ in 42 as i16 {}
= help: the trait `Iterator` is not implemented for `i16`
= note: if you want to iterate between `start` until a value `end`, use the exclusive range syntax `start..end` or the inclusive range syntax `start..=end`
= note: required because of the requirements on the impl of `IntoIterator` for `i16`
= note: required by `into_iter`
note: required by `into_iter`
--> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL
|
LL | fn into_iter(self) -> Self::IntoIter;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0277]: `u32` is not an iterator
--> $DIR/integral.rs:12:14
@ -62,7 +82,11 @@ LL | for _ in 42 as u32 {}
= help: the trait `Iterator` is not implemented for `u32`
= note: if you want to iterate between `start` until a value `end`, use the exclusive range syntax `start..end` or the inclusive range syntax `start..=end`
= note: required because of the requirements on the impl of `IntoIterator` for `u32`
= note: required by `into_iter`
note: required by `into_iter`
--> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL
|
LL | fn into_iter(self) -> Self::IntoIter;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0277]: `i32` is not an iterator
--> $DIR/integral.rs:14:14
@ -73,7 +97,11 @@ LL | for _ in 42 as i32 {}
= help: the trait `Iterator` is not implemented for `i32`
= note: if you want to iterate between `start` until a value `end`, use the exclusive range syntax `start..end` or the inclusive range syntax `start..=end`
= note: required because of the requirements on the impl of `IntoIterator` for `i32`
= note: required by `into_iter`
note: required by `into_iter`
--> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL
|
LL | fn into_iter(self) -> Self::IntoIter;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0277]: `u64` is not an iterator
--> $DIR/integral.rs:16:14
@ -84,7 +112,11 @@ LL | for _ in 42 as u64 {}
= help: the trait `Iterator` is not implemented for `u64`
= note: if you want to iterate between `start` until a value `end`, use the exclusive range syntax `start..end` or the inclusive range syntax `start..=end`
= note: required because of the requirements on the impl of `IntoIterator` for `u64`
= note: required by `into_iter`
note: required by `into_iter`
--> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL
|
LL | fn into_iter(self) -> Self::IntoIter;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0277]: `i64` is not an iterator
--> $DIR/integral.rs:18:14
@ -95,7 +127,11 @@ LL | for _ in 42 as i64 {}
= help: the trait `Iterator` is not implemented for `i64`
= note: if you want to iterate between `start` until a value `end`, use the exclusive range syntax `start..end` or the inclusive range syntax `start..=end`
= note: required because of the requirements on the impl of `IntoIterator` for `i64`
= note: required by `into_iter`
note: required by `into_iter`
--> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL
|
LL | fn into_iter(self) -> Self::IntoIter;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0277]: `usize` is not an iterator
--> $DIR/integral.rs:20:14
@ -106,7 +142,11 @@ LL | for _ in 42 as usize {}
= help: the trait `Iterator` is not implemented for `usize`
= note: if you want to iterate between `start` until a value `end`, use the exclusive range syntax `start..end` or the inclusive range syntax `start..=end`
= note: required because of the requirements on the impl of `IntoIterator` for `usize`
= note: required by `into_iter`
note: required by `into_iter`
--> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL
|
LL | fn into_iter(self) -> Self::IntoIter;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0277]: `isize` is not an iterator
--> $DIR/integral.rs:22:14
@ -117,7 +157,11 @@ LL | for _ in 42 as isize {}
= help: the trait `Iterator` is not implemented for `isize`
= note: if you want to iterate between `start` until a value `end`, use the exclusive range syntax `start..end` or the inclusive range syntax `start..=end`
= note: required because of the requirements on the impl of `IntoIterator` for `isize`
= note: required by `into_iter`
note: required by `into_iter`
--> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL
|
LL | fn into_iter(self) -> Self::IntoIter;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0277]: `{float}` is not an iterator
--> $DIR/integral.rs:24:14
@ -127,7 +171,11 @@ LL | for _ in 42.0 {}
|
= help: the trait `Iterator` is not implemented for `{float}`
= note: required because of the requirements on the impl of `IntoIterator` for `{float}`
= note: required by `into_iter`
note: required by `into_iter`
--> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL
|
LL | fn into_iter(self) -> Self::IntoIter;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to 12 previous errors

View File

@ -7,7 +7,11 @@ LL | for _ in ..10 {}
= help: the trait `Iterator` is not implemented for `RangeTo<{integer}>`
= note: `..end` is a `RangeTo`, which cannot be iterated on; you might have meant to have a bounded `Range`: `0..end`
= note: required because of the requirements on the impl of `IntoIterator` for `RangeTo<{integer}>`
= note: required by `into_iter`
note: required by `into_iter`
--> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL
|
LL | fn into_iter(self) -> Self::IntoIter;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0277]: `RangeToInclusive<{integer}>` is not an iterator
--> $DIR/ranges.rs:4:14
@ -18,7 +22,11 @@ LL | for _ in ..=10 {}
= help: the trait `Iterator` is not implemented for `RangeToInclusive<{integer}>`
= note: `..=end` is a `RangeToInclusive`, which cannot be iterated on; you might have meant to have a bounded `RangeInclusive`: `0..=end`
= note: required because of the requirements on the impl of `IntoIterator` for `RangeToInclusive<{integer}>`
= note: required by `into_iter`
note: required by `into_iter`
--> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL
|
LL | fn into_iter(self) -> Self::IntoIter;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to 2 previous errors

View File

@ -6,7 +6,11 @@ LL | for _ in "".to_owned() {}
|
= help: the trait `Iterator` is not implemented for `String`
= note: required because of the requirements on the impl of `IntoIterator` for `String`
= note: required by `into_iter`
note: required by `into_iter`
--> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL
|
LL | fn into_iter(self) -> Self::IntoIter;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0277]: `&str` is not an iterator
--> $DIR/string.rs:4:14
@ -16,7 +20,11 @@ LL | for _ in "" {}
|
= help: the trait `Iterator` is not implemented for `&str`
= note: required because of the requirements on the impl of `IntoIterator` for `&str`
= note: required by `into_iter`
note: required by `into_iter`
--> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL
|
LL | fn into_iter(self) -> Self::IntoIter;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to 2 previous errors

Some files were not shown because too many files have changed in this diff Show More