]> git.lizzy.rs Git - rust.git/commit
Auto merge of #66104 - yodaldevoid:generic-arg-disambiguation, r=petrochenkov
authorbors <bors@rust-lang.org>
Wed, 20 Nov 2019 03:07:39 +0000 (03:07 +0000)
committerbors <bors@rust-lang.org>
Wed, 20 Nov 2019 03:07:39 +0000 (03:07 +0000)
commitf50d6ea348c2dd7c2f76e35ecde6560d87bb98ec
tree3ee8e88d65463afa48968ad77ffbb859586fb179
parent618b01f9fa0a6b4e7e2ce5b3409abe104b80c4a8
parent0207a15fa14c2c05e33acac1abd4604fce1f346a
Auto merge of #66104 - yodaldevoid:generic-arg-disambiguation, r=petrochenkov

Generic arg disambiguation

Using the tactic suggested by @petrochenkov in https://github.com/rust-lang/rust/issues/60804#issuecomment-516769465 and on [zulip](https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/generic.20argument.20disambiguation), this change checks type arguments to see if they are really incorrectly-parsed const arguments.

it should be noted that `segments.len() == 1 && segments[0].arg.is_none()` was reduced to `segments.len() == 1` as suggested by @petrochenkov in [zulip](https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/generic.20argument.20disambiguation/near/177848002). This change allowed a few more existing tests to have their braces removed.

There are a couple of "problems" with these changes that I should note. First, there was a regression in the error messages found in "src/test/ui/privacy-ns1.rs" and "src/test/ui/privacy-ns1.rs". Second, some braces were unable to be removed from "src/test/ui/const-generics/fn-const-param-infer.rs". Those on line 24 caused the statement to stop equating when removed, and those on line 20 cause a statement that should not equate to produce no error when removed.

I have not looked further into any of these issues yet, though I would be willing to look into them before landing this. I simply wanted to get some other eyes on this before going further.

Fixes #60804

cc @varkor @jplatte