Skip to content

Commit a478bfe

Browse files
author
Alexander Regueiro
committed
Removed copyright notices.
1 parent 433e494 commit a478bfe

File tree

77 files changed

+53
-644
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+53
-644
lines changed

tests/compile-fail/copy_nonoverlapping.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,3 @@
1-
// Copyright 2015 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-
111
#![feature(core_intrinsics)]
122

133
//error-pattern: copy_nonoverlapping called on overlapping ranges

tests/compile-fail/copy_null.rs

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,8 @@
1-
// Copyright 2015 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-
111
//error-pattern: invalid use of NULL pointer
122

133
fn main() {
144
let mut data = [0u16; 4];
155
let ptr = &mut data[0] as *mut u16;
16-
// Even copying 0 elements from NULL should error
6+
// Even copying 0 elements from NULL should error.
177
unsafe { ptr.copy_from(std::ptr::null(), 0); }
188
}

tests/compile-fail/copy_unaligned.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,3 @@
1-
// Copyright 2015 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-
111
//error-pattern: tried to access memory with alignment 1, but alignment 2 is required
122

133
fn main() {

tests/compile-fail/div-by-zero-1.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,3 @@
1-
// Copyright 2015 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-
111
#![feature(core_intrinsics)]
122

133
use std::intrinsics::*;

tests/compile-fail/div-by-zero-2.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,3 @@
1-
// Copyright 2015 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-
111
#![allow(const_err)]
122

133
fn main() {

tests/compile-fail/overflowing-lsh-neg.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,3 @@
1-
// Copyright 2015 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-
111
#![allow(exceeding_bitshifts)]
122
#![allow(const_err)]
133

tests/compile-fail/overflowing-rsh-1.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,3 @@
1-
// Copyright 2015 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-
111
#![allow(exceeding_bitshifts)]
122

133
fn main() {

tests/compile-fail/overflowing-rsh-2.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,3 @@
1-
// Copyright 2015 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-
111
#![allow(exceeding_bitshifts, const_err)]
122

133
fn main() {

tests/compile-fail/overflowing-unchecked-rsh.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,3 @@
1-
// Copyright 2015 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-
111
#![feature(core_intrinsics)]
122

133
use std::intrinsics::*;

tests/compile-fail/ptr_offset_ptr_plus_0.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
fn main() {
44
let x = Box::into_raw(Box::new(0u32));
5-
let x = x.wrapping_offset(8); // okay, this has no inbounds tag
5+
let x = x.wrapping_offset(8); // ok, this has no inbounds tag
66
let _x = unsafe { x.offset(0) }; // UB despite offset 0, the pointer is not inbounds of the only object it can point to
77
}

tests/compile-fail/reading_half_a_pointer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ fn main() {
2020

2121
// Get a pointer to the beginning of the Data struct (one u8 byte, then the pointer bytes).
2222
// Thanks to the wrapper, we know this is aligned-enough to perform a load at ptr size.
23-
// We load at pointer type, so having a relocation is okay -- but here, the relocation
23+
// We load at pointer type, so having a relocation is ok -- but here, the relocation
2424
// starts 1 byte to the right, so using it would actually be wrong!
2525
let d_alias = &mut w.data as *mut _ as *mut *const u8;
2626
unsafe {

tests/compile-fail/stacked_borrows/illegal_read1.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
fn main() {
55
let mut x = 15;
66
let xraw = &mut x as *mut _;
7-
let xref = unsafe { &mut *xraw }; // derived from raw, so using raw is still okay...
7+
let xref = unsafe { &mut *xraw }; // derived from raw, so using raw is still ok...
88
callee(xraw);
99
let _val = *xref; // ...but any use of raw will invalidate our ref.
1010
//~^ ERROR: does not exist on the borrow stack

tests/compile-fail/stacked_borrows/illegal_read2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
fn main() {
55
let mut x = 15;
66
let xraw = &mut x as *mut _;
7-
let xref = unsafe { &mut *xraw }; // derived from raw, so using raw is still okay...
7+
let xref = unsafe { &mut *xraw }; // derived from raw, so using raw is still ok...
88
callee(xraw);
99
let _val = *xref; // ...but any use of raw will invalidate our ref.
1010
//~^ ERROR: does not exist on the borrow stack

tests/compile-fail/stacked_borrows/illegal_read3.rs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,25 @@
1-
#![feature(untagged_unions)]
2-
// A callee may not read the destination of our `&mut` without
3-
// us noticing.
1+
// A callee may not read the destination of our `&mut` without us noticing.
42
// Thise code got carefully checked to not introduce any reborrows
5-
// that are not explicit in the source. Let's hope the compiler does not break this later!
3+
// that are not explicit in the source. Let's hope the compiler does not break this later!
4+
5+
#![feature(untagged_unions)]
66

77
use std::mem;
88

99
fn main() {
1010
let mut x: i32 = 15;
1111
let xref1 = &mut x;
1212
let xref1_sneaky: usize = unsafe { mem::transmute_copy(&xref1) };
13-
let xref2 = &mut *xref1; // derived from xref1, so using raw is still okay...
13+
// Derived from `xref1`, so using raw value is still ok, ...
14+
let xref2 = &mut *xref1;
1415
callee(xref1_sneaky);
15-
let _val = *xref2; // ...but any use of it will invalidate our ref.
16+
// ... though any use of it will invalidate our ref.
17+
let _val = *xref2;
1618
//~^ ERROR: does not exist on the borrow stack
1719
}
1820

1921
fn callee(xref1: usize) {
20-
// Transmuting through a union to avoid retagging
22+
// Transmuting through a union to avoid retagging.
2123
union UsizeToRef {
2224
from: usize,
2325
to: &'static mut i32,

tests/compile-fail/stacked_borrows/illegal_read5.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ fn main() {
88
let rc = RefCell::new(0);
99
let mut refmut = rc.borrow_mut();
1010
let xref: &mut i32 = &mut *refmut;
11-
let xshr = &rc; // creating this is okay
11+
let xshr = &rc; // creating this is ok
1212
let _val = *xref; // we can even still use our mutable reference
1313
mem::forget(unsafe { ptr::read(xshr) }); // but after reading through the shared ref
1414
let _val = *xref; // the mutable one is dead and gone

tests/compile-fail/stacked_borrows/illegal_write5.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
// A callee may not write to the destination of our `&mut` without
2-
// us noticing.
1+
// A callee may not write to the destination of our `&mut` without us noticing.
32

43
fn main() {
54
let mut x = 15;
65
let xraw = &mut x as *mut _;
7-
let xref = unsafe { &mut *xraw }; // derived from raw, so using raw is still okay...
6+
// Derived from raw value, so using raw value is still ok ...
7+
let xref = unsafe { &mut *xraw };
88
callee(xraw);
9-
let _val = *xref; // ...but any use of raw will invalidate our ref.
9+
// ... though any use of raw value will invalidate our ref.
10+
let _val = *xref;
1011
//~^ ERROR: does not exist on the borrow stack
1112
}
1213

tests/compile-fail/transmute-pair-undef.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,15 @@ fn main() {
88
std::mem::transmute::<(usize, bool), Option<Box<[u8]>>>(z)
99
};
1010
let y = &x;
11-
// Now read this bytewise. There should be (ptr_size+1) def bytes followed by (ptr_size-1) undef bytes (the padding after the bool) in there.
11+
// Now read this bytewise. There should be (`ptr_size + 1`) def bytes followed by
12+
// (`ptr_size - 1`) undef bytes (the padding after the bool) in there.
1213
let z : *const u8 = y as *const _ as *const _;
1314
let first_undef = mem::size_of::<usize>() as isize + 1;
1415
for i in 0..first_undef {
1516
let byte = unsafe { *z.offset(i) };
1617
assert_eq!(byte, 0);
1718
}
1819
let v = unsafe { *z.offset(first_undef) };
19-
if v == 0 {} //~ ERROR attempted to read undefined bytes
20+
if v == 0 {}
21+
//~^ ERROR attempted to read undefined bytes
2022
}
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
// This should fail even without validation
1+
// This should fail even without validation.
22
// compile-flags: -Zmiri-disable-validation
33

44
fn main() {
55
let x = &2u16;
66
let x = x as *const _ as *const *const u8;
7-
// This must fail because alignment is violated. Test specifically for loading pointers, which have special code
8-
// in miri's memory.
9-
let _x = unsafe { *x }; //~ ERROR tried to access memory with alignment 2, but alignment
7+
// This must fail because alignment is violated. Test specifically for loading pointers,
8+
// which have special code in miri's memory.
9+
let _x = unsafe { *x };
10+
//~^ ERROR tried to access memory with alignment 2, but alignment
1011
}
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
fn main() {
22
let x = &2u16;
33
let x = x as *const _ as *const [u32; 0];
4-
// This must fail because alignment is violated. Test specifically for loading ZST.
5-
let _x = unsafe { *x }; //~ ERROR tried to access memory with alignment 2, but alignment 4 is required
4+
// This must fail because alignment is violated. Test specifically for loading ZST.
5+
let _x = unsafe { *x };
6+
//~^ ERROR tried to access memory with alignment 2, but alignment 4 is required
67
}
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
fn main() {
22
// Cast a function pointer such that on a call, the argument gets transmuted
3-
// from raw ptr to reference. This is ABI-compatible, so it's not the call that
3+
// from raw ptr to reference. This is ABI-compatible, so it's not the call that
44
// should fail, but validation should.
55
fn f(_x: &i32) { }
66

77
let g: fn(*const i32) = unsafe { std::mem::transmute(f as fn(&i32)) };
88

9-
g(0usize as *const i32) //~ ERROR encountered 0, but expected something greater or equal to 1
9+
g(0usize as *const i32)
10+
//~^ ERROR encountered 0, but expected something greater or equal to 1
1011
}
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
fn main() {
22
// Cast a function pointer such that when returning, the return value gets transmuted
3-
// from raw ptr to reference. This is ABI-compatible, so it's not the call that
3+
// from raw ptr to reference. This is ABI-compatible, so it's not the call that
44
// should fail, but validation should.
55
fn f() -> *const i32 { 0usize as *const i32 }
66

77
let g: fn() -> &'static i32 = unsafe { std::mem::transmute(f as fn() -> *const i32) };
88

9-
let _x = g(); //~ ERROR encountered 0, but expected something greater or equal to 1
9+
let _x = g();
10+
//~^ ERROR encountered 0, but expected something greater or equal to 1
1011
}

tests/compiletest.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,10 @@ fn miri_pass(path: &str, target: &str, opt: bool) {
8787
compiletest::run_tests(&config);
8888
}
8989

90-
/// Make sure the MIRI_SYSROOT env var is set
90+
/// Ensures that the `MIRI_SYSROOT` env var is set.
9191
fn set_sysroot() {
9292
if std::env::var("MIRI_SYSROOT").is_ok() {
93-
// Nothing to do
93+
// Nothing to do.
9494
return;
9595
}
9696
let sysroot = std::process::Command::new("rustc")

tests/run-pass/associated-const.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,3 @@
1-
// Copyright 2015 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-
111
trait Foo {
122
const ID: i32;
133
}

tests/run-pass/atomic-access-bool.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,3 @@
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-
111
use std::sync::atomic::{AtomicBool, Ordering::*};
122

133
static mut ATOMIC: AtomicBool = AtomicBool::new(false);

tests/run-pass/atomic-compare_exchange.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,3 @@
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-
111
use std::sync::atomic::{AtomicIsize, Ordering::*};
122

133
static ATOMIC: AtomicIsize = AtomicIsize::new(0);

tests/run-pass/binops.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,3 @@
1-
// Copyright 2012 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-
111
// Binop corner cases
122

133
fn test_nil() {

tests/run-pass/cast-rfc0401-vtable-kinds.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,3 @@
1-
// Copyright 2015 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-
111
// Check that you can cast between different pointers to trait objects
122
// whose vtable have the same kind (both lengths, or both trait pointers).
133

tests/run-pass/deriving-associated-types.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,3 @@
1-
// Copyright 2015 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-
111
pub trait DeclaredTrait {
122
type Type;
133
}

0 commit comments

Comments
 (0)