]>
git.proxmox.com Git - rustc.git/blob - src/test/ui/nll/polonius-smoke-test.rs
1 // Check that Polonius borrow check works for simple cases.
2 // ignore-compare-mode-nll
3 // compile-flags: -Z borrowck=mir -Zpolonius
5 pub fn return_ref_to_local() -> &'
static i32 {
10 pub fn use_while_mut() {
17 pub fn use_while_mut_fr(x
: &mut i32) -> &mut i32 {
23 // Cases like this are why we have Polonius.
24 pub fn position_dependent_outlives(x
: &mut i32, cond
: bool
) -> &mut i32 {
34 fn foo
<'a
, 'b
>(p
: &'b
&'a
mut usize) -> &'b
usize {
38 // Check that we create constraints for well-formedness of function arguments
39 fn well_formed_function_inputs() {