-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
async fn presence affects an unrelated error message #66312
Comments
Nominating because:
This might indicate a quite serious bug in the compiler. |
I would suggest stable- and beta-nominating the fix for this PR; it seems like this could warrant a point release. cc @rust-lang/release @rust-lang/lang |
@rustbot modify labels: beta-nominated stable-nominated |
Phew; looks like precedence works correctly in non-error code at least: trait Test {
fn is_some(&self) -> u8;
}
impl<T> Test for Option<T> {
fn is_some(&self) -> u8 {
self.is_some() as u8
}
}
async fn f() {
let x = Some(2);
let _: () = x.is_some(); // type is bool.
} Crisis averted? :) |
unnominating for back ports; we don't backport nominate issues, just Pull Requests. |
I managed to get similar symptoms without async but with #![feature(arbitrary_self_types)]
trait Test<T: core::ops::Deref<Target = Self>> {
fn is_some(self: T);
}
fn f() {
let x = Some(2);
if x.is_some() {
println!("Some");
}
}
|
I am 99% sure that the diagnosis I posted on #67651 also applies here. |
The async case is fixed by #68884, I think we should break out the arbitrary self types case into a distinct bug. |
Add test for rust-lang#66312 Closes rust-lang#66312. This issue was fixed by rust-lang#68884. r? @Zoxc
Add test for rust-lang#66312 Closes rust-lang#66312. This issue was fixed by rust-lang#68884. r? @Zoxc
Add test for rust-lang#66312 Closes rust-lang#66312. This issue was fixed by rust-lang#68884. r? @Zoxc
Rollup of 7 pull requests Successful merges: - rust-lang#70331 (Increase verbosity when using update syntax with private fields) - rust-lang#70349 (move `hir_id_validation` to `rustc_passes` + simplify `hir::map` code) - rust-lang#70361 (Update backtrace crate to 0.3.46) - rust-lang#70364 (resolve: Remove `rustc_attrs` as a standalone feature gate) - rust-lang#70369 (Fix smaller issues with invalid placeholder type errors) - rust-lang#70373 (normalize some imports & prefer direct ones) - rust-lang#70376 (Add test for rust-lang#66312) Failed merges: r? @ghost
The following code
produces an expected error:
If I make
f
async,the original error is replaced with this:
Meta
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: