Commit Graph

5580 Commits

Author SHA1 Message Date
Maybe Waffle
dc7dc3e74c Implement become expression formatting in rustfmt 2023-06-19 12:54:34 +00:00
Deadbeef
5f9de6bfc9 Recover comments between attrs and generic param
Fixes #5320.
2023-06-11 19:34:36 -05:00
Eric Huss
e903fcdaae Remove rustc-workspace-hack 2023-06-11 19:34:01 -05:00
Matthias Krüger
48e380fa40 Rollup merge of #110989 - jyn514:bug-report-url, r=WaffleLapkin
Make the BUG_REPORT_URL configurable by tools

This greatly simplifies how hard it is to set a custom bug report url; previously tools had to copy
the entire hook implementation.

I haven't changed clippy in case they want to make the change upstream instead of the subtree, but
I'm happy to do so here if the maintainers want - cc ````@rust-lang/clippy````

Fixes https://github.com/rust-lang/rust/issues/109486.
2023-05-06 13:30:04 +02:00
Michael Goulet
8ed5d5de3d Rustfmt support for negative bounds, test 2023-05-02 22:36:25 +00:00
Michael Goulet
8e330f9d5b Make tools happy 2023-05-02 22:36:24 +00:00
bors
ae213e228d Auto merge of #109128 - chenyukang:yukang/remove-type-ascription, r=estebank
Remove type ascription from parser and diagnostics

Mostly based on https://github.com/rust-lang/rust/pull/106826

Part of #101728

r? `@estebank`
2023-05-02 09:41:35 +00:00
jyn
34a71f67d1 Make the BUG_REPORT_URL configurable by tools
This greatly simplifies how hard it is to set a custom bug report url; previously tools had to copy
the entire hook implementation.

- Switch clippy to the new hook

  This also adds a `extra_info` callback so clippy can include its own version number, which differs
  from rustc's.

- Call `install_ice_hook` in rustfmt
2023-05-01 21:44:04 -05:00
bors
4351e50a9e Auto merge of #111036 - RalfJung:miri, r=RalfJung
update Miri

r? `@ghost`
2023-05-01 11:13:49 +00:00
yukang
9d20134a78 remove rustfmt testcase for type ascription 2023-05-01 16:15:17 +08:00
yukang
a74d2d7440 fix tests 2023-05-01 16:15:17 +08:00
Ralf Jung
4eb1b520d5 Merge from rustc 2023-04-30 22:35:29 +02:00
Lukas Markeffsky
a44c7ea592 fix broken markdown 2023-04-27 13:44:17 -05:00
Michael Goulet
6b9c151686 Tweak await span 2023-04-27 17:18:11 +00:00
Ralf Jung
afe34c8443 Merge from rustc 2023-04-22 10:35:35 +02:00
DrMeepster
f4c9b4c26f rustfmt fmt 2023-04-21 08:59:30 -07:00
DrMeepster
ecfdec44df minor tweaks 2023-04-21 02:14:04 -07:00
DrMeepster
84385bff42 offset_of 2023-04-21 02:14:02 -07:00
Ben Kimock
f533800225 Merge from rustc 2023-04-10 07:55:57 -04:00
Oli Scherer
f1781396bf box a bunch of large types 2023-04-04 13:58:50 +00:00
Oli Scherer
3ecb9ed53c Split out ast::ItemKind::Const into its own struct 2023-04-04 09:44:50 +00:00
Oli Scherer
ced3cd8d40 rust-analyzer guided tuple field to named field 2023-04-04 09:44:50 +00:00
Oli Scherer
c2890ec2d7 rust-analyzer guided enum variant structification 2023-04-04 09:44:45 +00:00
Oli Scherer
5effe61a54 Merge from rustc 2023-04-04 08:01:31 +00:00
Greg Jandl
a3b2bfc2db Honor --color option when emitting errors
Fixes issue 5717.
2023-04-01 16:51:30 -04:00
Yacin Tmimi
475396a03c Prevent ICE when calling parse_attribute in parse_cfg_if_inner
Fixes 5728

Previously we were ignoring the diagnostic error, which lead to the ICE.
Now we properly cancel the error.
2023-04-01 13:21:12 -05:00
Guillaume Gomez
5cbb08db00 Rollup merge of #109354 - Swatinem:rm-closureid, r=compiler-errors
Remove the `NodeId` of `ast::ExprKind::Async`

This is a followup to https://github.com/rust-lang/rust/pull/104833#pullrequestreview-1314537416.

