Add ui test insufficient-suggestion-issue-141679.rs

This commit is contained in:
xizheyin 2026-02-09 14:24:59 +08:00
parent 1c316d3461
commit 3b705eae4f
2 changed files with 19 additions and 0 deletions

View file

@ -0,0 +1,8 @@
use std::rc::Rc;
pub struct Foo;
pub type Function = Rc<Foo>;
impl Function {}
//~^ ERROR cannot define inherent `impl` for a type outside of the crate where the type is defined [E0116]
fn main(){}

View file

@ -0,0 +1,11 @@
error[E0116]: cannot define inherent `impl` for a type outside of the crate where the type is defined
--> $DIR/insufficient-suggestion-issue-141679.rs:6:1
|
LL | impl Function {}
| ^^^^^^^^^^^^^ impl for type defined outside of crate
|
= note: define and implement a trait or new type instead
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0116`.