-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Use more precise span when reporting semicolon hint #13435
Conversation
|
r? |
|
||
fn foo() -> ~str { //~ ERROR not all control paths return a value | ||
format!("Hello {:s}", | ||
"world"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you put this semicolon on its own line, the test will test that it's exactly the semicolon:
format!("Hello {}",
"world")
; //~ NOTE consider removing this semcolon
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm? I don't follow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current test will pass if the span points to the )
or to the "world"
, since it's entirely line-based. By putting the ;
on its own line, then you're testing that exactly the semicolon gets the span.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point.
Comments addressed. r? @huonw |
When reporting "consider removing this semicolon" hint message, the offending semicolon may come from macro call site instead of macro itself. Using the more appropriate span makes the hint more helpful. Closes rust-lang#13428.
When reporting "consider removing this semicolon" hint message, the offending semicolon may come from macro call site instead of macro itself. Using the more appropriate span makes the hint more helpful. Closes #13428.
…re-pt3, r=Veykril Migrate assists to format args captures, part 3 Continuation of rust-lang/rust-analyzer#13379 Migrates: - `inline_call` - `inline_local_variable` - `introduce_named_lifetime` - `merge_match_arms` - `move_from_mod_rs` - `move_guard` - `move_module_to_file` - `move_to_mod_rs` - `number_representation` - `qualify_method_call` - `qualify_path` - `raw_string` - `remove_dbg` - `replace_derive_with_manual_impl` - `replace_or_with_or_else` - `replace_turbofish_with_explicit_type` - `unwrap_tuple` - `wrap_return_type_in_result`
When reporting "consider removing this semicolon" hint message, the
offending semicolon may come from macro call site instead of macro
itself. Using the more appropriate span makes the hint more helpful.
Closes #13428.