-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
librustc *still* cannot be used as a library? (trouble resolving libstd) #11063
Comments
Closing this as working as intended. Sadly rustc isn't designed to be the easiest library to use right now, but rustc for better or for worse has a lot of inference based on If there are ideas though about how to make guessing where the target libraries are more robust, then that would be fantastic to commit to rustc! For now though, with a lack of ideas, I'm going to close this issue. |
I have opened #11068 as a specific way to go about fixing this issue. |
[`missing_fields_in_debug`]: make sure self type is an adt Fixes rust-lang#11063, another ICE that can only happen in core. This lint needs the `DefId` of the implementor to get its fields, but that ICEs if the implementor does not have a `DefId` (as is the case with primitive types, e.g. `impl Debug for bool`), which is where this ICE comes from. This PR changes the check I added in rust-lang#10897 to be more... robust against `Debug` implementations we don't want to lint. Instead of just checking if the self type is a type parameter and "special casing" one specific case we don't want to lint, we should probably rather just check that the self type is either a struct, an enum or a union and only then continue. That prevents weird edge cases like this one that can only happen in core. Again, I don't know if it's even possible to add a test case for this since one cannot implement `Debug` for primitive types outside of the crate that defined `Debug` (core). I did make sure that this PR no longer ICEs on `impl<T> Debug for T` and `impl Debug for bool`. Maybe writing such a test is possible with `#![no_core]` and then re-defining the `Debug` trait or something like that...? changelog: [`missing_fields_in_debug`]: make sure self type is an adt (fixes an ICE in core) r? `@Alexendoo` (reviewed the last PRs for this lint)
[`missing_fields_in_debug`]: make sure self type is an adt Fixes rust-lang#11063, another ICE that can only happen in core. This lint needs the `DefId` of the implementor to get its fields, but that ICEs if the implementor does not have a `DefId` (as is the case with primitive types, e.g. `impl Debug for bool`), which is where this ICE comes from. This PR changes the check I added in rust-lang#10897 to be more... robust against `Debug` implementations we don't want to lint. Instead of just checking if the self type is a type parameter and "special casing" one specific case we don't want to lint, we should probably rather just check that the self type is either a struct, an enum or a union and only then continue. That prevents weird edge cases like this one that can only happen in core. Again, I don't know if it's even possible to add a test case for this since one cannot implement `Debug` for primitive types outside of the crate that defined `Debug` (core). I did make sure that this PR no longer ICEs on `impl<T> Debug for T` and `impl Debug for bool`. Maybe writing such a test is possible with `#![no_core]` and then re-defining the `Debug` trait or something like that...? changelog: [`missing_fields_in_debug`]: make sure self type is an adt (fixes an ICE in core) r? `@Alexendoo` (reviewed the last PRs for this lint)
Moving on from #11026 (where I was missing args[0]), now I'm seeing this at runtime:
Where
testloop
is my program callingrustc::main_args
(and trying to builddemo.rs
)...cc @alexcrichton
The text was updated successfully, but these errors were encountered: