rust/src/test/ui/macros
bors 3a7dfda40a Auto merge of #69171 - Amanieu:new-asm, r=nagisa,nikomatsakis
Implement new asm! syntax from RFC 2850

This PR implements the new `asm!` syntax proposed in https://github.com/rust-lang/rfcs/pull/2850.

# Design

A large part of this PR revolves around taking an `asm!` macro invocation and plumbing it through all of the compiler layers down to LLVM codegen. Throughout the various stages, an `InlineAsm` generally consists of 3 components:

- The template string, which is stored as an array of `InlineAsmTemplatePiece`. Each piece represents either a literal or a placeholder for an operand (just like format strings).
```rust
pub enum InlineAsmTemplatePiece {
    String(String),
    Placeholder { operand_idx: usize, modifier: Option<char>, span: Span },
}
```

- The list of operands to the `asm!` (`in`, `[late]out`, `in[late]out`, `sym`, `const`). These are represented differently at each stage of lowering, but follow a common pattern:
  - `in`, `out` and `inout` all have an associated register class (`reg`) or explicit register (`"eax"`).
  - `inout` has 2 forms: one with a single expression that is both read from and written to, and one with two separate expressions for the input and output parts.
  - `out` and `inout` have a `late` flag (`lateout` / `inlateout`) to indicate that the register allocator is allowed to reuse an input register for this output.
  - `out` and the split variant of `inout` allow `_` to be specified for an output, which means that the output is discarded. This is used to allocate scratch registers for assembly code.
  - `sym` is a bit special since it only accepts a path expression, which must point to a `static` or a `fn`.

- The options set at the end of the `asm!` macro. The only one that is particularly of interest to rustc is `NORETURN` which makes `asm!` return `!` instead of `()`.
```rust
bitflags::bitflags! {
    pub struct InlineAsmOptions: u8 {
        const PURE = 1 << 0;
        const NOMEM = 1 << 1;
        const READONLY = 1 << 2;
        const PRESERVES_FLAGS = 1 << 3;
        const NORETURN = 1 << 4;
        const NOSTACK = 1 << 5;
    }
}
```

## AST

`InlineAsm` is represented as an expression in the AST:

```rust
pub struct InlineAsm {
    pub template: Vec<InlineAsmTemplatePiece>,
    pub operands: Vec<(InlineAsmOperand, Span)>,
    pub options: InlineAsmOptions,
}

pub enum InlineAsmRegOrRegClass {
    Reg(Symbol),
    RegClass(Symbol),
}

pub enum InlineAsmOperand {
    In {
        reg: InlineAsmRegOrRegClass,
        expr: P<Expr>,
    },
    Out {
        reg: InlineAsmRegOrRegClass,
        late: bool,
        expr: Option<P<Expr>>,
    },
    InOut {
        reg: InlineAsmRegOrRegClass,
        late: bool,
        expr: P<Expr>,
    },
    SplitInOut {
        reg: InlineAsmRegOrRegClass,
        late: bool,
        in_expr: P<Expr>,
        out_expr: Option<P<Expr>>,
    },
    Const {
        expr: P<Expr>,
    },
    Sym {
        expr: P<Expr>,
    },
}
```

The `asm!` macro is implemented in librustc_builtin_macros and outputs an `InlineAsm` AST node. The template string is parsed using libfmt_macros, positional and named operands are resolved to explicit operand indicies. Since target information is not available to macro invocations, validation of the registers and register classes is deferred to AST lowering.

## HIR

`InlineAsm` is represented as an expression in the HIR:

```rust
pub struct InlineAsm<'hir> {
    pub template: &'hir [InlineAsmTemplatePiece],
    pub operands: &'hir [InlineAsmOperand<'hir>],
    pub options: InlineAsmOptions,
}

pub enum InlineAsmRegOrRegClass {
    Reg(InlineAsmReg),
    RegClass(InlineAsmRegClass),
}

pub enum InlineAsmOperand<'hir> {
    In {
        reg: InlineAsmRegOrRegClass,
        expr: Expr<'hir>,
    },
    Out {
        reg: InlineAsmRegOrRegClass,
        late: bool,
        expr: Option<Expr<'hir>>,
    },
    InOut {
        reg: InlineAsmRegOrRegClass,
        late: bool,
        expr: Expr<'hir>,
    },
    SplitInOut {
        reg: InlineAsmRegOrRegClass,
        late: bool,
        in_expr: Expr<'hir>,
        out_expr: Option<Expr<'hir>>,
    },
    Const {
        expr: Expr<'hir>,
    },
    Sym {
        expr: Expr<'hir>,
    },
}
```

AST lowering is where `InlineAsmRegOrRegClass` is converted from `Symbol`s to an actual register or register class. If any modifiers are specified for a template string placeholder, these are validated against the set allowed for that operand type. Finally, explicit registers for inputs and outputs are checked for conflicts (same register used for different operands).

## Type checking

Each register class has a whitelist of types that it may be used with. After the types of all operands have been determined, the `intrinsicck` pass will check that these types are in the whitelist. It also checks that split `inout` operands have compatible types and that `const` operands are integers or floats. Suggestions are emitted where needed if a template modifier should be used for an operand based on the type that was passed into it.

## HAIR

`InlineAsm` is represented as an expression in the HAIR:

```rust
crate enum ExprKind<'tcx> {
    // [..]
    InlineAsm {
        template: &'tcx [InlineAsmTemplatePiece],
        operands: Vec<InlineAsmOperand<'tcx>>,
        options: InlineAsmOptions,
    },
}
crate enum InlineAsmOperand<'tcx> {
    In {
        reg: InlineAsmRegOrRegClass,
        expr: ExprRef<'tcx>,
    },
    Out {
        reg: InlineAsmRegOrRegClass,
        late: bool,
        expr: Option<ExprRef<'tcx>>,
    },
    InOut {
        reg: InlineAsmRegOrRegClass,
        late: bool,
        expr: ExprRef<'tcx>,
    },
    SplitInOut {
        reg: InlineAsmRegOrRegClass,
        late: bool,
        in_expr: ExprRef<'tcx>,
        out_expr: Option<ExprRef<'tcx>>,
    },
    Const {
        expr: ExprRef<'tcx>,
    },
    SymFn {
        expr: ExprRef<'tcx>,
    },
    SymStatic {
        expr: ExprRef<'tcx>,
    },
}
```

The only significant change compared to HIR is that `Sym` has been lowered to either a `SymFn` whose `expr` is a `Literal` ZST of the `fn`, or a `SymStatic` whose `expr` is a `StaticRef`.

## MIR

`InlineAsm` is represented as a `Terminator` in the MIR:

```rust
pub enum TerminatorKind<'tcx> {
    // [..]

    /// Block ends with an inline assembly block. This is a terminator since
    /// inline assembly is allowed to diverge.
    InlineAsm {
        /// The template for the inline assembly, with placeholders.
        template: &'tcx [InlineAsmTemplatePiece],

        /// The operands for the inline assembly, as `Operand`s or `Place`s.
        operands: Vec<InlineAsmOperand<'tcx>>,

        /// Miscellaneous options for the inline assembly.
        options: InlineAsmOptions,

        /// Destination block after the inline assembly returns, unless it is
        /// diverging (InlineAsmOptions::NORETURN).
        destination: Option<BasicBlock>,
    },
}

pub enum InlineAsmOperand<'tcx> {
    In {
        reg: InlineAsmRegOrRegClass,
        value: Operand<'tcx>,
    },
    Out {
        reg: InlineAsmRegOrRegClass,
        late: bool,
        place: Option<Place<'tcx>>,
    },
    InOut {
        reg: InlineAsmRegOrRegClass,
        late: bool,
        in_value: Operand<'tcx>,
        out_place: Option<Place<'tcx>>,
    },
    Const {
        value: Operand<'tcx>,
    },
    SymFn {
        value: Box<Constant<'tcx>>,
    },
    SymStatic {
        value: Box<Constant<'tcx>>,
    },
}
```

As part of HAIR lowering, `InOut` and `SplitInOut` operands are lowered to a split form with a separate `in_value` and `out_place`.

Semantically, the `InlineAsm` terminator is similar to the `Call` terminator except that it has multiple output places where a `Call` only has a single return place output.

The constant promotion pass is used to ensure that `const` operands are actually constants (using the same logic as `#[rustc_args_required_const]`).

## Codegen

Operands are lowered one more time before being passed to LLVM codegen:

```rust
pub enum InlineAsmOperandRef<'tcx, B: BackendTypes + ?Sized> {
    In {
        reg: InlineAsmRegOrRegClass,
        value: OperandRef<'tcx, B::Value>,
    },
    Out {
        reg: InlineAsmRegOrRegClass,
        late: bool,
        place: Option<PlaceRef<'tcx, B::Value>>,
    },
    InOut {
        reg: InlineAsmRegOrRegClass,
        late: bool,
        in_value: OperandRef<'tcx, B::Value>,
        out_place: Option<PlaceRef<'tcx, B::Value>>,
    },
    Const {
        string: String,
    },
    SymFn {
        instance: Instance<'tcx>,
    },
    SymStatic {
        def_id: DefId,
    },
}
```

