diff options
| author | bors <bors@rust-lang.org> | 2023-06-19 20:01:50 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-06-19 20:01:50 +0000 |
| commit | fe7454bf439c93cbe9ac8a8f7fcfacd5a40244c2 (patch) | |
| tree | 40d9bcb451b3427ef5b4565bdf0aa021393f26ae /src | |
| parent | 405130538938e2d63a761b7d8d6b27d26e634c33 (diff) | |
| parent | 68d3e0e3bd36c655b7bfdee9ca081814b1bb002f (diff) | |
| download | rust-fe7454bf439c93cbe9ac8a8f7fcfacd5a40244c2.tar.gz rust-fe7454bf439c93cbe9ac8a8f7fcfacd5a40244c2.zip | |
Auto merge of #112805 - matthiaskrgr:rollup-r5yrefu, r=matthiaskrgr
Rollup of 7 pull requests Successful merges: - #109970 ([doc] `poll_fn`: explain how to `pin` captured state safely) - #112705 (Simplify `Span::source_callee` impl) - #112757 (Use BorrowFlag instead of explicit isize) - #112768 (Rewrite various resolve/diagnostics errors as translatable diagnostics) - #112777 (Continue folding in query normalizer on weak aliases) - #112780 (Treat TAIT equation as always ambiguous in coherence) - #112783 (Don't ICE on bound var in `reject_fn_ptr_impls`) r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'src')
| -rw-r--r-- | src/tools/clippy/tests/ui/from_over_into_unfixable.rs | 6 | ||||
| -rw-r--r-- | src/tools/clippy/tests/ui/from_over_into_unfixable.stderr | 33 |
2 files changed, 25 insertions, 14 deletions
diff --git a/src/tools/clippy/tests/ui/from_over_into_unfixable.rs b/src/tools/clippy/tests/ui/from_over_into_unfixable.rs index bd62c655216..3b280b7488a 100644 --- a/src/tools/clippy/tests/ui/from_over_into_unfixable.rs +++ b/src/tools/clippy/tests/ui/from_over_into_unfixable.rs @@ -32,10 +32,4 @@ impl Into<u8> for ContainsVal { } } -type Opaque = impl Sized; -struct IntoOpaque; -impl Into<Opaque> for IntoOpaque { - fn into(self) -> Opaque {} -} - fn main() {} diff --git a/src/tools/clippy/tests/ui/from_over_into_unfixable.stderr b/src/tools/clippy/tests/ui/from_over_into_unfixable.stderr index bb966af4b0f..251f1d84e74 100644 --- a/src/tools/clippy/tests/ui/from_over_into_unfixable.stderr +++ b/src/tools/clippy/tests/ui/from_over_into_unfixable.stderr @@ -1,12 +1,29 @@ -error[E0658]: `impl Trait` in type aliases is unstable - --> $DIR/from_over_into_unfixable.rs:35:15 +error: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true + --> $DIR/from_over_into_unfixable.rs:11:1 | -LL | type Opaque = impl Sized; - | ^^^^^^^^^^ +LL | impl Into<InMacro> for String { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information - = help: add `#![feature(type_alias_impl_trait)]` to the crate attributes to enable + = help: replace the `Into` implementation with `From<std::string::String>` + = note: `-D clippy::from-over-into` implied by `-D warnings` -error: aborting due to previous error +error: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true + --> $DIR/from_over_into_unfixable.rs:19:1 + | +LL | impl Into<WeirdUpperSelf> for &'static [u8] { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: replace the `Into` implementation with `From<&'static [u8]>` + +error: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true + --> $DIR/from_over_into_unfixable.rs:28:1 + | +LL | impl Into<u8> for ContainsVal { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: `impl From<Local> for Foreign` is allowed by the orphan rules, for more information see + https://doc.rust-lang.org/reference/items/implementations.html#trait-implementation-coherence + = help: replace the `Into` implementation with `From<ContainsVal>` + +error: aborting due to 3 previous errors -For more information about this error, try `rustc --explain E0658`. |
