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

Placeholder span used when trait uses a HRTB on itself #98786

Closed
CAD97 opened this issue Jul 1, 2022 · 1 comment · Fixed by #98794
Closed

Placeholder span used when trait uses a HRTB on itself #98786

CAD97 opened this issue Jul 1, 2022 · 1 comment · Fixed by #98794
Assignees
Labels
A-diagnostics Area: Messages for errors, warnings, and lints T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@CAD97
Copy link
Contributor

CAD97 commented Jul 1, 2022

Given the following code: [playground]

pub trait Pack<'a> {
    fn pack()
    where
        Self: for<'x> Pack<'x>;
}

The current output is:

error[E0283]: type annotations needed
  |
  = note: cannot satisfy `Self: Pack<'a>`

This should at least point at the Self: for<'x> Pack<'x> bound.

Ideally, this should work. (It's unclear why it shouldn't, given other where Self: work fine.)

@CAD97 CAD97 added A-diagnostics Area: Messages for errors, warnings, and lints T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jul 1, 2022
@compiler-errors compiler-errors self-assigned this Jul 1, 2022
@ChayimFriedman2
Copy link
Contributor

As for the "it should work", see #84435.

@bors bors closed this as completed in 54dde86 Jul 8, 2022
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this issue Dec 13, 2022
…env-2, r=estebank

Highlight conflicting param-env candidates, again

Un-reverts rust-lang#98794 (i.e. reverts rust-lang#99290).

The previous time I attempted to land this PR, it was because of an incremental issue (rust-lang#99233). The repro instructions in the issue is no longer manifest the ICE -- I think it's because this ambiguity code was refactored (I think by `@lcnr)` to no longer store the ambiguities in the fulfillment error, but instead recompute them on the fly.

The main motivation for trying to re-land this is that it fixes rust-lang#105131 by highlighting the root-cause of the issue, which is conflicting param-env candidates:

```
error[E0283]: type annotations needed: cannot satisfy `Self: Gen<'source>`
   |
note: multiple `impl`s or `where` clauses satisfying `Self: Gen<'source>` found
  --> $DIR/conflicting-bounds.rs:3:1
   |
LL | pub trait Gen<'source> {
   | ^^^^^^^^^^^^^^^^^^^^^^
...
LL |         Self: for<'s> Gen<'s, Output = T>;
   |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to previous error

For more information about this error, try `rustc --explain E0283`.
```

Fixes rust-lang#105131.
Fixes (again) rust-lang#98786
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this issue Dec 13, 2022
…env-2, r=estebank

Highlight conflicting param-env candidates, again

Un-reverts rust-lang#98794 (i.e. reverts rust-lang#99290).

The previous time I attempted to land this PR, it was because of an incremental issue (rust-lang#99233). The repro instructions in the issue is no longer manifest the ICE -- I think it's because this ambiguity code was refactored (I think by ``@lcnr)`` to no longer store the ambiguities in the fulfillment error, but instead recompute them on the fly.

The main motivation for trying to re-land this is that it fixes rust-lang#105131 by highlighting the root-cause of the issue, which is conflicting param-env candidates:

```
error[E0283]: type annotations needed: cannot satisfy `Self: Gen<'source>`
   |
note: multiple `impl`s or `where` clauses satisfying `Self: Gen<'source>` found
  --> $DIR/conflicting-bounds.rs:3:1
   |
LL | pub trait Gen<'source> {
   | ^^^^^^^^^^^^^^^^^^^^^^
...
LL |         Self: for<'s> Gen<'s, Output = T>;
   |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to previous error

For more information about this error, try `rustc --explain E0283`.
```

Fixes rust-lang#105131.
Fixes (again) rust-lang#98786
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Dec 14, 2022
…env-2, r=estebank

Highlight conflicting param-env candidates, again

Un-reverts rust-lang#98794 (i.e. reverts rust-lang#99290).

The previous time I attempted to land this PR, it was because of an incremental issue (rust-lang#99233). The repro instructions in the issue is no longer manifest the ICE -- I think it's because this ambiguity code was refactored (I think by `@lcnr)` to no longer store the ambiguities in the fulfillment error, but instead recompute them on the fly.

The main motivation for trying to re-land this is that it fixes rust-lang#105131 by highlighting the root-cause of the issue, which is conflicting param-env candidates:

```
error[E0283]: type annotations needed: cannot satisfy `Self: Gen<'source>`
   |
note: multiple `impl`s or `where` clauses satisfying `Self: Gen<'source>` found
  --> $DIR/conflicting-bounds.rs:3:1
   |
LL | pub trait Gen<'source> {
   | ^^^^^^^^^^^^^^^^^^^^^^
...
LL |         Self: for<'s> Gen<'s, Output = T>;
   |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to previous error

