Keep track of the start of the argument block of a closure#104199
Keep track of the start of the argument block of a closure#104199bors merged 1 commit intorust-lang:masterfrom
Conversation
|
Some changes occurred in src/tools/clippy cc @rust-lang/clippy Some changes occurred in src/tools/rustfmt cc @rust-lang/rustfmt |
Yes this will almost certainly be problematic (especially looking at the diff to the rustfmt source) and should be reverted |
8e10fa7 to
591a2fe
Compare
|
@calebcartwright I removed the formatting. |
|
☔ The latest upstream changes (presumably #101562) made this pull request unmergeable. Please resolve the merge conflicts. |
591a2fe to
1247ce6
Compare
|
☔ The latest upstream changes (presumably #104776) made this pull request unmergeable. Please resolve the merge conflicts. |
1247ce6 to
2db3f64
Compare
compiler/rustc_ast/src/ast.rs
Outdated
There was a problem hiding this comment.
Could you correct the comment to mention it contains the eventual move too?
compiler/rustc_ast/src/ast.rs
Outdated
There was a problem hiding this comment.
Could you add a comment?
Should we just have a span for move || -> ty and one for just ||?
Like fn_arg_span you made for HIR.
There was a problem hiding this comment.
I wrote this before #101562 to try to minimize the size of ast::Expr. Now that ast::Closure is boxed inside ast::Expr I agree changing this to the span of |...| will be better.
There was a problem hiding this comment.
This span comes from a desugaring, nothing corresponds to the arguments.
There was a problem hiding this comment.
Made the hir::Closure::fn_arg_span Option<Span> to better represent this
2db3f64 to
8f705e2
Compare
|
Thanks @SarthakSingh31. |
…iaskrgr Rollup of 9 pull requests Successful merges: - rust-lang#104199 (Keep track of the start of the argument block of a closure) - rust-lang#105050 (Remove useless borrows and derefs) - rust-lang#105153 (Create a hacky fail-fast mode that stops tests at the first failure) - rust-lang#105164 (Restore `use` suggestion for `dyn` method call requiring `Sized`) - rust-lang#105193 (Disable coverage instrumentation for naked functions) - rust-lang#105200 (Remove useless filter in unused extern crate check.) - rust-lang#105201 (Do not call fn_sig on non-functions.) - rust-lang#105208 (Add AmbiguityError for inconsistent resolution for an import) - rust-lang#105214 (update Miri) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
…gillot Keep track of the start of the argument block of a closure This removes a call to `tcx.sess.source_map()` from [compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs](https://github.com/rust-lang/rust/compare/master...SarthakSingh31:issue-97417-1?expand=1#diff-8406bbc0d0b43d84c91b1933305df896ecdba0d1f9269e6744f13d87a2ab268a) as required by rust-lang#97417. VsCode automatically applied `rustfmt` to the files I edited under `src/tools`. I can undo that if its a problem. r? `@cjgillot`
…iaskrgr Rollup of 9 pull requests Successful merges: - rust-lang#104199 (Keep track of the start of the argument block of a closure) - rust-lang#105050 (Remove useless borrows and derefs) - rust-lang#105153 (Create a hacky fail-fast mode that stops tests at the first failure) - rust-lang#105164 (Restore `use` suggestion for `dyn` method call requiring `Sized`) - rust-lang#105193 (Disable coverage instrumentation for naked functions) - rust-lang#105200 (Remove useless filter in unused extern crate check.) - rust-lang#105201 (Do not call fn_sig on non-functions.) - rust-lang#105208 (Add AmbiguityError for inconsistent resolution for an import) - rust-lang#105214 (update Miri) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
…gillot Keep track of the start of the argument block of a closure This removes a call to `tcx.sess.source_map()` from [compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs](https://github.com/rust-lang/rust/compare/master...SarthakSingh31:issue-97417-1?expand=1#diff-8406bbc0d0b43d84c91b1933305df896ecdba0d1f9269e6744f13d87a2ab268a) as required by rust-lang#97417. VsCode automatically applied `rustfmt` to the files I edited under `src/tools`. I can undo that if its a problem. r? `@cjgillot`
This removes a call to
tcx.sess.source_map()from compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs as required by #97417.VsCode automatically applied
rustfmtto the files I edited undersrc/tools. I can undo that if its a problem.r? @cjgillot