bjorn3
d33140d2dc
Make rustc_parse_format compile on stable
...
This allows it to be used by lightweight formatting systems and may
allow it to be used by rust-analyzer.
2022-05-03 11:26:58 +02:00
Vadim Petrochenkov
2733ec1be3
rustc_ast: Harmonize delimiter naming with proc_macro::Delimiter
2022-04-28 10:04:29 +03:00
Amanieu d'Antras
dc345d8bff
Reimplement lowering of sym operands for asm! so that it also works with global_asm!
2022-04-14 15:32:03 +01:00
Eduard-Mihai Burtescu
b7e95dee65
rustc_errors: let DiagnosticBuilder::emit
return a "guarantee of emission".
2022-02-23 06:38:52 +00:00
Chayim Refael Friedman
91adb6ccd6
Correctly mark the span of captured arguments in format_args!()
...
It should only include the identifier, or misspelling suggestions will be wrong.
2022-02-16 07:34:06 +00:00
bors
a34c079752
Auto merge of #92816 - tmiasko:rm-llvm-asm, r=Amanieu
...
Remove deprecated LLVM-style inline assembly
The `llvm_asm!` was deprecated back in #87590 1.56.0, with intention to remove
it once `asm!` was stabilized, which already happened in #91728 1.59.0. Now it
is time to remove `llvm_asm!` to avoid continued maintenance cost.
Closes #70173 .
Closes #92794 .
Closes #87612 .
Closes #82065 .
cc `@rust-lang/wg-inline-asm`
r? `@Amanieu`
2022-01-17 09:40:29 +00:00
Tomasz Miąsko
000b36c505
Remove deprecated LLVM-style inline assembly
2022-01-12 18:51:31 +01:00
Yacin Tmimi
11bea2681c
Update AsmArgs field visibility for rustfmt
...
To more easily allow rustfmt to format the asm! macro as specified in
rust-dev-tools/fmt-rfcs#152 certain fields are made public.
2022-01-10 22:38:15 -05:00
Caleb Cartwright
63c2edefda
rustc_builtin_macros: make asm mod public for rustfmt
2021-12-21 11:52:40 -06:00
bors
a41a6925ba
Auto merge of #91957 - nnethercote:rm-SymbolStr, r=oli-obk
...
Remove `SymbolStr`
This was originally proposed in https://github.com/rust-lang/rust/pull/74554#discussion_r466203544 . As well as removing the icky `SymbolStr` type, it allows the removal of a lot of `&` and `*` occurrences.
Best reviewed one commit at a time.
r? `@oli-obk`
2021-12-19 09:31:37 +00:00
Caleb Cartwright
78a8e0092f
builtin_macros: allow external consumers for AsmArgs parsing
2021-12-16 18:40:38 -06:00
Nicholas Nethercote
056d48a2c9
Remove unnecessary sigils around Symbol::as_str()
calls.
2021-12-15 17:32:14 +11:00
Amanieu d'Antras
b3a55371a7
Remove automatic rustfix of asm! to llvm_asm!
...
This no longer works now that asm! needs an explicit import. Also, it's
been over a year since asm! landed, everyone should have transitioned by
now.
2021-12-12 11:20:03 +00:00
est31
15de4cbc4b
Remove redundant [..]s
2021-12-09 00:01:29 +01:00
Amanieu d'Antras
940b2eabad
Add initial AST and MIR support for unwinding from inline assembly
2021-12-03 23:51:46 +01:00
asquared31415
b233d3b5da
Add support for specifying multiple clobber_abi in asm!
...
Allow multiple clobber_abi in asm
Update docs
Fix aarch64 test
Combine abis
Emit duplicate ABI error, empty ABI list error
multiple clobber_abi
2021-11-10 01:06:03 -05:00
Matthias Krüger
5c454551da
more clippy fixes
2021-11-07 16:59:05 +01:00
Vadim Petrochenkov
a6808335d4
rustc_span: Ident::invalid
-> Ident::empty
...
The equivalent for `Symbol`s was renamed some time ago (`kw::Invalid` -> `kw::Empty`), and it makes sense to do the same thing for `Ident`s.
2021-10-17 23:20:30 +03:00
Jubilee
3af42a897f
Rollup merge of #88209 - Amanieu:asm_in_underscore, r=nagisa
...
Improve error message when _ is used for in/inout asm operands
As suggested by ```@Commeownist``` in https://github.com/rust-lang/rust/issues/72016#issuecomment-903102415 .
2021-09-11 08:23:40 -07:00
Manish Goregaokar
358a018292
Rollup merge of #87441 - ibraheemdev:i-86865, r=cjgillot
...
Emit suggestion when passing byte literal to format macro
Closes #86865
2021-09-10 08:23:15 -07:00
ibraheemdev
f56034ec3e
emit suggestion byte literal is passed to format!
2021-08-31 17:29:42 -04:00
asquared31415
0b81c2eb82
Move named_asm_labels
to a HIR lint
2021-08-24 08:23:58 -04:00
Amanieu d'Antras
4d6bfdec9e
Improve error message when _ is used for in/inout asm operands
2021-08-21 15:47:24 +01:00
bors
85109e257a
Auto merge of #87581 - Amanieu:asm_clobber_abi, r=nagisa
...
Add support for clobber_abi to asm!
This PR adds the `clobber_abi` feature that was proposed in #81092 .
Fixes #81092
cc `@rust-lang/wg-inline-asm`
r? `@nagisa`
2021-08-14 22:29:27 +00:00
Amanieu d'Antras
3fd463a5ca
Add support for clobber_abi to asm!
2021-08-12 12:43:11 +01:00
Amanieu d'Antras
e9fb7bada1
Fix error message typo for pure asm without outputs
2021-08-12 12:42:58 +01:00
asquared31415
51e414ff45
Combine spans into one error, deduplicate code
2021-08-04 17:28:55 -04:00
asquared31415
ae8a1bafc2
Update error message
2021-08-04 13:38:17 -04:00
asquared31415
1ae19b69e8
Fix lint capitalization and ignoring, test with include_str
2021-08-04 13:38:17 -04:00
asquared31415
8e7bbc9e9d
Handle leading colons properly
2021-08-04 13:38:17 -04:00
asquared31415
6f45f62ded
Proper characters in labels, ignore comments
2021-08-04 13:38:17 -04:00
asquared31415
1e1f2194b6
Comment tweaks
2021-08-04 13:38:17 -04:00
asquared31415
75915ad16f
Lint against named asm labels
2021-08-04 13:38:17 -04:00
Aaron Hill
ddd544856e
Compute a better lint_node_id
during expansion
...
When we need to emit a lint at a macro invocation, we currently use the
`NodeId` of its parent definition (e.g. the enclosing function). This
means that any `#[allow]` / `#[deny]` attributes placed 'closer' to the
macro (e.g. on an enclosing block or statement) will have no effect.
This commit computes a better `lint_node_id` in `InvocationCollector`.
When we visit/flat_map an AST node, we assign it a `NodeId` (earlier
than we normally would), and store than `NodeId` in current
`ExpansionData`. When we collect a macro invocation, the current
`lint_node_id` gets cloned along with our `ExpansionData`, allowing it
to be used if we need to emit a lint later on.
This improves the handling of `#[allow]` / `#[deny]` for
`SEMICOLON_IN_EXPRESSIONS_FROM_MACROS` and some `asm!`-related lints.
The 'legacy derive helpers' lint retains its current behavior
(I've inlined the now-removed `lint_node_id` function), since
there isn't an `ExpansionData` readily available.
2021-07-17 23:03:56 -05:00
Amanieu d'Antras
d0443bb7c2
Add a "raw" option for asm! which ignores format string specifiers
2021-06-24 23:42:15 +01:00
Amanieu d'Antras
5918ee4317
Add support for const operands and options to global_asm!
...
On x86, the default syntax is also switched to Intel to match asm!
2021-05-13 22:31:57 +01:00
Amanieu d'Antras
32be124e30
Use AnonConst for asm! constants
2021-04-06 12:35:41 +01:00
Amanieu d'Antras
5dabc80796
Refactor #82270 as lint instead of an error
2021-03-25 13:12:29 +00:00
asquared31415
05ae66607f
Move default inline asm dialect to Session
2021-03-08 12:16:12 -05:00
asquared31415
39dcd01bf5
Take into account target default syntax
2021-02-20 01:17:18 -05:00
asquared31415
12c6a12d62
Emit error when trying to use assembler syntax directives in asm!
2021-02-18 14:27:11 -05:00
Vadim Petrochenkov
219c66c55c
rustc_parse: Make Parser::unexpected
public and use it in built-in macros
2020-10-06 00:23:36 +03:00
Vadim Petrochenkov
299136b9c7
builtin_macros: Fix use of interpolated identifiers in asm!
2020-10-06 00:18:03 +03:00
Vadim Petrochenkov
85ef265dbe
expand: Stop un-interpolating NtIdent
s before passing them to built-in macros
...
This was a big hack, and built-in macros should be able to deal with `NtIdents` in the input by themselves like any other parser code.
2020-09-28 23:10:44 +03:00
mark
9e5f7d5631
mv compiler to compiler/
2020-08-30 18:45:07 +03:00