File tree 3 files changed +25
-1
lines changed
test/run-make/issue-46239
3 files changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -792,7 +792,8 @@ impl<'a, 'tcx> FnType<'tcx> {
792
792
// dependencies rather than pointer equality
793
793
let no_alias = match kind {
794
794
PointerKind :: Shared => false ,
795
- PointerKind :: Frozen | PointerKind :: UniqueOwned => true ,
795
+ PointerKind :: UniqueOwned => true ,
796
+ PointerKind :: Frozen |
796
797
PointerKind :: UniqueBorrowed => !is_return
797
798
} ;
798
799
if no_alias {
Original file line number Diff line number Diff line change
1
+ -include ../tools.mk
2
+
3
+ all :
4
+ $(RUSTC ) main.rs -C opt-level=1
5
+ $(call RUN,main)
Original file line number Diff line number Diff line change
1
+ // Copyright 2017 The Rust Project Developers. See the COPYRIGHT
2
+ // file at the top-level directory of this distribution and at
3
+ // http://rust-lang.org/COPYRIGHT.
4
+ //
5
+ // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6
+ // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7
+ // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8
+ // option. This file may not be copied, modified, or distributed
9
+ // except according to those terms.
10
+
11
+ fn project < T > ( x : & ( T , ) ) -> & T { & x. 0 }
12
+
13
+ fn dummy ( ) { }
14
+
15
+ fn main ( ) {
16
+ let f = ( dummy as fn ( ) , ) ;
17
+ ( * project ( & f) ) ( ) ;
18
+ }
You can’t perform that action at this time.
0 commit comments