Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
172e67e
Adjust installation place for compiler docs
Mark-Simulacrum Aug 16, 2020
695d86f
Make OnceCell<T> transparent to dropck
matklad Aug 17, 2020
5d49c0e
Move to intra doc links for std::io
poliorcetics Aug 18, 2020
70dfe3f
move const param structural match checks to wfcheck
lcnr Aug 2, 2020
6ad01e9
run wfcheck in parralel again, add test for 74950
lcnr Aug 13, 2020
7542615
change const param ty warning message
lcnr Aug 18, 2020
9eeb3ee
Suppress MIR comments for FnDef in ty::Const
tesuji Aug 18, 2020
7c4d315
bless tests
tesuji Aug 19, 2020
34e7eac
Remove `#[cfg(miri)]` from OnceCell tests
matklad Aug 19, 2020
967ec1f
Refactor `impl_for_type` into a separate function
jyn514 Aug 17, 2020
8a0aa7b
Say `tcx.lang_items()` less
jyn514 Aug 17, 2020
3ddd8b2
Return all impls, not just the primary one
jyn514 Aug 17, 2020
06d6d3d
impl_for_type -> PrimitiveType::impls
jyn514 Aug 17, 2020
9cf2fa8
Allow reusing the code in `collect_trait_impls`
jyn514 Aug 17, 2020
219e93d
Use `impls` for intra doc links as well
jyn514 Aug 17, 2020
121974e
xpy fmt
jyn514 Aug 17, 2020
570b0d9
Add a test
jyn514 Aug 17, 2020
dad8e11
Fix nits in intra-doc links for std io
poliorcetics Aug 19, 2020
aff01f8
Add test for f32 and f64 methods
jyn514 Aug 19, 2020
f0b7901
Rollup merge of #75069 - lcnr:type-of-lazy-norm, r=varkor
tmandry Aug 19, 2020
42b3ed6
Rollup merge of #75593 - Mark-Simulacrum:compiler-docs-must-not-overl…
tmandry Aug 19, 2020
576c121
Rollup merge of #75648 - matklad:lazy-dropck, r=KodrAus
tmandry Aug 19, 2020
f59775a
Rollup merge of #75649 - jyn514:inherent-lang-impls, r=guillaumegomez
tmandry Aug 19, 2020
5256b95
Rollup merge of #75670 - lzutao:suppress-mir-fndef-ty, r=oli-obk
tmandry Aug 19, 2020
10f52c3
Rollup merge of #75674 - poliorcetics:intra-links-std-io, r=jyn514
tmandry Aug 19, 2020
d2dbc4c
Rollup merge of #75696 - matklad:mirit, r=RalfJung
tmandry Aug 19, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions library/core/tests/lazy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,3 +122,12 @@ fn reentrant_init() {
});
eprintln!("use after free: {:?}", dangling_ref.get().unwrap());
}

#[test]
fn dropck() {
let cell = OnceCell::new();
{
let s = String::new();
cell.set(&s).unwrap();
}
}
14 changes: 12 additions & 2 deletions library/std/src/lazy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -386,9 +386,10 @@ impl<T> SyncOnceCell<T> {
}
}

impl<T> Drop for SyncOnceCell<T> {
unsafe impl<#[may_dangle] T> Drop for SyncOnceCell<T> {
fn drop(&mut self) {
// Safety: The cell is being dropped, so it can't be accessed again
// Safety: The cell is being dropped, so it can't be accessed again.
// We also don't touch the `T`, which validates our usage of #[may_dangle].
unsafe { self.take_inner() };
}
}
Expand Down Expand Up @@ -845,4 +846,13 @@ mod tests {
assert_eq!(msg, MSG);
}
}

#[test]
fn dropck() {
let cell = SyncOnceCell::new();
{
let s = String::new();
cell.set(&s).unwrap();
}
}
}