about summary refs log tree commit diff
path: root/src/test/ui/allocator
AgeCommit message (Collapse)AuthorLines
2023-01-11Move /src/test to /testsAlbert Larsan-594/+0
2022-11-30Reduce the number of unstable features in testsAmanieu d'Antras-70/+34
2022-11-03Stabilize default_alloc_error_handlerAmanieu d'Antras-2/+0
Closes #66741
2022-08-31Fix a bunch of typoDezhi Wu-2/+2
This PR will fix some typos detected by [typos]. I only picked the ones I was sure were spelling errors to fix, mostly in the comments. [typos]: https://github.com/crate-ci/typos
2022-08-03Warn about dead tuple struct fieldsFabian Wolff-2/+2
2022-04-04Mention implementers of unsatisfied traitEsteban Kuber-4/+8
When encountering an unsatisfied trait bound, if there are no other suggestions, mention all the types that *do* implement that trait: ``` error[E0277]: the trait bound `f32: Foo` is not satisfied --> $DIR/impl_wf.rs:22:6 | LL | impl Baz<f32> for f32 { } | ^^^^^^^^ the trait `Foo` is not implemented for `f32` | = help: the following other types implement trait `Foo`: Option<T> i32 str note: required by a bound in `Baz` --> $DIR/impl_wf.rs:18:31 | LL | trait Baz<U: ?Sized> where U: Foo { } | ^^^ required by this bound in `Baz` ``` Mention implementers of traits in `ImplObligation`s. Do not mention other `impl`s for closures, ranges and `?`.
2021-12-15Point at type when a `static` `#[global_allocator]` doesn't `impl` `GlobalAlloc`Esteban Kuber-8/+8
2021-11-20Do not mention associated items when they introduce an obligationEsteban Kuber-20/+0
2021-07-19Various diagnostics clean ups/tweaksEsteban Küber-4/+29
* Always point at macros, including derive macros * Point at non-local items that introduce a trait requirement * On private associated item, point at definition
2021-05-12Show macro name in 'this error originates in macro' messageAaron Hill-5/+5
When there are multiple macros in use, it can be difficult to tell which one was responsible for producing an error.
2021-03-09add integration tests, unwind across FFI boundarykatelyn a. martin-2/+16
### 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-02-03make Allocator object-safeRustyYato-0/+13
add test to ensure object-safety This allows for runtime polymorphic allocators
2020-12-04 Rename `AllocRef` to `Allocator` and `(de)alloc` to `(de)allocate`Tim Diekmann-13/+12
2020-11-22Drop support for cloudabi targetsLzu Tao-2/+0
2020-10-02Implement Make `handle_alloc_error` default to panic (for no_std + liballoc)Harald Hoyer-1/+184
Related: https://github.com/rust-lang/rust/issues/66741 Guarded with `#![feature(default_alloc_error_handler)]` a default `alloc_error_handler` is called, if a custom allocator is used and no other custom `#[alloc_error_handler]` is defined. The panic message does not contain the size anymore, because it would pull in the fmt machinery, which would blow up the code size significantly.
2020-09-22a few more &mut self -> self changesblitzerr-1/+1
2020-09-22fixing the test failureblitzerr-1/+2
2020-09-22fixing the custom.rsblitzerr-1/+1
2020-09-21Changing the alloc() to accept &self instead of &mut selfblitzerr-1/+1
2020-09-02pretty: trim paths of unique symbolsDan Aloni-8/+8
If a symbol name can only be imported from one place for a type, and as long as it was not glob-imported anywhere in the current crate, we can trim its printed path and print only the name. This has wide implications on error messages with types, for example, shortening `std::vec::Vec` to just `Vec`, as long as there is no other `Vec` importable anywhere. This adds a new '-Z trim-diagnostic-paths=false' option to control this feature. On the good path, with no diagnosis printed, we should try to avoid issuing this query, so we need to prevent trimmed_def_paths query on several cases. This change also relies on a previous commit that differentiates between `Debug` and `Display` on various rustc types, where the latter is trimmed and presented to the user and the former is not.
2020-08-04Replace `Memoryblock` with `NonNull<[u8]>`Tim Diekmann-8/+10
2020-07-28Remove in-place allocation and revert to separate methods for zeroed allocationsTim Diekmann-6/+6
Fix docs
2020-03-28Make fields in `MemoryBlock` publicTim Diekmann-8/+8
2020-03-26Remove alignment from `MemoryBlock`Tim Diekmann-4/+4
2020-03-26Fix issues from review and unsoundness of `RawVec::into_box`Tim Diekmann-12/+12
2020-03-26Overhaul of the `AllocRef` trait to match allocator-wg's latest consensTim Diekmann-7/+7
2020-03-03Remove `usable_size` APIsTim Diekmann-4/+4
2020-02-06rustc_macros: don't limit the -Zmacro-backtrace suggestion to extern macros.Eduard-Mihai Burtescu-0/+6
2020-01-31Auto merge of #68080 - varkor:declared-here, r=petrochenkovbors-1/+1
Address inconsistency in using "is" with "declared here" "is" was generally used for NLL diagnostics, but not other diagnostics. Using "is" makes the diagnostics sound more natural and readable, so it seems sensible to commit to them throughout. r? @Centril
2020-01-27Rename `Alloc` to `AllocRef`Tim Diekmann-2/+2
2020-01-24Normalise diagnostics with respect to "the X is declared/defined here"varkor-1/+1
2019-11-28rustc_metadata: Move `has_global_allocator` from session to cstoreVadim Petrochenkov-1/+1
2019-11-25Tweak multiple allocators errorEsteban Küber-7/+4
2019-09-15Remove `with_legacy_ctxt`Matthew Jasper-0/+31
2019-07-27tests: Move run-pass tests without naming conflicts to uiVadim Petrochenkov-0/+234
2019-07-24syntax_ext: Reuse built-in attribute template checking for macro attributesVadim Petrochenkov-1/+1
2019-07-24syntax_ext: Turn `#[global_allocator]` into a regular attribute macroVadim Petrochenkov-2/+29
2019-07-22normalize use of backticks in compiler messages for librustc_allocatorSamy Kacimi-2/+2
https://github.com/rust-lang/rust/issues/60532
2019-07-19normalize use of backticks in compiler messages for librustc_metadataSamy Kacimi-4/+4
https://github.com/rust-lang/rust/issues/60532
2019-04-22Remove double trailing newlinesvarkor-2/+0
2019-03-11Update testsVadim Petrochenkov-1/+1
2018-12-25Remove licensesMark Rousskov-77/+6
2018-08-14Merged migrated compile-fail tests and ui tests. Fixes #46841.David Wood-0/+191