-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix issues in suggesting importing extern crate paths
- Loading branch information
1 parent
340bb19
commit 43844e3
Showing
12 changed files
with
52 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# ignore-cross-compile | ||
include ../tools.mk | ||
|
||
all: | ||
$(RUSTC) --crate-type=rlib unwieldy_crate_name.rs -o $(TMPDIR)/libunwieldy_crate_name.rlib | ||
$(RUSTC) --crate-type rlib main.rs --extern unwieldy_crate_name=$(TMPDIR)/libunwieldy_crate_name.rlib \ | ||
2>&1 | $(CGREP) "use nice_crate_name::Foo;" | ||
|
||
$(RUSTC) --crate-type=rlib --edition=2021 unwieldy_crate_name.rs -o $(TMPDIR)/libunwieldy_crate_name.rlib | ||
$(RUSTC) --crate-type rlib main.rs --edition=2021 --extern unwieldy_crate_name=$(TMPDIR)/libunwieldy_crate_name.rlib \ | ||
2>&1 | $(CGREP) "use crate::nice_crate_name::Foo;" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
extern crate unwieldy_crate_name as nice_crate_name; | ||
|
||
fn use_foo_from_another_crate_without_importing_it_first() { | ||
//use nice_crate_name::Foo; | ||
let _: Foo<i32> = todo!(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
pub struct Foo<T>(pub core::ptr::NonNull<T>); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters