Logo
Explore Help
Register Sign In
rust-lang/rust
1
0
Fork 0
You've already forked rust
Code Issues Pull Requests Actions 1 Packages Projects Releases Wiki Activity
Files
14e59bb317c3c901bce83deb16ee9bfa5cc90e28
rust/tests/ui/drop/nondrop-cycle.rs

32 lines
445 B
Rust
Raw Normal View History

Add `// run-pass` annotations to all the tests under `ui/run-pass/`. (I may have accidentally added it to some auxilliary crates as well; my emacs-macro-based methodology was pretty crude.)
2018-08-30 14:18:55 +02:00
// run-pass
rustdoc: Replace no-pretty-expanded with pretty-expanded Now that features must be declared expanded source often does not compile. This adds 'pretty-expanded' to a bunch of test cases that still work.
2015-03-22 13:13:15 -07:00
// pretty-expanded FIXME #23616
run-pass tests. includes regression tests discovered during bootstrapping and tests of cyclic structure that currently pass and are expected to continue passing under the dropck rule. (Note that all the uses of `unsafe_destructor` are just placating the simple analysis used for that feature, which will eventually go away once we have put the dropck through its paces.)
2015-01-05 13:26:29 +01:00
use std::cell::Cell;
struct C<'a> {
p: Cell<Option<&'a C<'a>>>,
}
impl<'a> C<'a> {
fn new() -> C<'a> { C { p: Cell::new(None) } }
}
fn f1() {
let (c1, c2) = (C::new(), C::new());
c1.p.set(Some(&c2));
c2.p.set(Some(&c1));
}
fn f2() {
let (c1, c2);
c1 = C::new();
c2 = C::new();
c1.p.set(Some(&c2));
c2.p.set(Some(&c1));
}
fn main() {
f1();
f2();
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.6 Page: 3640ms Template: 2ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API