rust/src/test/ui/allocator
katelyn a. martin baf227ea0c add integration tests, unwind across FFI boundary
### Integration Tests

    This commit introduces some new fixtures to the `run-make-fulldeps`
    test suite.

        * c-unwind-abi-catch-panic: Exercise unwinding a panic. This
          catches a panic across an FFI boundary and downcasts it into
          an integer.

        * c-unwind-abi-catch-lib-panic: This is similar to the previous
         `*catch-panic` test, however in this case the Rust code that
         panics resides in a separate crate.

 ### Add `rust_eh_personality` to `#[no_std]` alloc tests

    This commit addresses some test failures that now occur in the
    following two tests:

        * no_std-alloc-error-handler-custom.rs
        * no_std-alloc-error-handler-default.rs

    Each test now defines a `rust_eh_personality` extern function, in
    the same manner as shown in the "Writing an executable without
    stdlib" section of the `lang_items` documentation here:
    https://doc.rust-lang.org/unstable-book/language-features/lang-items.html#writing-an-executable-without-stdlib

    Without this change, these tests would fail to compile due to a
    linking error explaining that there was an "undefined reference
    to `rust_eh_personality'."

 ### Updated hash

    * update 32-bit hash in `impl1` test

 ### Panics

    This commit uses `panic!` macro invocations that return a string,
    rather than using an integer as a panic payload.

    Doing so avoids the following warnings that were observed during
    rollup for the `*-msvc-1` targets:

    ```
    warning: panic message is not a string literal
      --> panic.rs:10:16
       |
    10 |         panic!(x); // That is too big!
       |                ^
       |
       = note: `#[warn(non_fmt_panic)]` on by default
       = note: this is no longer accepted in Rust 2021
    help: add a "{}" format string to Display the message
       |
    10 |         panic!("{}", x); // That is too big!
       |                ^^^^^
    help: or use std::panic::panic_any instead
       |
    10 |         std::panic::panic_any(x); // That is too big!
       |         ^^^^^^^^^^^^^^^^^^^^^

    warning: 1 warning emitted
    ```

    See: https://github.com/rust-lang-ci/rust/runs/1992118428

    As these errors imply, panicking without a format string will be
    disallowed in Rust 2021, per #78500.
2021-03-09 14:40:33 -05:00
..
auxiliary Implement Make `handle_alloc_error` default to panic (for no_std + liballoc) 2020-10-02 09:00:29 +02:00
allocator-args.rs syntax_ext: Turn `#[global_allocator]` into a regular attribute macro 2019-07-24 12:29:44 +03:00
allocator-args.stderr syntax_ext: Reuse built-in attribute template checking for macro attributes 2019-07-24 12:29:45 +03:00
custom-in-block.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
custom-in-submodule.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
custom.rs Rename `AllocRef` to `Allocator` and `(de)alloc` to `(de)allocate` 2020-12-04 14:47:15 +01:00
function-allocator.rs Remove licenses 2018-12-25 21:08:33 -07:00
function-allocator.stderr Update tests 2019-03-11 23:10:26 +03:00
hygiene.rs Remove `with_legacy_ctxt` 2019-09-15 09:15:38 +01:00
no_std-alloc-error-handler-custom.rs add integration tests, unwind across FFI boundary 2021-03-09 14:40:33 -05:00
no_std-alloc-error-handler-default.rs add integration tests, unwind across FFI boundary 2021-03-09 14:40:33 -05:00
not-an-allocator.rs Remove licenses 2018-12-25 21:08:33 -07:00
not-an-allocator.stderr pretty: trim paths of unique symbols 2020-09-02 22:26:37 +03:00
object-safe.rs make Allocator object-safe 2021-02-03 20:46:16 -05:00
two-allocators.rs syntax_ext: Turn `#[global_allocator]` into a regular attribute macro 2019-07-24 12:29:44 +03:00
two-allocators.stderr rustc_macros: don't limit the -Zmacro-backtrace suggestion to extern macros. 2020-02-06 21:46:38 +02:00
two-allocators2.rs normalize use of backticks in compiler messages for librustc_metadata 2019-07-19 22:24:56 +02:00
two-allocators2.stderr normalize use of backticks in compiler messages for librustc_metadata 2019-07-19 22:24:56 +02:00
two-allocators3.rs normalize use of backticks in compiler messages for librustc_metadata 2019-07-19 22:24:56 +02:00
two-allocators3.stderr rustc_metadata: Move `has_global_allocator` from session to cstore 2019-11-28 20:59:57 +03:00
xcrate-use.rs Rename `AllocRef` to `Allocator` and `(de)alloc` to `(de)allocate` 2020-12-04 14:47:15 +01:00
xcrate-use2.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00