Commit Graph

5566 Commits

Author SHA1 Message Date
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
amab8901
bcfc57ec8a
added tests (#5619) 2023-01-28 15:18:52 -06:00
Arthur Carcano
567bd97723
Document which comments are excluded from wrapping (#5637)
* Document which comments are excluded from wrapping

Cf: https://github.com/rust-lang/rustfmt/issues/5634

* Add examples in wrap_commments doc

* fix failling tests
2023-01-28 15:16:46 -06:00
bors
6d133152f8 Auto merge of #106745 - m-ou-se:format-args-ast, r=oli-obk
Move format_args!() into AST (and expand it during AST lowering)

Implements https://github.com/rust-lang/compiler-team/issues/541

This moves FormatArgs from rustc_builtin_macros to rustc_ast_lowering. For now, the end result is the same. But this allows for future changes to do smarter things with format_args!(). It also allows Clippy to directly access the ast::FormatArgs, making things a lot easier.

This change turns the format args types into lang items. The builtin macro used to refer to them by their path. After this change, the path is no longer relevant, making it easier to make changes in `core`.

This updates clippy to use the new language items, but this doesn't yet make clippy use the ast::FormatArgs structure that's now available. That should be done after this is merged.
2023-01-26 12:44:47 +00:00
Matthias Krüger
1d9afb285f Rollup merge of #106960 - estebank:parse-anon-enums, r=cjgillot
Teach parser to understand fake anonymous enum syntax

Parse `Ty | OtherTy` in function argument and return types.
Parse type ascription in top level patterns.

Minimally address #100741.
2023-01-26 06:15:24 +01:00
Caleb Cartwright
094b7f599c Merge commit '1d8491b120223272b13451fc81265aa64f7f4d5b' into sync-from-rustfmt 2023-01-24 14:16:03 -06:00
Caleb Cartwright
1d8491b120 chore: prep v1.5.2 release 2023-01-24 14:04:12 -06:00
Caleb Cartwright
5139b14620 fix: version gate changes for multiline single generic bound 2023-01-24 11:38:44 -06:00
Caleb Cartwright
6eeb4fd230
Merge pull request #5670 from calebcartwright/subtree-sync-2023-01-24
Subtree sync 2023-01-24
2023-01-23 22:13:01 -06:00
Caleb Cartwright
18dd0757db chore: bump toolchain 2023-01-23 21:44:03 -06:00
Caleb Cartwright
e7d87ad61d Merge remote-tracking branch 'upstream/master' into subtree-sync-2023-01-24 2023-01-23 21:19:31 -06:00
Esteban Küber
4e3ed18e1d review comment: Remove AST AnonTy 2023-01-23 18:21:08 +00:00
Caleb Cartwright
aae222c974 fix: correct span for structs with const generics 2023-01-23 12:55:02 -05:00
Esteban Küber
2791cc37e6 Teach parser to understand fake anonymous enum syntax
Parse `-> Ty | OtherTy`.
Parse type ascription in top level patterns.
2023-01-17 01:58:32 +00:00
Deadbeef
19c2286d5c parse const closures 2023-01-12 02:28:37 +00:00