-
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
Don't hide ICEs from previous incremental compiles #65470
Conversation
…ation in this case
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @matthewjasper (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
r? @michaelwoerister cc @eddyb |
You should add the mcve in the comment (#63154 (comment)) as a test (as in #65395). |
If I understood the issue correctly, the test should be that when |
Here's an example of a test specifically for incremental compilation: #60697 |
The problem is now on how can I make the compiler ICE reliablely ? |
Oh, I misread the issue being solved! I'm not exactly sure the correct test for this. |
@jackh726 I can help and will do so tonight or tomorrow |
Apart from needing the test, is the fix correct ? |
The fix looks correct to me. Thanks, @traxys! |
Here is some documentation on using "revisions" for test cases: https://rust-lang.github.io/rustc-guide/tests/adding.html#revisions |
In addition to @michaelwoerister 's point about using "revisions" for test cases, we also need to check about whether there is a good way to cause the compiler to ICE in a reliable fashion (i.e., something that we could put in a test suite and rely on going forward).
|
I tried the |
@traxys okay. I think the way to go here would be to extend the E.g. something where If you want to have a go at implementing this yourself, the main places to look are here: rust/src/librustc_codegen_utils/lib.rs Lines 30 to 40 in d3d28a4
(which implements the actual handling of the attribute) and here:
which implements the initial check that Based on my reading of the definition of rust/src/libsyntax/feature_gate/builtin_attrs.rs Lines 113 to 116 in d3d28a4
it seems like you should be able to get this going initially by just replacing |
Should I do this in this PR or in another PR ? |
I'd say go ahead and do it in this PR, but as a separate commit. (If this |
@pnkfelix I added something that seems to be correct, the only problem is that it does not trigger the issue with the rustc affected by the issue, and I don't know why, I need to look in more details |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
📌 Commit 5930551 has been approved by |
fn main() {
break rust;
} ICEs "reliably", as long as this joke isn't removed (though it doesn't use |
⌛ Testing commit 5930551 with merge 1d506eca253e003f26ecb3a6ca5e3f0c8314d488... |
Don't hide ICEs from previous incremental compiles I think this fixes rust-lang#65401, the compiler does not fail to ICE after the first compilation, tested on the last snippet of [this comment](rust-lang#63154 (comment)). I am not very sure of the fix as I don't understand much of the structure of the compiler.
@bors retry rolled up |
Rollup of 16 pull requests Successful merges: - #65112 (Add lint and tests for unnecessary parens around types) - #65470 (Don't hide ICEs from previous incremental compiles) - #65471 (Add long error explanation for E0578) - #65857 (rustdoc: Resolve module-level doc references more locally) - #65902 (Make ItemContext available for better diagnositcs) - #65914 (Use structured suggestion for unnecessary bounds in type aliases) - #65946 (Make `promote_consts` emit the errors when required promotion fails) - #65960 (doc: reword iter module example and mention other methods) - #65963 (update submodules to rust-lang) - #65972 (Fix libunwind build: Define __LITTLE_ENDIAN__ for LE targets) - #65977 (Fix incorrect diagnostics for expected type in E0271 with an associated type) - #65995 (Add error code E0743 for "C-variadic has been used on a non-foreign function") - #65997 (Fix outdated rustdoc of Once::init_locking function) - #66002 (Stabilize float_to_from_bytes feature) - #66005 (vxWorks: remove code related unix socket) - #66018 (Revert PR 64324: dylibs export generics again (for now)) Failed merges: r? @ghost
I think this fixes #65401, the compiler does not fail to ICE after the first compilation, tested on the last snippet of this comment.
I am not very sure of the fix as I don't understand much of the structure of the compiler.