For more information about this error, try `rustc --explain E0283`.
```

Fixes rust-lang#105131.
Fixes (again) rust-lang#98786
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Dec 14, 2022
…env-2, r=estebank

Highlight conflicting param-env candidates, again

Un-reverts rust-lang#98794 (i.e. reverts rust-lang#99290).

The previous time I attempted to land this PR, it was because of an incremental issue (rust-lang#99233). The repro instructions in the issue is no longer manifest the ICE -- I think it's because this ambiguity code was refactored (I think by ``@lcnr)`` to no longer store the ambiguities in the fulfillment error, but instead recompute them on the fly.

The main motivation for trying to re-land this is that it fixes rust-lang#105131 by highlighting the root-cause of the issue, which is conflicting param-env candidates:

```
error[E0283]: type annotations needed: cannot satisfy `Self: Gen<'source>`
   |
note: multiple `impl`s or `where` clauses satisfying `Self: Gen<'source>` found
  --> $DIR/conflicting-bounds.rs:3:1
   |
LL | pub trait Gen<'source> {
   | ^^^^^^^^^^^^^^^^^^^^^^
...
LL |         Self: for<'s> Gen<'s, Output = T>;
   |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to previous error

For more information about this error, try `rustc --explain E0283`.
```

Fixes rust-lang#105131.
Fixes (again) rust-lang#98786
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Dec 15, 2022
…env-2, r=estebank

Highlight conflicting param-env candidates, again

Un-reverts rust-lang#98794 (i.e. reverts rust-lang#99290).

The previous time I attempted to land this PR, it was because of an incremental issue (rust-lang#99233). The repro instructions in the issue is no longer manifest the ICE -- I think it's because this ambiguity code was refactored (I think by ```@lcnr)``` to no longer store the ambiguities in the fulfillment error, but instead recompute them on the fly.

The main motivation for trying to re-land this is that it fixes rust-lang#105131 by highlighting the root-cause of the issue, which is conflicting param-env candidates:

```
error[E0283]: type annotations needed: cannot satisfy `Self: Gen<'source>`
   |
note: multiple `impl`s or `where` clauses satisfying `Self: Gen<'source>` found
  --> $DIR/conflicting-bounds.rs:3:1
   |
LL | pub trait Gen<'source> {
   | ^^^^^^^^^^^^^^^^^^^^^^
...
LL |         Self: for<'s> Gen<'s, Output = T>;
   |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to previous error

For more information about this error, try `rustc --explain E0283`.
```

Fixes rust-lang#105131.
Fixes (again) rust-lang#98786
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Dec 15, 2022
…env-2, r=estebank

Highlight conflicting param-env candidates, again

Un-reverts rust-lang#98794 (i.e. reverts rust-lang#99290).

The previous time I attempted to land this PR, it was because of an incremental issue (rust-lang#99233). The repro instructions in the issue is no longer manifest the ICE -- I think it's because this ambiguity code was refactored (I think by ````@lcnr)```` to no longer store the ambiguities in the fulfillment error, but instead recompute them on the fly.

The main motivation for trying to re-land this is that it fixes rust-lang#105131 by highlighting the root-cause of the issue, which is conflicting param-env candidates:

```
error[E0283]: type annotations needed: cannot satisfy `Self: Gen<'source>`
   |
note: multiple `impl`s or `where` clauses satisfying `Self: Gen<'source>` found
  --> $DIR/conflicting-bounds.rs:3:1
   |
LL | pub trait Gen<'source> {
   | ^^^^^^^^^^^^^^^^^^^^^^
...
LL |         Self: for<'s> Gen<'s, Output = T>;
   |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to previous error

For more information about this error, try `rustc --explain E0283`.
```

Fixes rust-lang#105131.
Fixes (again) rust-lang#98786
bors added a commit to rust-lang-ci/rust that referenced this issue Dec 15, 2022
…v-2, r=estebank

Highlight conflicting param-env candidates, again

Un-reverts rust-lang#98794 (i.e. reverts rust-lang#99290).

The previous time I attempted to land this PR, it was because of an incremental issue (rust-lang#99233). The repro instructions in the issue is no longer manifest the ICE -- I think it's because this ambiguity code was refactored (I think by `@lcnr)` to no longer store the ambiguities in the fulfillment error, but instead recompute them on the fly.

The main motivation for trying to re-land this is that it fixes rust-lang#105131 by highlighting the root-cause of the issue, which is conflicting param-env candidates:

```
error[E0283]: type annotations needed: cannot satisfy `Self: Gen<'source>`
   |
note: multiple `impl`s or `where` clauses satisfying `Self: Gen<'source>` found
  --> $DIR/conflicting-bounds.rs:3:1
   |
LL | pub trait Gen<'source> {
   | ^^^^^^^^^^^^^^^^^^^^^^
...
LL |         Self: for<'s> Gen<'s, Output = T>;
   |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to previous error

For more information about this error, try `rustc --explain E0283`.
```

Fixes rust-lang#105131.
Fixes (again) rust-lang#98786
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants