rust/src
bors f59c71eb8e Auto merge of #60787 - alexcrichton:error-type-id-destabilize-master, r=pietroalbini
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
formal announcement has been made to the [security mailing list](https://groups.google.com/forum/#!topic/rustlang-security-announcements/aZabeCMUv70) as well as [the blog](https://blog.rust-lang.org/2019/05/13/Security-advisory.html)

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-14 15:58:33 +00:00
..
bootstrap Make tests compatible with musl host 2019-05-10 16:12:47 +02:00
build_helper
ci Conditionally provide cc in musl-toolchain.sh 2019-05-10 16:12:47 +02:00
doc Update cargo, books 2019-04-23 21:39:27 -07:00
etc
grammar
liballoc Auto merge of #60396 - cuviper:ordered-retain, r=scottmcm 2019-05-12 06:24:10 +00:00
libarena Deny internal in stage0 2019-04-17 05:15:00 +02:00
libcore Rollup merge of #60201 - RalfJung:core-tests, r=alexcrichton 2019-05-13 21:36:51 +02:00
libfmt_macros Deny internal in stage0 2019-04-17 05:15:00 +02:00
libgraphviz
libpanic_abort
libpanic_unwind Stabilize the alloc crate. 2019-04-12 20:07:30 +02:00
libproc_macro proc_macro: stop using LEB128 for RPC. 2019-04-09 21:05:15 +03:00
libprofiler_builtins libprofiler_builtins: Set compilation flags more correctly for C code. 2019-05-08 17:02:58 +02:00
librustc Auto merge of #60765 - matthewjasper:fix-more-escaping-rescopes, r=oli-obk 2019-05-13 08:13:01 +00:00
librustc_allocator Pass a Symbol to check_name, emit_feature_err, and related functions. 2019-05-13 09:29:22 +10:00
librustc_apfloat ignore-tidy-filelength on all files with greater than 3000 lines 2019-04-25 21:39:09 +01:00
librustc_asan Update cmake, cc and compiler_builtins for VS 2019 support 2019-04-10 21:17:31 +02:00
librustc_borrowck Auto merge of #60195 - varkor:commontypes-to-common, r=eddyb 2019-05-01 09:32:58 +00:00
librustc_codegen_llvm Pass a Symbol to check_name, emit_feature_err, and related functions. 2019-05-13 09:29:22 +10:00
librustc_codegen_ssa Remove the equality operation between Symbol and strings. 2019-05-13 09:31:30 +10:00
librustc_codegen_utils Remove the equality operation between Symbol and strings. 2019-05-13 09:31:30 +10:00
librustc_cratesio_shim
librustc_data_structures Delegate SmallVec's stable_hash to array's stable_hash. 2019-05-04 20:29:35 +02:00
librustc_driver Remove the equality operation between Symbol and strings. 2019-05-13 09:31:30 +10:00
librustc_errors Remove hir::ExprKind::If and replace it with lowering to hir::ExprKind::Match. 2019-05-10 19:41:10 +02:00
librustc_fs_util
librustc_incremental Pass a Symbol to check_name, emit_feature_err, and related functions. 2019-05-13 09:29:22 +10:00
librustc_interface Remove the equality operation between Symbol and strings. 2019-05-13 09:31:30 +10:00
librustc_lint Return a Symbol from name_or_empty functions. 2019-05-13 09:31:32 +10:00
librustc_llvm
librustc_lsan Update cmake, cc and compiler_builtins for VS 2019 support 2019-04-10 21:17:31 +02:00
librustc_macros Add lots of static Symbols. 2019-05-13 09:26:43 +10:00
librustc_metadata Return a Symbol from name_or_empty functions. 2019-05-13 09:31:32 +10:00
librustc_mir Rollup merge of #60176 - matthewjasper:yield-ref-to-local, r=pnkfelix 2019-05-13 21:36:49 +02:00
librustc_msan Update cmake, cc and compiler_builtins for VS 2019 support 2019-04-10 21:17:31 +02:00
librustc_passes Auto merge of #60630 - nnethercote:use-Symbol-more, r=petrochenkov 2019-05-13 00:28:38 +00:00
librustc_plugin Return a Symbol from name_or_empty functions. 2019-05-13 09:31:32 +10:00
librustc_privacy Pass a Symbol to check_name, emit_feature_err, and related functions. 2019-05-13 09:29:22 +10:00
librustc_resolve Remove the equality operation between Symbol and strings. 2019-05-13 09:31:30 +10:00
librustc_save_analysis Auto merge of #60649 - Xanewok:save-analysis-assoc-const-ice, r=oli-obk 2019-05-13 10:57:59 +00:00
librustc_target Omit the vendor component in the WASI triple 2019-05-09 11:35:10 -07:00
librustc_traits Pass a Symbol to check_name, emit_feature_err, and related functions. 2019-05-13 09:29:22 +10:00
librustc_tsan Update cmake, cc and compiler_builtins for VS 2019 support 2019-04-10 21:17:31 +02:00
librustc_typeck Rollup merge of #60710 - varkor:delay_span_bug-const-parent, r=matthewjasper 2019-05-13 21:36:54 +02:00
librustdoc Return a Symbol from name_or_empty functions. 2019-05-13 09:31:32 +10:00
libserialize serialize: add missing Encodable impl for Path. 2019-05-07 02:47:45 +03:00
libstd Destabilize the Error::type_id function 2019-05-13 08:18:37 -07:00
libsyntax add impl_trait_in_bindings to INCOMPLETE_FEATURES 2019-05-13 18:45:20 +03:00
libsyntax_ext Rollup merge of #60562 - iliekturtles:proc-macro-missing-docs, r=alexcrichton 2019-05-13 21:36:52 +02:00
libsyntax_pos Remove the equality operation between Symbol and strings. 2019-05-13 09:31:30 +10:00
libterm Revert "Auto merge of #57842 - gnzlbg:extract_libtest, r=gnzlbg" 2019-04-07 03:16:31 -04:00
libtest Update getopts to 0.2.19 2019-05-05 10:45:10 +01:00
libunwind Support using LLVM's libunwind as the unwinder implementation 2019-04-03 11:21:40 -07:00
llvm-emscripten@7f23313edf
llvm-project@84abffda0e Support using LLVM's libunwind as the unwinder implementation 2019-04-03 11:21:40 -07:00
rtstartup
rustc Remove leading newlines 2019-04-22 17:01:33 +01:00
rustllvm Limit internalization in LLVM 8 ThinLTO 2019-04-26 08:58:14 -07:00
stdsimd@4bf456c35e Breaking update of stdsimd 2019-04-22 09:07:25 +02:00
test Rollup merge of #60770 - Pulkit07:issue60764, r=Centril 2019-05-13 21:36:55 +02:00
tools Auto merge of #60474 - mati865:musl_toolchain, r=alexcrichton 2019-05-12 09:19:28 +00:00
.gitignore
README.md
stage0.txt bump bootstrap => 2019-04-11 2019-04-17 05:15:00 +02:00

This directory contains the source code of the rust project, including:

  • rustc and its tests
  • libstd
  • Various submodules for tools, like rustdoc, rls, etc.

For more information on how various parts of the compiler work, see the rustc guide.

There is also useful content in the following READMEs, which are gradually being moved over to the guide: