-
Notifications
You must be signed in to change notification settings - Fork 12.3k
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 ICE per #28172 #28178
Fix ICE per #28172 #28178
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @nikomatsakis (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. 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. |
This leads to error triplication - one from Also, you need to add a test (copy one of the files in |
@arielb1 Can you elaborate a little more? I'm new to Rust, so this doesn't make much sense to me. |
First, we add a test for every bug fixed in rustc. The tests we add are typically compiletests - these are // Copyright 2015 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
fn main() {
let x = 0;
match 1 {
0 ... x => {} //~ ERROR non-constant path
};
} The Anyway, your change causes 3 errors to be emitted in that case, and that is just ugly. |
Ok whoops! Thanks for explaining. |
The second commit gives the proper behavior. As I said in #28178, there are two things wrong with the code, so two errors are necessary, but the third error (the ICE) is not. |
OK, @nikomatsakis I implemented that. It works just fine. BTW, is there any way I can familiarize myself more with the Rust codebase? This is one of my first pull requests to Rust, so I don't have much domain-specific knowledge. |
@ChristopherDumas (sorry for the delay)
Looks great, thanks. Can you maybe squash the commits? Most of the history doesn't seem so relevant anymore.
Hmm, I'm not sure of any great resource. I guess it's our job to let you know about these things :) |
(our job as reviewers, I mean) |
@nikomatsakis Sorry about my delay, I'll squash the commits. |
@nikomatsakis I've squashed all the commits, and the tests are passing. |
@nikomatsakis I added a test, but since there are two errors on the same line, it fails. Do you know how to fix this? |
@ChristopherDumas yes, you can do this:
The Just for reference, you can put any number of |
@nikomatsakis Awesome! Thanks! |
@bors r+ |
📌 Commit 175a642 has been approved by |
@nikomatsakis Is there a manual for the testing stuff that you showed me? |
🔒 Merge conflict |
☔ The latest upstream changes (presumably #28350) made this pull request unmergeable. Please resolve the merge conflicts. |
Merge conflict! |
@nikomatsakis Can you make bors retry? |
⌛ Testing commit 4611308 with merge a690a2d... |
💔 Test failed - auto-win-msvc-64-opt |
@alexcrichton Why is bors' homu test failing? |
Looks like a spurious failure, not caused by your PR |
@bors retry @ChristopherDumas our buildbot is glitchy. |
This fixes the ICE, and makes it just a compiler error/warning. I'm not exactly sure that's whats wanted, so tell me if it isn't.
⌛ Testing commit 4611308 with merge 483600e... |
This fixes the ICE, and makes it just a compiler error/warning. I'm not exactly sure that's whats wanted, so tell me if it isn't.