mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
@@ -0,0 +1,20 @@
|
||||
// Regression test for #153743 and #153744.
|
||||
// Delegation to a module or crate root inside a trait impl
|
||||
// should emit a resolution error, not ICE.
|
||||
|
||||
#![feature(fn_delegation)]
|
||||
#![allow(incomplete_features)]
|
||||
|
||||
trait Trait {
|
||||
fn bar();
|
||||
fn bar2();
|
||||
}
|
||||
|
||||
impl Trait for () {
|
||||
reuse std::path::<> as bar;
|
||||
//~^ ERROR expected function, found module `std::path`
|
||||
reuse core::<> as bar2;
|
||||
//~^ ERROR expected function, found crate `core`
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
@@ -0,0 +1,15 @@
|
||||
error[E0423]: expected function, found module `std::path`
|
||||
--> $DIR/ice-non-fn-target-in-trait-impl.rs:14:11
|
||||
|
|
||||
LL | reuse std::path::<> as bar;
|
||||
| ^^^^^^^^^^^^^ not a function
|
||||
|
||||
error[E0423]: expected function, found crate `core`
|
||||
--> $DIR/ice-non-fn-target-in-trait-impl.rs:16:11
|
||||
|
|
||||
LL | reuse core::<> as bar2;
|
||||
| ^^^^^^^^ not a function
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0423`.
|
||||
Reference in New Issue
Block a user