-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
The “use of unstable library feature 'rustc_private'” error is very repetitive #44953
Comments
Mentoring instructionsModify |
But However, the reported code isn't reproducing the issue for me with a stage 1 compiler, perhaps hinting at something more subtle going on with this report. |
That actually works and is a pretty elegant/quick fix. The only caveat is that you shouldn't pass the span in the tuple... i'm guessing, it messes up the hashcode, and the error ends up being different each time. I can't yet figure out why (complete newbie to the codebase) - so if you want to take up this issue & fix it, please feel free to do so, it'll take me a little while (I'm slow/don't have much time available to work on it :) ). |
Update - i had some time to inspect it. Basically, the error is reported in two places. Here:
and here:
The second one is the one that is reported many times - and the primary span seems to be different each time (which is why if you include the span in the "key", it sees the messages as different and emits them all). I'm planning to go from the primary span to file/line/column string, and include that in the message - basically, the key for |
But they look like they're all pointing to the same code-snippet; what could be making them different? It looks like |
So, I printed the location from the span - most of the "repeated" ones are within the macros, e.g.
I'm pretty sure I need to invoke EmitterWritter::fix_multispan_in_std_macros() on the primary span, in order to retrieve the true location (main.rs, line 4) - only problem is, that method is private. And now it's late :) I have another idea, I'll try it tomorrow - anyway, this looks to be genuinely trickier than it first appeared to be |
…vate'” error is very repetitive
Ok guys, I've created PR #45540 - let me know if you think it's a reasonable solution. |
Avoid repetition on “use of unstable library feature 'rustc_private'” This PR fixes the error by only emitting it when the span contains a real file (is not inside a macro) - and making sure it's emitted only once per span. The first check was needed because spans-within-macros seem to differ a lot and "fixing" them to the real location is not trivial (and the method that does this is private to another module). It also feels like there always will be an error on import, with the real file name, so not sure there's a point to re-emit the same error at macro use. Fix #44953.
#45540 did not contain the UI test to verify correctness. @virgil-palanciuc could you (or anybody interested) submit another PR to add the test? Sorry for the inconvenience. |
Just to clarify: the request is that I add a test in If yes - sure, I'll add it, sorry for not adding it from the start, I'm new to this project :). |
@virgil-palanciuc that is exactly right :) |
I added the test with PR #45635 ... but, at least on my local build, it seems that the compilation error changed in the meanwhile? (I get a much-more reduced version of it). Not sure why/ if I changed something in the build environment, or the code changed due to other PRs, in (FWIW, that's why I thought that a test won't be needed for this fix - error output tends to change in time, making such tests a bit fragile) |
So it wasn't just a thing on my build environment - the error is now simply |
@virgil-palanciuc, in my opinion the way to go would be to write a complete ui-fulldeps test, so as not to rely on the |
Add test for rust-lang#44953 Added the requested test - trying to see if it passes; my local build fails, but not sure why - the nightly shows this output, but in my build the compilation error changed. Fixes rust-lang#44953.
MIR: adopt borrowck test Fix trailing whitespace span_bug! on unexpected action Make RegionVid use newtype_index! Closes rust-lang#45843 Check rvalue aggregates during check_stmt in tycheck, add initial, (not passing) test Fix failing test Remove attributes and test comments accidentally left behind, add in span_mirbugs Normalize LvalueTy for ops and format code to satisfy tidy check only normalize operand types when in an ADT constructor avoid early return handle the active field index in unions normalize types in ADT constructor Fixes rust-lang#45940 Fix borrowck compiler errors for upvars contain "spurious" dereferences Fixes rust-lang#46003 added associated function Box::leak Box::leak - improve documentation Box::leak - fixed bug in documentation Box::leak - relaxed constraints wrt. lifetimes Box::leak - updated documentation Box::leak - made an oops, fixed now =) Box::leak: update unstable issue number (46179). Add test for rust-lang#44953 Add missing Debug impls to std_unicode Also adds #![deny(missing_debug_implementations)] so they don't get missed again. Amend RELEASES for 1.22.1 and fix the date for 1.22.0 Rename param in `[T]::swap_with_slice` from `src` to `other`. The idea of ‘source’ and ‘destination’ aren’t very applicable for this operation since both slices can both be considered sources and destinations. Clarify stdin behavior of `Command::output`. Fixes rust-lang#44929. Add hints for the case of confusing enum with its variants Add failing testcases Add module population and case of enum in place of expression Use for_each_child_stable in find_module Use multiline text for crate conflict diagnostics Make float::from_bits transmute (and update the documentation to reflect this). The current implementation/documentation was made to avoid sNaN because of potential safety issues implied by old/bad LLVM documentation. These issues aren't real, so we can just make the implementation transmute (as permitted by the existing documentation of this method). Also the documentation didn't actually match the behaviour: it said we may change sNaNs, but in fact we canonicalized *all* NaNs. Also an example in the documentation was wrong: it said we *always* change sNaNs, when the documentation was explicitly written to indicate it was implementation-defined. This makes to_bits and from_bits perfectly roundtrip cross-platform, except for one caveat: although the 2008 edition of IEEE-754 specifies how to interpet the signaling bit, earlier editions didn't. This lead to some platforms picking the opposite interpretation, so all signaling NaNs on x86/ARM are quiet on MIPS, and vice-versa. NaN-boxing is a fairly important optimization, while we don't even guarantee that float operations properly preserve signalingness. As such, this seems like the more natural strategy to take (as opposed to trying to mangle the signaling bit on a per-platform basis). This implementation is also, of course, faster. Simplify an Iterator::fold to Iterator::any This method of once-diagnostics doesn't allow nesting UI tests extract the regular output from the 'rendered' field in json Merge cfail and ui tests into ui tests Add a MIR pass to lower 128-bit operators to lang item calls Runs only with `-Z lower_128bit_ops` since it's not hooked into targets yet. Include tuple projections in MIR tests Add type checking for the lang item As part of doing so, add more lang items instead of passing u128 to the i128 ones where it doesn't matter in twos-complement. Handle shifts properly * The overflow-checking shift items need to take a full 128-bit type, since they need to be able to detect idiocy like `1i128 << (1u128 << 127)` * The unchecked ones just take u32, like the `*_sh?` methods in core * Because shift-by-anything is allowed, cast into a new local for every shift incr.comp.: Make sure we don't lose unused green results from the query cache. rustbuild: Update LLVM and enable ThinLTO This commit updates LLVM to fix rust-lang#45511 (https://reviews.llvm.org/D39981) and also reenables ThinLTO for libtest now that we shouldn't hit rust-lang#45768. This also opportunistically enables ThinLTO for libstd which was previously blocked (rust-lang#45661) on test failures related to debuginfo with a presumed cause of rust-lang#45511. Closes rust-lang#45511 std: Flag Windows TLS dtor symbol as #[used] Turns out ThinLTO was internalizing this symbol and eliminating it. Worse yet if you compiled with LTO turns out no TLS destructors would run on Windows! The `#[used]` annotation should be a more bulletproof implementation (in the face of LTO) of preserving this symbol all the way through in LLVM and ensuring it makes it all the way to the linker which will take care of it. Add enum InitializationRequiringAction Fix tidy tests
It tested rust-lang#44953. `log` macros in newer versions are no longer recursive, so these duplicated error messages (about unstable feature uses) previously occurring at each level of recursion are no longer possible, even with the fix by rust-lang#45540. Furthermore this test breaks when multiple versions of `log` are in the sysroot (`log 0.3.9` depends on`log 0.4.1`)
Add compiler docs testing to CI. Fixes #47025. I don't know if `x86_64-gnu` is the right builder for this, but there seems to be time left on [Travis](https://travis-ci.org/rust-lang/rust/jobs/307488864). Remaining problems blocking this PR: - [x] broken links caused by rustdoc issues: - [x] `pub use self::Enum::...`: #46766 and #46767 (fixed by #47050, thanks @ollie27!) - [x] `impl Deref for DerefToStdType`: #32129 (ignored in linkchecker) - [x] `#[feature(decl_macro)]` and `use std::vec`: #47038 (ignored in linkchecker) - [x] `rustc_data_structures::sync::{Lrc, RwLock}` aliases `std` types: #32130 (ignored in linkchecker) - [x] markdown differences, in rust repository and in external crates, now failing the build with #46880 merged (all fixed) - [x] multiple crate updates needed: `rand`, `log`, `parking_lot_core`, `flate2` - [x] submodule updates needed to deduplicate dependencies: `rust-installer`, ~`cargo`~ (done by #47052) - [x] #44953 test broken by `log` update (removed, this can be controversial) - [x] Waiting `x86_64-gnu` build results ([done](https://travis-ci.org/rust-lang/rust/builds/323451069)) See individual commits for more details.
rustc 1.22.0-nightly (0e6f4cf51 2017-09-27)
Compiling this:
while not including
log
as a dependency inCargo.toml
, produces the following output:The text was updated successfully, but these errors were encountered: