Skip to content

Commit 43d863b

Browse files
committed
Add test for reexported crate names
1 parent 68f5b34 commit 43d863b

File tree

4 files changed

+67
-0
lines changed

4 files changed

+67
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
#![crate_type="lib"]
12+
13+
14+
pub trait A {
15+
fn a(&self) {}
16+
}
17+
impl A for () {}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
#![crate_type="lib"]
12+
13+
pub extern crate xcrate_issue_43189_a;

src/test/ui/issue-43189.rs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
// Issue 46112: An extern crate pub re-exporting libcore was causing
12+
// paths rooted from `std` to be misrendered in the diagnostic output.
13+
14+
// ignore-windows
15+
// aux-build:xcrate_issue_43189_a.rs
16+
// aux-build:xcrate_issue_43189_b.rs
17+
18+
extern crate xcrate_issue_43189_b;
19+
fn main() {
20+
().a();
21+
//~^ ERROR no method named `a` found for type `()` in the current scope [E0599]
22+
}

src/test/ui/issue-43189.stderr

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
error[E0599]: no method named `a` found for type `()` in the current scope
2+
--> $DIR/issue-43189.rs:20:8
3+
|
4+
LL | ().a();
5+
| ^
6+
|
7+
= help: items from traits can only be used if the trait is in scope
8+
help: the following trait is implemented but not in scope, perhaps add a `use` for it:
9+
|
10+
LL | use xcrate_issue_43189_b::xcrate_issue_43189_a::A;
11+
|
12+
13+
error: aborting due to previous error
14+
15+
For more information about this error, try `rustc --explain E0599`.

0 commit comments

Comments
 (0)