-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Continue evaluating after missing main #59903
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#![allow(dead_code)] | ||
|
||
// error-pattern:`main` function not found in crate | ||
|
||
struct Tableau<'a, MP> { | ||
provider: &'a MP, | ||
} | ||
|
||
impl<'adapted_matrix_provider, 'original_data, MP> | ||
Tableau<'adapted_matrix_provider, AdaptedMatrixProvider<'original_data, MP>> | ||
{ | ||
fn provider(&self) -> &'adapted_matrix_provider AdaptedMatrixProvider</*'original_data,*/ MP> { | ||
self.provider | ||
} | ||
} | ||
|
||
struct AdaptedMatrixProvider<'a, T> { | ||
original_problem: &'a T, | ||
} | ||
|
||
impl<'a, T> AdaptedMatrixProvider<'a, T> { | ||
fn clone_with_extra_bound(&self) -> Self { | ||
AdaptedMatrixProvider { original_problem: self.original_problem } | ||
} | ||
} | ||
|
||
fn create_and_solve_subproblems<'data_provider, 'original_data, MP>( | ||
tableau: Tableau<'data_provider, AdaptedMatrixProvider<'original_data, MP>>, | ||
) { | ||
let _: AdaptedMatrixProvider<'original_data, MP> = tableau.provider().clone_with_extra_bound(); | ||
//~^ ERROR lifetime mismatch | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
error[E0601]: `main` function not found in crate `continue_after_missing_main` | ||
| | ||
= note: consider adding a `main` function to `$DIR/continue-after-missing-main.rs` | ||
|
||
error[E0623]: lifetime mismatch | ||
--> $DIR/continue-after-missing-main.rs:30:56 | ||
| | ||
LL | tableau: Tableau<'data_provider, AdaptedMatrixProvider<'original_data, MP>>, | ||
| ------------------------------------------------------------------ these two types are declared with different lifetimes... | ||
LL | ) { | ||
LL | let _: AdaptedMatrixProvider<'original_data, MP> = tableau.provider().clone_with_extra_bound(); | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ...but data from `tableau` flows into `tableau` here | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
Some errors occurred: E0601, E0623. | ||
For more information about an error, try `rustc --explain E0601`. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well, we actually want to, but that's not really a problem of this PR. Have you checked how bad the fallout is if we remove this
abort_if_errors
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe that there were some useless errors coming from const evaluation, but those might have come from removing the later check at https://github.com/rust-lang/rust/pull/59903/files/13a05a27e9a5747cad090b1670c0a6b0baa624b9#diff-24c5c945888bb0d041e769bfb852de6cR976
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you check? I'd rather remove it entirely. Const eval should not evaluate MIR with typeck errors or borrowck errors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@oli-obk most of the extra errors are not too bad, but
src/test/ui/consts/match_ice.rs
starts ICEing again. I'll need to dig deeper to fix the ICE and would like to remove the duplicated errors/warnings before merging that change, but it is certainly doable.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm... Those look like deeper issues to me where some things should be querified more or just produce dummy values in case of errors. Please open an issue linking to the fallout of 8395dbd and mentioning the problems.