forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Delay specific span_bug() call until abort_if_errors()
An actual typeck error is the cause of many failed compilations but an unrelated bug is being reported instead. It is triggered because a typeck error is presumably not yet identified during compiler execution, which would normally bypass an invariant in the presence of other errors. In this particular situation, we delay the reporting of the bug until abort_if_errors(). Closes rust-lang#23827, closes rust-lang#24356, closes rust-lang#23041, closes rust-lang#22897, closes rust-lang#23966, closes rust-lang#24013, and closes rust-lang#23729
- Loading branch information
Showing
3 changed files
with
50 additions
and
3 deletions.
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,31 @@ | ||
// 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() { } | ||
|
||
// Before these errors would ICE as "cat_expr Errd" because the errors | ||
// were unknown when the bug was triggered. | ||
|
||
fn unconstrained_type() { | ||
[]; | ||
//~^ ERROR cannot determine a type for this expression: unconstrained type | ||
} | ||
|
||
fn invalid_impl_within_scope() { | ||
{ | ||
use std::ops::Deref; | ||
struct Something; | ||
|
||
impl Deref for Something {} | ||
//~^ ERROR not all trait items implemented, missing: `Target`, `deref` | ||
|
||
*Something | ||
}; | ||
} |