Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Call out the types that are non local on E0117 #65318

Merged
merged 8 commits into from
Oct 29, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions src/librustc/traits/coherence.rs
Original file line number Diff line number Diff line change
@@ -237,7 +237,7 @@ pub fn trait_ref_is_local_or_fundamental<'tcx>(
}

pub enum OrphanCheckErr<'tcx> {
NonLocalInputType(Vec<Ty<'tcx>>),
NonLocalInputType(Vec<(Ty<'tcx>, usize)>),
UncoveredTy(Ty<'tcx>),
}

@@ -391,8 +391,10 @@ fn orphan_check_trait_ref<'tcx>(
}

let mut non_local_spans = vec![];
for input_ty in
trait_ref.input_types().flat_map(|ty| uncover_fundamental_ty(tcx, ty, in_crate))
for (i, input_ty) in trait_ref
.input_types()
.flat_map(|ty| uncover_fundamental_ty(tcx, ty, in_crate))
.enumerate()
{
debug!("orphan_check_trait_ref: check ty `{:?}`", input_ty);
if ty_is_local(tcx, input_ty, in_crate) {
@@ -402,7 +404,7 @@ fn orphan_check_trait_ref<'tcx>(
debug!("orphan_check_trait_ref: uncovered ty: `{:?}`", input_ty);
return Err(OrphanCheckErr::UncoveredTy(input_ty))
}
non_local_spans.push(input_ty);
non_local_spans.push((input_ty, i));
}
// If we exit above loop, never found a local type.
debug!("orphan_check_trait_ref: no local type");
@@ -413,7 +415,7 @@ fn orphan_check_trait_ref<'tcx>(
// parameters to the trait, with the self type appearing
// first. Find the first input type that either references a
// type parameter OR some local type.
for input_ty in trait_ref.input_types() {
for (i, input_ty) in trait_ref.input_types().enumerate() {
if ty_is_local(tcx, input_ty, in_crate) {
debug!("orphan_check_trait_ref: ty_is_local `{:?}`", input_ty);

@@ -442,7 +444,7 @@ fn orphan_check_trait_ref<'tcx>(
return Err(OrphanCheckErr::UncoveredTy(param));
}

non_local_spans.push(input_ty);
non_local_spans.push((input_ty, i));
}
// If we exit above loop, never found a local type.
debug!("orphan_check_trait_ref: no local type");
49 changes: 32 additions & 17 deletions src/librustc_typeck/coherence/orphan.rs
Original file line number Diff line number Diff line change
@@ -24,7 +24,7 @@ impl ItemLikeVisitor<'v> for OrphanChecker<'tcx> {
fn visit_item(&mut self, item: &hir::Item) {
let def_id = self.tcx.hir().local_def_id(item.hir_id);
// "Trait" impl
if let hir::ItemKind::Impl(.., Some(_), _, _) = item.kind {
if let hir::ItemKind::Impl(.., generics, Some(_), impl_ty, _) = &item.kind {
debug!("coherence2::orphan check: trait impl {}",
self.tcx.hir().node_to_string(item.hir_id));
let trait_ref = self.tcx.impl_trait_ref(def_id).unwrap();
@@ -41,28 +41,43 @@ impl ItemLikeVisitor<'v> for OrphanChecker<'tcx> {
"only traits defined in the current crate can be implemented for \
arbitrary types"
);
err.span_label(sp, "impl doesn't use types inside crate");
for ty in &tys {
err.note(&format!("`{}` is not defined in the current create", ty));
err.span_label(sp, "impl doesn't use only types from inside the current crate");
for (ty, i) in &tys {
let msg = format!("`{}` is not defined in the current crate", ty);
if *i == 0 {
err.span_label(impl_ty.span, &msg);
} else {
err.note(&msg);
}
}
err.note("define and implement a trait or new type instead");
err.emit();
return;
}
Err(traits::OrphanCheckErr::UncoveredTy(param_ty)) => {
struct_span_err!(self.tcx.sess,
sp,
E0210,
"type parameter `{}` must be used as the type parameter \
for some local type (e.g., `MyStruct<{}>`)",
param_ty,
param_ty)
.span_label(sp,
format!("type parameter `{}` must be used as the type \
parameter for some local type", param_ty))
.note("only traits defined in the current crate can be implemented \
for a type parameter")
.emit();
let mut sp = sp;
for param in &generics.params {
if param.name.ident().to_string() == param_ty.to_string() {
sp = param.span;
}
}
let mut err = struct_span_err!(
self.tcx.sess,
sp,
E0210,
"type parameter `{}` must be used as the type parameter for some local \
type (e.g., `MyStruct<{}>`)",
param_ty,
param_ty
);
err.span_label(sp, format!(
"type parameter `{}` must be used as the type parameter for some local \
type",
param_ty,
));
err.note("only traits defined in the current crate can be implemented for a \
type parameter");
err.emit();
return;
}
}
4 changes: 2 additions & 2 deletions src/test/ui/coherence/coherence-all-remote.old.stderr
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)
--> $DIR/coherence-all-remote.rs:9:1
--> $DIR/coherence-all-remote.rs:9:6
|
LL | impl<T> Remote1<T> for isize { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type parameter `T` must be used as the type parameter for some local type
| ^ type parameter `T` must be used as the type parameter for some local type
|
= note: only traits defined in the current crate can be implemented for a type parameter

4 changes: 2 additions & 2 deletions src/test/ui/coherence/coherence-all-remote.re.stderr
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)
--> $DIR/coherence-all-remote.rs:9:1
--> $DIR/coherence-all-remote.rs:9:6
|
LL | impl<T> Remote1<T> for isize { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type parameter `T` must be used as the type parameter for some local type
| ^ type parameter `T` must be used as the type parameter for some local type
|
= note: only traits defined in the current crate can be implemented for a type parameter

4 changes: 2 additions & 2 deletions src/test/ui/coherence/coherence-bigint-param.old.stderr
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)
--> $DIR/coherence-bigint-param.rs:11:1
--> $DIR/coherence-bigint-param.rs:11:6
|
LL | impl<T> Remote1<BigInt> for T { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type parameter `T` must be used as the type parameter for some local type
| ^ type parameter `T` must be used as the type parameter for some local type
|
= note: only traits defined in the current crate can be implemented for a type parameter

4 changes: 2 additions & 2 deletions src/test/ui/coherence/coherence-bigint-param.re.stderr
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)
--> $DIR/coherence-bigint-param.rs:11:1
--> $DIR/coherence-bigint-param.rs:11:6
|
LL | impl<T> Remote1<BigInt> for T { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type parameter `T` must be used as the type parameter for some local type
| ^ type parameter `T` must be used as the type parameter for some local type
|
= note: only traits defined in the current crate can be implemented for a type parameter

4 changes: 2 additions & 2 deletions src/test/ui/coherence/coherence-cow.a.stderr
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)
--> $DIR/coherence-cow.rs:18:1
--> $DIR/coherence-cow.rs:18:6
|
LL | impl<T> Remote for Pair<T,Cover<T>> { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type parameter `T` must be used as the type parameter for some local type
| ^ type parameter `T` must be used as the type parameter for some local type
|
= note: only traits defined in the current crate can be implemented for a type parameter

4 changes: 2 additions & 2 deletions src/test/ui/coherence/coherence-cow.b.stderr
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)
--> $DIR/coherence-cow.rs:23:1
--> $DIR/coherence-cow.rs:23:6
|
LL | impl<T> Remote for Pair<Cover<T>,T> { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type parameter `T` must be used as the type parameter for some local type
| ^ type parameter `T` must be used as the type parameter for some local type
|
= note: only traits defined in the current crate can be implemented for a type parameter

4 changes: 2 additions & 2 deletions src/test/ui/coherence/coherence-cow.c.stderr
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)
--> $DIR/coherence-cow.rs:28:1
--> $DIR/coherence-cow.rs:28:6
|
LL | impl<T,U> Remote for Pair<Cover<T>,U> { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type parameter `T` must be used as the type parameter for some local type
| ^ type parameter `T` must be used as the type parameter for some local type
|
= note: only traits defined in the current crate can be implemented for a type parameter

6 changes: 4 additions & 2 deletions src/test/ui/coherence/coherence-cow.re_a.stderr
Original file line number Diff line number Diff line change
@@ -2,9 +2,11 @@ error[E0117]: only traits defined in the current crate can be implemented for ar
--> $DIR/coherence-cow.rs:18:1
|
LL | impl<T> Remote for Pair<T,Cover<T>> { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate
| ^^^^^^^^^^^^^^^^^^^----------------
| | |
| | `lib::Pair<T, Cover<T>>` is not defined in the current crate
| impl doesn't use only types from inside the current crate
|
= note: `lib::Pair<T, Cover<T>>` is not defined in the current create
= note: define and implement a trait or new type instead

error: aborting due to previous error
6 changes: 4 additions & 2 deletions src/test/ui/coherence/coherence-cow.re_b.stderr
Original file line number Diff line number Diff line change
@@ -2,9 +2,11 @@ error[E0117]: only traits defined in the current crate can be implemented for ar
--> $DIR/coherence-cow.rs:23:1
|
LL | impl<T> Remote for Pair<Cover<T>,T> { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate
| ^^^^^^^^^^^^^^^^^^^----------------
| | |
| | `lib::Pair<Cover<T>, T>` is not defined in the current crate
| impl doesn't use only types from inside the current crate
|
= note: `lib::Pair<Cover<T>, T>` is not defined in the current create
= note: define and implement a trait or new type instead

error: aborting due to previous error
6 changes: 4 additions & 2 deletions src/test/ui/coherence/coherence-cow.re_c.stderr
Original file line number Diff line number Diff line change
@@ -2,9 +2,11 @@ error[E0117]: only traits defined in the current crate can be implemented for ar
--> $DIR/coherence-cow.rs:28:1
|
LL | impl<T,U> Remote for Pair<Cover<T>,U> { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate
| ^^^^^^^^^^^^^^^^^^^^^----------------
| | |
| | `lib::Pair<Cover<T>, U>` is not defined in the current crate
| impl doesn't use only types from inside the current crate
|
= note: `lib::Pair<Cover<T>, U>` is not defined in the current create
= note: define and implement a trait or new type instead

error: aborting due to previous error
Original file line number Diff line number Diff line change
@@ -8,10 +8,10 @@ LL | impl<A> Foo for A {
- impl trait_impl_conflict::Foo for isize;

error[E0210]: type parameter `A` must be used as the type parameter for some local type (e.g., `MyStruct<A>`)
--> $DIR/coherence-cross-crate-conflict.rs:12:1
--> $DIR/coherence-cross-crate-conflict.rs:12:6
|
LL | impl<A> Foo for A {
| ^^^^^^^^^^^^^^^^^ type parameter `A` must be used as the type parameter for some local type
| ^ type parameter `A` must be used as the type parameter for some local type
|
= note: only traits defined in the current crate can be implemented for a type parameter

Original file line number Diff line number Diff line change
@@ -8,10 +8,10 @@ LL | impl<A> Foo for A {
- impl trait_impl_conflict::Foo for isize;

error[E0210]: type parameter `A` must be used as the type parameter for some local type (e.g., `MyStruct<A>`)
--> $DIR/coherence-cross-crate-conflict.rs:12:1
--> $DIR/coherence-cross-crate-conflict.rs:12:6
|
LL | impl<A> Foo for A {
| ^^^^^^^^^^^^^^^^^ type parameter `A` must be used as the type parameter for some local type
| ^ type parameter `A` must be used as the type parameter for some local type
|
= note: only traits defined in the current crate can be implemented for a type parameter

Original file line number Diff line number Diff line change
@@ -2,9 +2,11 @@ error[E0117]: only traits defined in the current crate can be implemented for ar
--> $DIR/coherence-fundamental-trait-objects.rs:15:1
|
LL | impl Misc for dyn Fundamental<Local> {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate
| ^^^^^^^^^^^^^^----------------------
| | |
| | `(dyn coherence_fundamental_trait_lib::Fundamental<Local> + 'static)` is not defined in the current crate
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be `coherence_fundamental_trait_lib::Fundamental<Local>` is not defined in the current crate. Having the dyn and lifetime bound is confusing (also + 'static is default, so needn't be included).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't remove the dyn, but that shouldn't be too big of a problem.

| impl doesn't use only types from inside the current crate
|
= note: `(dyn coherence_fundamental_trait_lib::Fundamental<Local> + 'static)` is not defined in the current create
= note: define and implement a trait or new type instead

error: aborting due to previous error
Original file line number Diff line number Diff line change
@@ -2,9 +2,11 @@ error[E0117]: only traits defined in the current crate can be implemented for ar
--> $DIR/coherence-fundamental-trait-objects.rs:15:1
|
LL | impl Misc for dyn Fundamental<Local> {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate
| ^^^^^^^^^^^^^^----------------------
| | |
| | `(dyn coherence_fundamental_trait_lib::Fundamental<Local> + 'static)` is not defined in the current crate
| impl doesn't use only types from inside the current crate
|
= note: `(dyn coherence_fundamental_trait_lib::Fundamental<Local> + 'static)` is not defined in the current create
= note: define and implement a trait or new type instead

error: aborting due to previous error
Original file line number Diff line number Diff line change
@@ -14,9 +14,11 @@ error[E0117]: only traits defined in the current crate can be implemented for ar
--> $DIR/coherence-impl-trait-for-marker-trait-negative.rs:22:1
|
LL | impl !Send for dyn Marker2 {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate
| ^^^^^^^^^^^^^^^-----------
| | |
| | `(dyn Marker2 + 'static)` is not defined in the current crate
| impl doesn't use only types from inside the current crate
|
= note: `(dyn Marker2 + 'static)` is not defined in the current create
= note: define and implement a trait or new type instead

error[E0321]: cross-crate traits with a default impl, like `std::marker::Send`, can only be implemented for a struct/enum type, not `(dyn Object + 'static)`
Original file line number Diff line number Diff line change
@@ -14,9 +14,11 @@ error[E0117]: only traits defined in the current crate can be implemented for ar
--> $DIR/coherence-impl-trait-for-marker-trait-positive.rs:22:1
|
LL | unsafe impl Send for dyn Marker2 {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate
| ^^^^^^^^^^^^^^^^^^^^^-----------
| | |
| | `(dyn Marker2 + 'static)` is not defined in the current crate
| impl doesn't use only types from inside the current crate
|
= note: `(dyn Marker2 + 'static)` is not defined in the current create
= note: define and implement a trait or new type instead

error[E0321]: cross-crate traits with a default impl, like `std::marker::Send`, can only be implemented for a struct/enum type, not `(dyn Object + 'static)`
24 changes: 16 additions & 8 deletions src/test/ui/coherence/coherence-impls-copy.old.stderr
Original file line number Diff line number Diff line change
@@ -49,36 +49,44 @@ error[E0117]: only traits defined in the current crate can be implemented for ar
--> $DIR/coherence-impls-copy.rs:8:1
|
LL | impl Copy for i32 {}
| ^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate
| ^^^^^^^^^^^^^^---
| | |
| | `i32` is not defined in the current crate
| impl doesn't use only types from inside the current crate
|
= note: `i32` is not defined in the current create
= note: define and implement a trait or new type instead

error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
--> $DIR/coherence-impls-copy.rs:32:1
|
LL | impl Copy for (MyType, MyType) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate
| ^^^^^^^^^^^^^^----------------
| | |
| | `(MyType, MyType)` is not defined in the current crate
| impl doesn't use only types from inside the current crate
|
= note: `(MyType, MyType)` is not defined in the current create
= note: define and implement a trait or new type instead

error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
--> $DIR/coherence-impls-copy.rs:40:1
|
LL | impl Copy for [MyType] {}
| ^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate
| ^^^^^^^^^^^^^^--------
| | |
| | `[MyType]` is not defined in the current crate
| impl doesn't use only types from inside the current crate
|
= note: `[MyType]` is not defined in the current create
= note: define and implement a trait or new type instead

error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
--> $DIR/coherence-impls-copy.rs:45:1
|
LL | impl Copy for &'static [NotSync] {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate
| ^^^^^^^^^^^^^^------------------
| | |
| | `&'static [NotSync]` is not defined in the current crate
| impl doesn't use only types from inside the current crate
|
= note: `&'static [NotSync]` is not defined in the current create
= note: define and implement a trait or new type instead

error: aborting due to 10 previous errors
24 changes: 16 additions & 8 deletions src/test/ui/coherence/coherence-impls-copy.re.stderr
Original file line number Diff line number Diff line change
@@ -49,36 +49,44 @@ error[E0117]: only traits defined in the current crate can be implemented for ar
--> $DIR/coherence-impls-copy.rs:8:1
|
LL | impl Copy for i32 {}
| ^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate
| ^^^^^^^^^^^^^^---
| | |
| | `i32` is not defined in the current crate
| impl doesn't use only types from inside the current crate
|
= note: `i32` is not defined in the current create
= note: define and implement a trait or new type instead

error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
--> $DIR/coherence-impls-copy.rs:32:1
|
LL | impl Copy for (MyType, MyType) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate
| ^^^^^^^^^^^^^^----------------
| | |
| | `(MyType, MyType)` is not defined in the current crate
| impl doesn't use only types from inside the current crate
|
= note: `(MyType, MyType)` is not defined in the current create
= note: define and implement a trait or new type instead

error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
--> $DIR/coherence-impls-copy.rs:40:1
|
LL | impl Copy for [MyType] {}
| ^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate
| ^^^^^^^^^^^^^^--------
| | |
| | `[MyType]` is not defined in the current crate
| impl doesn't use only types from inside the current crate
|
= note: `[MyType]` is not defined in the current create
= note: define and implement a trait or new type instead

error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
--> $DIR/coherence-impls-copy.rs:45:1
|
LL | impl Copy for &'static [NotSync] {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate
| ^^^^^^^^^^^^^^------------------
| | |
| | `[NotSync]` is not defined in the current crate
| impl doesn't use only types from inside the current crate
|
= note: `[NotSync]` is not defined in the current create
= note: define and implement a trait or new type instead

error: aborting due to 10 previous errors
18 changes: 12 additions & 6 deletions src/test/ui/coherence/coherence-impls-send.old.stderr
Original file line number Diff line number Diff line change
@@ -2,9 +2,11 @@ error[E0117]: only traits defined in the current crate can be implemented for ar
--> $DIR/coherence-impls-send.rs:20:1
|
LL | unsafe impl Send for (MyType, MyType) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate
| ^^^^^^^^^^^^^^^^^^^^^----------------
| | |
| | `(MyType, MyType)` is not defined in the current crate
| impl doesn't use only types from inside the current crate
|
= note: `(MyType, MyType)` is not defined in the current create
= note: define and implement a trait or new type instead

error[E0321]: cross-crate traits with a default impl, like `std::marker::Send`, can only be implemented for a struct/enum type, not `&'static NotSync`
@@ -17,18 +19,22 @@ error[E0117]: only traits defined in the current crate can be implemented for ar
--> $DIR/coherence-impls-send.rs:28:1
|
LL | unsafe impl Send for [MyType] {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate
| ^^^^^^^^^^^^^^^^^^^^^--------
| | |
| | `[MyType]` is not defined in the current crate
| impl doesn't use only types from inside the current crate
|
= note: `[MyType]` is not defined in the current create
= note: define and implement a trait or new type instead

error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
--> $DIR/coherence-impls-send.rs:32:1
|
LL | unsafe impl Send for &'static [NotSync] {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate
| ^^^^^^^^^^^^^^^^^^^^^------------------
| | |
| | `&'static [NotSync]` is not defined in the current crate
| impl doesn't use only types from inside the current crate
|
= note: `&'static [NotSync]` is not defined in the current create
= note: define and implement a trait or new type instead

error: aborting due to 4 previous errors
18 changes: 12 additions & 6 deletions src/test/ui/coherence/coherence-impls-send.re.stderr
Original file line number Diff line number Diff line change
@@ -2,9 +2,11 @@ error[E0117]: only traits defined in the current crate can be implemented for ar
--> $DIR/coherence-impls-send.rs:20:1
|
LL | unsafe impl Send for (MyType, MyType) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate
| ^^^^^^^^^^^^^^^^^^^^^----------------
| | |
| | `(MyType, MyType)` is not defined in the current crate
| impl doesn't use only types from inside the current crate
|
= note: `(MyType, MyType)` is not defined in the current create
= note: define and implement a trait or new type instead

error[E0321]: cross-crate traits with a default impl, like `std::marker::Send`, can only be implemented for a struct/enum type, not `&'static NotSync`
@@ -17,18 +19,22 @@ error[E0117]: only traits defined in the current crate can be implemented for ar
--> $DIR/coherence-impls-send.rs:28:1
|
LL | unsafe impl Send for [MyType] {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate
| ^^^^^^^^^^^^^^^^^^^^^--------
| | |
| | `[MyType]` is not defined in the current crate
| impl doesn't use only types from inside the current crate
|
= note: `[MyType]` is not defined in the current create
= note: define and implement a trait or new type instead

error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
--> $DIR/coherence-impls-send.rs:32:1
|
LL | unsafe impl Send for &'static [NotSync] {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate
| ^^^^^^^^^^^^^^^^^^^^^------------------
| | |
| | `[NotSync]` is not defined in the current crate
| impl doesn't use only types from inside the current crate
|
= note: `[NotSync]` is not defined in the current create
= note: define and implement a trait or new type instead

error: aborting due to 4 previous errors
18 changes: 12 additions & 6 deletions src/test/ui/coherence/coherence-impls-sized.old.stderr
Original file line number Diff line number Diff line change
@@ -38,27 +38,33 @@ error[E0117]: only traits defined in the current crate can be implemented for ar
--> $DIR/coherence-impls-sized.rs:27:1
|
LL | impl Sized for (MyType, MyType) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate
| ^^^^^^^^^^^^^^^----------------
| | |
| | `(MyType, MyType)` is not defined in the current crate
| impl doesn't use only types from inside the current crate
|
= note: `(MyType, MyType)` is not defined in the current create
= note: define and implement a trait or new type instead

error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
--> $DIR/coherence-impls-sized.rs:39:1
|
LL | impl Sized for [MyType] {}
| ^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate
| ^^^^^^^^^^^^^^^--------
| | |
| | `[MyType]` is not defined in the current crate
| impl doesn't use only types from inside the current crate
|
= note: `[MyType]` is not defined in the current create
= note: define and implement a trait or new type instead

error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
--> $DIR/coherence-impls-sized.rs:46:1
|
LL | impl Sized for &'static [NotSync] {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate
| ^^^^^^^^^^^^^^^------------------
| | |
| | `&'static [NotSync]` is not defined in the current crate
| impl doesn't use only types from inside the current crate
|
= note: `&'static [NotSync]` is not defined in the current create
= note: define and implement a trait or new type instead

error: aborting due to 9 previous errors
18 changes: 12 additions & 6 deletions src/test/ui/coherence/coherence-impls-sized.re.stderr
Original file line number Diff line number Diff line change
@@ -38,27 +38,33 @@ error[E0117]: only traits defined in the current crate can be implemented for ar
--> $DIR/coherence-impls-sized.rs:27:1
|
LL | impl Sized for (MyType, MyType) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate
| ^^^^^^^^^^^^^^^----------------
| | |
| | `(MyType, MyType)` is not defined in the current crate
| impl doesn't use only types from inside the current crate
|
= note: `(MyType, MyType)` is not defined in the current create
= note: define and implement a trait or new type instead

error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
--> $DIR/coherence-impls-sized.rs:39:1
|
LL | impl Sized for [MyType] {}
| ^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate
| ^^^^^^^^^^^^^^^--------
| | |
| | `[MyType]` is not defined in the current crate
| impl doesn't use only types from inside the current crate
|
= note: `[MyType]` is not defined in the current create
= note: define and implement a trait or new type instead

error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
--> $DIR/coherence-impls-sized.rs:46:1
|
LL | impl Sized for &'static [NotSync] {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate
| ^^^^^^^^^^^^^^^------------------
| | |
| | `[NotSync]` is not defined in the current crate
| impl doesn't use only types from inside the current crate
|
= note: `[NotSync]` is not defined in the current create
= note: define and implement a trait or new type instead

error: aborting due to 9 previous errors
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)
--> $DIR/coherence-lone-type-parameter.rs:9:1
--> $DIR/coherence-lone-type-parameter.rs:9:6
|
LL | impl<T> Remote for T { }
| ^^^^^^^^^^^^^^^^^^^^ type parameter `T` must be used as the type parameter for some local type
| ^ type parameter `T` must be used as the type parameter for some local type
|
= note: only traits defined in the current crate can be implemented for a type parameter

4 changes: 2 additions & 2 deletions src/test/ui/coherence/coherence-lone-type-parameter.re.stderr
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)
--> $DIR/coherence-lone-type-parameter.rs:9:1
--> $DIR/coherence-lone-type-parameter.rs:9:6
|
LL | impl<T> Remote for T { }
| ^^^^^^^^^^^^^^^^^^^^ type parameter `T` must be used as the type parameter for some local type
| ^ type parameter `T` must be used as the type parameter for some local type
|
= note: only traits defined in the current crate can be implemented for a type parameter

14 changes: 9 additions & 5 deletions src/test/ui/coherence/coherence-orphan.old.stderr
Original file line number Diff line number Diff line change
@@ -2,19 +2,23 @@ error[E0117]: only traits defined in the current crate can be implemented for ar
--> $DIR/coherence-orphan.rs:13:1
|
LL | impl TheTrait<usize> for isize { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate
| ^^^^^^^^^^^^^^^^^^^^^^^^^-----
| | |
| | `isize` is not defined in the current crate
| impl doesn't use only types from inside the current crate
|
= note: `isize` is not defined in the current create
= note: `usize` is not defined in the current create
= note: `usize` is not defined in the current crate
= note: define and implement a trait or new type instead

error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
--> $DIR/coherence-orphan.rs:21:1
|
LL | impl !Send for Vec<isize> { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate
| ^^^^^^^^^^^^^^^----------
| | |
| | `std::vec::Vec<isize>` is not defined in the current crate
| impl doesn't use only types from inside the current crate
|
= note: `std::vec::Vec<isize>` is not defined in the current create
= note: define and implement a trait or new type instead

error: aborting due to 2 previous errors
14 changes: 9 additions & 5 deletions src/test/ui/coherence/coherence-orphan.re.stderr
Original file line number Diff line number Diff line change
@@ -2,19 +2,23 @@ error[E0117]: only traits defined in the current crate can be implemented for ar
--> $DIR/coherence-orphan.rs:13:1
|
LL | impl TheTrait<usize> for isize { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate
| ^^^^^^^^^^^^^^^^^^^^^^^^^-----
| | |
| | `isize` is not defined in the current crate
| impl doesn't use only types from inside the current crate
|
= note: `isize` is not defined in the current create
= note: `usize` is not defined in the current create
= note: `usize` is not defined in the current crate
= note: define and implement a trait or new type instead

error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
--> $DIR/coherence-orphan.rs:21:1
|
LL | impl !Send for Vec<isize> { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate
| ^^^^^^^^^^^^^^^----------
| | |
| | `std::vec::Vec<isize>` is not defined in the current crate
| impl doesn't use only types from inside the current crate
|
= note: `std::vec::Vec<isize>` is not defined in the current create
= note: define and implement a trait or new type instead

error: aborting due to 2 previous errors
4 changes: 2 additions & 2 deletions src/test/ui/coherence/coherence-overlapping-pairs.old.stderr
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)
--> $DIR/coherence-overlapping-pairs.rs:11:1
--> $DIR/coherence-overlapping-pairs.rs:11:6
|
LL | impl<T> Remote for lib::Pair<T,Foo> { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type parameter `T` must be used as the type parameter for some local type
| ^ type parameter `T` must be used as the type parameter for some local type
|
= note: only traits defined in the current crate can be implemented for a type parameter

6 changes: 4 additions & 2 deletions src/test/ui/coherence/coherence-overlapping-pairs.re.stderr
Original file line number Diff line number Diff line change
@@ -2,9 +2,11 @@ error[E0117]: only traits defined in the current crate can be implemented for ar
--> $DIR/coherence-overlapping-pairs.rs:11:1
|
LL | impl<T> Remote for lib::Pair<T,Foo> { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate
| ^^^^^^^^^^^^^^^^^^^----------------
| | |
| | `lib::Pair<T, Foo>` is not defined in the current crate
| impl doesn't use only types from inside the current crate
|
= note: `lib::Pair<T, Foo>` is not defined in the current create
= note: define and implement a trait or new type instead

error: aborting due to previous error
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)
--> $DIR/coherence-pair-covered-uncovered-1.rs:15:1
--> $DIR/coherence-pair-covered-uncovered-1.rs:15:6
|
LL | impl<T, U> Remote1<Pair<T, Local<U>>> for i32 { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type parameter `T` must be used as the type parameter for some local type
| ^ type parameter `T` must be used as the type parameter for some local type
|
= note: only traits defined in the current crate can be implemented for a type parameter

Original file line number Diff line number Diff line change
@@ -2,10 +2,12 @@ error[E0117]: only traits defined in the current crate can be implemented for ar
--> $DIR/coherence-pair-covered-uncovered-1.rs:15:1
|
LL | impl<T, U> Remote1<Pair<T, Local<U>>> for i32 { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
| | |
| | `i32` is not defined in the current crate
| impl doesn't use only types from inside the current crate
|
= note: `i32` is not defined in the current create
= note: `lib::Pair<T, Local<U>>` is not defined in the current create
= note: `lib::Pair<T, Local<U>>` is not defined in the current crate
= note: define and implement a trait or new type instead

error: aborting due to previous error
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)
--> $DIR/coherence-pair-covered-uncovered.rs:11:1
--> $DIR/coherence-pair-covered-uncovered.rs:11:6
|
LL | impl<T,U> Remote for Pair<T,Local<U>> { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type parameter `T` must be used as the type parameter for some local type
| ^ type parameter `T` must be used as the type parameter for some local type
|
= note: only traits defined in the current crate can be implemented for a type parameter

Original file line number Diff line number Diff line change
@@ -2,9 +2,11 @@ error[E0117]: only traits defined in the current crate can be implemented for ar
--> $DIR/coherence-pair-covered-uncovered.rs:11:1
|
LL | impl<T,U> Remote for Pair<T,Local<U>> { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate
| ^^^^^^^^^^^^^^^^^^^^^----------------
| | |
| | `lib::Pair<T, Local<U>>` is not defined in the current crate
| impl doesn't use only types from inside the current crate
|
= note: `lib::Pair<T, Local<U>>` is not defined in the current create
= note: define and implement a trait or new type instead

error: aborting due to previous error
4 changes: 2 additions & 2 deletions src/test/ui/coherence/coherence-vec-local-2.old.stderr
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)
--> $DIR/coherence-vec-local-2.rs:14:1
--> $DIR/coherence-vec-local-2.rs:14:6
|
LL | impl<T> Remote for Vec<Local<T>> { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type parameter `T` must be used as the type parameter for some local type
| ^ type parameter `T` must be used as the type parameter for some local type
|
= note: only traits defined in the current crate can be implemented for a type parameter

6 changes: 4 additions & 2 deletions src/test/ui/coherence/coherence-vec-local-2.re.stderr
Original file line number Diff line number Diff line change
@@ -2,9 +2,11 @@ error[E0117]: only traits defined in the current crate can be implemented for ar
--> $DIR/coherence-vec-local-2.rs:14:1
|
LL | impl<T> Remote for Vec<Local<T>> { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate
| ^^^^^^^^^^^^^^^^^^^-------------
| | |
| | `std::vec::Vec<Local<T>>` is not defined in the current crate
| impl doesn't use only types from inside the current crate
|
= note: `std::vec::Vec<Local<T>>` is not defined in the current create
= note: define and implement a trait or new type instead

error: aborting due to previous error
6 changes: 4 additions & 2 deletions src/test/ui/coherence/coherence-vec-local.old.stderr
Original file line number Diff line number Diff line change
@@ -2,9 +2,11 @@ error[E0117]: only traits defined in the current crate can be implemented for ar
--> $DIR/coherence-vec-local.rs:14:1
|
LL | impl Remote for Vec<Local> { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate
| ^^^^^^^^^^^^^^^^----------
| | |
| | `std::vec::Vec<Local>` is not defined in the current crate
| impl doesn't use only types from inside the current crate
|
= note: `std::vec::Vec<Local>` is not defined in the current create
= note: define and implement a trait or new type instead

error: aborting due to previous error
6 changes: 4 additions & 2 deletions src/test/ui/coherence/coherence-vec-local.re.stderr
Original file line number Diff line number Diff line change
@@ -2,9 +2,11 @@ error[E0117]: only traits defined in the current crate can be implemented for ar
--> $DIR/coherence-vec-local.rs:14:1
|
LL | impl Remote for Vec<Local> { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate
| ^^^^^^^^^^^^^^^^----------
| | |
| | `std::vec::Vec<Local>` is not defined in the current crate
| impl doesn't use only types from inside the current crate
|
= note: `std::vec::Vec<Local>` is not defined in the current create
= note: define and implement a trait or new type instead

error: aborting due to previous error
6 changes: 4 additions & 2 deletions src/test/ui/coherence/coherence_local_err_struct.old.stderr
Original file line number Diff line number Diff line change
@@ -2,9 +2,11 @@ error[E0117]: only traits defined in the current crate can be implemented for ar
--> $DIR/coherence_local_err_struct.rs:17:1
|
LL | impl lib::MyCopy for lib::MyStruct<MyType> { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate
| ^^^^^^^^^^^^^^^^^^^^^---------------------
| | |
| | `lib::MyStruct<MyType>` is not defined in the current crate
| impl doesn't use only types from inside the current crate
|
= note: `lib::MyStruct<MyType>` is not defined in the current create
= note: define and implement a trait or new type instead

error: aborting due to previous error
6 changes: 4 additions & 2 deletions src/test/ui/coherence/coherence_local_err_struct.re.stderr
Original file line number Diff line number Diff line change
@@ -2,9 +2,11 @@ error[E0117]: only traits defined in the current crate can be implemented for ar
--> $DIR/coherence_local_err_struct.rs:17:1
|
LL | impl lib::MyCopy for lib::MyStruct<MyType> { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate
| ^^^^^^^^^^^^^^^^^^^^^---------------------
| | |
| | `lib::MyStruct<MyType>` is not defined in the current crate
| impl doesn't use only types from inside the current crate
|
= note: `lib::MyStruct<MyType>` is not defined in the current create
= note: define and implement a trait or new type instead

error: aborting due to previous error
6 changes: 4 additions & 2 deletions src/test/ui/coherence/coherence_local_err_tuple.old.stderr
Original file line number Diff line number Diff line change
@@ -2,9 +2,11 @@ error[E0117]: only traits defined in the current crate can be implemented for ar
--> $DIR/coherence_local_err_tuple.rs:17:1
|
LL | impl lib::MyCopy for (MyType,) { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate
| ^^^^^^^^^^^^^^^^^^^^^---------
| | |
| | `(MyType,)` is not defined in the current crate
| impl doesn't use only types from inside the current crate
|
= note: `(MyType,)` is not defined in the current create
= note: define and implement a trait or new type instead

error: aborting due to previous error
6 changes: 4 additions & 2 deletions src/test/ui/coherence/coherence_local_err_tuple.re.stderr
Original file line number Diff line number Diff line change
@@ -2,9 +2,11 @@ error[E0117]: only traits defined in the current crate can be implemented for ar
--> $DIR/coherence_local_err_tuple.rs:17:1
|
LL | impl lib::MyCopy for (MyType,) { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate
| ^^^^^^^^^^^^^^^^^^^^^---------
| | |
| | `(MyType,)` is not defined in the current crate
| impl doesn't use only types from inside the current crate
|
= note: `(MyType,)` is not defined in the current create
= note: define and implement a trait or new type instead

error: aborting due to previous error
Original file line number Diff line number Diff line change
@@ -2,10 +2,12 @@ error[E0117]: only traits defined in the current crate can be implemented for ar
--> $DIR/impl-foreign[foreign]-for-foreign.rs:12:1
|
LL | impl Remote1<u32> for f64 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate
| ^^^^^^^^^^^^^^^^^^^^^^---
| | |
| | `f64` is not defined in the current crate
| impl doesn't use only types from inside the current crate
|
= note: `f64` is not defined in the current create
= note: `u32` is not defined in the current create
= note: `u32` is not defined in the current crate
= note: define and implement a trait or new type instead

error: aborting due to previous error
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)
--> $DIR/impl[t]-foreign[foreign]-for-fundamental[t].rs:12:1
--> $DIR/impl[t]-foreign[foreign]-for-fundamental[t].rs:12:6
|
LL | impl<T> Remote1<u32> for Box<T> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type parameter `T` must be used as the type parameter for some local type
| ^ type parameter `T` must be used as the type parameter for some local type
|
= note: only traits defined in the current crate can be implemented for a type parameter

error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)
--> $DIR/impl[t]-foreign[foreign]-for-fundamental[t].rs:16:1
--> $DIR/impl[t]-foreign[foreign]-for-fundamental[t].rs:16:10
|
LL | impl<'a, T> Remote1<u32> for &'a T {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type parameter `T` must be used as the type parameter for some local type
| ^ type parameter `T` must be used as the type parameter for some local type
|
= note: only traits defined in the current crate can be implemented for a type parameter

4 changes: 2 additions & 2 deletions src/test/ui/coherence/impl[t]-foreign[foreign]-for-t.stderr
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)
--> $DIR/impl[t]-foreign[foreign]-for-t.rs:12:1
--> $DIR/impl[t]-foreign[foreign]-for-t.rs:12:6
|
LL | impl<T> Remote1<u32> for T {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ type parameter `T` must be used as the type parameter for some local type
| ^ type parameter `T` must be used as the type parameter for some local type
|
= note: only traits defined in the current crate can be implemented for a type parameter

Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)
--> $DIR/impl[t]-foreign[fundamental[t]]-for-foreign.rs:12:1
--> $DIR/impl[t]-foreign[fundamental[t]]-for-foreign.rs:12:6
|
LL | impl<T> Remote1<Box<T>> for u32 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type parameter `T` must be used as the type parameter for some local type
| ^ type parameter `T` must be used as the type parameter for some local type
|
= note: only traits defined in the current crate can be implemented for a type parameter

error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)
--> $DIR/impl[t]-foreign[fundamental[t]]-for-foreign.rs:16:1
--> $DIR/impl[t]-foreign[fundamental[t]]-for-foreign.rs:16:10
|
LL | impl<'a, T> Remote1<&'a T> for u32 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type parameter `T` must be used as the type parameter for some local type
| ^ type parameter `T` must be used as the type parameter for some local type
|
= note: only traits defined in the current crate can be implemented for a type parameter

Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)
--> $DIR/impl[t]-foreign[fundamental[t]]-for-fundamental[t].rs:12:1
--> $DIR/impl[t]-foreign[fundamental[t]]-for-fundamental[t].rs:12:10
|
LL | impl<'a, T> Remote1<Box<T>> for &'a T {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type parameter `T` must be used as the type parameter for some local type
| ^ type parameter `T` must be used as the type parameter for some local type
|
= note: only traits defined in the current crate can be implemented for a type parameter

error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)
--> $DIR/impl[t]-foreign[fundamental[t]]-for-fundamental[t].rs:15:1
--> $DIR/impl[t]-foreign[fundamental[t]]-for-fundamental[t].rs:15:10
|
LL | impl<'a, T> Remote1<&'a T> for Box<T> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type parameter `T` must be used as the type parameter for some local type
| ^ type parameter `T` must be used as the type parameter for some local type
|
= note: only traits defined in the current crate can be implemented for a type parameter

Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)
--> $DIR/impl[t]-foreign[fundamental[t]]-for-t.rs:12:1
--> $DIR/impl[t]-foreign[fundamental[t]]-for-t.rs:12:6
|
LL | impl<T> Remote1<Box<T>> for T {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type parameter `T` must be used as the type parameter for some local type
| ^ type parameter `T` must be used as the type parameter for some local type
|
= note: only traits defined in the current crate can be implemented for a type parameter

error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)
--> $DIR/impl[t]-foreign[fundamental[t]]-for-t.rs:15:1
--> $DIR/impl[t]-foreign[fundamental[t]]-for-t.rs:15:10
|
LL | impl<'a, T> Remote1<&'a T> for T {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type parameter `T` must be used as the type parameter for some local type
| ^ type parameter `T` must be used as the type parameter for some local type
|
= note: only traits defined in the current crate can be implemented for a type parameter

Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)
--> $DIR/impl[t]-foreign[fundamental[t]_local]-for-foreign.rs:12:1
--> $DIR/impl[t]-foreign[fundamental[t]_local]-for-foreign.rs:12:6
|
LL | impl<T> Remote2<Box<T>, Local> for u32 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type parameter `T` must be used as the type parameter for some local type
| ^ type parameter `T` must be used as the type parameter for some local type
|
= note: only traits defined in the current crate can be implemented for a type parameter

error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)
--> $DIR/impl[t]-foreign[fundamental[t]_local]-for-foreign.rs:16:1
--> $DIR/impl[t]-foreign[fundamental[t]_local]-for-foreign.rs:16:10
|
LL | impl<'a, T> Remote2<&'a T, Local> for u32 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type parameter `T` must be used as the type parameter for some local type
| ^ type parameter `T` must be used as the type parameter for some local type
|
= note: only traits defined in the current crate can be implemented for a type parameter

Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)
--> $DIR/impl[t]-foreign[local]-for-fundamental[t].rs:12:1
--> $DIR/impl[t]-foreign[local]-for-fundamental[t].rs:12:6
|
LL | impl<T> Remote1<Local> for Box<T> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type parameter `T` must be used as the type parameter for some local type
| ^ type parameter `T` must be used as the type parameter for some local type
|
= note: only traits defined in the current crate can be implemented for a type parameter

error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)
--> $DIR/impl[t]-foreign[local]-for-fundamental[t].rs:16:1
--> $DIR/impl[t]-foreign[local]-for-fundamental[t].rs:16:6
|
LL | impl<T> Remote1<Local> for &T {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type parameter `T` must be used as the type parameter for some local type
| ^ type parameter `T` must be used as the type parameter for some local type
|
= note: only traits defined in the current crate can be implemented for a type parameter

4 changes: 2 additions & 2 deletions src/test/ui/coherence/impl[t]-foreign[local]-for-t.stderr
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)
--> $DIR/impl[t]-foreign[local]-for-t.rs:12:1
--> $DIR/impl[t]-foreign[local]-for-t.rs:12:6
|
LL | impl<T> Remote1<Local> for T {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type parameter `T` must be used as the type parameter for some local type
| ^ type parameter `T` must be used as the type parameter for some local type
|
= note: only traits defined in the current crate can be implemented for a type parameter

4 changes: 2 additions & 2 deletions src/test/ui/coherence/impl[t]-foreign[t]-for-foreign.stderr
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)
--> $DIR/impl[t]-foreign[t]-for-foreign.rs:12:1
--> $DIR/impl[t]-foreign[t]-for-foreign.rs:12:6
|
LL | impl<T> Remote1<T> for u32 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ type parameter `T` must be used as the type parameter for some local type
| ^ type parameter `T` must be used as the type parameter for some local type
|
= note: only traits defined in the current crate can be implemented for a type parameter

Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)
--> $DIR/impl[t]-foreign[t]-for-fundamental.rs:12:1
--> $DIR/impl[t]-foreign[t]-for-fundamental.rs:12:6
|
LL | impl<T> Remote1<T> for Box<T> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type parameter `T` must be used as the type parameter for some local type
| ^ type parameter `T` must be used as the type parameter for some local type
|
= note: only traits defined in the current crate can be implemented for a type parameter

error[E0210]: type parameter `B` must be used as the type parameter for some local type (e.g., `MyStruct<B>`)
--> $DIR/impl[t]-foreign[t]-for-fundamental.rs:16:1
--> $DIR/impl[t]-foreign[t]-for-fundamental.rs:16:13
|
LL | impl<'a, A, B> Remote1<A> for &'a B {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type parameter `B` must be used as the type parameter for some local type
| ^ type parameter `B` must be used as the type parameter for some local type
|
= note: only traits defined in the current crate can be implemented for a type parameter

4 changes: 2 additions & 2 deletions src/test/ui/coherence/impl[t]-foreign[t]-for-t.stderr
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)
--> $DIR/impl[t]-foreign[t]-for-t.rs:12:1
--> $DIR/impl[t]-foreign[t]-for-t.rs:12:6
|
LL | impl<T> Remote1<T> for T {
| ^^^^^^^^^^^^^^^^^^^^^^^^ type parameter `T` must be used as the type parameter for some local type
| ^ type parameter `T` must be used as the type parameter for some local type
|
= note: only traits defined in the current crate can be implemented for a type parameter

6 changes: 4 additions & 2 deletions src/test/ui/dropck/drop-on-non-struct.stderr
Original file line number Diff line number Diff line change
@@ -8,9 +8,11 @@ error[E0117]: only traits defined in the current crate can be implemented for ar
--> $DIR/drop-on-non-struct.rs:1:1
|
LL | impl<'a> Drop for &'a mut isize {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate
| ^^^^^^^^^^^^^^^^^^-------------
| | |
| | `&'a mut isize` is not defined in the current crate
| impl doesn't use only types from inside the current crate
|
= note: `&'a mut isize` is not defined in the current create
= note: define and implement a trait or new type instead

error: aborting due to 2 previous errors
6 changes: 4 additions & 2 deletions src/test/ui/error-codes/E0117.stderr
Original file line number Diff line number Diff line change
@@ -8,9 +8,11 @@ error[E0117]: only traits defined in the current crate can be implemented for ar
--> $DIR/E0117.rs:1:1
|
LL | impl Drop for u32 {}
| ^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate
| ^^^^^^^^^^^^^^---
| | |
| | `u32` is not defined in the current crate
| impl doesn't use only types from inside the current crate
|
= note: `u32` is not defined in the current create
= note: define and implement a trait or new type instead

error: aborting due to 2 previous errors
6 changes: 4 additions & 2 deletions src/test/ui/error-codes/E0206.stderr
Original file line number Diff line number Diff line change
@@ -14,9 +14,11 @@ error[E0117]: only traits defined in the current crate can be implemented for ar
--> $DIR/E0206.rs:3:1
|
LL | impl Copy for Foo { }
| ^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate
| ^^^^^^^^^^^^^^---
| | |
| | `[u8; _]` is not defined in the current crate
| impl doesn't use only types from inside the current crate
|
= note: `[u8; _]` is not defined in the current create
= note: define and implement a trait or new type instead

error: aborting due to 3 previous errors
4 changes: 2 additions & 2 deletions src/test/ui/error-codes/e0119/complex-impl.stderr
Original file line number Diff line number Diff line change
@@ -9,10 +9,10 @@ LL | impl<R> External for (Q, R) {}
where <U as std::ops::FnOnce<(T,)>>::Output == V, <V as std::iter::Iterator>::Item == T, 'b : 'a, T : 'a, U: std::ops::FnOnce<(T,)>, U : 'static, V: std::iter::Iterator, V: std::clone::Clone, W: std::ops::Add, <W as std::ops::Add>::Output: std::marker::Copy;

error[E0210]: type parameter `R` must be used as the type parameter for some local type (e.g., `MyStruct<R>`)
--> $DIR/complex-impl.rs:9:1
--> $DIR/complex-impl.rs:9:6
|
LL | impl<R> External for (Q, R) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ type parameter `R` must be used as the type parameter for some local type
| ^ type parameter `R` must be used as the type parameter for some local type
|
= note: only traits defined in the current crate can be implemented for a type parameter

4 changes: 2 additions & 2 deletions src/test/ui/error-codes/e0119/issue-28981.stderr
Original file line number Diff line number Diff line change
@@ -9,10 +9,10 @@ LL | impl<Foo> Deref for Foo { }
where T: ?Sized;

error[E0210]: type parameter `Foo` must be used as the type parameter for some local type (e.g., `MyStruct<Foo>`)
--> $DIR/issue-28981.rs:5:1
--> $DIR/issue-28981.rs:5:6
|
LL | impl<Foo> Deref for Foo { }
| ^^^^^^^^^^^^^^^^^^^^^^^ type parameter `Foo` must be used as the type parameter for some local type
| ^^^ type parameter `Foo` must be used as the type parameter for some local type
|
= note: only traits defined in the current crate can be implemented for a type parameter

Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)
--> $DIR/feature-gate-re-rebalance-coherence.rs:10:1
--> $DIR/feature-gate-re-rebalance-coherence.rs:10:10
|
LL | impl<'a, T:'a, Tab> QueryFragment<Oracle> for BatchInsert<'a, T, Tab> {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type parameter `T` must be used as the type parameter for some local type
| ^ type parameter `T` must be used as the type parameter for some local type
|
= note: only traits defined in the current crate can be implemented for a type parameter

4 changes: 2 additions & 2 deletions src/test/ui/issues/issue-41974.stderr
Original file line number Diff line number Diff line change
@@ -16,10 +16,10 @@ LL | impl<T> Drop for T where T: A {
| ^ implementing Drop requires a struct

error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)
--> $DIR/issue-41974.rs:7:1
--> $DIR/issue-41974.rs:7:6
|
LL | impl<T> Drop for T where T: A {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type parameter `T` must be used as the type parameter for some local type
| ^ type parameter `T` must be used as the type parameter for some local type
|
= note: only traits defined in the current crate can be implemented for a type parameter

4 changes: 2 additions & 2 deletions src/test/ui/orphan-check-diagnostics.stderr
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)
--> $DIR/orphan-check-diagnostics.rs:11:1
--> $DIR/orphan-check-diagnostics.rs:11:6
|
LL | impl<T> RemoteTrait for T where T: LocalTrait {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type parameter `T` must be used as the type parameter for some local type
| ^ type parameter `T` must be used as the type parameter for some local type
|
= note: only traits defined in the current crate can be implemented for a type parameter

Original file line number Diff line number Diff line change
@@ -2,18 +2,22 @@ error[E0117]: only traits defined in the current crate can be implemented for ar
--> $DIR/typeck-default-trait-impl-cross-crate-coherence.rs:13:1
|
LL | impl DefaultedTrait for (A,) { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate
| ^^^^^^^^^^^^^^^^^^^^^^^^----
| | |
| | `(A,)` is not defined in the current crate
| impl doesn't use only types from inside the current crate
|
= note: `(A,)` is not defined in the current create
= note: define and implement a trait or new type instead

error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
--> $DIR/typeck-default-trait-impl-cross-crate-coherence.rs:16:1
|
LL | impl !DefaultedTrait for (B,) { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate
| ^^^^^^^^^^^^^^^^^^^^^^^^^----
| | |
| | `(B,)` is not defined in the current crate
| impl doesn't use only types from inside the current crate
|
= note: `(B,)` is not defined in the current create
= note: define and implement a trait or new type instead

error[E0321]: cross-crate traits with a default impl, like `lib::DefaultedTrait`, can only be implemented for a struct/enum type defined in the current crate
@@ -26,9 +30,11 @@ error[E0117]: only traits defined in the current crate can be implemented for ar
--> $DIR/typeck-default-trait-impl-cross-crate-coherence.rs:21:1
|
LL | impl DefaultedTrait for lib::Something<C> { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate
| ^^^^^^^^^^^^^^^^^^^^^^^^-----------------
| | |
| | `lib::Something<C>` is not defined in the current crate
| impl doesn't use only types from inside the current crate
|
= note: `lib::Something<C>` is not defined in the current create
= note: define and implement a trait or new type instead

error: aborting due to 4 previous errors