Skip to content

Commit 0e2f128

Browse files
committed
---
yaml --- r: 276805 b: refs/heads/try c: 8620bba h: refs/heads/master i: 276803: eba4082
1 parent 84b6a9e commit 0e2f128

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
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 6dbb0e86aec11050480beb76eade6fb805010ba7
33
refs/heads/snap-stage3: 235d77457d80b549dad3ac36d94f235208a1eafb
4-
refs/heads/try: 78eae9bf23fc589d79ba402267b377f972140d19
4+
refs/heads/try: 8620bbaafd8bffda3584b4e8534d38dcc09cc6b1
55
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
66
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
77
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
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)