| Age | Commit message (Collapse) | Author | Lines | |
|---|---|---|---|---|
| 2023-03-11 | Rollup merge of #104363 - WaffleLapkin:bonk_box_new, r=Nilstrieb | Matthias Krüger | -2/+3 | |
| 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 :shrug: 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-03 | Add unuseless `#[allow(unused_allocation)]` | Maybe Waffle | -2/+3 | |
| 2023-03-03 | Label opaque type for 'captures lifetime' error message | Michael Goulet | -4/+6 | |
| 2023-02-22 | diagnostics: update test cases to refer to assoc fn with `self` as method | Michael Howell | -64/+64 | |
| 2023-01-30 | Modify primary span label for E0308 | Esteban Küber | -1/+1 | |
| The previous output was unintuitive to users. | ||||
| 2023-01-26 | Rollup merge of #97373 - dimpolo:cell_dispatch_from_dyn, r=dtolnay | Matthias Krüger | -0/+22 | |
| impl DispatchFromDyn for Cell and UnsafeCell After some fruitful discussion on [Internals](https://internals.rust-lang.org/t/impl-dispatchfromdyn-for-cell-2/16520) here's my first PR to rust-lang/rust 🎉 Please let me know if there's something I missed. This adds `DispatchFromDyn` impls for `Cell`, `UnsafeCell` and `SyncUnsafeCell`. An existing test is also expanded to test the `Cell` impl (which requires the `UnsafeCell` impl) The different `RefCell` types can not implement `DispatchFromDyn` since they have more than one (non ZST) field. **Edit:** ### What: These changes allow one to make types like `MyRc`(code below), to be object safe method receivers after implementing `DispatchFromDyn` and `Deref` for them. This allows for code like this: ```rust struct MyRc<T: ?Sized>(Cell<NonNull<RcBox<T>>>); /* impls for DispatchFromDyn, CoerceUnsized and Deref for MyRc*/ trait Trait { fn foo(self: MyRc<Self>); } let impls_trait = ...; let rc = MyRc::new(impls_trait) as MyRc<dyn Trait>; rc.foo(); ``` Note: `Cell` and `UnsafeCell` won't directly become valid method receivers since they don't implement `Deref`. Making use of these changes requires a wrapper type and nightly features. ### Why: A custom pointer type with interior mutability allows one to store extra information in the pointer itself. These changes allow for such a type to be a method receiver. ### Examples: My use case is a cycle aware custom `Rc` implementation that when dropping a cycle marks some references dangling. On the [forum](https://internals.rust-lang.org/t/impl-dispatchfromdyn-for-cell/14762/8) andersk mentioned that they track if a `Gc` reference is rooted with an extra bit in the reference itself. | ||||
| 2023-01-24 | impl DispatchFromDyn for Cell and UnsafeCell | dimi | -0/+22 | |
| 2023-01-15 | Tweak E0597 | Esteban Küber | -0/+2 | |
| CC #99430 | ||||
| 2023-01-11 | When suggesting writing a fully qualified path probe for appropriate types | Esteban Küber | -2/+2 | |
| Fix #46585. | ||||
| 2023-01-11 | Move /src/test to /tests | Albert Larsan | -0/+4352 | |
