review comment
This commit is contained in:
parent
319dd6f139
commit
3cdd7ae59e
src
librustc_typeck/check
test/ui
impl-trait
issues
missing/missing-items
span
suggestions
@ -2208,7 +2208,7 @@ fn bounds_from_generic_predicates(
|
||||
for projection in &projections {
|
||||
let p = projection.skip_binder();
|
||||
// FIXME: this is not currently supported syntax, we should be looking at the `types` and
|
||||
// insert the associated types where they correspond, but for now lets be "lazy" and
|
||||
// insert the associated types where they correspond, but for now let's be "lazy" and
|
||||
// propose this instead of the following valid resugaring:
|
||||
// `T: Trait, Trait::Assoc = K` → `T: Trait<Assoc = K>`
|
||||
where_clauses.push(format!("{} = {}", tcx.def_path_str(p.projection_ty.item_def_id), p.ty));
|
||||
@ -2265,7 +2265,7 @@ fn fn_sig_suggestion(
|
||||
// fill in a significant portion of the missing code, and other subsequent
|
||||
// suggestions can help the user fix the code.
|
||||
format!(
|
||||
"{}fn {}{}({}){}{} {{ unimplemented!() }}",
|
||||
"{}fn {}{}({}){}{} {{ todo!() }}",
|
||||
unsafety, ident, generics, args, output, where_clauses
|
||||
)
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ error[E0046]: not all trait items implemented, missing: `fmt`
|
||||
LL | impl std::fmt::Display for MyType4 {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `fmt` in implementation
|
||||
|
|
||||
= help: implement the missing item: `fn fmt(&self, _: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> { unimplemented!() }`
|
||||
= help: implement the missing item: `fn fmt(&self, _: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> { todo!() }`
|
||||
|
||||
error: aborting due to 4 previous errors
|
||||
|
||||
|
@ -4,7 +4,7 @@ error[E0046]: not all trait items implemented, missing: `partial_cmp`
|
||||
LL | impl PartialOrd for Thing {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^ missing `partial_cmp` in implementation
|
||||
|
|
||||
= help: implement the missing item: `fn partial_cmp(&self, _: &Rhs) -> std::option::Option<std::cmp::Ordering> { unimplemented!() }`
|
||||
= help: implement the missing item: `fn partial_cmp(&self, _: &Rhs) -> std::option::Option<std::cmp::Ordering> { todo!() }`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
@ -6,7 +6,7 @@ LL | impl m1::X for X {
|
||||
|
|
||||
= help: implement the missing item: `const CONSTANT: u32 = 42;`
|
||||
= help: implement the missing item: `type Type = Type;`
|
||||
= help: implement the missing item: `fn method(&self, _: std::string::String) -> <Self as m1::X>::Type { unimplemented!() }`
|
||||
= help: implement the missing item: `fn method(&self, _: std::string::String) -> <Self as m1::X>::Type { todo!() }`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
@ -64,7 +64,7 @@ error[E0046]: not all trait items implemented, missing: `fmt`
|
||||
LL | impl Debug for FooTypeForMethod {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `fmt` in implementation
|
||||
|
|
||||
= help: implement the missing item: `fn fmt(&self, _: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> { unimplemented!() }`
|
||||
= help: implement the missing item: `fn fmt(&self, _: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> { todo!() }`
|
||||
|
||||
error: aborting due to 8 previous errors
|
||||
|
||||
|
@ -13,8 +13,8 @@ struct S;
|
||||
struct Type;
|
||||
|
||||
impl TraitA<()> for S { //~ ERROR not all trait items implemented
|
||||
fn baz<T>(_: T) -> Self where T: TraitB, <T as TraitB>::Item: std::marker::Copy { unimplemented!() }
|
||||
fn bar<T>(_: T) -> Self { unimplemented!() }
|
||||
fn baz<T>(_: T) -> Self where T: TraitB, <T as TraitB>::Item: std::marker::Copy { todo!() }
|
||||
fn bar<T>(_: T) -> Self { todo!() }
|
||||
type Type = Type;
|
||||
}
|
||||
|
||||
|
@ -28,7 +28,7 @@ error[E0046]: not all trait items implemented, missing: `from_iter`
|
||||
LL | impl FromIterator<()> for X {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `from_iter` in implementation
|
||||
|
|
||||
= help: implement the missing item: `fn from_iter<T>(_: T) -> Self where T: std::iter::IntoIterator, std::iter::IntoIterator::Item = A { unimplemented!() }`
|
||||
= help: implement the missing item: `fn from_iter<T>(_: T) -> Self where T: std::iter::IntoIterator, std::iter::IntoIterator::Item = A { todo!() }`
|
||||
|
||||
error: aborting due to 3 previous errors
|
||||
|
||||
|
@ -7,13 +7,13 @@ trait T {
|
||||
|
||||
mod foo {
|
||||
use super::T;
|
||||
impl T for () { fn bar(&self, _: &usize, _: &usize) -> usize { unimplemented!() }
|
||||
unsafe fn foo(_: &usize, _: &usize) -> usize { unimplemented!() }
|
||||
impl T for () { fn bar(&self, _: &usize, _: &usize) -> usize { todo!() }
|
||||
unsafe fn foo(_: &usize, _: &usize) -> usize { todo!() }
|
||||
} //~ ERROR not all trait items
|
||||
|
||||
impl T for usize { //~ ERROR not all trait items
|
||||
fn bar(&self, _: &usize, _: &usize) -> usize { unimplemented!() }
|
||||
unsafe fn foo(_: &usize, _: &usize) -> usize { unimplemented!() }
|
||||
fn bar(&self, _: &usize, _: &usize) -> usize { todo!() }
|
||||
unsafe fn foo(_: &usize, _: &usize) -> usize { todo!() }
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user