rust/tests/ui/self
Matthias Krüger fbc121fdfd
Rollup merge of #104363 - WaffleLapkin:bonk_box_new, r=Nilstrieb
Make `unused_allocation` lint against `Box::new` too

Previously it only linted against `box` syntax, which likely won't ever be stabilized, which is pretty useless. Even now I'm not sure if it's a meaningful lint, but it's at least something 🤷

This means that code like the following will be linted against:
```rust
Box::new([1, 2, 3]).len();
f(&Box::new(1)); // where f : &i32 -> ()
```
The lint works by checking if a `Box::new` (or `box`) expression has an a borrow adjustment, meaning that the code that first stores the box in a variable won't be linted against:
```rust
let boxed = Box::new([1, 2, 3]); // no lint
boxed.len();
```
2023-03-11 15:43:11 +01:00
..
auxiliary Move /src/test to /tests 2023-01-11 09:32:08 +00:00
elision diagnostics: update test cases to refer to assoc fn with self as method 2023-02-22 08:40:47 -07:00
arbitrary_self_types_nested.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
arbitrary_self_types_pin_lifetime_impl_trait-async.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
arbitrary_self_types_pin_lifetime_impl_trait-async.stderr Label opaque type for 'captures lifetime' error message 2023-03-03 05:02:34 +00:00
arbitrary_self_types_pin_lifetime_impl_trait.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
arbitrary_self_types_pin_lifetime_impl_trait.stderr Label opaque type for 'captures lifetime' error message 2023-03-03 05:02:34 +00:00
arbitrary_self_types_pin_lifetime_mismatch-async.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
arbitrary_self_types_pin_lifetime_mismatch-async.stderr diagnostics: update test cases to refer to assoc fn with self as method 2023-02-22 08:40:47 -07:00
arbitrary_self_types_pin_lifetime_mismatch.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
arbitrary_self_types_pin_lifetime_mismatch.stderr diagnostics: update test cases to refer to assoc fn with self as method 2023-02-22 08:40:47 -07:00
arbitrary_self_types_pin_lifetime-async.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
arbitrary_self_types_pin_lifetime.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
arbitrary_self_types_pointers_and_wrappers.rs impl DispatchFromDyn for Cell and UnsafeCell 2023-01-24 12:06:12 +01:00
arbitrary_self_types_raw_pointer_struct.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
arbitrary_self_types_raw_pointer_trait.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
arbitrary_self_types_silly.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
arbitrary_self_types_stdlib_pointers.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
arbitrary_self_types_struct.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
arbitrary_self_types_trait.rs Add unuseless #[allow(unused_allocation)] 2023-03-03 17:47:48 +00:00
arbitrary_self_types_unsized_struct.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
arbitrary-self-types-not-object-safe.curr.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
arbitrary-self-types-not-object-safe.object_safe_for_dispatch.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
arbitrary-self-types-not-object-safe.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
builtin-superkinds-self-type.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
by-value-self-in-mut-slot.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
class-missing-self.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
class-missing-self.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
explicit_self_xcrate_exe.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
explicit-self-closures.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
explicit-self-generic.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
explicit-self-objects-uniq.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
explicit-self.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-61882-2.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-61882-2.stderr Tweak E0597 2023-01-15 19:46:20 +00:00
issue-61882.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-61882.stderr Modify primary span label for E0308 2023-01-30 20:12:19 +00:00
move-self.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
object-safety-sized-self-by-value-self.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
object-safety-sized-self-generic-method.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
object-safety-sized-self-return-Self.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
objects-owned-object-owned-method.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
point-at-arbitrary-self-type-method.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
point-at-arbitrary-self-type-method.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
point-at-arbitrary-self-type-trait-method.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
point-at-arbitrary-self-type-trait-method.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
self_lifetime-async.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
self_lifetime.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
self_type_keyword-2.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
self_type_keyword-2.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
self_type_keyword.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
self_type_keyword.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
self-impl-2.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
self-impl.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
self-impl.stderr When suggesting writing a fully qualified path probe for appropriate types 2023-01-11 21:30:10 +00:00
self-in-mut-slot-default-method.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
self-in-mut-slot-immediate-value.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
self-in-typedefs.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
self-infer.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
self-infer.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
self-re-assign.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
self-shadowing-import.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
self-type-param.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
self-vs-path-ambiguity.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
self-vs-path-ambiguity.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
string-self-append.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
suggest-self-2.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
suggest-self-2.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
suggest-self.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
suggest-self.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
ufcs-explicit-self.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
uniq-self-in-mut-slot.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
where-for-self.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00