-
Notifications
You must be signed in to change notification settings - Fork 13.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(resolve): replace bindings to dummy for unresolved imports #109602
Conversation
In my opinion, there are three solutions:
#![crate_type = "lib"]
extern crate f;
pub use inner::f;
pub use f as g;
g!{}
fn main() {} |
But we are already doing that?
Why does |
No, at this stage we only add The type namespace of |
Wait a minute, maybe we're not talking about the same |
And without |
The logic goes like this: For For When dealing with value namespace, |
Yes, for Perhaps we could put binding.is_dummy_binding_import to something that doesn't rely on a token value like |
The issue is not related to the #![crate_type = "lib"]
pub mod f {}
pub use unresolved::f;
/// [g]
pub use f as g; |
In the newest commit, I had replaced all bindings to dummy for indeterminate imports, It seems more reasonable to avoid panic caused by @rustbot ready |
Thanks! |
PR in rollup #111577 will be merged soon, testing already. |
Thanks for the tips! @rustbot ready |
@bors r+ |
⌛ Testing commit 1e8f887 with merge 94aba6b5c5ca54c7be1c4f20739fc233ada488c8... |
💥 Test timed out |
This comment has been minimized.
This comment has been minimized.
timeout again and I rebased latest code. so @rustbot ready |
@bors r+ |
☀️ Test successful - checks-actions |
Finished benchmarking commit (92f5dea): comparison URL. Overall result: ❌✅ regressions and improvements - no action needed@rustbot label: -perf-regression Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 641.544s -> 641.663s (0.02%) |
close #109343
In #109343,
f
inpub use f as g
points to:external crate f
None
None
When resolve
value_ns
duringresolve_doc_links
, the value of the binding of single_importpub use f as g
goes topub use inner::f
, and since it does not satisfy !self.is_accessible_from(binding.vis, single_import.parent_scope.module) and returnsErr(Undetermined)
, which eventually goes toPathResult::Indeterminate => unreachable!
.This PR replace all namespace binding to
dummy_binding
for indeterminate import, so, the bindings ofpub use f as g
had been changed to followings after finalize:dummy
dummy
dummy
r?@petrochenkov