about summary refs log tree commit diff
path: root/src/test/ui/error-codes
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-04-04 18:11:51 +0000
committerbors <bors@rust-lang.org>2018-04-04 18:11:51 +0000
commitfb44b4c0eb1d344f84f7bb2c90f28e31a8a180be (patch)
tree9f860914840b493b7f11e1be457a861ec0c63e29 /src/test/ui/error-codes
parent17fea66ba46bb32d1a49495518d899cede1d298a (diff)
parent87c08f9926b7078489a93cedd1c9f10df1bdf2e0 (diff)
downloadrust-fb44b4c0eb1d344f84f7bb2c90f28e31a8a180be.tar.gz
rust-fb44b4c0eb1d344f84f7bb2c90f28e31a8a180be.zip
Auto merge of #48171 - FraGag:doc-copy-clone-impls, r=nikomatsakis
Better document the implementors of Clone and Copy

There are two parts to this change. The first part is a change to the compiler and to the standard library (specifically, libcore) to allow implementations of `Clone` and `Copy` to be written for a subset of builtin types. By adding these implementations to libcore, they now show up in the documentation. This is a [breaking-change] for users of `#![no_core]`, because they will now have to supply their own copy of the implementations of `Clone` and `Copy` that were added in libcore.

The second part is purely a documentation change to document the other implementors of `Clone` and `Copy` that cannot be described in Rust code (yet) and are thus provided by the compiler.

Fixes #25893
Diffstat (limited to 'src/test/ui/error-codes')
-rw-r--r--src/test/ui/error-codes/E0206.rs4
-rw-r--r--src/test/ui/error-codes/E0206.stderr4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/test/ui/error-codes/E0206.rs b/src/test/ui/error-codes/E0206.rs
index da0370b301b..9b3d1b351dd 100644
--- a/src/test/ui/error-codes/E0206.rs
+++ b/src/test/ui/error-codes/E0206.rs
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-type Foo = i32;
+type Foo = [u8; 256];
 
 impl Copy for Foo { }
 //~^ ERROR the trait `Copy` may not be implemented for this type
@@ -17,7 +17,7 @@ impl Copy for Foo { }
 #[derive(Copy, Clone)]
 struct Bar;
 
-impl Copy for &'static Bar { }
+impl Copy for &'static mut Bar { }
 //~^ ERROR the trait `Copy` may not be implemented for this type
 
 fn main() {
diff --git a/src/test/ui/error-codes/E0206.stderr b/src/test/ui/error-codes/E0206.stderr
index bbc0da2248f..f2c23b0767a 100644
--- a/src/test/ui/error-codes/E0206.stderr
+++ b/src/test/ui/error-codes/E0206.stderr
@@ -7,8 +7,8 @@ LL | impl Copy for Foo { }
 error[E0206]: the trait `Copy` may not be implemented for this type
   --> $DIR/E0206.rs:20:15
    |
-LL | impl Copy for &'static Bar { }
-   |               ^^^^^^^^^^^^ type is not a structure or enumeration
+LL | impl Copy for &'static mut Bar { }
+   |               ^^^^^^^^^^^^^^^^ type is not a structure or enumeration
 
 error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
   --> $DIR/E0206.rs:13:1