Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix SourceAnnotation ranges and refactor to std::fmt::Display #27

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
zbraniecki merged 3 commits into rust-lang:master from zzau13:master
Mar 26, 2020
Merged

Fix SourceAnnotation ranges and refactor to std::fmt::Display #27

zbraniecki merged 3 commits into rust-lang:master from zzau13:master
Mar 26, 2020

Conversation

Copy link
Contributor

@zzau13 zzau13 commented Mar 20, 2020
edited
Loading

In test_i26 what should be the output?
panic or anything other than the label disappearing?

I would panic or even refactor to TryFrom. What you prefer

Fix #26

zbraniecki reacted with heart emoji
Copy link
Contributor

This PR looks awesome! Thank you so much!

for test_i26 I'd panic for now. We can improve fallibility later.

Copy link
Contributor Author

zzau13 commented Mar 20, 2020

Ok, should panic

Copy link
Contributor

Can you mark this PR as draft until you're ready for review? I'm excited to review it :)

Copy link
Contributor Author

zzau13 commented Mar 21, 2020

It seems that the coverage is not correct.
Exactly tests/fixtures/no-color/multiline_annotation.yaml.

In the report details:

thread 'test_fixtures' panicked at 'SourceAnnotation range `(23, 786)` is bigger than source length `766`', src/display_list/from_snippet.rs:190:9

So I think there are more bugs. So I will review that part of the logic.

@zzau13 zzau13 changed the title (削除) [WIP] Undefined behaviour and minor issues (削除ここまで) (追記) Fix SourceAnnotation ranges and refactor to std::fmt::Display (追記ここまで) Mar 22, 2020
Copy link
Contributor Author

zzau13 commented Mar 22, 2020
edited
Loading

Should already be presentable and debb3e2 doubles performance

@zbraniecki zbraniecki self-requested a review March 22, 2020 18:49
Copy link
Contributor

@zbraniecki zbraniecki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall - very impressive! Thank you! The patch looks great and is definitely a significant clean up!

Several leftovers:

  • the format example crashes, fix the second annotation to (21,724) (I assume the new values are a fix to calculations)
  • same with the bench
  • your branch seem to have broken color mode - cargo run --example format --features color.

Copy link
Contributor Author

zzau13 commented Mar 25, 2020
edited
Loading

The changes are already there.

A detail is that the ranges are start at 0, it should start at 1.
We would have to put much more coverage.

Well but for this PR there is already enough,

zbraniecki reacted with heart emoji

@zzau13 zzau13 requested a review from zbraniecki March 25, 2020 18:38
@zbraniecki zbraniecki merged commit 80ea580 into rust-lang:master Mar 26, 2020
Copy link
Contributor

Thank you! This looks awesome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers
1 more reviewer

@zbraniecki zbraniecki zbraniecki approved these changes

Reviewers whose approvals may not affect merge requirements
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Error from Snippet to DisplayList

AltStyle によって変換されたページ (->オリジナル) /