diff options
| author | bors <bors@rust-lang.org> | 2024-01-03 18:37:41 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-01-03 18:37:41 +0000 |
| commit | 139fb2214675fed8143a12f6287a3a1e6e2e866d (patch) | |
| tree | 6f260a23f1ee001180e2a59eff4a8852af21914d /library/alloc/src | |
| parent | 1a47f5b448f1e023e7ffd2eb57d473d619d2c04d (diff) | |
| parent | 9b2a44adc228e3a583c29f621975fde75ca9b80f (diff) | |
| download | rust-139fb2214675fed8143a12f6287a3a1e6e2e866d.tar.gz rust-139fb2214675fed8143a12f6287a3a1e6e2e866d.zip | |
Auto merge of #119549 - fmease:rollup-jxvbfes, r=fmease
Rollup of 21 pull requests Successful merges: - #119086 (Query panic!() to useful diagnostic) - #119239 (Remove unnecessary arm in `check_expr_yield`) - #119298 (suppress change-tracker warnings in CI containers) - #119319 (Document that File does not buffer reads/writes) - #119434 (rc: Take *const T in is_dangling) - #119444 (Rename `TyCtxt::is_closure` to `TyCtxt::is_closure_or_coroutine`) - #119474 (Update tracking issue of naked_functions) - #119476 (Pretty-print always-const trait predicates correctly) - #119477 (rustdoc ui: adjust tooltip z-index to be above sidebar) - #119479 (Remove two unused feature gates from rustc_query_impl) - #119487 (Minor improvements in comment on `freshen.rs`) - #119492 (Update books) - #119494 (Deny defaults for higher-ranked generic parameters) - #119498 (Update deadlinks of `strict_provenance` lints) - #119505 (Don't synthesize host effect params for trait associated functions marked const) - #119510 (Report I/O errors from rmeta encoding with emit_fatal) - #119512 (Mark myself as back from leave) - #119514 (coverage: Avoid a query stability hazard in `function_coverage_map`) - #119523 (llvm: Allow `noundef` in codegen tests) - #119534 (Update `thread_local` examples to use `local_key_cell_methods`) - #119544 (Fix: Properly set vendor in i686-win7-windows-msvc target) r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'library/alloc/src')
| -rw-r--r-- | library/alloc/src/rc.rs | 4 | ||||
| -rw-r--r-- | library/alloc/src/sync.rs | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/library/alloc/src/rc.rs b/library/alloc/src/rc.rs index 59f3a50ddb7..263b1449de1 100644 --- a/library/alloc/src/rc.rs +++ b/library/alloc/src/rc.rs @@ -2778,7 +2778,7 @@ impl<T, A: Allocator> Weak<T, A> { } } -pub(crate) fn is_dangling<T: ?Sized>(ptr: *mut T) -> bool { +pub(crate) fn is_dangling<T: ?Sized>(ptr: *const T) -> bool { (ptr.cast::<()>()).addr() == usize::MAX } @@ -3003,7 +3003,7 @@ impl<T: ?Sized, A: Allocator> Weak<T, A> { pub unsafe fn from_raw_in(ptr: *const T, alloc: A) -> Self { // See Weak::as_ptr for context on how the input pointer is derived. - let ptr = if is_dangling(ptr as *mut T) { + let ptr = if is_dangling(ptr) { // This is a dangling Weak. ptr as *mut RcBox<T> } else { diff --git a/library/alloc/src/sync.rs b/library/alloc/src/sync.rs index 1fc6fe631ab..5273b3cb2da 100644 --- a/library/alloc/src/sync.rs +++ b/library/alloc/src/sync.rs @@ -2722,7 +2722,7 @@ impl<T: ?Sized, A: Allocator> Weak<T, A> { pub unsafe fn from_raw_in(ptr: *const T, alloc: A) -> Self { // See Weak::as_ptr for context on how the input pointer is derived. - let ptr = if is_dangling(ptr as *mut T) { + let ptr = if is_dangling(ptr) { // This is a dangling Weak. ptr as *mut ArcInner<T> } else { |
