Skip to content
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

Delay a good path bug on drop for TypeErrCtxt (instead of a regular delayed bug) #110476

Merged
merged 2 commits into from
Apr 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 1 addition & 2 deletions compiler/rustc_infer/src/infer/error_reporting/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ use rustc_middle::ty::{
self, error::TypeError, List, Region, Ty, TyCtxt, TypeFoldable, TypeSuperVisitable,
TypeVisitable, TypeVisitableExt,
};
use rustc_span::DUMMY_SP;
use rustc_span::{sym, symbol::kw, BytePos, DesugaringKind, Pos, Span};
use rustc_target::spec::abi;
use std::ops::{ControlFlow, Deref};
Expand Down Expand Up @@ -138,7 +137,7 @@ impl Drop for TypeErrCtxt<'_, '_> {
self.infcx
.tcx
.sess
.delay_span_bug(DUMMY_SP, "used a `TypeErrCtxt` without failing compilation");
.delay_good_path_bug("used a `TypeErrCtxt` without raising an error or lint");
}
}
}
Expand Down
5 changes: 4 additions & 1 deletion src/tools/clippy/tests/ui/crashes/ice-5207.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
// Regression test for https://github.com/rust-lang/rust-clippy/issues/5207
// compile-flags: --cap-lints=warn
// ^ for https://github.com/rust-lang/rust-clippy/issues/10645

// Regression test for https://github.com/rust-lang/rust-clippy/issues/5207
#![warn(clippy::future_not_send)]
pub async fn bar<'a, T: 'a>(_: T) {}

fn main() {}
16 changes: 16 additions & 0 deletions src/tools/clippy/tests/ui/crashes/ice-5207.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
warning: future cannot be sent between threads safely
--> $DIR/ice-5207.rs:6:35
|
LL | pub async fn bar<'a, T: 'a>(_: T) {}
| ^ future returned by `bar` is not `Send`
|
note: captured value is not `Send`
--> $DIR/ice-5207.rs:6:29
|
LL | pub async fn bar<'a, T: 'a>(_: T) {}
| ^ has type `T` which is not `Send`
= note: `T` doesn't implement `std::marker::Send`
= note: `-D clippy::future-not-send` implied by `-D warnings`

warning: 1 warning emitted