In my original attempt, I was using `LoweringContext::expr`, which was not correct as it creates a fresh `DefId`.
It now uses the correct `DefId` for the wrapping `Expr`, and also makes forwarding `#[track_caller]` attributes more explicit.
2023-03-27 18:56:19 +02:00
Oli Scherer
9510f7eb2c Merge from rustc 2023-03-23 07:33:19 +00:00
Vadim Petrochenkov
809dd77b80 rustc: Remove unused Session argument from some attribute functions 2023-03-22 13:55:55 +04:00
Arpad Borsos
3ef194c14c Remove the NodeId of ast::ExprKind::Async 2023-03-19 19:01:31 +01:00
clubby789
4e658cc01e Remove box_syntax from AST and use in tools 2023-03-12 13:19:46 +00:00
clubby789
a5ba6e025f Remove uses of box_syntax in rustc and tools 2023-03-12 13:19:46 +00:00
David Wood
386ea3770f various: translation resources from cg backend
Extend `CodegenBackend` trait with a function returning the translation
resources from the codegen backend, which can be added to the complete
list of resources provided to the emitter.

Signed-off-by: David Wood <david.wood@huawei.com>
2023-02-22 09:15:54 +00:00
David Wood
8b7f8116d6 errors: generate typed identifiers in each crate
Instead of loading the Fluent resources for every crate in
`rustc_error_messages`, each crate generates typed identifiers for its
own diagnostics and creates a static which are pulled together in the
`rustc_driver` crate and provided to the diagnostic emitter.

Signed-off-by: David Wood <david.wood@huawei.com>
2023-02-22 09:15:53 +00:00
Nicholas Nethercote
01ed9ddf0e Use ThinVec in a few more AST types. 2023-02-21 11:51:56 +11:00
Nicholas Nethercote
23007fc9e4 Use ThinVec in ast::Block. 2023-02-21 11:51:56 +11:00
Nicholas Nethercote
af75a2f7f1 Use ThinVec in various AST types.
This commit changes the sequence parsers to produce `ThinVec`, which
triggers numerous conversions.
2023-02-21 11:51:56 +11:00
Caleb Cartwright
34f9ca28f2 fix: use correct span for struct generics 2023-02-16 00:03:36 -05:00
Esteban Küber
24f4ecec25 Introduce -Zterminal-urls to use OSC8 for error codes
Terminals supporting the OSC8 Hyperlink Extension can support inline
anchors where the text is user defineable but clicking on it opens a
browser to a specified URLs, just like `<a href="URL">` does in HTML.

https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda
2023-02-09 14:52:54 +00:00
Nicholas Nethercote
c6b822d855 Rename Cursor/CursorRef as TokenTreeCursor/RefTokenTreeCursor.
This makes it clear they return token trees, and makes for a nice
comparison against `TokenCursor` which returns tokens.
2023-02-03 10:06:52 +11:00
Rajiv Sharma
5391847ea5 Fix #5488 - prevent shorthand init for tuple struct
Closes #5488

Fix for #5488. Before applying shorthand initialization for structs,
check if identifier is a literal (e.g. tuple struct). If yes, then do
not apply short hand initialization.

Added test case to validate the changes for the fix.
2023-02-01 21:33:19 -06:00
Thaqib
e2996a807b
Lists doc comments fix4041 (#5560)
* add + start of an itemized line

* add test

* fix format

* fix tests

* update doc comment
2023-02-01 21:26:12 -06:00
Wim Looman
3f36c997bf Test that with all comment wrapping disabled table comments are not wrapped 2023-01-29 16:47:06 -06:00
Wim Looman
cdd0b56071 Test that both table headers and values are not wrapped 2023-01-29 16:47:06 -06:00
Wim Looman
368a63305c Fix typo 2023-01-29 16:47:06 -06:00
Ayaz Hafiz
846662cdb3 Don't wrap comments that are part of a table
Closes #4210
2023-01-29 16:47:06 -06:00
Yuki Okushi
fb1a223eba
Remove use of actions-rs (#5571)
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2023-01-29 16:45:26 -06:00
Yuki Okushi
9cc0af5407
Remove old CI config (#5572)
* Remove old CI config

Signed-off-by: Yuki Okushi <jtitor@2k36.org>

* Replace outdated badges

Signed-off-by: Yuki Okushi <jtitor@2k36.org>

---------

Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2023-01-29 16:44:58 -06:00
Tom French
61d82acf53
refactor: fix typo in comment (#5581) 2023-01-29 16:43:40 -06:00
David Bar-On
b08130c590
Fix #5234 - handling of empty code block (#5601) 2023-01-29 12:55:14 -06:00