Add test for reexported crate names
This commit is contained in:
parent
68f5b34b2c
commit
43d863b5ed
4 changed files with 67 additions and 0 deletions
17
src/test/ui/auxiliary/xcrate_issue_43189_a.rs
Normal file
17
src/test/ui/auxiliary/xcrate_issue_43189_a.rs
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
#![crate_type="lib"]
|
||||
|
||||
|
||||
pub trait A {
|
||||
fn a(&self) {}
|
||||
}
|
||||
impl A for () {}
|
||||
13
src/test/ui/auxiliary/xcrate_issue_43189_b.rs
Normal file
13
src/test/ui/auxiliary/xcrate_issue_43189_b.rs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
#![crate_type="lib"]
|
||||
|
||||
pub extern crate xcrate_issue_43189_a;
|
||||
22
src/test/ui/issue-43189.rs
Normal file
22
src/test/ui/issue-43189.rs
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// Issue 46112: An extern crate pub re-exporting libcore was causing
|
||||
// paths rooted from `std` to be misrendered in the diagnostic output.
|
||||
|
||||
// ignore-windows
|
||||
// aux-build:xcrate_issue_43189_a.rs
|
||||
// aux-build:xcrate_issue_43189_b.rs
|
||||
|
||||
extern crate xcrate_issue_43189_b;
|
||||
fn main() {
|
||||
().a();
|
||||
//~^ ERROR no method named `a` found for type `()` in the current scope [E0599]
|
||||
}
|
||||
15
src/test/ui/issue-43189.stderr
Normal file
15
src/test/ui/issue-43189.stderr
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
error[E0599]: no method named `a` found for type `()` in the current scope
|
||||
--> $DIR/issue-43189.rs:20:8
|
||||
|
|
||||
LL | ().a();
|
||||
| ^
|
||||
|
|
||||
= help: items from traits can only be used if the trait is in scope
|
||||
help: the following trait is implemented but not in scope, perhaps add a `use` for it:
|
||||
|
|
||||
LL | use xcrate_issue_43189_b::xcrate_issue_43189_a::A;
|
||||
|
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0599`.
|
||||
Loading…
Add table
Add a link
Reference in a new issue