Skip to content

regression: error: path separator must be a double colon (in where clause) #140227

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

Closed
cuviper opened this issue Apr 23, 2025 · 6 comments
Closed
Assignees
Labels
A-parser Area: The lexing & parsing of Rust source code to an AST C-bug Category: This is a bug. P-critical Critical priority regression-from-stable-to-beta Performance or correctness regression from stable to beta. S-has-bisection Status: a bisection has been found for this issue S-has-mcve Status: A Minimal Complete and Verifiable Example has been found for this issue T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Milestone

Comments

@cuviper
Copy link
Member

cuviper commented Apr 23, 2025

[INFO] [stdout] error: path separator must be a double colon
[INFO] [stdout]   --> src/lib.rs:68:12
[INFO] [stdout]    |
[INFO] [stdout] 68 |     where a:AsRef<str>{
[INFO] [stdout]    |            ^
[INFO] [stdout]    |
[INFO] [stdout] help: use a double colon instead
[INFO] [stdout]    |
[INFO] [stdout] 68 |     where a::AsRef<str>{
[INFO] [stdout]    |             +

Version it worked on

It most recently worked on: 1.86.0

Version with regression

rustc 1.87.0-beta.5 (386abeb93 2025-04-19) in crater #139827.

@rustbot modify labels: +regression-from-stable-to-beta -regression-untriaged

@cuviper cuviper added C-bug Category: This is a bug. regression-untriaged Untriaged performance or correctness regression. labels Apr 23, 2025
@cuviper cuviper added this to the 1.87.0 milestone Apr 23, 2025
@rustbot rustbot added I-prioritize Issue: Indicates that prioritization has been requested for this issue. needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. regression-from-stable-to-beta Performance or correctness regression from stable to beta. and removed regression-untriaged Untriaged performance or correctness regression. labels Apr 23, 2025
@cuviper
Copy link
Member Author

cuviper commented Apr 23, 2025

I minimized it to this example:

pub fn upper<T>() where T:Copy {}
pub fn lower<t>() where t:Copy {}

The upper is fine, but lower gives the error. It's also fine if you add a space, where t: Copy.

On nightly, it also mentions type ascription:

error: path separator must be a double colon
 --> src/lib.rs:2:26
  |
2 | pub fn lower<t>() where t:Copy {}
  |                          ^
  |
  = note: if you meant to annotate an expression with a type, the type ascription syntax has been removed, see issue #101728 <https://github.com/rust-lang/rust/issues/101728>
help: use a double colon instead
  |
2 | pub fn lower<t>() where t::Copy {}
  |                           +

edit: that was with rustc 1.88.0-nightly (78f2104e3 2025-04-16), but not after I updated to 6bc57c6bf 2025-04-22.

@fmease fmease added S-has-mcve Status: A Minimal Complete and Verifiable Example has been found for this issue A-parser Area: The lexing & parsing of Rust source code to an AST labels Apr 23, 2025
@fmease fmease self-assigned this Apr 23, 2025
@fmease fmease added E-needs-bisection Call for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Apr 23, 2025
@cuviper cuviper changed the title regression: error: path separator must be a double colon (in where clause regression: error: path separator must be a double colon (in where clause) Apr 23, 2025
@fmease fmease added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Apr 23, 2025
@fmease
Copy link
Member

fmease commented Apr 23, 2025

Regressed in commit 500a686 (PR #136808)

@fmease fmease added S-has-bisection Status: a bisection has been found for this issue and removed E-needs-bisection Call for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc labels Apr 23, 2025
@fmease
Copy link
Member

fmease commented Apr 23, 2025

Also regressed:

fn f<t>(_: impl a<t:u>) {}

trait a { type t; }
trait u {}

@cuviper
Copy link
Member Author

cuviper commented Apr 23, 2025

To be clear, all of those also warn that you should use CamelCase, but that's a style lint, not a language requirement.

@apiraino
Copy link
Contributor

Assigning priority (discussion on Zulip).

@rustbot label -I-prioritize +P-critical

@rustbot rustbot added P-critical Critical priority and removed I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Apr 24, 2025
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Apr 24, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
…covery, r=jieyouxu

Revert overzealous parse recovery for single colons in paths

Basically manually reverts rust-lang#136808, cc `@chenyukang` `@estebank.`

Reopens rust-lang#129273.
Fixes [after beta backport] rust-lang#140227.
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Apr 24, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
…covery, r=jieyouxu

Revert overzealous parse recovery for single colons in paths

Basically manually reverts rust-lang#136808, cc ``@chenyukang`` ``@estebank.``

Reopens rust-lang#129273.
Fixes [after beta backport] rust-lang#140227.
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Apr 24, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Rollup merge of rust-lang#140228 - fmease:revert-overzealous-colon-recovery, r=jieyouxu

Revert overzealous parse recovery for single colons in paths

Basically manually reverts rust-lang#136808, cc ``@chenyukang`` ``@estebank.``

Reopens rust-lang#129273.
Fixes [after beta backport] rust-lang#140227.
@fmease
Copy link
Member

fmease commented Apr 28, 2025

Fixed in #140228.
Backported in #140269.

@fmease fmease closed this as completed Apr 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-parser Area: The lexing & parsing of Rust source code to an AST C-bug Category: This is a bug. P-critical Critical priority regression-from-stable-to-beta Performance or correctness regression from stable to beta. S-has-bisection Status: a bisection has been found for this issue S-has-mcve Status: A Minimal Complete and Verifiable Example has been found for this issue T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

4 participants