1
Fork 0

Rollup merge of #82217 - m-ou-se:edition-prelude, r=nikomatsakis

Edition-specific preludes

This changes `{std,core}::prelude` to export edition-specific preludes under `rust_2015`, `rust_2018` and `rust_2021`. (As suggested in https://github.com/rust-lang/rust/issues/51418#issuecomment-395630382.) For now they all just re-export `v1::*`, but this allows us to add things to the 2021edition prelude soon.

This also changes the compiler to make the automatically injected prelude import dependent on the selected edition.

cc `@rust-lang/libs` `@djc`
This commit is contained in:
Dylan DPC 2021-03-10 17:55:38 +01:00 committed by GitHub
commit 759204ffc4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 113 additions and 33 deletions

View file

@ -958,8 +958,11 @@ symbols! {
rt,
rtm_target_feature,
rust,
rust_2015,
rust_2015_preview,
rust_2018,
rust_2018_preview,
rust_2021,
rust_2021_preview,
rust_begin_unwind,
rust_eh_catch_typeinfo,