Rollup merge of #55102 - petrochenkov:trextra, r=nikomatsakis

resolve: Do not skip extern prelude during speculative resolution

Fixes https://github.com/rust-lang/rust/issues/54665
This commit is contained in:
kennytm 2018-10-18 10:47:28 +08:00
commit 8988403d69
No known key found for this signature in database
GPG key ID: FEF6C8051D0E013C
5 changed files with 30 additions and 4 deletions

View file

@ -10,7 +10,7 @@
// run-pass
#![allow(unused_variables)]
// compile-flags: --extern LooksLikeExternCrate=/path/to/nowhere
// compile-flags: --extern LooksLikeExternCrate
mod m {
pub struct LooksLikeExternCrate;

View file

@ -0,0 +1 @@
pub trait MyTrait {}

View file

@ -0,0 +1,10 @@
// aux-build:extra-item.rs
// compile-flags:--extern extra_item
struct S;
impl extra_item::MyTrait for S {
fn extra() {} //~ ERROR method `extra` is not a member of trait `extra_item::MyTrait`
}
fn main() {}

View file

@ -0,0 +1,9 @@
error[E0407]: method `extra` is not a member of trait `extra_item::MyTrait`
--> $DIR/extra-item.rs:7:5
|
LL | fn extra() {} //~ ERROR method `extra` is not a member of trait `extra_item::MyTrait`
| ^^^^^^^^^^^^^ not a member of trait `extra_item::MyTrait`
error: aborting due to previous error
For more information about this error, try `rustc --explain E0407`.