Skip to content

Commit c92a8e4

Browse files
committed
Auto merge of #127311 - oli-obk:do_not_count_errors, r=compiler-errors
Avoid follow-up errors and ICEs after missing lifetime errors on data structures Tuple struct constructors are functions, so when we call them typeck will use the signature tuple struct constructor function to provide type hints. Since typeck mostly ignores and erases lifetimes, we end up never seeing the error lifetime in writeback, thus not tainting the typeck result. Now, we eagerly taint typeck results by tainting from `resolve_vars_if_possible`, which is called all over the place. I did not carry over all the `crashes` test suite tests, as they are really all the same cause (missing or unknown lifetime names in tuple struct definitions or generic arg lists). fixes #124262 fixes #124083 fixes #125155 fixes #125888 fixes #125992 fixes #126666 fixes #126648 fixes #127268 fixes #127266 fixes #127304
2 parents fdf7ea6 + dce98c5 commit c92a8e4

22 files changed

+37
-211
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ build/
5050
/target
5151
/src/bootstrap/target
5252
/src/tools/x/target
53+
/inc-fat/
5354
# Created by default with `src/ci/docker/run.sh`
5455
/obj/
5556
/rustc-ice*

compiler/rustc_infer/src/infer/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1264,6 +1264,9 @@ impl<'tcx> InferCtxt<'tcx> {
12641264
where
12651265
T: TypeFoldable<TyCtxt<'tcx>>,
12661266
{
1267+
if let Err(guar) = value.error_reported() {
1268+
self.set_tainted_by_errors(guar);
1269+
}
12671270
if !value.has_non_region_infer() {
12681271
return value;
12691272
}

tests/crashes/124083.rs

Lines changed: 0 additions & 9 deletions
This file was deleted.

tests/crashes/124262.rs

Lines changed: 0 additions & 5 deletions
This file was deleted.

tests/crashes/125155.rs

Lines changed: 0 additions & 17 deletions
This file was deleted.

tests/crashes/125888.rs

Lines changed: 0 additions & 17 deletions
This file was deleted.

tests/crashes/125992.rs

Lines changed: 0 additions & 19 deletions
This file was deleted.

tests/crashes/126648.rs

Lines changed: 0 additions & 8 deletions
This file was deleted.

tests/crashes/126666.rs

Lines changed: 0 additions & 18 deletions
This file was deleted.

tests/crashes/127266.rs

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)