The operands are lowered to LLVM operands and constraint codes as follow:
- `out` and the output part of `inout` operands are added first, as required by LLVM. Late output operands have a `=` prefix added to their constraint code, non-late output operands have a `=&` prefix added to their constraint code.
- `in` operands are added normally.
- `inout` operands are tied to the matching output operand.
- `sym` operands are passed as function pointers or pointers, using the `"s"` constraint.
- `const` operands are formatted to a string and directly inserted in the template string.

The template string is converted to LLVM form:
- `$` characters are escaped as `$$`.
- `const` operands are converted to strings and inserted directly.
- Placeholders are formatted as `${X:M}` where `X` is the operand index and `M` is the modifier character. Modifiers are converted from the Rust form to the LLVM form.

The various options are converted to clobber constraints or LLVM attributes, refer to the [RFC](https://github.com/Amanieu/rfcs/blob/inline-asm/text/0000-inline-asm.md#mapping-to-llvm-ir) for more details.

Note that LLVM is sometimes rather picky about what types it accepts for certain constraint codes so we sometimes need to insert conversions to/from a supported type. See the target-specific ISelLowering.cpp files in LLVM for details.

# Adding support for new architectures

Adding inline assembly support to an architecture is mostly a matter of defining the registers and register classes for that architecture. All the definitions for register classes are located in `src/librustc_target/asm/`.

Additionally you will need to implement lowering of these register classes to LLVM constraint codes in `src/librustc_codegen_llvm/asm.rs`.
2020-05-19 18:32:40 +00:00
..
auxiliary Stabilize fn-like proc macros in expression, pattern and statement positions 2020-05-03 19:24:41 +03:00
issue-69838-dir expand_include: set .directory to dir of included file. 2020-03-20 17:39:29 +01:00
macro-expanded-include Add tests for asm! 2020-05-18 14:41:32 +01:00
syntax-extension-source-utils-files tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
ambiguity-legacy-vs-modern.rs resolve: Prefer macro_rules definitions to in-module macro definitions in some cases 2018-10-03 16:12:39 +04:00
ambiguity-legacy-vs-modern.stderr Update tests 2019-03-11 23:10:26 +03:00
assert-as-macro.rs Skip tests on emscripten 2020-05-08 00:39:02 +09:00
assert-eq-macro-panic.rs Skip tests on emscripten 2020-05-08 00:39:02 +09:00
assert-eq-macro-success.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
assert-eq-macro-unsized.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
assert-macro-explicit.rs Skip tests on emscripten 2020-05-08 00:39:02 +09:00
assert-macro-fmt.rs Skip tests on emscripten 2020-05-08 00:39:02 +09:00
assert-macro-owned.rs Skip tests on emscripten 2020-05-08 00:39:02 +09:00
assert-macro-static.rs Skip tests on emscripten 2020-05-08 00:39:02 +09:00
assert-ne-macro-panic.rs Skip tests on emscripten 2020-05-08 00:39:02 +09:00
assert-ne-macro-success.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
assert-ne-macro-unsized.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
assert-trailing-junk.rs Turn trailing tokens in assert!() into hard errors 2020-03-06 22:02:20 +01:00
assert-trailing-junk.stderr Turn trailing tokens in assert!() into hard errors 2020-03-06 22:02:20 +01:00
assert.rs make panictry! private to libsyntax 2019-01-02 11:02:30 -05:00
assert.stderr rustc_macros: don't limit the -Zmacro-backtrace suggestion to extern macros. 2020-02-06 21:46:38 +02:00
bad-concat.rs Remove licenses 2018-12-25 21:08:33 -07:00
bad-concat.stderr Remove licenses 2018-12-25 21:08:33 -07:00
bad_hello.rs Remove licenses 2018-12-25 21:08:33 -07:00
bad_hello.stderr Increase spacing for suggestions in diagnostics 2019-10-24 12:26:01 -07:00
builtin-prelude-no-accidents.rs Give built-in macros stable addresses in the standard library 2019-08-10 00:05:37 +03:00
builtin-prelude-no-accidents.stderr Give built-in macros stable addresses in the standard library 2019-08-10 00:05:37 +03:00
builtin-std-paths-fail.rs Update tests 2020-01-09 21:23:12 +03:00
builtin-std-paths-fail.stderr Update tests 2020-01-09 21:23:12 +03:00
builtin-std-paths.rs Give built-in macros stable addresses in the standard library 2019-08-10 00:05:37 +03:00
cfg.rs make panictry! private to libsyntax 2019-01-02 11:02:30 -05:00
cfg.stderr rustc_macros: don't limit the -Zmacro-backtrace suggestion to extern macros. 2020-02-06 21:46:38 +02:00
colorful-write-macros.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
conditional-debug-macro-on.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
derive-in-eager-expansion-hang.rs Add a regression test for #44692 2019-07-11 00:35:01 +03:00
derive-in-eager-expansion-hang.stderr rustc_macros: don't limit the -Zmacro-backtrace suggestion to extern macros. 2020-02-06 21:46:38 +02:00
die-macro-2.rs Skip tests on emscripten 2020-05-08 00:39:02 +09:00
die-macro-expr.rs Skip tests on emscripten 2020-05-08 00:39:02 +09:00
die-macro-pure.rs Skip tests on emscripten 2020-05-08 00:39:02 +09:00
die-macro.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
dollar-crate-nested-encoding.rs pretty-print: Do not lose the $crate printing flag in print_tt 2019-07-11 12:07:35 +03:00
format-foreign.rs Remove licenses 2018-12-25 21:08:33 -07:00
format-foreign.stderr compiletest: make path normalization smarter 2019-03-25 01:06:45 -04:00
format-parse-errors.rs Specific error for positional args after named args in format!() 2019-07-15 20:51:32 -07:00
format-parse-errors.stderr rustc_macros: don't limit the -Zmacro-backtrace suggestion to extern macros. 2020-02-06 21:46:38 +02:00
format-unused-lables.rs Remove licenses 2018-12-25 21:08:33 -07:00
format-unused-lables.stderr Update tests 2019-03-11 23:10:26 +03:00
global-asm.rs make panictry! private to libsyntax 2019-01-02 11:02:30 -05:00
global-asm.stderr Update tests 2019-03-11 23:10:26 +03:00
issue-25274.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
issue-30143.rs Remove licenses 2018-12-25 21:08:33 -07:00
issue-30143.stderr Increase spacing for suggestions in diagnostics 2019-10-24 12:26:01 -07:00
issue-34421-mac-expr-bad-stmt-good-add-semi.rs suggest semi on expr mac!() good as stmt mac!(). 2020-03-27 07:02:50 +01:00
issue-34421-mac-expr-bad-stmt-good-add-semi.stderr suggest semi on expr mac!() good as stmt mac!(). 2020-03-27 07:02:50 +01:00
issue-54441.rs parse: use parse_item_common in parse_foreign_item. 2020-02-24 00:59:38 +01:00
issue-54441.stderr parse: use parse_item_common in parse_foreign_item. 2020-02-24 00:59:38 +01:00
issue-58490.rs Add test for issue-58490 2020-03-13 16:06:07 +09:00
issue-58490.stderr Add test for issue-58490 2020-03-13 16:06:07 +09:00
issue-61033-1.rs mbe::transcribe: defatalize errors. 2020-03-24 06:28:56 +01:00
issue-61033-1.stderr mbe::transcribe: defatalize errors. 2020-03-24 06:28:56 +01:00
issue-61033-2.rs mbe::transcribe: defatalize errors. 2020-03-24 06:28:56 +01:00
issue-61033-2.stderr mbe::transcribe: defatalize errors. 2020-03-24 06:28:56 +01:00
issue-61053-different-kleene.rs Implement checks for meta-variables in macros 2019-07-19 19:59:12 +02:00
issue-61053-different-kleene.stderr Normalise notes with the/is 2020-01-24 16:24:50 +00:00
issue-61053-duplicate-binder.rs Implement checks for meta-variables in macros 2019-07-19 19:59:12 +02:00
issue-61053-duplicate-binder.stderr Normalise notes with the/is 2020-01-24 16:24:50 +00:00
issue-61053-missing-repetition.rs Implement checks for meta-variables in macros 2019-07-19 19:59:12 +02:00
issue-61053-missing-repetition.stderr Normalise notes with the/is 2020-01-24 16:24:50 +00:00
issue-61053-unbound.rs Implement checks for meta-variables in macros 2019-07-19 19:59:12 +02:00
issue-61053-unbound.stderr Normalise notes with the/is 2020-01-24 16:24:50 +00:00
issue-63102.rs Add check-pass test for #63102. 2019-08-01 22:41:10 +01:00
issue-68058.rs Fix test not to depend on environment 2020-01-11 10:15:54 +09:00
issue-68060.rs rustc: fix check_attr() for methods, closures and foreign functions 2020-04-16 17:23:57 +02:00
issue-68060.stderr Add new tests and bless old tests 2020-05-01 17:32:06 +02:00
issue-69838-mods-relative-to-included-path.rs expand_include: set .directory to dir of included file. 2020-03-20 17:39:29 +01:00
issue-70446.rs macro_rules: NtLifetime cannot start with an identifier 2020-04-04 16:23:43 +03:00
local-ambiguity-multiple-parsing-options.rs defatalize compile_declarative_macro 2020-03-24 06:28:56 +01:00
local-ambiguity-multiple-parsing-options.stderr defatalize compile_declarative_macro 2020-03-24 06:28:56 +01:00
log_syntax-trace_macros-macro-locations.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
log_syntax-trace_macros-macro-locations.stdout tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
macro-2.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
macro-as-fn-body.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
macro-at-most-once-rep-2015-rpass.rs tests: Move run-pass tests with naming conflicts to ui 2019-07-27 18:56:17 +03:00
macro-at-most-once-rep-2015.rs Fix inaccurate comments in '?' Kleene operator tests. 2019-06-09 04:16:34 +02:00
macro-at-most-once-rep-2015.stderr Fix inaccurate comments in '?' Kleene operator tests. 2019-06-09 04:16:34 +02:00
macro-at-most-once-rep-2018-rpass.rs tests: Move run-pass tests with naming conflicts to ui 2019-07-27 18:56:17 +03:00
macro-at-most-once-rep-2018.rs Fix typo in comment. 2019-06-09 04:16:34 +02:00
macro-at-most-once-rep-2018.stderr Fix inaccurate comments in '?' Kleene operator tests. 2019-06-09 04:16:34 +02:00
macro-attribute-expansion.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
macro-attribute.rs Stabilize unrestricted_attribute_tokens 2019-02-25 23:21:54 +03:00
macro-attribute.stderr Move literal parsing code into a separate file 2019-05-11 16:03:16 +03:00
macro-attributes.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
macro-backtrace-invalid-internals.rs Remove licenses 2018-12-25 21:08:33 -07:00
macro-backtrace-invalid-internals.stderr rustc_macros: don't limit the -Zmacro-backtrace suggestion to extern macros. 2020-02-06 21:46:38 +02:00
macro-backtrace-nested.rs Remove licenses 2018-12-25 21:08:33 -07:00
macro-backtrace-nested.stderr rustc_macros: don't limit the -Zmacro-backtrace suggestion to extern macros. 2020-02-06 21:46:38 +02:00
macro-backtrace-println.rs Remove licenses 2018-12-25 21:08:33 -07:00
macro-backtrace-println.stderr rustc_macros: don't limit the -Zmacro-backtrace suggestion to extern macros. 2020-02-06 21:46:38 +02:00
macro-block-nonterminal.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
macro-comma-behavior-rpass.rs Re-enable Emscripten's exception handling support 2019-10-25 15:16:36 -07:00
macro-comma-behavior.core.stderr Remove eh_unwind_resume lang item 2020-03-05 17:36:50 +00:00
macro-comma-behavior.rs Remove eh_unwind_resume lang item 2020-03-05 17:36:50 +00:00
macro-comma-behavior.std.stderr Remove eh_unwind_resume lang item 2020-03-05 17:36:50 +00:00
macro-comma-support-rpass.rs Allow deprecated try macro in test crates 2019-08-09 02:29:44 +00:00
macro-comma-support.rs Remove licenses 2018-12-25 21:08:33 -07:00
macro-comma-support.stderr Update tests 2019-03-11 23:10:26 +03:00
macro-context.rs nix panictry! in ParserAnyMacro::make 2020-03-24 06:28:10 +01:00
macro-context.stderr nix panictry! in ParserAnyMacro::make 2020-03-24 06:28:10 +01:00
macro-crate-def-only.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
macro-crate-nonterminal-non-root.rs Remove licenses 2018-12-25 21:08:33 -07:00
macro-crate-nonterminal-non-root.stderr Update tests 2019-03-11 23:10:26 +03:00
macro-crate-nonterminal-renamed.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
macro-crate-nonterminal.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
macro-crate-use.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
macro-deep_expansion.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
macro-delimiter-significance.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
macro-deprecation.rs Address review comments + Fix rebase 2019-07-07 13:04:07 +03:00
macro-deprecation.stderr rustc: Add a warning count upon completion 2020-04-11 16:15:24 +02:00
macro-doc-comments.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
macro-doc-escapes.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
macro-doc-raw-str-hashes.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
macro-error.rs Remove licenses 2018-12-25 21:08:33 -07:00
macro-error.stderr expand: Merge expand_{bang,attr,derive}_invoc into a single function 2019-07-11 00:12:57 +03:00
macro-expansion-tests.rs Remove licenses 2018-12-25 21:08:33 -07:00
macro-expansion-tests.stderr resolve: Remove ! from "cannot find" diagnostics for macros 2019-09-15 13:22:07 +03:00
macro-export-inner-module.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
macro-first-set.rs syntax: Support modern attribute syntax in the meta matcher 2019-09-30 22:58:22 +03:00
macro-follow-rpass.rs tests: Move run-pass tests with naming conflicts to ui 2019-07-27 18:56:17 +03:00
macro-follow.rs Remove double trailing newlines 2019-04-22 16:57:01 +01:00
macro-follow.stderr Fix typo in Delimited::open_tt 2019-07-27 11:50:09 +02:00
macro-followed-by-seq-bad.rs Remove licenses 2018-12-25 21:08:33 -07:00
macro-followed-by-seq-bad.stderr Update tests 2019-03-11 23:10:26 +03:00
macro-followed-by-seq.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
macro-in-expression-context-2.rs Update ui tests 2018-12-04 10:06:05 +01:00
macro-in-expression-context-2.stderr suggest semi on expr mac!() good as stmt mac!(). 2020-03-27 07:02:50 +01:00
macro-in-expression-context.fixed Modify invalid macro in expression context diagnostic 2018-10-23 10:07:34 -07:00
macro-in-expression-context.rs Modify invalid macro in expression context diagnostic 2018-10-23 10:07:34 -07:00
macro-in-expression-context.stderr Modify invalid macro in expression context diagnostic 2018-10-23 10:07:34 -07:00
macro-in-fn.rs review comments 2019-08-21 16:11:01 -07:00
macro-include-items.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
macro-inner-attributes.rs Introduce #[rustc_dummy] attribute and use it in tests 2019-06-08 23:55:25 +03:00
macro-inner-attributes.stderr Remove licenses 2018-12-25 21:08:33 -07:00
macro-input-future-proofing.rs Remove licenses 2018-12-25 21:08:33 -07:00
macro-input-future-proofing.stderr syntax: Keep full Tokens for macro_rules separators 2019-06-08 20:36:20 +03:00
macro-interpolation.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
macro-invalid-fragment-spec.rs Remove licenses 2018-12-25 21:08:33 -07:00
macro-invalid-fragment-spec.stderr Remove licenses 2018-12-25 21:08:33 -07:00
macro-invocation-in-count-expr-fixed-array-type.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
macro-lifetime-used-with-bound.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
macro-lifetime-used-with-labels.rs Cleaned up unused labels 2019-11-15 16:31:30 -08:00
macro-lifetime-used-with-labels.stderr rustc: Add a warning count upon completion 2020-04-11 16:15:24 +02:00
macro-lifetime-used-with-static.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
macro-lifetime.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
macro-literal.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
macro-local-data-key-priv.rs Remove licenses 2018-12-25 21:08:33 -07:00
macro-local-data-key-priv.stderr Normalize wording of privacy access labels 2020-03-22 15:36:54 -07:00
macro-match-nonterminal.rs generic_extension: defatalize Error case 2020-03-24 06:28:55 +01:00
macro-match-nonterminal.stderr generic_extension: defatalize Error case 2020-03-24 06:28:55 +01:00
macro-meta-items-modern.rs Address review comments 2019-10-01 01:10:12 +03:00
macro-meta-items.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
macro-method-issue-4621.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
macro-missing-delimiters.rs Remove licenses 2018-12-25 21:08:33 -07:00
macro-missing-delimiters.stderr Update tests 2019-03-11 23:10:26 +03:00
macro-missing-fragment.rs Remove licenses 2018-12-25 21:08:33 -07:00
macro-missing-fragment.stderr Update tests 2019-03-11 23:10:26 +03:00
macro-multiple-items.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
macro-multiple-matcher-bindings.rs remove warn 2019-04-11 15:09:43 -05:00
macro-multiple-matcher-bindings.stderr Tweak duplicate matcher binding error 2019-11-25 13:30:52 -08:00
macro-name-typo.rs tests: remove ignore directives from tests that mention core/alloc/std spans. 2020-04-02 11:48:34 +03:00
macro-name-typo.stderr tests: remove ignore directives from tests that mention core/alloc/std spans. 2020-04-02 11:48:34 +03:00
macro-named-default.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
macro-nested_definition_issue-31946.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
macro-nested_expr.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
macro-nested_stmt_macros.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
macro-non-lifetime.rs Remove licenses 2018-12-25 21:08:33 -07:00
macro-non-lifetime.stderr Remove licenses 2018-12-25 21:08:33 -07:00
macro-nt-list.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
macro-of-higher-order.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
macro-outer-attributes.rs Introduce #[rustc_dummy] attribute and use it in tests 2019-06-08 23:55:25 +03:00
macro-outer-attributes.stderr reword "possible candidate" import suggestion 2020-05-07 00:33:25 -04:00
macro-parameter-span.rs Remove licenses 2018-12-25 21:08:33 -07:00
macro-parameter-span.stderr Update tests 2019-03-11 23:10:26 +03:00
macro-pat-follow.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
macro-pat-neg-lit.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
macro-pat.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
macro-path-prelude-fail-1.rs clarify what the item is in "not a module" error 2019-04-10 12:55:21 -04:00
macro-path-prelude-fail-1.stderr clarify what the item is in "not a module" error 2019-04-10 12:55:21 -04:00
macro-path-prelude-fail-2.rs Remove licenses 2018-12-25 21:08:33 -07:00
macro-path-prelude-fail-2.stderr Update tests 2019-03-11 23:10:26 +03:00
macro-path-prelude-fail-3.rs tests: remove ignore directives from tests that mention core/alloc/std spans. 2020-04-02 11:48:34 +03:00
macro-path-prelude-fail-3.stderr tests: remove ignore directives from tests that mention core/alloc/std spans. 2020-04-02 11:48:34 +03:00
macro-path-prelude-fail-4.rs resolve/expand: Catch macro kind mismatches early in resolve 2019-07-11 00:12:08 +03:00
macro-path-prelude-fail-4.stderr resolve/expand: Catch macro kind mismatches early in resolve 2019-07-11 00:12:08 +03:00
macro-path-prelude-pass.rs Make error and warning annotations mandatory in UI tests 2019-11-10 21:01:02 +01:00
macro-path-prelude-shadowing.rs Remove licenses 2018-12-25 21:08:33 -07:00
macro-path-prelude-shadowing.stderr diagnostics: Describe crate root modules in DefKind::Mod as "crate" 2019-08-10 23:17:20 +03:00
macro-path.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
macro-pub-matcher.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
macro-reexport-removed.rs resolve: Tweak "cannot find" wording for attributes 2019-09-15 13:10:12 +03:00
macro-reexport-removed.stderr Tweak removed feature error 2019-11-25 13:30:52 -08:00
macro-seq-followed-by-seq.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
macro-shadowing-relaxed.rs Migrate compile-pass annotations to build-pass 2019-07-03 06:30:28 +09:00
macro-shadowing.rs Remove licenses 2018-12-25 21:08:33 -07:00
macro-shadowing.stderr rustc_macros: don't limit the -Zmacro-backtrace suggestion to extern macros. 2020-02-06 21:46:38 +02:00
macro-stability-rpass.rs Require issue = "none" over issue = "0" in unstable attributes 2019-12-21 13:16:18 +02:00
macro-stability.rs Require issue = "none" over issue = "0" in unstable attributes 2019-12-21 13:16:18 +02:00
macro-stability.stderr rustc: Add a warning count upon completion 2020-04-11 16:15:24 +02:00
macro-stmt-matchers.rs Migrate compile-pass annotations to build-pass 2019-07-03 06:30:28 +09:00
macro-stmt.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
macro-stmt_macro_in_expr_macro.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
macro-tt-followed-by-seq.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
macro-tt-matchers.rs Migrate compile-pass annotations to build-pass 2019-07-03 06:30:28 +09:00
macro-use-all-and-none.rs Make error and warning annotations mandatory in UI tests 2019-11-10 21:01:02 +01:00
macro-use-all-and-none.stderr rustc: Add a warning count upon completion 2020-04-11 16:15:24 +02:00
macro-use-all.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
macro-use-bad-args-1.rs Remove lint annotations in specific crates that are already enforced by rustbuild 2019-07-28 18:46:24 +03:00
macro-use-bad-args-1.stderr Remove lint annotations in specific crates that are already enforced by rustbuild 2019-07-28 18:46:24 +03:00
macro-use-bad-args-2.rs Remove lint annotations in specific crates that are already enforced by rustbuild 2019-07-28 18:46:24 +03:00
macro-use-bad-args-2.stderr Remove lint annotations in specific crates that are already enforced by rustbuild 2019-07-28 18:46:24 +03:00
macro-use-both.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
macro-use-one.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
macro-use-scope.rs Migrate compile-pass annotations to build-pass 2019-07-03 06:30:28 +09:00
macro-use-undef.rs Remove licenses 2018-12-25 21:08:33 -07:00
macro-use-undef.stderr Update tests 2019-03-11 23:10:26 +03:00
macro-use-wrong-name.rs Remove licenses 2018-12-25 21:08:33 -07:00
macro-use-wrong-name.stderr Use def_span to minimize definition span to first line when possible 2020-01-10 11:40:29 -08:00
macro-with-attrs1.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
macro-with-attrs2.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
macro-with-braces-in-expr-position.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
macro_path_as_generic_bound.rs Remove licenses 2018-12-25 21:08:33 -07:00
macro_path_as_generic_bound.stderr Update tests 2019-03-11 23:10:26 +03:00
macro_undefined.rs Remove licenses 2018-12-25 21:08:33 -07:00
macro_undefined.stderr Bless tests 2020-03-21 15:03:58 +01:00
macro_with_super_2.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
macros-in-extern.rs Stabilize macros in extern blocks 2019-09-30 21:59:35 +03:00
macros-nonfatal-errors.rs Add tests for asm! 2020-05-18 14:41:32 +01:00
macros-nonfatal-errors.stderr Add tests for asm! 2020-05-18 14:41:32 +01:00
meta-item-absolute-path.rs Update tests 2020-01-09 21:23:12 +03:00
meta-item-absolute-path.stderr Update tests 2020-01-09 21:23:12 +03:00
meta-variable-misuse.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
missing-comma.rs Add guard for missing comma in macro call suggestion 2019-04-24 16:45:29 -07:00
missing-comma.stderr Handle more cases of typos misinterpreted as type ascription 2019-07-19 10:56:37 -07:00
must-use-in-macro-55516.rs Moving more build-pass tests to check-pass 2020-04-23 20:21:38 -07:00
must-use-in-macro-55516.stderr rustc: Add a warning count upon completion 2020-04-11 16:15:24 +02:00
nonterminal-matching.rs Remove licenses 2018-12-25 21:08:33 -07:00
nonterminal-matching.stderr rustc_macros: don't limit the -Zmacro-backtrace suggestion to extern macros. 2020-02-06 21:46:38 +02:00
parse-complex-macro-invoc-op.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
paths-in-macro-invocations.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
pub-item-inside-macro.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
pub-method-inside-macro.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
restricted-shadowing-legacy.rs Add checks for expected macro output in restricted shadowing tests 2018-09-08 14:15:11 +03:00
restricted-shadowing-legacy.stderr rustc_macros: don't limit the -Zmacro-backtrace suggestion to extern macros. 2020-02-06 21:46:38 +02:00
restricted-shadowing-modern.rs Cherry-pick src/test changes with Centril's changes 2019-08-19 22:31:46 +01:00
restricted-shadowing-modern.stderr rustc_macros: don't limit the -Zmacro-backtrace suggestion to extern macros. 2020-02-06 21:46:38 +02:00
same-sequence-span.rs Stabilize proc macros generating macro_rules items 2019-10-15 10:03:51 +03:00
same-sequence-span.stderr rustc_macros: don't limit the -Zmacro-backtrace suggestion to extern macros. 2020-02-06 21:46:38 +02:00
semi-after-macro-ty.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
span-covering-argument-1.rs update tests for migrate mode by default 2019-04-22 08:40:08 +01:00
span-covering-argument-1.stderr rustc_macros: don't limit the -Zmacro-backtrace suggestion to extern macros. 2020-02-06 21:46:38 +02:00
stmt_expr_attr_macro_parse.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
syntax-extension-cfg.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
syntax-extension-source-utils.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
trace-macro.rs Migrate compile-pass annotations to build-pass 2019-07-03 06:30:28 +09:00
trace-macro.stderr Update pretty tests 2020-03-17 20:58:31 +01:00
trace_faulty_macros.rs fix rebase fallout due to #69497. 2020-03-24 06:28:56 +01:00
trace_faulty_macros.stderr fix rebase fallout due to #69497. 2020-03-24 06:28:56 +01:00
try-macro.rs Allow deprecated try macro in test crates 2019-08-09 02:29:44 +00:00
two-macro-use.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
type-macros-hlist.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
type-macros-simple.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
typeck-macro-interaction-issue-8852.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
unimplemented-macro-panic.rs Skip tests on emscripten 2020-05-08 00:39:02 +09:00
unknown-builtin.rs tests: remove ignore directives from tests that mention core/alloc/std spans. 2020-04-02 11:48:34 +03:00
unknown-builtin.stderr tests: remove ignore directives from tests that mention core/alloc/std spans. 2020-04-02 11:48:34 +03:00
unreachable-fmt-msg.rs Skip tests on emscripten 2020-05-08 00:39:02 +09:00
unreachable-macro-panic.rs Skip tests on emscripten 2020-05-08 00:39:02 +09:00
unreachable-static-msg.rs Skip tests on emscripten 2020-05-08 00:39:02 +09:00
unreachable.rs Skip tests on emscripten 2020-05-08 00:39:02 +09:00
use-macro-self.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00