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