Skip to content

Commit 57f05cb

Browse files
committed
---
yaml --- r: 272259 b: refs/heads/auto c: 8620bba h: refs/heads/master i: 272257: 2be2a18 272255: fdef19e
1 parent e05dfd0 commit 57f05cb

File tree

2 files changed

+118
-1
lines changed

2 files changed

+118
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
88
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
99
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1010
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
11-
refs/heads/auto: 78eae9bf23fc589d79ba402267b377f972140d19
11+
refs/heads/auto: 8620bbaafd8bffda3584b4e8534d38dcc09cc6b1
1212
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1313
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336
1414
refs/tags/0.2: 1754d02027f2924bed83b0160ee340c7f41d5ea1
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
// Copyright 2016 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+
#![feature(core_intrinsics, rustc_attrs)]
12+
#![allow(warnings)]
13+
14+
use std::intrinsics;
15+
16+
#[derive(Copy, Clone)]
17+
struct Foo(i64);
18+
type Bar = &'static Fn();
19+
type Quux = [u8; 100];
20+
21+
#[rustc_no_mir] // FIXME #27840 MIR doesn't provide precise spans for calls.
22+
unsafe fn test_bool_load(p: &mut bool, v: bool) {
23+
intrinsics::atomic_load(p);
24+
//~^ ERROR `atomic_load` intrinsic: expected basic integer type, found `bool`
25+
}
26+
27+
#[rustc_no_mir] // FIXME #27840 MIR doesn't provide precise spans for calls.
28+
unsafe fn test_bool_store(p: &mut bool, v: bool) {
29+
intrinsics::atomic_store(p, v);
30+
//~^ ERROR `atomic_store` intrinsic: expected basic integer type, found `bool`
31+
}
32+
33+
#[rustc_no_mir] // FIXME #27840 MIR doesn't provide precise spans for calls.
34+
unsafe fn test_bool_xchg(p: &mut bool, v: bool) {
35+
intrinsics::atomic_xchg(p, v);
36+
//~^ ERROR `atomic_xchg` intrinsic: expected basic integer type, found `bool`
37+
}
38+
39+
#[rustc_no_mir] // FIXME #27840 MIR doesn't provide precise spans for calls.
40+
unsafe fn test_bool_cxchg(p: &mut bool, v: bool) {
41+
intrinsics::atomic_cxchg(p, v, v);
42+
//~^ ERROR `atomic_cxchg` intrinsic: expected basic integer type, found `bool`
43+
}
44+
45+
#[rustc_no_mir] // FIXME #27840 MIR doesn't provide precise spans for calls.
46+
unsafe fn test_Foo_load(p: &mut Foo, v: Foo) {
47+
intrinsics::atomic_load(p);
48+
//~^ ERROR `atomic_load` intrinsic: expected basic integer type, found `Foo`
49+
}
50+
51+
#[rustc_no_mir] // FIXME #27840 MIR doesn't provide precise spans for calls.
52+
unsafe fn test_Foo_store(p: &mut Foo, v: Foo) {
53+
intrinsics::atomic_store(p, v);
54+
//~^ ERROR `atomic_store` intrinsic: expected basic integer type, found `Foo`
55+
}
56+
57+
#[rustc_no_mir] // FIXME #27840 MIR doesn't provide precise spans for calls.
58+
unsafe fn test_Foo_xchg(p: &mut Foo, v: Foo) {
59+
intrinsics::atomic_xchg(p, v);
60+
//~^ ERROR `atomic_xchg` intrinsic: expected basic integer type, found `Foo`
61+
}
62+
63+
#[rustc_no_mir] // FIXME #27840 MIR doesn't provide precise spans for calls.
64+
unsafe fn test_Foo_cxchg(p: &mut Foo, v: Foo) {
65+
intrinsics::atomic_cxchg(p, v, v);
66+
//~^ ERROR `atomic_cxchg` intrinsic: expected basic integer type, found `Foo`
67+
}
68+
69+
#[rustc_no_mir] // FIXME #27840 MIR doesn't provide precise spans for calls.
70+
unsafe fn test_Bar_load(p: &mut Bar, v: Bar) {
71+
intrinsics::atomic_load(p);
72+
//~^ ERROR expected basic integer type, found `&'static std::ops::Fn() + 'static`
73+
}
74+
75+
#[rustc_no_mir] // FIXME #27840 MIR doesn't provide precise spans for calls.
76+
unsafe fn test_Bar_store(p: &mut Bar, v: Bar) {
77+
intrinsics::atomic_store(p, v);
78+
//~^ ERROR expected basic integer type, found `&'static std::ops::Fn() + 'static`
79+
}
80+
81+
#[rustc_no_mir] // FIXME #27840 MIR doesn't provide precise spans for calls.
82+
unsafe fn test_Bar_xchg(p: &mut Bar, v: Bar) {
83+
intrinsics::atomic_xchg(p, v);
84+
//~^ ERROR expected basic integer type, found `&'static std::ops::Fn() + 'static`
85+
}
86+
87+
#[rustc_no_mir] // FIXME #27840 MIR doesn't provide precise spans for calls.
88+
unsafe fn test_Bar_cxchg(p: &mut Bar, v: Bar) {
89+
intrinsics::atomic_cxchg(p, v, v);
90+
//~^ ERROR expected basic integer type, found `&'static std::ops::Fn() + 'static`
91+
}
92+
93+
#[rustc_no_mir] // FIXME #27840 MIR doesn't provide precise spans for calls.
94+
unsafe fn test_Quux_load(p: &mut Quux, v: Quux) {
95+
intrinsics::atomic_load(p);
96+
//~^ ERROR `atomic_load` intrinsic: expected basic integer type, found `[u8; 100]`
97+
}
98+
99+
#[rustc_no_mir] // FIXME #27840 MIR doesn't provide precise spans for calls.
100+
unsafe fn test_Quux_store(p: &mut Quux, v: Quux) {
101+
intrinsics::atomic_store(p, v);
102+
//~^ ERROR `atomic_store` intrinsic: expected basic integer type, found `[u8; 100]`
103+
}
104+
105+
#[rustc_no_mir] // FIXME #27840 MIR doesn't provide precise spans for calls.
106+
unsafe fn test_Quux_xchg(p: &mut Quux, v: Quux) {
107+
intrinsics::atomic_xchg(p, v);
108+
//~^ ERROR `atomic_xchg` intrinsic: expected basic integer type, found `[u8; 100]`
109+
}
110+
111+
#[rustc_no_mir] // FIXME #27840 MIR doesn't provide precise spans for calls.
112+
unsafe fn test_Quux_cxchg(p: &mut Quux, v: Quux) {
113+
intrinsics::atomic_cxchg(p, v, v);
114+
//~^ ERROR `atomic_cxchg` intrinsic: expected basic integer type, found `[u8; 100]`
115+
}
116+
117+
fn main() {}

0 commit comments

Comments
 (0)