Skip to content

Stop using the HIR CFG #4523

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

Merged
merged 2 commits into from
Sep 8, 2019
Merged

Conversation

matthewjasper
Copy link
Contributor

@matthewjasper matthewjasper commented Sep 8, 2019

This does slightly change the behavior:

  • Functions with unreachable code don't end up being ignored
  • match guards are counted as +1 for each guard, rather than +1 for each pattern with a guard
  • Or patterns don't add to the complexity

changelog: none

@llogiq
Copy link
Contributor

llogiq commented Sep 8, 2019

Looks good, apart from exceeding the lines limit in cognitive_complexity.stderr. Please either split the ui test into two files or just remove one of the test cases.

@matthewjasper
Copy link
Contributor Author

I've changed the attributes to #[clippy::cognitive_complexity = "1"] to shorten the test output. A complexity of 0 isn't possible in most cases, so this isn't making the test less precise.

@llogiq
Copy link
Contributor

llogiq commented Sep 8, 2019

@bors r+

@bors
Copy link
Contributor

bors commented Sep 8, 2019

📌 Commit 5e7ff6b has been approved by llogiq

@bors
Copy link
Contributor

bors commented Sep 8, 2019

⌛ Testing commit 5e7ff6b with merge efd7340...

bors added a commit that referenced this pull request Sep 8, 2019
Stop using the HIR CFG

This does slightly change the behavior:

* Functions with unreachable code don't end up being ignored
* `match` guards are counted as +1 for each guard, rather than +1 for each pattern with a guard
* Or patterns don't add to the complexity
@llogiq
Copy link
Contributor

llogiq commented Sep 8, 2019

Thanks, @matthewjasper!

@bors
Copy link
Contributor

bors commented Sep 8, 2019

💔 Test failed - checks-travis

@matthiaskrgr
Copy link
Member

matthiaskrgr commented Sep 8, 2019

Oh sorry, I was just about to add a changelog line @matthewjasper
(we were both editing the pr body at the same time)

@matthiaskrgr
Copy link
Member

@bors retry

@bors
Copy link
Contributor

bors commented Sep 8, 2019

⌛ Testing commit 5e7ff6b with merge c0a00f8...

bors added a commit that referenced this pull request Sep 8, 2019
Stop using the HIR CFG

* Functions with unreachable code don't end up being ignored
* `match` guards are counted as +1 for each guard, rather than +1 for each pattern with a guard
* Or patterns don't add to the complexity

changelog: Slightly change the behavior of the `cognitive_complexity` lint
@bors
Copy link
Contributor

bors commented Sep 8, 2019

💔 Test failed - checks-travis

@matthiaskrgr
Copy link
Member

@bors retry

@bors
Copy link
Contributor

bors commented Sep 8, 2019

⌛ Testing commit 5e7ff6b with merge ac0fa4a...

bors added a commit that referenced this pull request Sep 8, 2019
Stop using the HIR CFG

This does slightly change the behavior:

* Functions with unreachable code don't end up being ignored
* `match` guards are counted as +1 for each guard, rather than +1 for each pattern with a guard
* Or patterns don't add to the complexity

Changelog: none
@bors
Copy link
Contributor

bors commented Sep 8, 2019

💔 Test failed - checks-travis

@matthiaskrgr
Copy link
Member

s/Changelog/changelog/
@bors retry

@bors
Copy link
Contributor

bors commented Sep 8, 2019

⌛ Testing commit 5e7ff6b with merge d4a48ed...

bors added a commit that referenced this pull request Sep 8, 2019
Stop using the HIR CFG

This does slightly change the behavior:

* Functions with unreachable code don't end up being ignored
* `match` guards are counted as +1 for each guard, rather than +1 for each pattern with a guard
* Or patterns don't add to the complexity

changelog: none
@bors
Copy link
Contributor

bors commented Sep 8, 2019

☀️ Test successful - checks-travis, status-appveyor
Approved by: llogiq
Pushing d4a48ed to master...

@bors bors merged commit 5e7ff6b into rust-lang:master Sep 8, 2019
@bors bors mentioned this pull request Sep 8, 2019
5 tasks
@matthewjasper matthewjasper deleted the remove-cfg-usage branch September 19, 2019 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants