Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
da33dc0
Initial work for linting on bad never fallback
Aaron1011 Jan 12, 2020
0c49893
Emit warning
Aaron1011 Jan 12, 2020
3a22be9
Improve lint to check substs
Aaron1011 Jan 12, 2020
d0dc1e3
Make the error message much better
Aaron1011 Jan 12, 2020
ebf1918
Provide a better error when no substs is provided for generic param
Aaron1011 Jan 13, 2020
5253bb6
Factor out code into its own module
Aaron1011 Jan 13, 2020
087af85
Tweak error message
Aaron1011 Jan 15, 2020
932d7c2
Some fixup and cleanup
Aaron1011 Jan 15, 2020
10cd2e3
Work on splitting up post_fallback
Aaron1011 Jan 15, 2020
a8ce823
More refactoring
Aaron1011 Jan 15, 2020
65318da
Add a bunch of comments
Aaron1011 Jan 15, 2020
61b879c
Some additional cleanup
Aaron1011 Jan 15, 2020
c5691a8
Change warning to error
Aaron1011 Jan 15, 2020
1ed39bc
Add some tests
Aaron1011 Jan 17, 2020
d4bd422
Fix tidy errors
Aaron1011 Jan 18, 2020
f1961b5
Fix failing test
Aaron1011 Jan 18, 2020
643a708
Unconditionally enable never-type fallback for Crater
Aaron1011 Jan 18, 2020
a81c513
Bail out on inference variables in function arguments
Aaron1011 Jan 19, 2020
9eb803a
Run never-compat post_fallback after errors are reported
Aaron1011 Jan 19, 2020
78a831f
Bail out if errors have occured
Aaron1011 Jan 19, 2020
3aefe61
Never consider built-in constructor fns to be 'questionable'
Aaron1011 Jan 19, 2020
409e8d7
Only skip fallback when errors have been reported in the same function
Aaron1011 Jan 19, 2020
39af896
Update test output
Aaron1011 Jan 19, 2020
c82ea60
Add explicit type annotations for `vec.push(break)` test
Aaron1011 Jan 19, 2020
fe77a00
Properly handle missing divering/regular inference variables
Aaron1011 Jan 26, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Only skip fallback when errors have been reported in the same function
  • Loading branch information
Aaron1011 committed Jan 19, 2020
commit 409e8d71a9a12225f8fee6a80b0d795c34e3d2e3
17 changes: 11 additions & 6 deletions 17 src/librustc_typeck/check/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1164,11 +1164,12 @@ fn typeck_tables_of_with_fallback<'tcx>(
fcx.require_type_is_sized(ty, span, code);
}

fcx.select_all_obligations_or_error();

// Report other errors in preference to never-type
// fallback errors.
never_compat.post_fallback(&fcx);
if !fcx.select_all_obligations_or_error() {
// If we just reported some errors, don't run
// never-type fallbakc - inference variables may
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

*fallback

// be in a weird state, leading to spurious errors
never_compat.post_fallback(&fcx);
}

if fn_decl.is_some() {
fcx.regionck_fn(id, body);
Expand Down Expand Up @@ -3473,10 +3474,14 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
true
}

fn select_all_obligations_or_error(&self) {
/// Returns whether or not errors were reported
fn select_all_obligations_or_error(&self) -> bool {
debug!("select_all_obligations_or_error");
if let Err(errors) = self.fulfillment_cx.borrow_mut().select_all_or_error(&self) {
self.report_fulfillment_errors(&errors, self.inh.body_id, false);
true
} else {
false
}
}

Expand Down
5 changes: 0 additions & 5 deletions 5 src/librustc_typeck/check/never_compat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -404,11 +404,6 @@ impl<'tcx> NeverCompatHandler<'tcx> {
/// We look for any "questionable" calls, generating diagnostic
/// message for them.
pub fn post_fallback(self, fcx: &FnCtxt<'a, 'tcx>) {
if fcx.tcx.sess.has_errors() {
debug!("post_fallback: sess has errors, bailing out");
return;
}

let tcx = fcx.tcx;
for (call_id, path) in &self.unresolved_paths {
debug!(
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.