rust/src/libstd
Alex Crichton c47e2ef8d4 Destabilize the Error::type_id function
This commit destabilizes the `Error::type_id` function in the standard library.
This does so by effectively reverting #58048, restoring the `#[unstable]`
attribute. The security mailing list has recently been notified of a
vulnerability relating to the stabilization of this function. First stabilized
in Rust 1.34.0, a stable function here allows users to implement a custom
return value for this function:

    struct MyType;

    impl Error for MyType {
	fn type_id(&self) -> TypeId {
	    // Enable safe casting to `String` by accident.
	    TypeId::of::<String>()
	}
    }

This, when combined with the `Error::downcast` family of functions, allows
safely casting a type to any other type, clearly a memory safety issue! A
security announcement will be shortly posted to the security mailing list as
well as the Rust Blog, and when those links are available they'll be filled in
for this PR as well.

This commit simply destabilizes the `Error::type_id` which, although breaking
for users since Rust 1.34.0, is hoped to have little impact and has been deemed
sufficient to mitigate this issue for the stable channel. The long-term fate of
the `Error::type_id` API will be discussed at #60784.
2019-05-13 08:18:37 -07:00
..
collections ignore-tidy-filelength on all files with greater than 3000 lines 2019-04-25 21:39:09 +01:00
ffi Mark unix::ffi::OsStrExt methods as inline 2019-04-04 10:55:31 +02:00
io Rollup merge of #60234 - tesaguri:cursor-default, r=Amanieu 2019-05-09 23:56:11 +02:00
net Stabilized vectored IO 2019-04-27 08:34:08 -07:00
os Categorize WASI as an "OS" rather than as an "environment". 2019-05-03 23:01:24 -07:00
prelude libstd => 2018 2019-02-28 04:06:15 +09:00
sync ignore-tidy-filelength on all files with greater than 3000 lines 2019-04-25 21:39:09 +01:00
sys Categorize WASI as an "OS" rather than as an "environment". 2019-05-03 23:01:24 -07:00
sys_common Auto merge of #60204 - jethrogb:jb/rtunwrap-debug-print, r=alexcrichton 2019-04-30 22:46:28 +00:00
tests libstd => 2018 2019-02-28 04:06:15 +09:00
thread Use more realistic example for thread builder 2019-04-18 14:58:38 +03:00
alloc.rs Add Default to std::alloc::System 2019-03-27 00:09:12 +01:00
ascii.rs Remove licenses 2018-12-25 21:08:33 -07:00
build.rs libstd => 2018 2019-02-28 04:06:15 +09:00
Cargo.toml std: Update compiler-builtins crate 2019-05-08 06:59:24 -07:00
env.rs Document Item type in std::env::SplitPaths iterator. 2019-04-17 08:11:37 +01:00
error.rs Destabilize the Error::type_id function 2019-05-13 08:18:37 -07:00
f32.rs Change copytest parameter name from y to sign 2019-04-05 20:30:45 -06:00
f64.rs Change copytest parameter name from y to sign 2019-04-05 20:30:45 -06:00
fs.rs Make std::fs::copy attempt to create copy-on-write clones of files on MacOS. 2019-05-02 09:41:37 +01:00
future.rs Stabilize futures_api 2019-04-23 16:13:53 -07:00
keyword_docs.rs Fix links on keyword docs. 2019-04-09 15:38:32 -07:00
lib.rs Fix cfg(test) build on SGX 2019-05-09 15:00:06 -07:00
macros.rs Remove the old await! macro 2019-05-09 10:49:39 -07:00
memchr.rs libstd => 2018 2019-02-28 04:06:15 +09:00
num.rs Reexport IntErrorKind in std 2019-04-23 00:15:43 +02:00
panic.rs Stabilize futures_api 2019-04-23 16:13:53 -07:00
panicking.rs libstd: deny(elided_lifetimes_in_paths) 2019-03-31 12:56:51 +02:00
path.rs ignore-tidy-filelength on all files with greater than 3000 lines 2019-04-25 21:39:09 +01:00
primitive_docs.rs Correct code points to match their textual description 2019-05-04 07:44:30 +02:00
process.rs doc: Warn about possible zombie apocalypse 2019-05-01 17:46:30 +02:00
rt.rs libstd => 2018 2019-02-28 04:06:15 +09:00
time.rs libstd: deny(elided_lifetimes_in_paths) 2019-03-31 12:56:51 +02:00