From 8e3ce43de9844a869e85eafca531079f8e89b732 Mon Sep 17 00:00:00 2001 From: Dylan MacKenzie <ecstaticmorse@gmail.com> Date: Mon, 14 Sep 2020 16:54:53 -0700 Subject: [PATCH 01/25] Add `Engine::pass_name` to differentiate dataflow runs --- .../src/dataflow/framework/engine.rs | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/compiler/rustc_mir/src/dataflow/framework/engine.rs b/compiler/rustc_mir/src/dataflow/framework/engine.rs index 0b5b437d186aa..757709f90ff8e 100644 --- a/compiler/rustc_mir/src/dataflow/framework/engine.rs +++ b/compiler/rustc_mir/src/dataflow/framework/engine.rs @@ -84,6 +84,7 @@ where def_id: DefId, dead_unwinds: Option<&'a BitSet<BasicBlock>>, entry_sets: IndexVec<BasicBlock, A::Domain>, + pass_name: Option<&'static str>, analysis: A, /// Cached, cumulative transfer functions for each block. @@ -174,6 +175,7 @@ where body, def_id, dead_unwinds: None, + pass_name: None, entry_sets, apply_trans_for_block, } @@ -189,6 +191,15 @@ where self } + /// Adds an identifier to the graphviz output for this particular run of a dataflow analysis. + /// + /// Some analyses are run multiple times in the compilation pipeline. Give them a `pass_name` + /// to differentiate them. Otherwise, only the results for the latest run will be saved. + pub fn pass_name(mut self, name: &'static str) -> Self { + self.pass_name = Some(name); + self + } + /// Computes the fixpoint for this dataflow problem and returns it. pub fn iterate_to_fixpoint(self) -> Results<'tcx, A> where @@ -202,6 +213,7 @@ where mut entry_sets, tcx, apply_trans_for_block, + pass_name, .. } = self; @@ -249,7 +261,7 @@ where let results = Results { analysis, entry_sets }; - let res = write_graphviz_results(tcx, def_id, &body, &results); + let res = write_graphviz_results(tcx, def_id, &body, &results, pass_name); if let Err(e) = res { warn!("Failed to write graphviz dataflow results: {}", e); } @@ -267,6 +279,7 @@ fn write_graphviz_results<A>( def_id: DefId, body: &mir::Body<'tcx>, results: &Results<'tcx, A>, + pass_name: Option<&'static str>, ) -> std::io::Result<()> where A: Analysis<'tcx>, @@ -285,12 +298,17 @@ where None if tcx.sess.opts.debugging_opts.dump_mir_dataflow && dump_enabled(tcx, A::NAME, def_id) => { + // FIXME: Use some variant of `pretty::dump_path` for this let mut path = PathBuf::from(&tcx.sess.opts.debugging_opts.dump_mir_dir); + let crate_name = tcx.crate_name(def_id.krate); let item_name = ty::print::with_forced_impl_filename_line(|| { tcx.def_path(def_id).to_filename_friendly_no_crate() }); - path.push(format!("rustc.{}.{}.dot", item_name, A::NAME)); + + let pass_name = pass_name.map(|s| format!(".{}", s)).unwrap_or_default(); + + path.push(format!("{}.{}.{}{}.dot", crate_name, item_name, A::NAME, pass_name)); path } From 0475c365fedb8243219247db1186d590032b550e Mon Sep 17 00:00:00 2001 From: Dylan MacKenzie <ecstaticmorse@gmail.com> Date: Mon, 14 Sep 2020 17:13:47 -0700 Subject: [PATCH 02/25] Add pass names to some common dataflow analyses --- compiler/rustc_mir/src/borrow_check/mod.rs | 4 ++++ .../rustc_mir/src/transform/check_consts/validation.rs | 1 + compiler/rustc_mir/src/transform/elaborate_drops.rs | 3 +++ compiler/rustc_mir/src/transform/generator.rs | 7 +++++-- src/tools/clippy/clippy_lints/src/redundant_clone.rs | 1 + 5 files changed, 14 insertions(+), 2 deletions(-) diff --git a/compiler/rustc_mir/src/borrow_check/mod.rs b/compiler/rustc_mir/src/borrow_check/mod.rs index acd9e3dcf3fcd..a6f06fee3b27b 100644 --- a/compiler/rustc_mir/src/borrow_check/mod.rs +++ b/compiler/rustc_mir/src/borrow_check/mod.rs @@ -205,6 +205,7 @@ fn do_mir_borrowck<'a, 'tcx>( let mut flow_inits = MaybeInitializedPlaces::new(tcx, &body, &mdpe) .into_engine(tcx, &body, def.did.to_def_id()) + .pass_name("borrowck") .iterate_to_fixpoint() .into_results_cursor(&body); @@ -264,12 +265,15 @@ fn do_mir_borrowck<'a, 'tcx>( let flow_borrows = Borrows::new(tcx, &body, regioncx.clone(), &borrow_set) .into_engine(tcx, &body, def.did.to_def_id()) + .pass_name("borrowck") .iterate_to_fixpoint(); let flow_uninits = MaybeUninitializedPlaces::new(tcx, &body, &mdpe) .into_engine(tcx, &body, def.did.to_def_id()) + .pass_name("borrowck") .iterate_to_fixpoint(); let flow_ever_inits = EverInitializedPlaces::new(tcx, &body, &mdpe) .into_engine(tcx, &body, def.did.to_def_id()) + .pass_name("borrowck") .iterate_to_fixpoint(); let movable_generator = match tcx.hir().get(id) { diff --git a/compiler/rustc_mir/src/transform/check_consts/validation.rs b/compiler/rustc_mir/src/transform/check_consts/validation.rs index e8411b121e394..ef306813825f5 100644 --- a/compiler/rustc_mir/src/transform/check_consts/validation.rs +++ b/compiler/rustc_mir/src/transform/check_consts/validation.rs @@ -57,6 +57,7 @@ impl Qualifs<'mir, 'tcx> { MaybeMutBorrowedLocals::mut_borrows_only(tcx, &body, param_env) .unsound_ignore_borrow_on_drop() .into_engine(tcx, &body, def_id.to_def_id()) + .pass_name("const_qualification") .iterate_to_fixpoint() .into_results_cursor(&body) }); diff --git a/compiler/rustc_mir/src/transform/elaborate_drops.rs b/compiler/rustc_mir/src/transform/elaborate_drops.rs index 5f1930693568c..a8b2ee5705f1f 100644 --- a/compiler/rustc_mir/src/transform/elaborate_drops.rs +++ b/compiler/rustc_mir/src/transform/elaborate_drops.rs @@ -44,6 +44,7 @@ impl<'tcx> MirPass<'tcx> for ElaborateDrops { let inits = MaybeInitializedPlaces::new(tcx, body, &env) .into_engine(tcx, body, def_id) .dead_unwinds(&dead_unwinds) + .pass_name("elaborate_drops") .iterate_to_fixpoint() .into_results_cursor(body); @@ -51,6 +52,7 @@ impl<'tcx> MirPass<'tcx> for ElaborateDrops { .mark_inactive_variants_as_uninit() .into_engine(tcx, body, def_id) .dead_unwinds(&dead_unwinds) + .pass_name("elaborate_drops") .iterate_to_fixpoint() .into_results_cursor(body); @@ -83,6 +85,7 @@ fn find_dead_unwinds<'tcx>( let mut dead_unwinds = BitSet::new_empty(body.basic_blocks().len()); let mut flow_inits = MaybeInitializedPlaces::new(tcx, body, &env) .into_engine(tcx, body, def_id) + .pass_name("find_dead_unwinds") .iterate_to_fixpoint() .into_results_cursor(body); for (bb, bb_data) in body.basic_blocks().iter_enumerated() { diff --git a/compiler/rustc_mir/src/transform/generator.rs b/compiler/rustc_mir/src/transform/generator.rs index 78cedec502007..1fffcf8151537 100644 --- a/compiler/rustc_mir/src/transform/generator.rs +++ b/compiler/rustc_mir/src/transform/generator.rs @@ -467,8 +467,10 @@ fn locals_live_across_suspend_points( // Calculate the MIR locals which have been previously // borrowed (even if they are still active). - let borrowed_locals_results = - MaybeBorrowedLocals::all_borrows().into_engine(tcx, body_ref, def_id).iterate_to_fixpoint(); + let borrowed_locals_results = MaybeBorrowedLocals::all_borrows() + .into_engine(tcx, body_ref, def_id) + .pass_name("generator") + .iterate_to_fixpoint(); let mut borrowed_locals_cursor = dataflow::ResultsCursor::new(body_ref, &borrowed_locals_results); @@ -484,6 +486,7 @@ fn locals_live_across_suspend_points( // Calculate the liveness of MIR locals ignoring borrows. let mut liveness = MaybeLiveLocals .into_engine(tcx, body_ref, def_id) + .pass_name("generator") .iterate_to_fixpoint() .into_results_cursor(body_ref); diff --git a/src/tools/clippy/clippy_lints/src/redundant_clone.rs b/src/tools/clippy/clippy_lints/src/redundant_clone.rs index 57a45e628db61..1615f19237096 100644 --- a/src/tools/clippy/clippy_lints/src/redundant_clone.rs +++ b/src/tools/clippy/clippy_lints/src/redundant_clone.rs @@ -87,6 +87,7 @@ impl<'tcx> LateLintPass<'tcx> for RedundantClone { let maybe_storage_live_result = MaybeStorageLive .into_engine(cx.tcx, mir, def_id.to_def_id()) + .pass_name("redundant_clone") .iterate_to_fixpoint() .into_results_cursor(mir); let mut possible_borrower = { From 3f0f40904c18bce9915b5fe2a1d017f3906c0d26 Mon Sep 17 00:00:00 2001 From: Erik Hofmayer <ehofmayer@outlook.de> Date: Sun, 20 Sep 2020 15:50:44 +0200 Subject: [PATCH 03/25] Documented From impls in std/sync/mpsc/mod.rs --- library/std/src/sync/mpsc/mod.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/library/std/src/sync/mpsc/mod.rs b/library/std/src/sync/mpsc/mod.rs index 073f969bbe25b..d23a8161a229c 100644 --- a/library/std/src/sync/mpsc/mod.rs +++ b/library/std/src/sync/mpsc/mod.rs @@ -1531,6 +1531,9 @@ impl<T: Send> error::Error for TrySendError<T> { #[stable(feature = "mpsc_error_conversions", since = "1.24.0")] impl<T> From<SendError<T>> for TrySendError<T> { + /// Converts a `SendError<T>` into a `TrySendError<T>`. + /// This conversion always returns a `TrySendError::Disconnected` containing the data in the `SendError<T>`. + /// No data is allocated on the heap. fn from(err: SendError<T>) -> TrySendError<T> { match err { SendError(t) => TrySendError::Disconnected(t), @@ -1576,6 +1579,9 @@ impl error::Error for TryRecvError { #[stable(feature = "mpsc_error_conversions", since = "1.24.0")] impl From<RecvError> for TryRecvError { + /// Converts a `RecvError` into a `TryRecvError`. + /// This conversion always returns `TryRecvError::Disconnected`. + /// No data is allocated on the heap. fn from(err: RecvError) -> TryRecvError { match err { RecvError => TryRecvError::Disconnected, @@ -1606,6 +1612,9 @@ impl error::Error for RecvTimeoutError { #[stable(feature = "mpsc_error_conversions", since = "1.24.0")] impl From<RecvError> for RecvTimeoutError { + /// Converts a `RecvError` into a `RecvTimeoutError`. + /// This conversion always returns `RecvTimeoutError::Disconnected`. + /// No data is allocated on the heap. fn from(err: RecvError) -> RecvTimeoutError { match err { RecvError => RecvTimeoutError::Disconnected, From 16eee2a04a4c3a93d398728d7a0c05a8afb6ca94 Mon Sep 17 00:00:00 2001 From: Erik Hofmayer <ehofmayer@outlook.de> Date: Mon, 21 Sep 2020 21:31:01 +0200 Subject: [PATCH 04/25] Applied review comments --- library/std/src/sync/mpsc/mod.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/library/std/src/sync/mpsc/mod.rs b/library/std/src/sync/mpsc/mod.rs index d23a8161a229c..dc13c9433f121 100644 --- a/library/std/src/sync/mpsc/mod.rs +++ b/library/std/src/sync/mpsc/mod.rs @@ -1532,7 +1532,9 @@ impl<T: Send> error::Error for TrySendError<T> { #[stable(feature = "mpsc_error_conversions", since = "1.24.0")] impl<T> From<SendError<T>> for TrySendError<T> { /// Converts a `SendError<T>` into a `TrySendError<T>`. + /// /// This conversion always returns a `TrySendError::Disconnected` containing the data in the `SendError<T>`. + /// /// No data is allocated on the heap. fn from(err: SendError<T>) -> TrySendError<T> { match err { @@ -1580,7 +1582,9 @@ impl error::Error for TryRecvError { #[stable(feature = "mpsc_error_conversions", since = "1.24.0")] impl From<RecvError> for TryRecvError { /// Converts a `RecvError` into a `TryRecvError`. + /// /// This conversion always returns `TryRecvError::Disconnected`. + /// /// No data is allocated on the heap. fn from(err: RecvError) -> TryRecvError { match err { @@ -1613,7 +1617,9 @@ impl error::Error for RecvTimeoutError { #[stable(feature = "mpsc_error_conversions", since = "1.24.0")] impl From<RecvError> for RecvTimeoutError { /// Converts a `RecvError` into a `RecvTimeoutError`. + /// /// This conversion always returns `RecvTimeoutError::Disconnected`. + /// /// No data is allocated on the heap. fn from(err: RecvError) -> RecvTimeoutError { match err { From 4a6bc77a0160a4540dea03e39642c373ca9f2a69 Mon Sep 17 00:00:00 2001 From: Ivan Tham <pickfire@riseup.net> Date: Tue, 22 Sep 2020 14:26:15 +0800 Subject: [PATCH 05/25] Liballoc bench vec use mem take not replace --- library/alloc/benches/vec.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/library/alloc/benches/vec.rs b/library/alloc/benches/vec.rs index b295342f3610e..687efa8e9e777 100644 --- a/library/alloc/benches/vec.rs +++ b/library/alloc/benches/vec.rs @@ -241,7 +241,7 @@ fn bench_extend_recycle(b: &mut Bencher) { let mut data = vec![0; 1000]; b.iter(|| { - let tmp = std::mem::replace(&mut data, Vec::new()); + let tmp = std::mem::take(&mut data); let mut to_extend = black_box(Vec::new()); to_extend.extend(tmp.into_iter()); data = black_box(to_extend); @@ -500,7 +500,7 @@ fn bench_in_place_recycle(b: &mut Bencher) { let mut data = vec![0; 1000]; b.iter(|| { - let tmp = std::mem::replace(&mut data, Vec::new()); + let tmp = std::mem::take(&mut data); data = black_box( tmp.into_iter() .enumerate() @@ -520,7 +520,7 @@ fn bench_in_place_zip_recycle(b: &mut Bencher) { rng.fill_bytes(&mut subst[..]); b.iter(|| { - let tmp = std::mem::replace(&mut data, Vec::new()); + let tmp = std::mem::take(&mut data); let mangled = tmp .into_iter() .zip(subst.iter().copied()) From 0082d201f1ea8ce106f1c71562d5f2d0d2e35513 Mon Sep 17 00:00:00 2001 From: follower <follower@rancidbacon.com> Date: Tue, 22 Sep 2020 20:54:07 +1200 Subject: [PATCH 06/25] Typo fix: "satsify" -> "satisfy" --- library/alloc/src/vec.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/alloc/src/vec.rs b/library/alloc/src/vec.rs index 8c0b6af54829b..d3845cbbc5e06 100644 --- a/library/alloc/src/vec.rs +++ b/library/alloc/src/vec.rs @@ -412,7 +412,7 @@ impl<T> Vec<T> { /// (at least, it's highly likely to be incorrect if it wasn't). /// * `T` needs to have the same size and alignment as what `ptr` was allocated with. /// (`T` having a less strict alignment is not sufficient, the alignment really - /// needs to be equal to satsify the [`dealloc`] requirement that memory must be + /// needs to be equal to satisfy the [`dealloc`] requirement that memory must be /// allocated and deallocated with the same layout.) /// * `length` needs to be less than or equal to `capacity`. /// * `capacity` needs to be the capacity that the pointer was allocated with. From 179f63dafcf9463b48d82e8698a844e18bf94370 Mon Sep 17 00:00:00 2001 From: Bastian Kauschke <bastian_kauschke@hotmail.de> Date: Tue, 22 Sep 2020 21:35:43 +0200 Subject: [PATCH 07/25] add array from_ref --- library/core/src/array/mod.rs | 14 ++++++++++++++ library/core/tests/array.rs | 17 ++++++++++++++++- library/core/tests/lib.rs | 1 + 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/library/core/src/array/mod.rs b/library/core/src/array/mod.rs index c1d3aca6fdd4f..5730074bf2747 100644 --- a/library/core/src/array/mod.rs +++ b/library/core/src/array/mod.rs @@ -19,6 +19,20 @@ mod iter; #[unstable(feature = "array_value_iter", issue = "65798")] pub use iter::IntoIter; +/// Converts a reference to `T` into a reference to an array of length 1 (without copying). +#[unstable(feature = "array_from_ref", issue = "none")] +pub fn from_ref<T>(s: &T) -> &[T; 1] { + // SAFETY: Converting `&T` to `&[T; 1]` is sound. + unsafe { &*(s as *const T).cast::<[T; 1]>() } +} + +/// Converts a mutable reference to `T` into a mutable reference to an array of length 1 (without copying). +#[unstable(feature = "array_from_ref", issue = "none")] +pub fn from_mut<T>(s: &mut T) -> &mut [T; 1] { + // SAFETY: Converting `&mut T` to `&mut [T; 1]` is sound. + unsafe { &mut *(s as *mut T).cast::<[T; 1]>() } +} + /// Utility trait implemented only on arrays of fixed size /// /// This trait can be used to implement other traits on fixed-size arrays diff --git a/library/core/tests/array.rs b/library/core/tests/array.rs index 5aba1a5d958d1..dbcea2747a00d 100644 --- a/library/core/tests/array.rs +++ b/library/core/tests/array.rs @@ -1,4 +1,4 @@ -use core::array::{FixedSizeArray, IntoIter}; +use core::array::{self, FixedSizeArray, IntoIter}; use core::convert::TryFrom; #[test] @@ -19,6 +19,21 @@ fn fixed_size_array() { assert_eq!(FixedSizeArray::as_mut_slice(&mut empty_zero_sized).len(), 0); } +#[test] +fn array_from_ref() { + let value: String = "Hello World!".into(); + let arr: &[String; 1] = array::from_ref(&value); + assert_eq!(&[value.clone()], arr); +} + +#[test] +fn array_from_mut() { + let mut value: String = "Hello World".into(); + let arr: &mut [String; 1] = array::from_mut(&mut value); + arr[0].push_str("!"); + assert_eq!(&value, "Hello World!"); +} + #[test] fn array_try_from() { macro_rules! test { diff --git a/library/core/tests/lib.rs b/library/core/tests/lib.rs index 7e75c7cf47bf6..d8b36beb3e085 100644 --- a/library/core/tests/lib.rs +++ b/library/core/tests/lib.rs @@ -1,5 +1,6 @@ #![feature(alloc_layout_extra)] #![feature(array_chunks)] +#![feature(array_from_ref)] #![feature(array_methods)] #![feature(array_map)] #![feature(array_windows)] From b6e72837fd36f65f7ff73dcf6e915971296a9af8 Mon Sep 17 00:00:00 2001 From: Alexis Bourget <alexis.bourget@gmail.com> Date: Tue, 22 Sep 2020 23:36:08 +0200 Subject: [PATCH 08/25] Use Self more in core/src/cmp.rs --- library/core/src/cmp.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/library/core/src/cmp.rs b/library/core/src/cmp.rs index dde442aa7b52d..ee79a94cc66ab 100644 --- a/library/core/src/cmp.rs +++ b/library/core/src/cmp.rs @@ -726,19 +726,19 @@ impl PartialOrd for Ordering { /// } /// /// impl PartialOrd for Person { -/// fn partial_cmp(&self, other: &Person) -> Option<Ordering> { +/// fn partial_cmp(&self, other: &Self) -> Option<Ordering> { /// Some(self.cmp(other)) /// } /// } /// /// impl Ord for Person { -/// fn cmp(&self, other: &Person) -> Ordering { +/// fn cmp(&self, other: &Self) -> Ordering { /// self.height.cmp(&other.height) /// } /// } /// /// impl PartialEq for Person { -/// fn eq(&self, other: &Person) -> bool { +/// fn eq(&self, other: &Self) -> bool { /// self.height == other.height /// } /// } From 87a5dec4db20aa4e45b0db63f762681de084ad58 Mon Sep 17 00:00:00 2001 From: Alexis Bourget <alexis.bourget@gmail.com> Date: Wed, 23 Sep 2020 00:16:16 +0200 Subject: [PATCH 09/25] Use Self more in core in doc when possible --- library/core/src/marker.rs | 4 +- library/core/src/ops/arith.rs | 22 +++++------ library/core/src/ops/bit.rs | 69 ++++++++++++++++++----------------- library/core/src/ops/mod.rs | 12 +++--- 4 files changed, 55 insertions(+), 52 deletions(-) diff --git a/library/core/src/marker.rs b/library/core/src/marker.rs index 9340b591ebd70..cdf742057b7b6 100644 --- a/library/core/src/marker.rs +++ b/library/core/src/marker.rs @@ -643,9 +643,9 @@ macro_rules! impls { /// } /// /// impl<R: ResType> ExternalResource<R> { -/// fn new() -> ExternalResource<R> { +/// fn new() -> Self { /// let size_of_res = mem::size_of::<R>(); -/// ExternalResource { +/// Self { /// resource_handle: foreign_lib::new(size_of_res), /// resource_type: PhantomData, /// } diff --git a/library/core/src/ops/arith.rs b/library/core/src/ops/arith.rs index bdf93baa1b8f9..19f86ced5007c 100644 --- a/library/core/src/ops/arith.rs +++ b/library/core/src/ops/arith.rs @@ -128,10 +128,10 @@ add_impl! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 f32 f64 } /// } /// /// impl Sub for Point { -/// type Output = Point; +/// type Output = Self; /// -/// fn sub(self, other: Point) -> Point { -/// Point { +/// fn sub(self, other: Self) -> Self::Output { +/// Self { /// x: self.x - other.x, /// y: self.y - other.y, /// } @@ -241,7 +241,7 @@ sub_impl! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 f32 f64 } /// // Reduce to lowest terms by dividing by the greatest common /// // divisor. /// let gcd = gcd(numerator, denominator); -/// Rational { +/// Self { /// numerator: numerator / gcd, /// denominator: denominator / gcd, /// } @@ -255,7 +255,7 @@ sub_impl! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 f32 f64 } /// fn mul(self, rhs: Self) -> Self { /// let numerator = self.numerator * rhs.numerator; /// let denominator = self.denominator * rhs.denominator; -/// Rational::new(numerator, denominator) +/// Self::new(numerator, denominator) /// } /// } /// @@ -291,7 +291,7 @@ sub_impl! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 f32 f64 } /// type Output = Self; /// /// fn mul(self, rhs: Scalar) -> Self::Output { -/// Vector { value: self.value.iter().map(|v| v * rhs.value).collect() } +/// Self { value: self.value.iter().map(|v| v * rhs.value).collect() } /// } /// } /// @@ -369,7 +369,7 @@ mul_impl! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 f32 f64 } /// // Reduce to lowest terms by dividing by the greatest common /// // divisor. /// let gcd = gcd(numerator, denominator); -/// Rational { +/// Self { /// numerator: numerator / gcd, /// denominator: denominator / gcd, /// } @@ -387,7 +387,7 @@ mul_impl! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 f32 f64 } /// /// let numerator = self.numerator * rhs.denominator; /// let denominator = self.denominator * rhs.numerator; -/// Rational::new(numerator, denominator) +/// Self::new(numerator, denominator) /// } /// } /// @@ -423,7 +423,7 @@ mul_impl! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 f32 f64 } /// type Output = Self; /// /// fn div(self, rhs: Scalar) -> Self::Output { -/// Vector { value: self.value.iter().map(|v| v / rhs.value).collect() } +/// Self { value: self.value.iter().map(|v| v / rhs.value).collect() } /// } /// } /// @@ -515,7 +515,7 @@ div_impl_float! { f32 f64 } /// let len = self.slice.len(); /// let rem = len % modulus; /// let start = len - rem; -/// SplitSlice {slice: &self.slice[start..]} +/// Self {slice: &self.slice[start..]} /// } /// } /// @@ -615,7 +615,7 @@ rem_impl_float! { f32 f64 } /// } /// /// impl Neg for Sign { -/// type Output = Sign; +/// type Output = Self; /// /// fn neg(self) -> Self::Output { /// match self { diff --git a/library/core/src/ops/bit.rs b/library/core/src/ops/bit.rs index 3d71e0b0002c2..6120da50c3cdf 100644 --- a/library/core/src/ops/bit.rs +++ b/library/core/src/ops/bit.rs @@ -15,7 +15,7 @@ /// } /// /// impl Not for Answer { -/// type Output = Answer; +/// type Output = Self; /// /// fn not(self) -> Self::Output { /// match self { @@ -85,7 +85,7 @@ not_impl! { bool usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 } /// /// // rhs is the "right-hand side" of the expression `a & b` /// fn bitand(self, rhs: Self) -> Self::Output { -/// Scalar(self.0 & rhs.0) +/// Self(self.0 & rhs.0) /// } /// } /// @@ -106,10 +106,13 @@ not_impl! { bool usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 } /// impl BitAnd for BooleanVector { /// type Output = Self; /// -/// fn bitand(self, BooleanVector(rhs): Self) -> Self::Output { -/// let BooleanVector(lhs) = self; +/// fn bitand(self, Self(rhs): Self) -> Self::Output { +/// let Self(lhs) = self; /// assert_eq!(lhs.len(), rhs.len()); -/// BooleanVector(lhs.iter().zip(rhs.iter()).map(|(x, y)| *x && *y).collect()) +/// Self(lhs.iter() +/// .zip(rhs.iter()) +/// .map(|(x, y)| *x && *y) +/// .collect()) /// } /// } /// @@ -179,8 +182,8 @@ bitand_impl! { bool usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 } /// type Output = Self; /// /// // rhs is the "right-hand side" of the expression `a | b` -/// fn bitor(self, rhs: Self) -> Self { -/// Scalar(self.0 | rhs.0) +/// fn bitor(self, rhs: Self) -> Self::Output { +/// Self(self.0 | rhs.0) /// } /// } /// @@ -201,10 +204,10 @@ bitand_impl! { bool usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 } /// impl BitOr for BooleanVector { /// type Output = Self; /// -/// fn bitor(self, BooleanVector(rhs): Self) -> Self::Output { -/// let BooleanVector(lhs) = self; +/// fn bitor(self, Self(rhs): Self) -> Self::Output { +/// let Self(lhs) = self; /// assert_eq!(lhs.len(), rhs.len()); -/// BooleanVector(lhs.iter().zip(rhs.iter()).map(|(x, y)| *x || *y).collect()) +/// Self(lhs.iter().zip(rhs.iter()).map(|(x, y)| *x || *y).collect()) /// } /// } /// @@ -275,7 +278,7 @@ bitor_impl! { bool usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 } /// /// // rhs is the "right-hand side" of the expression `a ^ b` /// fn bitxor(self, rhs: Self) -> Self::Output { -/// Scalar(self.0 ^ rhs.0) +/// Self(self.0 ^ rhs.0) /// } /// } /// @@ -296,13 +299,13 @@ bitor_impl! { bool usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 } /// impl BitXor for BooleanVector { /// type Output = Self; /// -/// fn bitxor(self, BooleanVector(rhs): Self) -> Self::Output { -/// let BooleanVector(lhs) = self; +/// fn bitxor(self, Self(rhs): Self) -> Self::Output { +/// let Self(lhs) = self; /// assert_eq!(lhs.len(), rhs.len()); -/// BooleanVector(lhs.iter() -/// .zip(rhs.iter()) -/// .map(|(x, y)| (*x || *y) && !(*x && *y)) -/// .collect()) +/// Self(lhs.iter() +/// .zip(rhs.iter()) +/// .map(|(x, y)| (*x || *y) && !(*x && *y)) +/// .collect()) /// } /// } /// @@ -375,9 +378,9 @@ bitxor_impl! { bool usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 } /// impl Shl<Scalar> for Scalar { /// type Output = Self; /// -/// fn shl(self, Scalar(rhs): Self) -> Scalar { -/// let Scalar(lhs) = self; -/// Scalar(lhs << rhs) +/// fn shl(self, Self(rhs): Self) -> Self::Output { +/// let Self(lhs) = self; +/// Self(lhs << rhs) /// } /// } /// @@ -400,10 +403,10 @@ bitxor_impl! { bool usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 } /// fn shl(self, rhs: usize) -> Self::Output { /// // Rotate the vector by `rhs` places. /// let (a, b) = self.vec.split_at(rhs); -/// let mut spun_vector: Vec<T> = vec![]; +/// let mut spun_vector = vec![]; /// spun_vector.extend_from_slice(b); /// spun_vector.extend_from_slice(a); -/// SpinVector { vec: spun_vector } +/// Self { vec: spun_vector } /// } /// } /// @@ -493,9 +496,9 @@ shl_impl_all! { u8 u16 u32 u64 u128 usize i8 i16 i32 i64 isize i128 } /// impl Shr<Scalar> for Scalar { /// type Output = Self; /// -/// fn shr(self, Scalar(rhs): Self) -> Scalar { -/// let Scalar(lhs) = self; -/// Scalar(lhs >> rhs) +/// fn shr(self, Self(rhs): Self) -> Self::Output { +/// let Self(lhs) = self; +/// Self(lhs >> rhs) /// } /// } /// @@ -518,10 +521,10 @@ shl_impl_all! { u8 u16 u32 u64 u128 usize i8 i16 i32 i64 isize i128 } /// fn shr(self, rhs: usize) -> Self::Output { /// // Rotate the vector by `rhs` places. /// let (a, b) = self.vec.split_at(self.vec.len() - rhs); -/// let mut spun_vector: Vec<T> = vec![]; +/// let mut spun_vector = vec![]; /// spun_vector.extend_from_slice(b); /// spun_vector.extend_from_slice(a); -/// SpinVector { vec: spun_vector } +/// Self { vec: spun_vector } /// } /// } /// @@ -606,7 +609,7 @@ shr_impl_all! { u8 u16 u32 u64 u128 usize i8 i16 i32 i64 i128 isize } /// impl BitAndAssign for Scalar { /// // rhs is the "right-hand side" of the expression `a &= b` /// fn bitand_assign(&mut self, rhs: Self) { -/// *self = Scalar(self.0 & rhs.0) +/// *self = Self(self.0 & rhs.0) /// } /// } /// @@ -640,11 +643,11 @@ shr_impl_all! { u8 u16 u32 u64 u128 usize i8 i16 i32 i64 i128 isize } /// // `rhs` is the "right-hand side" of the expression `a &= b`. /// fn bitand_assign(&mut self, rhs: Self) { /// assert_eq!(self.0.len(), rhs.0.len()); -/// *self = BooleanVector(self.0 -/// .iter() -/// .zip(rhs.0.iter()) -/// .map(|(x, y)| *x && *y) -/// .collect()); +/// *self = Self(self.0 +/// .iter() +/// .zip(rhs.0.iter()) +/// .map(|(x, y)| *x && *y) +/// .collect()); /// } /// } /// diff --git a/library/core/src/ops/mod.rs b/library/core/src/ops/mod.rs index 2a4186f9d5db9..354ad6b7b7333 100644 --- a/library/core/src/ops/mod.rs +++ b/library/core/src/ops/mod.rs @@ -49,18 +49,18 @@ //! } //! //! impl Add for Point { -//! type Output = Point; +//! type Output = Self; //! -//! fn add(self, other: Point) -> Point { -//! Point {x: self.x + other.x, y: self.y + other.y} +//! fn add(self, other: Self) -> Self { +//! Self {x: self.x + other.x, y: self.y + other.y} //! } //! } //! //! impl Sub for Point { -//! type Output = Point; +//! type Output = Self; //! -//! fn sub(self, other: Point) -> Point { -//! Point {x: self.x - other.x, y: self.y - other.y} +//! fn sub(self, other: Self) -> Self { +//! Self {x: self.x - other.x, y: self.y - other.y} //! } //! } //! From c07890543d13b36180dfbc0b6b6632c2c1dfff3f Mon Sep 17 00:00:00 2001 From: LingMan <LingMan@users.noreply.github.com> Date: Wed, 23 Sep 2020 00:29:56 +0200 Subject: [PATCH 10/25] Don't use an if guard to check equality with a constant Match on it directly instead --- compiler/rustc_attr/src/builtin.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/rustc_attr/src/builtin.rs b/compiler/rustc_attr/src/builtin.rs index 9951c25200129..1808eb270baa9 100644 --- a/compiler/rustc_attr/src/builtin.rs +++ b/compiler/rustc_attr/src/builtin.rs @@ -301,7 +301,7 @@ where .emit(); }; match issue.parse() { - Ok(num) if num == 0 => { + Ok(0) => { emit_diag( "`issue` must not be \"0\", \ use \"none\" instead", From ec4e9cd12a380bb61791c489baaaae2e9454546d Mon Sep 17 00:00:00 2001 From: Alexis Bourget <alexis.bourget@gmail.com> Date: Wed, 23 Sep 2020 00:31:37 +0200 Subject: [PATCH 11/25] Use Self in alloc --- library/alloc/src/collections/binary_heap.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/alloc/src/collections/binary_heap.rs b/library/alloc/src/collections/binary_heap.rs index ea75fa2196502..f2852b1cc2b80 100644 --- a/library/alloc/src/collections/binary_heap.rs +++ b/library/alloc/src/collections/binary_heap.rs @@ -30,7 +30,7 @@ //! // Explicitly implement the trait so the queue becomes a min-heap //! // instead of a max-heap. //! impl Ord for State { -//! fn cmp(&self, other: &State) -> Ordering { +//! fn cmp(&self, other: &Self) -> Ordering { //! // Notice that the we flip the ordering on costs. //! // In case of a tie we compare positions - this step is necessary //! // to make implementations of `PartialEq` and `Ord` consistent. @@ -41,7 +41,7 @@ //! //! // `PartialOrd` needs to be implemented as well. //! impl PartialOrd for State { -//! fn partial_cmp(&self, other: &State) -> Option<Ordering> { +//! fn partial_cmp(&self, other: &Self) -> Option<Ordering> { //! Some(self.cmp(other)) //! } //! } From d76b80768c4e5f1ee879af12db30d8930e50f70d Mon Sep 17 00:00:00 2001 From: LingMan <LingMan@users.noreply.github.com> Date: Wed, 23 Sep 2020 01:09:24 +0200 Subject: [PATCH 12/25] Merge two almost identical match arms --- compiler/rustc_builtin_macros/src/format_foreign.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/compiler/rustc_builtin_macros/src/format_foreign.rs b/compiler/rustc_builtin_macros/src/format_foreign.rs index b39423b86e7b5..ff81b5eca13a7 100644 --- a/compiler/rustc_builtin_macros/src/format_foreign.rs +++ b/compiler/rustc_builtin_macros/src/format_foreign.rs @@ -518,8 +518,7 @@ pub mod printf { .and_then(|end| end.at_next_cp()) .map(|end| (next.slice_between(end).unwrap(), end)); let end = match end { - Some(("32", end)) => end, - Some(("64", end)) => end, + Some(("32" | "64", end)) => end, _ => next, }; state = Type; From ed97b421059d25a86b2f947734a8ae366b68f473 Mon Sep 17 00:00:00 2001 From: Bastian Kauschke <bastian_kauschke@hotmail.de> Date: Wed, 23 Sep 2020 13:48:21 +0200 Subject: [PATCH 13/25] add tracking issue --- library/core/src/array/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/core/src/array/mod.rs b/library/core/src/array/mod.rs index 5730074bf2747..966272ca11549 100644 --- a/library/core/src/array/mod.rs +++ b/library/core/src/array/mod.rs @@ -20,14 +20,14 @@ mod iter; pub use iter::IntoIter; /// Converts a reference to `T` into a reference to an array of length 1 (without copying). -#[unstable(feature = "array_from_ref", issue = "none")] +#[unstable(feature = "array_from_ref", issue = "77101")] pub fn from_ref<T>(s: &T) -> &[T; 1] { // SAFETY: Converting `&T` to `&[T; 1]` is sound. unsafe { &*(s as *const T).cast::<[T; 1]>() } } /// Converts a mutable reference to `T` into a mutable reference to an array of length 1 (without copying). -#[unstable(feature = "array_from_ref", issue = "none")] +#[unstable(feature = "array_from_ref", issue = "77101")] pub fn from_mut<T>(s: &mut T) -> &mut [T; 1] { // SAFETY: Converting `&mut T` to `&mut [T; 1]` is sound. unsafe { &mut *(s as *mut T).cast::<[T; 1]>() } From dd66ea2d3d78727eb3d3574f4f6fbe82085d9ee2 Mon Sep 17 00:00:00 2001 From: Erik Hofmayer <ehofmayer@outlook.de> Date: Wed, 23 Sep 2020 21:14:43 +0200 Subject: [PATCH 14/25] Updated html_root_url for compiler crates --- compiler/rustc_apfloat/src/lib.rs | 2 +- compiler/rustc_arena/src/lib.rs | 2 +- compiler/rustc_ast/src/lib.rs | 2 +- compiler/rustc_builtin_macros/src/lib.rs | 2 +- compiler/rustc_codegen_llvm/src/lib.rs | 2 +- compiler/rustc_codegen_ssa/src/lib.rs | 2 +- compiler/rustc_data_structures/src/lib.rs | 2 +- compiler/rustc_driver/src/lib.rs | 2 +- compiler/rustc_errors/src/lib.rs | 2 +- compiler/rustc_graphviz/src/lib.rs | 2 +- compiler/rustc_incremental/src/lib.rs | 2 +- compiler/rustc_infer/src/lib.rs | 2 +- compiler/rustc_lint/src/lib.rs | 2 +- compiler/rustc_llvm/src/lib.rs | 2 +- compiler/rustc_metadata/src/lib.rs | 2 +- compiler/rustc_middle/src/lib.rs | 2 +- compiler/rustc_parse_format/src/lib.rs | 2 +- compiler/rustc_passes/src/lib.rs | 2 +- compiler/rustc_plugin_impl/src/lib.rs | 2 +- compiler/rustc_privacy/src/lib.rs | 2 +- compiler/rustc_resolve/src/lib.rs | 2 +- compiler/rustc_save_analysis/src/lib.rs | 2 +- compiler/rustc_serialize/src/lib.rs | 2 +- compiler/rustc_span/src/lib.rs | 2 +- compiler/rustc_symbol_mangling/src/lib.rs | 2 +- compiler/rustc_target/src/lib.rs | 2 +- compiler/rustc_trait_selection/src/lib.rs | 2 +- compiler/rustc_ty/src/lib.rs | 2 +- compiler/rustc_typeck/src/lib.rs | 2 +- 29 files changed, 29 insertions(+), 29 deletions(-) diff --git a/compiler/rustc_apfloat/src/lib.rs b/compiler/rustc_apfloat/src/lib.rs index ba3adc4a135cb..7c96be4f479a1 100644 --- a/compiler/rustc_apfloat/src/lib.rs +++ b/compiler/rustc_apfloat/src/lib.rs @@ -30,7 +30,7 @@ //! //! This API is completely unstable and subject to change. -#![doc(html_root_url = "https://doc.rust-lang.org/nightly/")] +#![doc(html_root_url = "https://doc.rust-lang.org/nightly-rustc/")] #![no_std] #![forbid(unsafe_code)] #![feature(nll)] diff --git a/compiler/rustc_arena/src/lib.rs b/compiler/rustc_arena/src/lib.rs index 6f9cccf58dd01..86a0fb64f2c73 100644 --- a/compiler/rustc_arena/src/lib.rs +++ b/compiler/rustc_arena/src/lib.rs @@ -8,7 +8,7 @@ //! This crate implements several kinds of arena. #![doc( - html_root_url = "https://doc.rust-lang.org/nightly/", + html_root_url = "https://doc.rust-lang.org/nightly-rustc/", test(no_crate_inject, attr(deny(warnings))) )] #![feature(dropck_eyepatch)] diff --git a/compiler/rustc_ast/src/lib.rs b/compiler/rustc_ast/src/lib.rs index 480a5d2f18eca..2072462baa025 100644 --- a/compiler/rustc_ast/src/lib.rs +++ b/compiler/rustc_ast/src/lib.rs @@ -4,7 +4,7 @@ //! //! This API is completely unstable and subject to change. -#![doc(html_root_url = "https://doc.rust-lang.org/nightly/", test(attr(deny(warnings))))] +#![doc(html_root_url = "https://doc.rust-lang.org/nightly-rustc/", test(attr(deny(warnings))))] #![feature(box_syntax)] #![feature(const_fn)] // For the `transmute` in `P::new` #![feature(const_fn_transmute)] diff --git a/compiler/rustc_builtin_macros/src/lib.rs b/compiler/rustc_builtin_macros/src/lib.rs index 87be6d1743a2a..6bffad3661567 100644 --- a/compiler/rustc_builtin_macros/src/lib.rs +++ b/compiler/rustc_builtin_macros/src/lib.rs @@ -1,7 +1,7 @@ //! This crate contains implementations of built-in macros and other code generating facilities //! injecting code into the crate before it is lowered to HIR. -#![doc(html_root_url = "https://doc.rust-lang.org/nightly/")] +#![doc(html_root_url = "https://doc.rust-lang.org/nightly-rustc/")] #![feature(bool_to_option)] #![feature(crate_visibility_modifier)] #![feature(decl_macro)] diff --git a/compiler/rustc_codegen_llvm/src/lib.rs b/compiler/rustc_codegen_llvm/src/lib.rs index 2e2abe9fb30f8..64c58775f49c3 100644 --- a/compiler/rustc_codegen_llvm/src/lib.rs +++ b/compiler/rustc_codegen_llvm/src/lib.rs @@ -4,7 +4,7 @@ //! //! This API is completely unstable and subject to change. -#![doc(html_root_url = "https://doc.rust-lang.org/nightly/")] +#![doc(html_root_url = "https://doc.rust-lang.org/nightly-rustc/")] #![feature(bool_to_option)] #![feature(const_cstr_unchecked)] #![feature(crate_visibility_modifier)] diff --git a/compiler/rustc_codegen_ssa/src/lib.rs b/compiler/rustc_codegen_ssa/src/lib.rs index a87ce1446ba14..16babec6255e7 100644 --- a/compiler/rustc_codegen_ssa/src/lib.rs +++ b/compiler/rustc_codegen_ssa/src/lib.rs @@ -1,4 +1,4 @@ -#![doc(html_root_url = "https://doc.rust-lang.org/nightly/")] +#![doc(html_root_url = "https://doc.rust-lang.org/nightly-rustc/")] #![feature(bool_to_option)] #![feature(option_expect_none)] #![feature(box_patterns)] diff --git a/compiler/rustc_data_structures/src/lib.rs b/compiler/rustc_data_structures/src/lib.rs index 1f977805f5e90..e037169b252dd 100644 --- a/compiler/rustc_data_structures/src/lib.rs +++ b/compiler/rustc_data_structures/src/lib.rs @@ -6,7 +6,7 @@ //! //! This API is completely unstable and subject to change. -#![doc(html_root_url = "https://doc.rust-lang.org/nightly/")] +#![doc(html_root_url = "https://doc.rust-lang.org/nightly-rustc/")] #![allow(incomplete_features)] #![feature(array_windows)] #![feature(control_flow_enum)] diff --git a/compiler/rustc_driver/src/lib.rs b/compiler/rustc_driver/src/lib.rs index 972e04fd101f0..5316fedee10ab 100644 --- a/compiler/rustc_driver/src/lib.rs +++ b/compiler/rustc_driver/src/lib.rs @@ -4,7 +4,7 @@ //! //! This API is completely unstable and subject to change. -#![doc(html_root_url = "https://doc.rust-lang.org/nightly/")] +#![doc(html_root_url = "https://doc.rust-lang.org/nightly-rustc/")] #![feature(nll)] #![feature(once_cell)] #![recursion_limit = "256"] diff --git a/compiler/rustc_errors/src/lib.rs b/compiler/rustc_errors/src/lib.rs index b16fe5603c100..b221219bedd07 100644 --- a/compiler/rustc_errors/src/lib.rs +++ b/compiler/rustc_errors/src/lib.rs @@ -2,7 +2,7 @@ //! //! This module contains the code for creating and emitting diagnostics. -#![doc(html_root_url = "https://doc.rust-lang.org/nightly/")] +#![doc(html_root_url = "https://doc.rust-lang.org/nightly-rustc/")] #![feature(crate_visibility_modifier)] #![feature(backtrace)] #![feature(nll)] diff --git a/compiler/rustc_graphviz/src/lib.rs b/compiler/rustc_graphviz/src/lib.rs index 58db81bc1dc61..4bd334e15e118 100644 --- a/compiler/rustc_graphviz/src/lib.rs +++ b/compiler/rustc_graphviz/src/lib.rs @@ -272,7 +272,7 @@ //! * [DOT language](http://www.graphviz.org/doc/info/lang.html) #![doc( - html_root_url = "https://doc.rust-lang.org/nightly/", + html_root_url = "https://doc.rust-lang.org/nightly-rustc/", test(attr(allow(unused_variables), deny(warnings))) )] #![feature(nll)] diff --git a/compiler/rustc_incremental/src/lib.rs b/compiler/rustc_incremental/src/lib.rs index ad18913805467..bcd700e5ac1e6 100644 --- a/compiler/rustc_incremental/src/lib.rs +++ b/compiler/rustc_incremental/src/lib.rs @@ -1,6 +1,6 @@ //! Support for serializing the dep-graph and reloading it. -#![doc(html_root_url = "https://doc.rust-lang.org/nightly/")] +#![doc(html_root_url = "https://doc.rust-lang.org/nightly-rustc/")] #![feature(in_band_lifetimes)] #![feature(nll)] #![recursion_limit = "256"] diff --git a/compiler/rustc_infer/src/lib.rs b/compiler/rustc_infer/src/lib.rs index 504b66bae7329..99bec24b86844 100644 --- a/compiler/rustc_infer/src/lib.rs +++ b/compiler/rustc_infer/src/lib.rs @@ -12,7 +12,7 @@ //! //! This API is completely unstable and subject to change. -#![doc(html_root_url = "https://doc.rust-lang.org/nightly/")] +#![doc(html_root_url = "https://doc.rust-lang.org/nightly-rustc/")] #![feature(bool_to_option)] #![feature(box_patterns)] #![feature(box_syntax)] diff --git a/compiler/rustc_lint/src/lib.rs b/compiler/rustc_lint/src/lib.rs index b48592c103ca2..c4832aa85e46a 100644 --- a/compiler/rustc_lint/src/lib.rs +++ b/compiler/rustc_lint/src/lib.rs @@ -25,7 +25,7 @@ //! //! This API is completely unstable and subject to change. -#![doc(html_root_url = "https://doc.rust-lang.org/nightly/")] +#![doc(html_root_url = "https://doc.rust-lang.org/nightly-rustc/")] #![cfg_attr(test, feature(test))] #![feature(array_windows)] #![feature(bool_to_option)] diff --git a/compiler/rustc_llvm/src/lib.rs b/compiler/rustc_llvm/src/lib.rs index 9d23397ade08e..dfcb6d04b6fab 100644 --- a/compiler/rustc_llvm/src/lib.rs +++ b/compiler/rustc_llvm/src/lib.rs @@ -1,6 +1,6 @@ #![feature(nll)] #![feature(static_nobundle)] -#![doc(html_root_url = "https://doc.rust-lang.org/nightly/")] +#![doc(html_root_url = "https://doc.rust-lang.org/nightly-rustc/")] // NOTE: This crate only exists to allow linking on mingw targets. diff --git a/compiler/rustc_metadata/src/lib.rs b/compiler/rustc_metadata/src/lib.rs index 85490f5f6e91a..4011521d23739 100644 --- a/compiler/rustc_metadata/src/lib.rs +++ b/compiler/rustc_metadata/src/lib.rs @@ -1,4 +1,4 @@ -#![doc(html_root_url = "https://doc.rust-lang.org/nightly/")] +#![doc(html_root_url = "https://doc.rust-lang.org/nightly-rustc/")] #![feature(bool_to_option)] #![feature(core_intrinsics)] #![feature(crate_visibility_modifier)] diff --git a/compiler/rustc_middle/src/lib.rs b/compiler/rustc_middle/src/lib.rs index 74cb3c130b7f0..86ceaca9b044b 100644 --- a/compiler/rustc_middle/src/lib.rs +++ b/compiler/rustc_middle/src/lib.rs @@ -22,7 +22,7 @@ //! //! This API is completely unstable and subject to change. -#![doc(html_root_url = "https://doc.rust-lang.org/nightly/")] +#![doc(html_root_url = "https://doc.rust-lang.org/nightly-rustc/")] #![feature(array_windows)] #![feature(backtrace)] #![feature(bool_to_option)] diff --git a/compiler/rustc_parse_format/src/lib.rs b/compiler/rustc_parse_format/src/lib.rs index cef632b1d8f03..a0d64107c9185 100644 --- a/compiler/rustc_parse_format/src/lib.rs +++ b/compiler/rustc_parse_format/src/lib.rs @@ -5,7 +5,7 @@ //! generated instead. #![doc( - html_root_url = "https://doc.rust-lang.org/nightly/", + html_root_url = "https://doc.rust-lang.org/nightly-rustc/", html_playground_url = "https://play.rust-lang.org/", test(attr(deny(warnings))) )] diff --git a/compiler/rustc_passes/src/lib.rs b/compiler/rustc_passes/src/lib.rs index be4c542ec3a1d..08e152cf5ee39 100644 --- a/compiler/rustc_passes/src/lib.rs +++ b/compiler/rustc_passes/src/lib.rs @@ -4,7 +4,7 @@ //! //! This API is completely unstable and subject to change. -#![doc(html_root_url = "https://doc.rust-lang.org/nightly/")] +#![doc(html_root_url = "https://doc.rust-lang.org/nightly-rustc/")] #![feature(in_band_lifetimes)] #![feature(nll)] #![feature(or_patterns)] diff --git a/compiler/rustc_plugin_impl/src/lib.rs b/compiler/rustc_plugin_impl/src/lib.rs index 1eb65dd96ba57..efa2f6e96f948 100644 --- a/compiler/rustc_plugin_impl/src/lib.rs +++ b/compiler/rustc_plugin_impl/src/lib.rs @@ -6,7 +6,7 @@ //! feature](https://doc.rust-lang.org/nightly/unstable-book/language-features/plugin.html) //! of the Unstable Book for some examples. -#![doc(html_root_url = "https://doc.rust-lang.org/nightly/")] +#![doc(html_root_url = "https://doc.rust-lang.org/nightly-rustc/")] #![feature(nll)] #![recursion_limit = "256"] diff --git a/compiler/rustc_privacy/src/lib.rs b/compiler/rustc_privacy/src/lib.rs index c2de4cdbf0dd5..0b45d7792604c 100644 --- a/compiler/rustc_privacy/src/lib.rs +++ b/compiler/rustc_privacy/src/lib.rs @@ -1,4 +1,4 @@ -#![doc(html_root_url = "https://doc.rust-lang.org/nightly/")] +#![doc(html_root_url = "https://doc.rust-lang.org/nightly-rustc/")] #![feature(in_band_lifetimes)] #![feature(nll)] #![recursion_limit = "256"] diff --git a/compiler/rustc_resolve/src/lib.rs b/compiler/rustc_resolve/src/lib.rs index 677cf27cde71c..a34572e7f36fa 100644 --- a/compiler/rustc_resolve/src/lib.rs +++ b/compiler/rustc_resolve/src/lib.rs @@ -8,7 +8,7 @@ //! //! Type-relative name resolution (methods, fields, associated items) happens in `librustc_typeck`. -#![doc(html_root_url = "https://doc.rust-lang.org/nightly/")] +#![doc(html_root_url = "https://doc.rust-lang.org/nightly-rustc/")] #![feature(bool_to_option)] #![feature(crate_visibility_modifier)] #![feature(nll)] diff --git a/compiler/rustc_save_analysis/src/lib.rs b/compiler/rustc_save_analysis/src/lib.rs index 032d7cb3ed6b7..af001594b20d2 100644 --- a/compiler/rustc_save_analysis/src/lib.rs +++ b/compiler/rustc_save_analysis/src/lib.rs @@ -1,4 +1,4 @@ -#![doc(html_root_url = "https://doc.rust-lang.org/nightly/")] +#![doc(html_root_url = "https://doc.rust-lang.org/nightly-rustc/")] #![feature(nll)] #![feature(or_patterns)] #![recursion_limit = "256"] diff --git a/compiler/rustc_serialize/src/lib.rs b/compiler/rustc_serialize/src/lib.rs index 265b3b95e956a..fa6f5ab3db62a 100644 --- a/compiler/rustc_serialize/src/lib.rs +++ b/compiler/rustc_serialize/src/lib.rs @@ -5,7 +5,7 @@ Core encoding and decoding interfaces. */ #![doc( - html_root_url = "https://doc.rust-lang.org/nightly/", + html_root_url = "https://doc.rust-lang.org/nightly-rustc/", html_playground_url = "https://play.rust-lang.org/", test(attr(allow(unused_variables), deny(warnings))) )] diff --git a/compiler/rustc_span/src/lib.rs b/compiler/rustc_span/src/lib.rs index 4b02a2d4076d7..20b2eff8555db 100644 --- a/compiler/rustc_span/src/lib.rs +++ b/compiler/rustc_span/src/lib.rs @@ -4,7 +4,7 @@ //! //! This API is completely unstable and subject to change. -#![doc(html_root_url = "https://doc.rust-lang.org/nightly/")] +#![doc(html_root_url = "https://doc.rust-lang.org/nightly-rustc/")] #![feature(array_windows)] #![feature(crate_visibility_modifier)] #![feature(const_fn)] diff --git a/compiler/rustc_symbol_mangling/src/lib.rs b/compiler/rustc_symbol_mangling/src/lib.rs index 296b40c4e395d..c15cb4bf6c5ed 100644 --- a/compiler/rustc_symbol_mangling/src/lib.rs +++ b/compiler/rustc_symbol_mangling/src/lib.rs @@ -87,7 +87,7 @@ //! virtually impossible. Thus, symbol hash generation exclusively relies on //! DefPaths which are much more robust in the face of changes to the code base. -#![doc(html_root_url = "https://doc.rust-lang.org/nightly/")] +#![doc(html_root_url = "https://doc.rust-lang.org/nightly-rustc/")] #![feature(never_type)] #![feature(nll)] #![feature(or_patterns)] diff --git a/compiler/rustc_target/src/lib.rs b/compiler/rustc_target/src/lib.rs index 5788e1e838598..eacc1d0c23d17 100644 --- a/compiler/rustc_target/src/lib.rs +++ b/compiler/rustc_target/src/lib.rs @@ -7,7 +7,7 @@ //! more 'stuff' here in the future. It does not have a dependency on //! LLVM. -#![doc(html_root_url = "https://doc.rust-lang.org/nightly/")] +#![doc(html_root_url = "https://doc.rust-lang.org/nightly-rustc/")] #![feature(bool_to_option)] #![feature(const_fn)] #![feature(const_panic)] diff --git a/compiler/rustc_trait_selection/src/lib.rs b/compiler/rustc_trait_selection/src/lib.rs index da1996b92a60b..b9e300a3ec1a1 100644 --- a/compiler/rustc_trait_selection/src/lib.rs +++ b/compiler/rustc_trait_selection/src/lib.rs @@ -10,7 +10,7 @@ //! //! This API is completely unstable and subject to change. -#![doc(html_root_url = "https://doc.rust-lang.org/nightly/")] +#![doc(html_root_url = "https://doc.rust-lang.org/nightly-rustc/")] #![feature(bool_to_option)] #![feature(box_patterns)] #![feature(drain_filter)] diff --git a/compiler/rustc_ty/src/lib.rs b/compiler/rustc_ty/src/lib.rs index 8dd6aa3c7fcc1..9f6a310033b7b 100644 --- a/compiler/rustc_ty/src/lib.rs +++ b/compiler/rustc_ty/src/lib.rs @@ -4,7 +4,7 @@ //! //! This API is completely unstable and subject to change. -#![doc(html_root_url = "https://doc.rust-lang.org/nightly/")] +#![doc(html_root_url = "https://doc.rust-lang.org/nightly-rustc/")] #![feature(nll)] #![recursion_limit = "256"] diff --git a/compiler/rustc_typeck/src/lib.rs b/compiler/rustc_typeck/src/lib.rs index 0e9f4476c2075..7ee62c77dbfb8 100644 --- a/compiler/rustc_typeck/src/lib.rs +++ b/compiler/rustc_typeck/src/lib.rs @@ -55,7 +55,7 @@ This API is completely unstable and subject to change. */ -#![doc(html_root_url = "https://doc.rust-lang.org/nightly/")] +#![doc(html_root_url = "https://doc.rust-lang.org/nightly-rustc/")] #![allow(non_camel_case_types)] #![feature(bool_to_option)] #![feature(box_syntax)] From 947536fca06e6dc6c3a3dd4ff1f66fc5080e9cbb Mon Sep 17 00:00:00 2001 From: Christiaan Dirkx <christiaan@dirkx.email> Date: Mon, 7 Sep 2020 17:43:48 +0200 Subject: [PATCH 15/25] Make delegation methods of `std::net::IpAddr` unstable const Make the following methods of `std::net::IpAddr` unstable const under the `const_ip` feature: - `is_unspecified` - `is_loopback` - `is_global` - `is_multicast` Also adds a test for these methods in a const context. Possible because these methods delegate to the inner `Ipv4Addr` or `Ipv6Addr`, which were made const, and the recent stabilization of const control flow. Part of #76205 --- library/std/src/lib.rs | 1 + library/std/src/net/ip.rs | 15 ++++++++++----- library/std/src/net/ip/tests.rs | 19 +++++++++++++++++++ 3 files changed, 30 insertions(+), 5 deletions(-) diff --git a/library/std/src/lib.rs b/library/std/src/lib.rs index 309657e70424b..ac0075ad129c5 100644 --- a/library/std/src/lib.rs +++ b/library/std/src/lib.rs @@ -238,6 +238,7 @@ #![feature(const_cstr_unchecked)] #![feature(const_fn_transmute)] #![feature(const_fn)] +#![feature(const_ip)] #![feature(const_ipv6)] #![feature(const_raw_ptr_deref)] #![feature(const_ipv4)] diff --git a/library/std/src/net/ip.rs b/library/std/src/net/ip.rs index e2fc7edb87e2c..f01a7b72a6559 100644 --- a/library/std/src/net/ip.rs +++ b/library/std/src/net/ip.rs @@ -148,8 +148,9 @@ impl IpAddr { /// assert_eq!(IpAddr::V4(Ipv4Addr::new(0, 0, 0, 0)).is_unspecified(), true); /// assert_eq!(IpAddr::V6(Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 0)).is_unspecified(), true); /// ``` + #[rustc_const_unstable(feature = "const_ip", issue = "76205")] #[stable(feature = "ip_shared", since = "1.12.0")] - pub fn is_unspecified(&self) -> bool { + pub const fn is_unspecified(&self) -> bool { match self { IpAddr::V4(ip) => ip.is_unspecified(), IpAddr::V6(ip) => ip.is_unspecified(), @@ -169,8 +170,9 @@ impl IpAddr { /// assert_eq!(IpAddr::V4(Ipv4Addr::new(127, 0, 0, 1)).is_loopback(), true); /// assert_eq!(IpAddr::V6(Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 0x1)).is_loopback(), true); /// ``` + #[rustc_const_unstable(feature = "const_ip", issue = "76205")] #[stable(feature = "ip_shared", since = "1.12.0")] - pub fn is_loopback(&self) -> bool { + pub const fn is_loopback(&self) -> bool { match self { IpAddr::V4(ip) => ip.is_loopback(), IpAddr::V6(ip) => ip.is_loopback(), @@ -192,7 +194,8 @@ impl IpAddr { /// assert_eq!(IpAddr::V4(Ipv4Addr::new(80, 9, 12, 3)).is_global(), true); /// assert_eq!(IpAddr::V6(Ipv6Addr::new(0, 0, 0x1c9, 0, 0, 0xafc8, 0, 0x1)).is_global(), true); /// ``` - pub fn is_global(&self) -> bool { + #[rustc_const_unstable(feature = "const_ip", issue = "76205")] + pub const fn is_global(&self) -> bool { match self { IpAddr::V4(ip) => ip.is_global(), IpAddr::V6(ip) => ip.is_global(), @@ -212,8 +215,9 @@ impl IpAddr { /// assert_eq!(IpAddr::V4(Ipv4Addr::new(224, 254, 0, 0)).is_multicast(), true); /// assert_eq!(IpAddr::V6(Ipv6Addr::new(0xff00, 0, 0, 0, 0, 0, 0, 0)).is_multicast(), true); /// ``` + #[rustc_const_unstable(feature = "const_ip", issue = "76205")] #[stable(feature = "ip_shared", since = "1.12.0")] - pub fn is_multicast(&self) -> bool { + pub const fn is_multicast(&self) -> bool { match self { IpAddr::V4(ip) => ip.is_multicast(), IpAddr::V6(ip) => ip.is_multicast(), @@ -238,7 +242,8 @@ impl IpAddr { /// true /// ); /// ``` - pub fn is_documentation(&self) -> bool { + #[rustc_const_unstable(feature = "const_ip", issue = "76205")] + pub const fn is_documentation(&self) -> bool { match self { IpAddr::V4(ip) => ip.is_documentation(), IpAddr::V6(ip) => ip.is_documentation(), diff --git a/library/std/src/net/ip/tests.rs b/library/std/src/net/ip/tests.rs index 76a0ae8b9454d..d9fbdd1b5e794 100644 --- a/library/std/src/net/ip/tests.rs +++ b/library/std/src/net/ip/tests.rs @@ -918,3 +918,22 @@ fn ipv6_const() { const IP_V4: Option<Ipv4Addr> = IP_ADDRESS.to_ipv4(); assert_eq!(IP_V4.unwrap(), Ipv4Addr::new(0, 0, 0, 1)); } + +#[test] +fn ip_const() { + // test that the methods of `IpAddr` are usable in a const context + + const IP_ADDRESS: IpAddr = IpAddr::V4(Ipv4Addr::LOCALHOST); + + const IS_UNSPECIFIED: bool = IP_ADDRESS.is_unspecified(); + assert!(!IS_UNSPECIFIED); + + const IS_LOOPBACK: bool = IP_ADDRESS.is_loopback(); + assert!(IS_LOOPBACK); + + const IS_GLOBAL: bool = IP_ADDRESS.is_global(); + assert!(!IS_GLOBAL); + + const IS_MULTICAST: bool = IP_ADDRESS.is_multicast(); + assert!(!IS_MULTICAST); +} From 138a2e5eaaafeee8b981045857f9df18ef4689d5 Mon Sep 17 00:00:00 2001 From: Erik Hofmayer <ehofmayer@outlook.de> Date: Wed, 23 Sep 2020 21:51:56 +0200 Subject: [PATCH 16/25] /nightly/nightly-rustc --- compiler/rustc_apfloat/src/lib.rs | 2 +- compiler/rustc_arena/src/lib.rs | 2 +- compiler/rustc_ast/src/lib.rs | 2 +- compiler/rustc_builtin_macros/src/lib.rs | 2 +- compiler/rustc_codegen_llvm/src/lib.rs | 2 +- compiler/rustc_codegen_ssa/src/lib.rs | 2 +- compiler/rustc_data_structures/src/lib.rs | 2 +- compiler/rustc_driver/src/lib.rs | 2 +- compiler/rustc_errors/src/lib.rs | 2 +- compiler/rustc_graphviz/src/lib.rs | 2 +- compiler/rustc_incremental/src/lib.rs | 2 +- compiler/rustc_infer/src/lib.rs | 2 +- compiler/rustc_lint/src/lib.rs | 2 +- compiler/rustc_llvm/src/lib.rs | 2 +- compiler/rustc_metadata/src/lib.rs | 2 +- compiler/rustc_middle/src/lib.rs | 2 +- compiler/rustc_parse_format/src/lib.rs | 2 +- compiler/rustc_passes/src/lib.rs | 2 +- compiler/rustc_plugin_impl/src/lib.rs | 2 +- compiler/rustc_privacy/src/lib.rs | 2 +- compiler/rustc_resolve/src/lib.rs | 2 +- compiler/rustc_save_analysis/src/lib.rs | 2 +- compiler/rustc_serialize/src/lib.rs | 2 +- compiler/rustc_span/src/lib.rs | 2 +- compiler/rustc_symbol_mangling/src/lib.rs | 2 +- compiler/rustc_target/src/lib.rs | 2 +- compiler/rustc_trait_selection/src/lib.rs | 2 +- compiler/rustc_ty/src/lib.rs | 2 +- compiler/rustc_typeck/src/lib.rs | 2 +- 29 files changed, 29 insertions(+), 29 deletions(-) diff --git a/compiler/rustc_apfloat/src/lib.rs b/compiler/rustc_apfloat/src/lib.rs index 7c96be4f479a1..4a845fcb6917b 100644 --- a/compiler/rustc_apfloat/src/lib.rs +++ b/compiler/rustc_apfloat/src/lib.rs @@ -30,7 +30,7 @@ //! //! This API is completely unstable and subject to change. -#![doc(html_root_url = "https://doc.rust-lang.org/nightly-rustc/")] +#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")] #![no_std] #![forbid(unsafe_code)] #![feature(nll)] diff --git a/compiler/rustc_arena/src/lib.rs b/compiler/rustc_arena/src/lib.rs index 86a0fb64f2c73..152f0f1ab2a6f 100644 --- a/compiler/rustc_arena/src/lib.rs +++ b/compiler/rustc_arena/src/lib.rs @@ -8,7 +8,7 @@ //! This crate implements several kinds of arena. #![doc( - html_root_url = "https://doc.rust-lang.org/nightly-rustc/", + html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/", test(no_crate_inject, attr(deny(warnings))) )] #![feature(dropck_eyepatch)] diff --git a/compiler/rustc_ast/src/lib.rs b/compiler/rustc_ast/src/lib.rs index 2072462baa025..765a21fd93e1b 100644 --- a/compiler/rustc_ast/src/lib.rs +++ b/compiler/rustc_ast/src/lib.rs @@ -4,7 +4,7 @@ //! //! This API is completely unstable and subject to change. -#![doc(html_root_url = "https://doc.rust-lang.org/nightly-rustc/", test(attr(deny(warnings))))] +#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/", test(attr(deny(warnings))))] #![feature(box_syntax)] #![feature(const_fn)] // For the `transmute` in `P::new` #![feature(const_fn_transmute)] diff --git a/compiler/rustc_builtin_macros/src/lib.rs b/compiler/rustc_builtin_macros/src/lib.rs index 6bffad3661567..97cadb913cacf 100644 --- a/compiler/rustc_builtin_macros/src/lib.rs +++ b/compiler/rustc_builtin_macros/src/lib.rs @@ -1,7 +1,7 @@ //! This crate contains implementations of built-in macros and other code generating facilities //! injecting code into the crate before it is lowered to HIR. -#![doc(html_root_url = "https://doc.rust-lang.org/nightly-rustc/")] +#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")] #![feature(bool_to_option)] #![feature(crate_visibility_modifier)] #![feature(decl_macro)] diff --git a/compiler/rustc_codegen_llvm/src/lib.rs b/compiler/rustc_codegen_llvm/src/lib.rs index 64c58775f49c3..456e9c7ce75fa 100644 --- a/compiler/rustc_codegen_llvm/src/lib.rs +++ b/compiler/rustc_codegen_llvm/src/lib.rs @@ -4,7 +4,7 @@ //! //! This API is completely unstable and subject to change. -#![doc(html_root_url = "https://doc.rust-lang.org/nightly-rustc/")] +#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")] #![feature(bool_to_option)] #![feature(const_cstr_unchecked)] #![feature(crate_visibility_modifier)] diff --git a/compiler/rustc_codegen_ssa/src/lib.rs b/compiler/rustc_codegen_ssa/src/lib.rs index 16babec6255e7..8568bd64f4c4f 100644 --- a/compiler/rustc_codegen_ssa/src/lib.rs +++ b/compiler/rustc_codegen_ssa/src/lib.rs @@ -1,4 +1,4 @@ -#![doc(html_root_url = "https://doc.rust-lang.org/nightly-rustc/")] +#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")] #![feature(bool_to_option)] #![feature(option_expect_none)] #![feature(box_patterns)] diff --git a/compiler/rustc_data_structures/src/lib.rs b/compiler/rustc_data_structures/src/lib.rs index e037169b252dd..b0b7f9058f973 100644 --- a/compiler/rustc_data_structures/src/lib.rs +++ b/compiler/rustc_data_structures/src/lib.rs @@ -6,7 +6,7 @@ //! //! This API is completely unstable and subject to change. -#![doc(html_root_url = "https://doc.rust-lang.org/nightly-rustc/")] +#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")] #![allow(incomplete_features)] #![feature(array_windows)] #![feature(control_flow_enum)] diff --git a/compiler/rustc_driver/src/lib.rs b/compiler/rustc_driver/src/lib.rs index 5316fedee10ab..7118437c0c850 100644 --- a/compiler/rustc_driver/src/lib.rs +++ b/compiler/rustc_driver/src/lib.rs @@ -4,7 +4,7 @@ //! //! This API is completely unstable and subject to change. -#![doc(html_root_url = "https://doc.rust-lang.org/nightly-rustc/")] +#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")] #![feature(nll)] #![feature(once_cell)] #![recursion_limit = "256"] diff --git a/compiler/rustc_errors/src/lib.rs b/compiler/rustc_errors/src/lib.rs index b221219bedd07..2e8a4ef327ac4 100644 --- a/compiler/rustc_errors/src/lib.rs +++ b/compiler/rustc_errors/src/lib.rs @@ -2,7 +2,7 @@ //! //! This module contains the code for creating and emitting diagnostics. -#![doc(html_root_url = "https://doc.rust-lang.org/nightly-rustc/")] +#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")] #![feature(crate_visibility_modifier)] #![feature(backtrace)] #![feature(nll)] diff --git a/compiler/rustc_graphviz/src/lib.rs b/compiler/rustc_graphviz/src/lib.rs index 4bd334e15e118..76e33bed97f27 100644 --- a/compiler/rustc_graphviz/src/lib.rs +++ b/compiler/rustc_graphviz/src/lib.rs @@ -272,7 +272,7 @@ //! * [DOT language](http://www.graphviz.org/doc/info/lang.html) #![doc( - html_root_url = "https://doc.rust-lang.org/nightly-rustc/", + html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/", test(attr(allow(unused_variables), deny(warnings))) )] #![feature(nll)] diff --git a/compiler/rustc_incremental/src/lib.rs b/compiler/rustc_incremental/src/lib.rs index bcd700e5ac1e6..a80c4be3e9335 100644 --- a/compiler/rustc_incremental/src/lib.rs +++ b/compiler/rustc_incremental/src/lib.rs @@ -1,6 +1,6 @@ //! Support for serializing the dep-graph and reloading it. -#![doc(html_root_url = "https://doc.rust-lang.org/nightly-rustc/")] +#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")] #![feature(in_band_lifetimes)] #![feature(nll)] #![recursion_limit = "256"] diff --git a/compiler/rustc_infer/src/lib.rs b/compiler/rustc_infer/src/lib.rs index 99bec24b86844..ea9a46613484a 100644 --- a/compiler/rustc_infer/src/lib.rs +++ b/compiler/rustc_infer/src/lib.rs @@ -12,7 +12,7 @@ //! //! This API is completely unstable and subject to change. -#![doc(html_root_url = "https://doc.rust-lang.org/nightly-rustc/")] +#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")] #![feature(bool_to_option)] #![feature(box_patterns)] #![feature(box_syntax)] diff --git a/compiler/rustc_lint/src/lib.rs b/compiler/rustc_lint/src/lib.rs index c4832aa85e46a..7f7472d9283b8 100644 --- a/compiler/rustc_lint/src/lib.rs +++ b/compiler/rustc_lint/src/lib.rs @@ -25,7 +25,7 @@ //! //! This API is completely unstable and subject to change. -#![doc(html_root_url = "https://doc.rust-lang.org/nightly-rustc/")] +#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")] #![cfg_attr(test, feature(test))] #![feature(array_windows)] #![feature(bool_to_option)] diff --git a/compiler/rustc_llvm/src/lib.rs b/compiler/rustc_llvm/src/lib.rs index dfcb6d04b6fab..a7a10b91b4eca 100644 --- a/compiler/rustc_llvm/src/lib.rs +++ b/compiler/rustc_llvm/src/lib.rs @@ -1,6 +1,6 @@ #![feature(nll)] #![feature(static_nobundle)] -#![doc(html_root_url = "https://doc.rust-lang.org/nightly-rustc/")] +#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")] // NOTE: This crate only exists to allow linking on mingw targets. diff --git a/compiler/rustc_metadata/src/lib.rs b/compiler/rustc_metadata/src/lib.rs index 4011521d23739..77766be7397c7 100644 --- a/compiler/rustc_metadata/src/lib.rs +++ b/compiler/rustc_metadata/src/lib.rs @@ -1,4 +1,4 @@ -#![doc(html_root_url = "https://doc.rust-lang.org/nightly-rustc/")] +#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")] #![feature(bool_to_option)] #![feature(core_intrinsics)] #![feature(crate_visibility_modifier)] diff --git a/compiler/rustc_middle/src/lib.rs b/compiler/rustc_middle/src/lib.rs index 86ceaca9b044b..fa885ce2e7cdf 100644 --- a/compiler/rustc_middle/src/lib.rs +++ b/compiler/rustc_middle/src/lib.rs @@ -22,7 +22,7 @@ //! //! This API is completely unstable and subject to change. -#![doc(html_root_url = "https://doc.rust-lang.org/nightly-rustc/")] +#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")] #![feature(array_windows)] #![feature(backtrace)] #![feature(bool_to_option)] diff --git a/compiler/rustc_parse_format/src/lib.rs b/compiler/rustc_parse_format/src/lib.rs index a0d64107c9185..25e3e67e28e6c 100644 --- a/compiler/rustc_parse_format/src/lib.rs +++ b/compiler/rustc_parse_format/src/lib.rs @@ -5,7 +5,7 @@ //! generated instead. #![doc( - html_root_url = "https://doc.rust-lang.org/nightly-rustc/", + html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/", html_playground_url = "https://play.rust-lang.org/", test(attr(deny(warnings))) )] diff --git a/compiler/rustc_passes/src/lib.rs b/compiler/rustc_passes/src/lib.rs index 08e152cf5ee39..c14d6aace87e0 100644 --- a/compiler/rustc_passes/src/lib.rs +++ b/compiler/rustc_passes/src/lib.rs @@ -4,7 +4,7 @@ //! //! This API is completely unstable and subject to change. -#![doc(html_root_url = "https://doc.rust-lang.org/nightly-rustc/")] +#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")] #![feature(in_band_lifetimes)] #![feature(nll)] #![feature(or_patterns)] diff --git a/compiler/rustc_plugin_impl/src/lib.rs b/compiler/rustc_plugin_impl/src/lib.rs index efa2f6e96f948..5bf4d300e9e54 100644 --- a/compiler/rustc_plugin_impl/src/lib.rs +++ b/compiler/rustc_plugin_impl/src/lib.rs @@ -6,7 +6,7 @@ //! feature](https://doc.rust-lang.org/nightly/unstable-book/language-features/plugin.html) //! of the Unstable Book for some examples. -#![doc(html_root_url = "https://doc.rust-lang.org/nightly-rustc/")] +#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")] #![feature(nll)] #![recursion_limit = "256"] diff --git a/compiler/rustc_privacy/src/lib.rs b/compiler/rustc_privacy/src/lib.rs index 0b45d7792604c..8d1b826ea3595 100644 --- a/compiler/rustc_privacy/src/lib.rs +++ b/compiler/rustc_privacy/src/lib.rs @@ -1,4 +1,4 @@ -#![doc(html_root_url = "https://doc.rust-lang.org/nightly-rustc/")] +#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")] #![feature(in_band_lifetimes)] #![feature(nll)] #![recursion_limit = "256"] diff --git a/compiler/rustc_resolve/src/lib.rs b/compiler/rustc_resolve/src/lib.rs index a34572e7f36fa..283db1404d0a4 100644 --- a/compiler/rustc_resolve/src/lib.rs +++ b/compiler/rustc_resolve/src/lib.rs @@ -8,7 +8,7 @@ //! //! Type-relative name resolution (methods, fields, associated items) happens in `librustc_typeck`. -#![doc(html_root_url = "https://doc.rust-lang.org/nightly-rustc/")] +#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")] #![feature(bool_to_option)] #![feature(crate_visibility_modifier)] #![feature(nll)] diff --git a/compiler/rustc_save_analysis/src/lib.rs b/compiler/rustc_save_analysis/src/lib.rs index af001594b20d2..f6434689fec01 100644 --- a/compiler/rustc_save_analysis/src/lib.rs +++ b/compiler/rustc_save_analysis/src/lib.rs @@ -1,4 +1,4 @@ -#![doc(html_root_url = "https://doc.rust-lang.org/nightly-rustc/")] +#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")] #![feature(nll)] #![feature(or_patterns)] #![recursion_limit = "256"] diff --git a/compiler/rustc_serialize/src/lib.rs b/compiler/rustc_serialize/src/lib.rs index fa6f5ab3db62a..ed48fbf40ac1f 100644 --- a/compiler/rustc_serialize/src/lib.rs +++ b/compiler/rustc_serialize/src/lib.rs @@ -5,7 +5,7 @@ Core encoding and decoding interfaces. */ #![doc( - html_root_url = "https://doc.rust-lang.org/nightly-rustc/", + html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/", html_playground_url = "https://play.rust-lang.org/", test(attr(allow(unused_variables), deny(warnings))) )] diff --git a/compiler/rustc_span/src/lib.rs b/compiler/rustc_span/src/lib.rs index 20b2eff8555db..96a6956a40c54 100644 --- a/compiler/rustc_span/src/lib.rs +++ b/compiler/rustc_span/src/lib.rs @@ -4,7 +4,7 @@ //! //! This API is completely unstable and subject to change. -#![doc(html_root_url = "https://doc.rust-lang.org/nightly-rustc/")] +#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")] #![feature(array_windows)] #![feature(crate_visibility_modifier)] #![feature(const_fn)] diff --git a/compiler/rustc_symbol_mangling/src/lib.rs b/compiler/rustc_symbol_mangling/src/lib.rs index c15cb4bf6c5ed..75150a56c43be 100644 --- a/compiler/rustc_symbol_mangling/src/lib.rs +++ b/compiler/rustc_symbol_mangling/src/lib.rs @@ -87,7 +87,7 @@ //! virtually impossible. Thus, symbol hash generation exclusively relies on //! DefPaths which are much more robust in the face of changes to the code base. -#![doc(html_root_url = "https://doc.rust-lang.org/nightly-rustc/")] +#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")] #![feature(never_type)] #![feature(nll)] #![feature(or_patterns)] diff --git a/compiler/rustc_target/src/lib.rs b/compiler/rustc_target/src/lib.rs index eacc1d0c23d17..fb747dfcbd337 100644 --- a/compiler/rustc_target/src/lib.rs +++ b/compiler/rustc_target/src/lib.rs @@ -7,7 +7,7 @@ //! more 'stuff' here in the future. It does not have a dependency on //! LLVM. -#![doc(html_root_url = "https://doc.rust-lang.org/nightly-rustc/")] +#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")] #![feature(bool_to_option)] #![feature(const_fn)] #![feature(const_panic)] diff --git a/compiler/rustc_trait_selection/src/lib.rs b/compiler/rustc_trait_selection/src/lib.rs index b9e300a3ec1a1..caf0325084c09 100644 --- a/compiler/rustc_trait_selection/src/lib.rs +++ b/compiler/rustc_trait_selection/src/lib.rs @@ -10,7 +10,7 @@ //! //! This API is completely unstable and subject to change. -#![doc(html_root_url = "https://doc.rust-lang.org/nightly-rustc/")] +#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")] #![feature(bool_to_option)] #![feature(box_patterns)] #![feature(drain_filter)] diff --git a/compiler/rustc_ty/src/lib.rs b/compiler/rustc_ty/src/lib.rs index 9f6a310033b7b..904c0062a926f 100644 --- a/compiler/rustc_ty/src/lib.rs +++ b/compiler/rustc_ty/src/lib.rs @@ -4,7 +4,7 @@ //! //! This API is completely unstable and subject to change. -#![doc(html_root_url = "https://doc.rust-lang.org/nightly-rustc/")] +#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")] #![feature(nll)] #![recursion_limit = "256"] diff --git a/compiler/rustc_typeck/src/lib.rs b/compiler/rustc_typeck/src/lib.rs index 7ee62c77dbfb8..84efb92582ed2 100644 --- a/compiler/rustc_typeck/src/lib.rs +++ b/compiler/rustc_typeck/src/lib.rs @@ -55,7 +55,7 @@ This API is completely unstable and subject to change. */ -#![doc(html_root_url = "https://doc.rust-lang.org/nightly-rustc/")] +#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")] #![allow(non_camel_case_types)] #![feature(bool_to_option)] #![feature(box_syntax)] From 5b3016134fef93d9bed343bb15da837acf50b635 Mon Sep 17 00:00:00 2001 From: Bastian Kauschke <bastian_kauschke@hotmail.de> Date: Wed, 23 Sep 2020 21:33:45 +0200 Subject: [PATCH 17/25] use array::from_ref for slices --- library/core/src/slice/raw.rs | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/library/core/src/slice/raw.rs b/library/core/src/slice/raw.rs index a5811c5e47289..09209306c9d0f 100644 --- a/library/core/src/slice/raw.rs +++ b/library/core/src/slice/raw.rs @@ -1,5 +1,6 @@ //! Free functions to create `&[T]` and `&mut [T]`. +use crate::array; use crate::intrinsics::is_aligned_and_not_null; use crate::mem; use crate::ptr; @@ -140,19 +141,11 @@ pub unsafe fn from_raw_parts_mut<'a, T>(data: *mut T, len: usize) -> &'a mut [T] /// Converts a reference to T into a slice of length 1 (without copying). #[stable(feature = "from_ref", since = "1.28.0")] pub fn from_ref<T>(s: &T) -> &[T] { - // SAFETY: a reference is guaranteed to be valid for reads. The returned - // reference cannot be mutated as it is an immutable reference. - // `mem::size_of::<T>()` cannot be larger than `isize::MAX`. - // Thus the call to `from_raw_parts` is safe. - unsafe { from_raw_parts(s, 1) } + array::from_ref(s) } /// Converts a reference to T into a slice of length 1 (without copying). #[stable(feature = "from_ref", since = "1.28.0")] pub fn from_mut<T>(s: &mut T) -> &mut [T] { - // SAFETY: a mutable reference is guaranteed to be valid for writes. - // The reference cannot be accessed by another pointer as it is an mutable reference. - // `mem::size_of::<T>()` cannot be larger than `isize::MAX`. - // Thus the call to `from_raw_parts_mut` is safe. - unsafe { from_raw_parts_mut(s, 1) } + array::from_mut(s) } From 764967a7e5cd260db94395614399e2638bee1eda Mon Sep 17 00:00:00 2001 From: Erik Hofmayer <ehofmayer@outlook.de> Date: Wed, 23 Sep 2020 22:08:30 +0200 Subject: [PATCH 18/25] tidy --- compiler/rustc_ast/src/lib.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/compiler/rustc_ast/src/lib.rs b/compiler/rustc_ast/src/lib.rs index 765a21fd93e1b..6e47ff7d74081 100644 --- a/compiler/rustc_ast/src/lib.rs +++ b/compiler/rustc_ast/src/lib.rs @@ -4,7 +4,10 @@ //! //! This API is completely unstable and subject to change. -#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/", test(attr(deny(warnings))))] +#![doc( + html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/", + test(attr(deny(warnings))) +)] #![feature(box_syntax)] #![feature(const_fn)] // For the `transmute` in `P::new` #![feature(const_fn_transmute)] From 085679c8414fbcd0a832d57134eb6832ea7a1020 Mon Sep 17 00:00:00 2001 From: Jarek Samic <cldfire3@gmail.com> Date: Wed, 23 Sep 2020 21:31:27 -0400 Subject: [PATCH 19/25] Use theme-adaptive SVG favicon from other Rust sites --- src/librustdoc/html/layout.rs | 4 +++- src/librustdoc/html/render/mod.rs | 4 +++- src/librustdoc/html/static/favicon-16x16.png | Bin 0 -> 2214 bytes src/librustdoc/html/static/favicon-32x32.png | Bin 0 -> 2919 bytes src/librustdoc/html/static/favicon.ico | Bin 23229 -> 0 bytes src/librustdoc/html/static/favicon.svg | 24 +++++++++++++++++++ src/librustdoc/html/static_files.rs | 6 +++-- 7 files changed, 34 insertions(+), 4 deletions(-) create mode 100644 src/librustdoc/html/static/favicon-16x16.png create mode 100644 src/librustdoc/html/static/favicon-32x32.png delete mode 100644 src/librustdoc/html/static/favicon.ico create mode 100644 src/librustdoc/html/static/favicon.svg diff --git a/src/librustdoc/html/layout.rs b/src/librustdoc/html/layout.rs index 287c85b8c2253..7239b3c5ba2f6 100644 --- a/src/librustdoc/html/layout.rs +++ b/src/librustdoc/html/layout.rs @@ -158,7 +158,9 @@ pub fn render<T: Print, S: Print>( keywords = page.keywords, favicon = if layout.favicon.is_empty() { format!( - r#"<link rel="shortcut icon" href="{static_root_path}favicon{suffix}.ico">"#, + r##"<link rel="icon" type="image/svg+xml" href="{static_root_path}favicon{suffix}.svg"> +<link rel="alternate icon" type="image/png" href="{static_root_path}favicon-16x16{suffix}.png"> +<link rel="alternate icon" type="image/png" href="{static_root_path}favicon-32x32{suffix}.png">"##, static_root_path = static_root_path, suffix = page.resource_suffix ) diff --git a/src/librustdoc/html/render/mod.rs b/src/librustdoc/html/render/mod.rs index f095f67b54c63..8b5ba7a239c5f 100644 --- a/src/librustdoc/html/render/mod.rs +++ b/src/librustdoc/html/render/mod.rs @@ -754,7 +754,9 @@ fn write_shared( write(cx.path("rust-logo.png"), static_files::RUST_LOGO)?; } if (*cx.shared).layout.favicon.is_empty() { - write(cx.path("favicon.ico"), static_files::RUST_FAVICON)?; + write(cx.path("favicon.svg"), static_files::RUST_FAVICON_SVG)?; + write(cx.path("favicon-16x16.png"), static_files::RUST_FAVICON_PNG_16)?; + write(cx.path("favicon-32x32.png"), static_files::RUST_FAVICON_PNG_32)?; } write(cx.path("brush.svg"), static_files::BRUSH_SVG)?; write(cx.path("wheel.svg"), static_files::WHEEL_SVG)?; diff --git a/src/librustdoc/html/static/favicon-16x16.png b/src/librustdoc/html/static/favicon-16x16.png new file mode 100644 index 0000000000000000000000000000000000000000..7cfe6c13550d31bc31355616bbb9cb77fd1b25ef GIT binary patch literal 2214 zcmai0eOwb|96wBnh5{uNA5FX#8j9O(<Neq`*ieQX9|YoE@z`$c+RM$`;Wp5s%!)M2 zh9RMp3YnVtf+#8mD2kefNRgGuuouji&_p4j=($1QYyEL|d!Fz2_r2fS^Sc$s$IYF< znZ$u0Xo5UimH?h^?B(PL?o)3K;t(|UAeofPq++qCg3|GEC6!I^%{l|XAxIo<HsA^k z!NA!>4yl)LyARcIVNxmKrUYOD%pfJyWON=)B<95>De^Rm5G6M}j3YLqKtM+@IBeEw z^+wbz;o5ak@SEL6xUikVXe8WJEFP9pGyw<j1NZ`N7zY;9N)?(Qn=@<-RuZn7VGJmO zm`o<V$&XLbIfyVMBm@zN5Rr%n7(Amz&){aB-uNObF{B|Qj0&1GFeIgiSxr2f%4H;6 zF2Lboal%ZFs_Tuz;e$jVEP@F60_0vgL#iG_XOV~K1~tV{Mm1#^3E;k0jKB{Wg7iJw z#EcsrMaHoIrt5U~g<)i(mViVIC-pv`{(XTl$zmXo1j0z=(h4GK3880Rv}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cl6iwE^D@hJP*4p9rO3t3vM?Y`kos2{lnHH z8MY_k`u(%6w)mf!Tkl%aU0=HJ<O(?2+1Yt!@mHt1ZqW-;j%CmH^Yi2URo|sw>rp5h zIDA-gJMuv0N4O`)y}GEDLzI5DRqcQGw4<YA(HYe*ma={O_e(t{*rwHMX0QIqrzG|* z5BHVFief7K0|VPWEQ_gNUVW9{v^Y}#%%@}eDz9!!-*IZ6&LKTL{oM8IJNSHlQMC71 z^((K$R3ykX8Vx@AZRk+J>eZ{gx8^nswsmyuR8`H8qrt&We_mQ?E71KoB@x@ws?}<D z)zmoEx3^DO8#AsT@9@Q^`zPE;NlB@$uC9po=FYCFs`}yk?^|x)u0Gz>G)`?cr<RtM zUPl(6pOlS+hK9D@y_<&&mLF^F?I}2r$)7vjiYt}n(-5!s6Mfv*ty^cia^>AQn;UN4 z6pH^kmG!J);&{3;dAl$;_(V^Szpt<Flw~oOdU}eiR_h0MITt*2!g00*Sy>%NFJJz= zy0-T8z<~J6?w>4P{r&x!3m1l6=;+9(f6gXZaCUdB?(m(=>C3y+SzUDzf4JRP!@oM< Yn%3fx<aCE5*uNL@s5n_=<f1qJ0sSgV^8f$< literal 0 HcmV?d00001 diff --git a/src/librustdoc/html/static/favicon-32x32.png b/src/librustdoc/html/static/favicon-32x32.png new file mode 100644 index 0000000000000000000000000000000000000000..5109c1de8bea744180448b347fb44ddef23b90f4 GIT binary patch literal 2919 zcmai030P8T7skEJu&Hdcv?0>65<zk$a0QhVGZEA@6X7EFR~ES-xa2ZTO;$5yTBerm z)>vtoO=gysTc){dn_8A;mgY3Mwv7J;8=I#3|L3_2=X>9CzO#MjlI-o}Hd}k4HUfc| zO?4;xz;Be|o}mdpp_rIq1VX(S^!1nc(>w`mA>W+E5rzWha=r-05eTA#T*P9B0}@my z5C#fJ=%K5nXcWjHq5Z6AIGV@>;DPQjVt^jw<;#u<XWMbm4))qaIRQ4n2P7<%oF5^8 z2yzlyX_o;1RxD%DC?!P_PD1<ByiqPfF@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z z_4saH<D*9nWo3zhtrrG^oFE9Q(kZ-rd6gj&zQTDt_jjX%Z|caV^ToryetuUc>h&yB z^p~mghPtj97>Q&~mJ1n?k&&4}bb4yGLqc9k%6GjzJw+4wiJI<(-Hv-%0sGtYHon}` z(C0xfVU=q#n9SUQ0v{5Iw72I~<j-OVy0&W#|3KZ3k6wzbCH>7NR3A6DYM+KY^*`<- z<J9V|uHvk?cP-ZDj9-2|Gj1_Y!~L)M@fyKu7;3U3%8|ulxzeb|!`shx|Jhr6(0+4f zO-+pkp3P>Hk2kfhb5Je4BJD-A+*@(Gwzg%9mTv3ayQk{wy-2a6X6N$1FCQN-$_u`h zo18qe^Qvs!8RogQw9RQ1N3ymRCRN~cdV70oENMpeakk-FFJ8RhWafCb46iJ+^&ad^ zbP5f6i)%}2YFfYXikJcbK!CyS>ZjW3s>QKmc`-3D9aXiWUpTLR8`n#Y>~Ar~&P}d! zh#PM#ivK`>$!Te6A(`0*94>bo)K}kh|2~z)S^~G|Br#^#G~juD(&ERuvQ~k5((c6I z$LnlbhQ{cDfgV)q%*x8jil>pTZf*vKhCL51h1b>9$tRdzq4z!*>5mR~sTq8qYG(R0 z^v`Ab#-mp!`BolVW9>Fmp7j>C(^~?|`pkkF0tfqmbA6Ml6`Ne%l@YX&ivPz{iWfQ0 IIpoLx0#^I3DgXcg literal 0 HcmV?d00001 diff --git a/src/librustdoc/html/static/favicon.ico b/src/librustdoc/html/static/favicon.ico deleted file mode 100644 index b8ad23769ac8d06eb5973bfb3d2acbf385240f98..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 23229 zcmeHvc|28H|Nn80c^;Zf$(*SSWu`JD(V;RG>6p@BE^{)JxkzQmP>~SI(4dfxF(slB z5)PR%L}d!)x0ZYM{hrRHTlcx&;g8>bJ@5Nj>$5(?d#%0p+H0?)2Zf?QQKG7<P(ZFj zJ?2B9wxdueY3V=eS;8n3)jAYv9RO_4Vnv~DX`@iAK*IWAN)*c21ceGW#Og57bI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*oNtPndy&hUY=R~i(mvJ!=g{)9pWl!KN46iVhS`1hz_rI+UUql}^jYVcQc&<5H< IAL#r40Ahn8xc~qF diff --git a/src/librustdoc/html/static/favicon.svg b/src/librustdoc/html/static/favicon.svg new file mode 100644 index 0000000000000..8b34b511989e1 --- /dev/null +++ b/src/librustdoc/html/static/favicon.svg @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg width="100%" height="100%" viewBox="0 0 32 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;"> +<defs> + <style type="text/css"><![CDATA[ + #logo { + fill-rule: nonzero; + } + #logo-teeth { + stroke: #000000; + stroke-width: 0.92px; + } + @media (prefers-color-scheme: dark) { + #logo { + fill: #FFFFFF; + fill-rule: nonzero; + } + #logo-teeth { + fill: #FFFFFF; + stroke: #FFFFFF; + stroke-width: 0.92px; + } + } + ]]></style> +</defs> +<path id="logo" d="M15.993,1.54c-7.972,0 -14.461,6.492 -14.461,14.462c0,7.969 6.492,14.461 14.461,14.461c7.97,0 14.462,-6.492 14.462,-14.461c0,-7.97 -6.492,-14.462 -14.462,-14.462Zm-0.021,1.285c0.511,0.013 0.924,0.439 0.924,0.951c0,0.522 -0.43,0.952 -0.952,0.952c-0.522,0 -0.951,-0.43 -0.951,-0.952c0,0 0,0 0,0c0,-0.522 0.429,-0.952 0.951,-0.952c0.01,0 0.019,0.001 0.028,0.001Zm2.178,1.566c3.379,0.633 6.313,2.723 8.016,5.709l-1.123,2.533c-0.193,0.438 0.006,0.952 0.44,1.147l2.16,0.958c0.067,0.675 0.076,1.355 0.025,2.031l-1.202,0c-0.12,0 -0.169,0.08 -0.169,0.196l0,0.551c0,1.297 -0.731,1.582 -1.373,1.652c-0.612,0.07 -1.288,-0.257 -1.374,-0.63c-0.361,-2.029 -0.961,-2.46 -1.909,-3.21c1.178,-0.746 2.401,-1.85 2.401,-3.325c0,-1.594 -1.092,-2.597 -1.835,-3.09c-1.046,-0.688 -2.203,-0.826 -2.515,-0.826l-12.421,0c1.717,-1.918 4.02,-3.218 6.55,-3.696l1.466,1.536c0.33,0.346 0.878,0.361 1.223,0.028l1.64,-1.564Zm-13.522,7.043c0.511,0.015 0.924,0.44 0.924,0.951c0,0.522 -0.43,0.952 -0.952,0.952c-0.522,0 -0.951,-0.43 -0.951,-0.952c0,0 0,0 0,0c0,-0.522 0.429,-0.951 0.951,-0.951c0.009,0 0.019,0 0.028,0Zm22.685,0.043c0.511,0.015 0.924,0.44 0.924,0.951c0,0.522 -0.43,0.952 -0.952,0.952c-0.522,0 -0.951,-0.43 -0.951,-0.952c0,0 0,0 0,0c0,-0.522 0.429,-0.952 0.951,-0.952c0.01,0 0.019,0 0.028,0.001Zm-20.892,0.153l1.658,0l0,7.477l-3.347,0c-0.414,-1.452 -0.542,-2.97 -0.38,-4.47l2.05,-0.912c0.438,-0.195 0.637,-0.706 0.441,-1.144l-0.422,-0.951Zm6.92,0.079l3.949,0c0.205,0 1.441,0.236 1.441,1.163c0,0.768 -0.948,1.043 -1.728,1.043l-3.665,0l0.003,-2.206Zm0,5.373l3.026,0c0.275,0 1.477,0.079 1.86,1.615c0.119,0.471 0.385,2.007 0.566,2.499c0.18,0.551 0.911,1.652 1.691,1.652l4.938,0c-0.331,0.444 -0.693,0.863 -1.083,1.255l-2.01,-0.432c-0.468,-0.101 -0.93,0.199 -1.031,0.667l-0.477,2.228c-3.104,1.406 -6.672,1.389 -9.762,-0.046l-0.478,-2.228c-0.101,-0.468 -0.56,-0.767 -1.028,-0.667l-1.967,0.423c-0.365,-0.377 -0.704,-0.778 -1.016,-1.2l9.567,0c0.107,0 0.181,-0.018 0.181,-0.119l0,-3.384c0,-0.097 -0.074,-0.119 -0.181,-0.119l-2.799,0l0.003,-2.144Zm-4.415,7.749c0.512,0.015 0.924,0.44 0.924,0.951c0,0.522 -0.429,0.952 -0.951,0.952c-0.522,0 -0.952,-0.43 -0.952,-0.952c0,0 0,0 0,0c0,-0.522 0.43,-0.952 0.952,-0.952c0.009,0 0.018,0.001 0.027,0.001Zm14.089,0.043c0.511,0.015 0.924,0.439 0.923,0.951c0,0.522 -0.429,0.952 -0.951,0.952c-0.522,0 -0.951,-0.43 -0.951,-0.952c0,0 0,0 0,0c0,-0.522 0.429,-0.952 0.951,-0.952c0.009,0 0.018,0 0.028,0.001Z"/><path id="logo-teeth" d="M29.647,16.002c0,7.49 -6.163,13.653 -13.654,13.653c-7.49,0 -13.654,-6.163 -13.654,-13.653c0,-7.491 6.164,-13.654 13.654,-13.654c7.491,0 13.654,6.163 13.654,13.654Zm-0.257,-1.319l2.13,1.319l-2.13,1.318l1.83,1.71l-2.344,0.878l1.463,2.035l-2.475,0.404l1.04,2.282l-2.506,-0.089l0.575,2.442l-2.441,-0.576l0.089,2.506l-2.283,-1.04l-0.403,2.475l-2.035,-1.462l-0.878,2.343l-1.71,-1.829l-1.319,2.129l-1.318,-2.129l-1.71,1.829l-0.878,-2.343l-2.035,1.462l-0.404,-2.475l-2.282,1.04l0.089,-2.506l-2.442,0.576l0.575,-2.442l-2.505,0.089l1.04,-2.282l-2.475,-0.404l1.462,-2.035l-2.343,-0.878l1.829,-1.71l-2.129,-1.318l2.129,-1.319l-1.829,-1.71l2.343,-0.878l-1.462,-2.035l2.475,-0.404l-1.04,-2.282l2.505,0.089l-0.575,-2.441l2.442,0.575l-0.089,-2.506l2.282,1.04l0.404,-2.475l2.035,1.463l0.878,-2.344l1.71,1.83l1.318,-2.13l1.319,2.13l1.71,-1.83l0.878,2.344l2.035,-1.463l0.403,2.475l2.283,-1.04l-0.089,2.506l2.441,-0.575l-0.575,2.441l2.506,-0.089l-1.04,2.282l2.475,0.404l-1.463,2.035l2.344,0.878l-1.83,1.71Z"/></svg> diff --git a/src/librustdoc/html/static_files.rs b/src/librustdoc/html/static_files.rs index 6bd7e53cdfbe2..213c7f3aab8b6 100644 --- a/src/librustdoc/html/static_files.rs +++ b/src/librustdoc/html/static_files.rs @@ -53,8 +53,10 @@ pub static LICENSE_MIT: &[u8] = include_bytes!("static/LICENSE-MIT.txt"); /// The contents of `rust-logo.png`, the default icon of the documentation. pub static RUST_LOGO: &[u8] = include_bytes!("static/rust-logo.png"); -/// The contents of `favicon.ico`, the default favicon of the documentation. -pub static RUST_FAVICON: &[u8] = include_bytes!("static/favicon.ico"); +/// The default documentation favicons (SVG and PNG fallbacks) +pub static RUST_FAVICON_SVG: &[u8] = include_bytes!("static/favicon.svg"); +pub static RUST_FAVICON_PNG_16: &[u8] = include_bytes!("static/favicon-16x16.png"); +pub static RUST_FAVICON_PNG_32: &[u8] = include_bytes!("static/favicon-32x32.png"); /// The built-in themes given to every documentation site. pub mod themes { From a320ef751bcf3a0c09384cf887ea7eceab2fbee7 Mon Sep 17 00:00:00 2001 From: Dylan MacKenzie <ecstaticmorse@gmail.com> Date: Wed, 23 Sep 2020 21:04:07 -0700 Subject: [PATCH 20/25] Suggest `const_mut_refs` for mutable references in const fn --- compiler/rustc_mir/src/transform/check_consts/ops.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/compiler/rustc_mir/src/transform/check_consts/ops.rs b/compiler/rustc_mir/src/transform/check_consts/ops.rs index e14dcf92b89d2..d978d9279810d 100644 --- a/compiler/rustc_mir/src/transform/check_consts/ops.rs +++ b/compiler/rustc_mir/src/transform/check_consts/ops.rs @@ -535,6 +535,7 @@ impl NonConstOp for UnsizingCast { } } +// Types that cannot appear in the signature or locals of a `const fn`. pub mod ty { use super::*; @@ -548,7 +549,13 @@ pub mod ty { } fn emit_error(&self, ccx: &ConstCx<'_, '_>, span: Span) { - mcf_emit_error(ccx, span, "mutable references in const fn are unstable"); + feature_err( + &ccx.tcx.sess.parse_sess, + sym::const_mut_refs, + span, + &format!("mutable references are not allowed in {}s", ccx.const_kind()), + ) + .emit() } } From e5e5e64ff1b91e57fed22e7a52e5de333980fafd Mon Sep 17 00:00:00 2001 From: Dylan MacKenzie <ecstaticmorse@gmail.com> Date: Wed, 23 Sep 2020 21:05:59 -0700 Subject: [PATCH 21/25] Bless tests --- .../feature-gate-const_mut_refs.rs | 2 +- .../feature-gate-const_mut_refs.stderr | 8 ++--- src/test/ui/consts/const_let_assign3.stderr | 8 ++--- .../ui/consts/min_const_fn/min_const_fn.rs | 10 +++---- .../consts/min_const_fn/min_const_fn.stderr | 30 +++++++++---------- .../ui/consts/min_const_fn/mutable_borrow.rs | 4 +-- .../consts/min_const_fn/mutable_borrow.stderr | 14 ++++----- src/test/ui/unsafe/ranged_ints2_const.stderr | 14 ++++----- 8 files changed, 45 insertions(+), 45 deletions(-) diff --git a/src/test/ui/consts/const-mut-refs/feature-gate-const_mut_refs.rs b/src/test/ui/consts/const-mut-refs/feature-gate-const_mut_refs.rs index f31543af590d6..ce9be4ac5c2af 100644 --- a/src/test/ui/consts/const-mut-refs/feature-gate-const_mut_refs.rs +++ b/src/test/ui/consts/const-mut-refs/feature-gate-const_mut_refs.rs @@ -2,7 +2,7 @@ fn main() { foo(&mut 5); } -const fn foo(x: &mut i32) -> i32 { //~ ERROR mutable references in const fn +const fn foo(x: &mut i32) -> i32 { //~ ERROR mutable references *x + 1 } diff --git a/src/test/ui/consts/const-mut-refs/feature-gate-const_mut_refs.stderr b/src/test/ui/consts/const-mut-refs/feature-gate-const_mut_refs.stderr index 83e050c7a5c8a..3f9bd37053a0e 100644 --- a/src/test/ui/consts/const-mut-refs/feature-gate-const_mut_refs.stderr +++ b/src/test/ui/consts/const-mut-refs/feature-gate-const_mut_refs.stderr @@ -1,12 +1,12 @@ -error[E0723]: mutable references in const fn are unstable +error[E0658]: mutable references are not allowed in constant functions --> $DIR/feature-gate-const_mut_refs.rs:5:14 | LL | const fn foo(x: &mut i32) -> i32 { | ^ | - = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information - = help: add `#![feature(const_fn)]` to the crate attributes to enable + = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information + = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable error: aborting due to previous error -For more information about this error, try `rustc --explain E0723`. +For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/ui/consts/const_let_assign3.stderr b/src/test/ui/consts/const_let_assign3.stderr index 785d9c8c2a5fb..15badea003736 100644 --- a/src/test/ui/consts/const_let_assign3.stderr +++ b/src/test/ui/consts/const_let_assign3.stderr @@ -1,11 +1,11 @@ -error[E0723]: mutable references in const fn are unstable +error[E0658]: mutable references are not allowed in constant functions --> $DIR/const_let_assign3.rs:8:18 | LL | const fn foo(&mut self, x: u32) { | ^^^^^^^^^ | - = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information - = help: add `#![feature(const_fn)]` to the crate attributes to enable + = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information + = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable error[E0764]: mutable references are not allowed in constants --> $DIR/const_let_assign3.rs:16:5 @@ -29,5 +29,5 @@ LL | *y = 42; error: aborting due to 4 previous errors -Some errors have detailed explanations: E0019, E0723, E0764. +Some errors have detailed explanations: E0019, E0658, E0764. For more information about an error, try `rustc --explain E0019`. diff --git a/src/test/ui/consts/min_const_fn/min_const_fn.rs b/src/test/ui/consts/min_const_fn/min_const_fn.rs index 5dd70acb6ff1c..336d754b06a73 100644 --- a/src/test/ui/consts/min_const_fn/min_const_fn.rs +++ b/src/test/ui/consts/min_const_fn/min_const_fn.rs @@ -37,26 +37,26 @@ impl<T> Foo<T> { const fn into_inner(self) -> T { self.0 } //~ destructors cannot be evaluated const fn get(&self) -> &T { &self.0 } const fn get_mut(&mut self) -> &mut T { &mut self.0 } - //~^ mutable references in const fn are unstable + //~^ mutable references } impl<'a, T> Foo<T> { const fn new_lt(t: T) -> Self { Foo(t) } const fn into_inner_lt(self) -> T { self.0 } //~ destructors cannot be evaluated const fn get_lt(&'a self) -> &T { &self.0 } const fn get_mut_lt(&'a mut self) -> &mut T { &mut self.0 } - //~^ mutable references in const fn are unstable + //~^ mutable references } impl<T: Sized> Foo<T> { const fn new_s(t: T) -> Self { Foo(t) } const fn into_inner_s(self) -> T { self.0 } //~ ERROR destructors const fn get_s(&self) -> &T { &self.0 } const fn get_mut_s(&mut self) -> &mut T { &mut self.0 } - //~^ mutable references in const fn are unstable + //~^ mutable references } impl<T: ?Sized> Foo<T> { const fn get_sq(&self) -> &T { &self.0 } const fn get_mut_sq(&mut self) -> &mut T { &mut self.0 } - //~^ mutable references in const fn are unstable + //~^ mutable references } @@ -99,7 +99,7 @@ const fn foo30_2_with_unsafe(x: *mut u32) -> usize { unsafe { x as usize } } //~^ ERROR casting pointers to integers const fn foo30_6() -> bool { let x = true; x } const fn inc(x: &mut i32) { *x += 1 } -//~^ ERROR mutable references in const fn are unstable +//~^ ERROR mutable references // ok const fn foo36(a: bool, b: bool) -> bool { a && b } diff --git a/src/test/ui/consts/min_const_fn/min_const_fn.stderr b/src/test/ui/consts/min_const_fn/min_const_fn.stderr index d4498f061c64b..c96500e38ec83 100644 --- a/src/test/ui/consts/min_const_fn/min_const_fn.stderr +++ b/src/test/ui/consts/min_const_fn/min_const_fn.stderr @@ -6,14 +6,14 @@ LL | const fn into_inner(self) -> T { self.0 } | | | constant functions cannot evaluate destructors -error[E0723]: mutable references in const fn are unstable +error[E0658]: mutable references are not allowed in constant functions --> $DIR/min_const_fn.rs:39:36 | LL | const fn get_mut(&mut self) -> &mut T { &mut self.0 } | ^^^^^^ | - = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information - = help: add `#![feature(const_fn)]` to the crate attributes to enable + = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information + = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable error[E0493]: destructors cannot be evaluated at compile-time --> $DIR/min_const_fn.rs:44:28 @@ -23,14 +23,14 @@ LL | const fn into_inner_lt(self) -> T { self.0 } | | | constant functions cannot evaluate destructors -error[E0723]: mutable references in const fn are unstable +error[E0658]: mutable references are not allowed in constant functions --> $DIR/min_const_fn.rs:46:42 | LL | const fn get_mut_lt(&'a mut self) -> &mut T { &mut self.0 } | ^^^^^^ | - = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information - = help: add `#![feature(const_fn)]` to the crate attributes to enable + = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information + = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable error[E0493]: destructors cannot be evaluated at compile-time --> $DIR/min_const_fn.rs:51:27 @@ -40,23 +40,23 @@ LL | const fn into_inner_s(self) -> T { self.0 } | | | constant functions cannot evaluate destructors -error[E0723]: mutable references in const fn are unstable +error[E0658]: mutable references are not allowed in constant functions --> $DIR/min_const_fn.rs:53:38 | LL | const fn get_mut_s(&mut self) -> &mut T { &mut self.0 } | ^^^^^^ | - = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information - = help: add `#![feature(const_fn)]` to the crate attributes to enable + = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information + = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable -error[E0723]: mutable references in const fn are unstable +error[E0658]: mutable references are not allowed in constant functions --> $DIR/min_const_fn.rs:58:39 | LL | const fn get_mut_sq(&mut self) -> &mut T { &mut self.0 } | ^^^^^^ | - = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information - = help: add `#![feature(const_fn)]` to the crate attributes to enable + = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information + = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable --> $DIR/min_const_fn.rs:76:16 @@ -164,14 +164,14 @@ LL | const fn foo30_2_with_unsafe(x: *mut u32) -> usize { unsafe { x as usize } = note: see issue #51910 <https://github.com/rust-lang/rust/issues/51910> for more information = help: add `#![feature(const_raw_ptr_to_usize_cast)]` to the crate attributes to enable -error[E0723]: mutable references in const fn are unstable +error[E0658]: mutable references are not allowed in constant functions --> $DIR/min_const_fn.rs:101:14 | LL | const fn inc(x: &mut i32) { *x += 1 } | ^ | - = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information - = help: add `#![feature(const_fn)]` to the crate attributes to enable + = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information + = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable --> $DIR/min_const_fn.rs:110:6 diff --git a/src/test/ui/consts/min_const_fn/mutable_borrow.rs b/src/test/ui/consts/min_const_fn/mutable_borrow.rs index 89acfea6ed8ff..580b1d50f774e 100644 --- a/src/test/ui/consts/min_const_fn/mutable_borrow.rs +++ b/src/test/ui/consts/min_const_fn/mutable_borrow.rs @@ -1,6 +1,6 @@ const fn mutable_ref_in_const() -> u8 { let mut a = 0; - let b = &mut a; //~ ERROR mutable references in const fn + let b = &mut a; //~ ERROR mutable references *b } @@ -9,7 +9,7 @@ struct X; impl X { const fn inherent_mutable_ref_in_const() -> u8 { let mut a = 0; - let b = &mut a; //~ ERROR mutable references in const fn + let b = &mut a; //~ ERROR mutable references *b } } diff --git a/src/test/ui/consts/min_const_fn/mutable_borrow.stderr b/src/test/ui/consts/min_const_fn/mutable_borrow.stderr index f5a3c168a86d7..4e5cdbb18aae3 100644 --- a/src/test/ui/consts/min_const_fn/mutable_borrow.stderr +++ b/src/test/ui/consts/min_const_fn/mutable_borrow.stderr @@ -1,21 +1,21 @@ -error[E0723]: mutable references in const fn are unstable +error[E0658]: mutable references are not allowed in constant functions --> $DIR/mutable_borrow.rs:3:9 | LL | let b = &mut a; | ^ | - = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information - = help: add `#![feature(const_fn)]` to the crate attributes to enable + = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information + = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable -error[E0723]: mutable references in const fn are unstable +error[E0658]: mutable references are not allowed in constant functions --> $DIR/mutable_borrow.rs:12:13 | LL | let b = &mut a; | ^ | - = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information - = help: add `#![feature(const_fn)]` to the crate attributes to enable + = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information + = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable error: aborting due to 2 previous errors -For more information about this error, try `rustc --explain E0723`. +For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/ui/unsafe/ranged_ints2_const.stderr b/src/test/ui/unsafe/ranged_ints2_const.stderr index d508d07791de9..1a6bcd36ee157 100644 --- a/src/test/ui/unsafe/ranged_ints2_const.stderr +++ b/src/test/ui/unsafe/ranged_ints2_const.stderr @@ -1,20 +1,20 @@ -error[E0723]: mutable references in const fn are unstable +error[E0658]: mutable references are not allowed in constant functions --> $DIR/ranged_ints2_const.rs:11:9 | LL | let y = &mut x.0; | ^ | - = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information - = help: add `#![feature(const_fn)]` to the crate attributes to enable + = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information + = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable -error[E0723]: mutable references in const fn are unstable +error[E0658]: mutable references are not allowed in constant functions --> $DIR/ranged_ints2_const.rs:18:9 | LL | let y = unsafe { &mut x.0 }; | ^ | - = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information - = help: add `#![feature(const_fn)]` to the crate attributes to enable + = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information + = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable error[E0133]: mutation of layout constrained field is unsafe and requires unsafe function or block --> $DIR/ranged_ints2_const.rs:11:13 @@ -26,5 +26,5 @@ LL | let y = &mut x.0; error: aborting due to 3 previous errors -Some errors have detailed explanations: E0133, E0723. +Some errors have detailed explanations: E0133, E0658. For more information about an error, try `rustc --explain E0133`. From 13dc237037c8ef66423639c622d6018f1cf9a37e Mon Sep 17 00:00:00 2001 From: Mara Bos <m-ou.se@m-ou.se> Date: Thu, 24 Sep 2020 20:50:09 +0200 Subject: [PATCH 22/25] Remove workaround for deref issue that no longer exists. The double underscores were used to work around issue #12808, which was solved in 2016. --- library/std/src/sys_common/remutex.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/library/std/src/sys_common/remutex.rs b/library/std/src/sys_common/remutex.rs index 360337c030be4..162eab2388d55 100644 --- a/library/std/src/sys_common/remutex.rs +++ b/library/std/src/sys_common/remutex.rs @@ -37,9 +37,7 @@ impl<T> RefUnwindSafe for ReentrantMutex<T> {} /// guarded data. #[must_use = "if unused the ReentrantMutex will immediately unlock"] pub struct ReentrantMutexGuard<'a, T: 'a> { - // funny underscores due to how Deref currently works (it disregards field - // privacy). - __lock: &'a ReentrantMutex<T>, + lock: &'a ReentrantMutex<T>, } impl<T> !marker::Send for ReentrantMutexGuard<'_, T> {} @@ -129,7 +127,7 @@ impl<T: fmt::Debug + 'static> fmt::Debug for ReentrantMutex<T> { impl<'mutex, T> ReentrantMutexGuard<'mutex, T> { fn new(lock: &'mutex ReentrantMutex<T>) -> ReentrantMutexGuard<'mutex, T> { - ReentrantMutexGuard { __lock: lock } + ReentrantMutexGuard { lock } } } @@ -137,7 +135,7 @@ impl<T> Deref for ReentrantMutexGuard<'_, T> { type Target = T; fn deref(&self) -> &T { - &self.__lock.data + &self.lock.data } } @@ -145,7 +143,7 @@ impl<T> Drop for ReentrantMutexGuard<'_, T> { #[inline] fn drop(&mut self) { unsafe { - self.__lock.inner.unlock(); + self.lock.inner.unlock(); } } } From 7dec440340040ae377abcf22968a1d850a908f1b Mon Sep 17 00:00:00 2001 From: Simon Vandel Sillesen <simon.vandel@gmail.com> Date: Thu, 24 Sep 2020 21:02:53 +0200 Subject: [PATCH 23/25] Resolve https://github.com/rust-lang/rust/pull/76673#discussion_r494426303 --- compiler/rustc_middle/src/mir/terminator/mod.rs | 2 ++ compiler/rustc_mir/src/transform/remove_unneeded_drops.rs | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/compiler/rustc_middle/src/mir/terminator/mod.rs b/compiler/rustc_middle/src/mir/terminator/mod.rs index fcfd648c2b7aa..8909f02270cb3 100644 --- a/compiler/rustc_middle/src/mir/terminator/mod.rs +++ b/compiler/rustc_middle/src/mir/terminator/mod.rs @@ -96,6 +96,8 @@ pub enum TerminatorKind<'tcx> { /// P <- V /// } /// ``` + /// + /// Note that DropAndReplace is eliminated as part of the `ElaborateDrops` pass. DropAndReplace { place: Place<'tcx>, value: Operand<'tcx>, diff --git a/compiler/rustc_mir/src/transform/remove_unneeded_drops.rs b/compiler/rustc_mir/src/transform/remove_unneeded_drops.rs index f027f5e33a187..b9f29786c64ea 100644 --- a/compiler/rustc_mir/src/transform/remove_unneeded_drops.rs +++ b/compiler/rustc_mir/src/transform/remove_unneeded_drops.rs @@ -38,8 +38,7 @@ impl<'tcx> MirPass<'tcx> for RemoveUnneededDrops { impl<'a, 'tcx> Visitor<'tcx> for RemoveUnneededDropsOptimizationFinder<'a, 'tcx> { fn visit_terminator(&mut self, terminator: &Terminator<'tcx>, location: Location) { match terminator.kind { - TerminatorKind::Drop { place, target, .. } - | TerminatorKind::DropAndReplace { place, target, .. } => { + TerminatorKind::Drop { place, target, .. } => { let ty = place.ty(self.body, self.tcx); let needs_drop = ty.ty.needs_drop(self.tcx, self.tcx.param_env(self.def_id)); if !needs_drop { From ebf024bba84242e0c4176583b80ddd1cba071c42 Mon Sep 17 00:00:00 2001 From: Dylan MacKenzie <ecstaticmorse@gmail.com> Date: Thu, 24 Sep 2020 11:11:53 -0700 Subject: [PATCH 24/25] Suggest `const_fn_transmute` instead of `const_fn` --- compiler/rustc_mir/src/transform/check_consts/ops.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/compiler/rustc_mir/src/transform/check_consts/ops.rs b/compiler/rustc_mir/src/transform/check_consts/ops.rs index e14dcf92b89d2..9871300027740 100644 --- a/compiler/rustc_mir/src/transform/check_consts/ops.rs +++ b/compiler/rustc_mir/src/transform/check_consts/ops.rs @@ -489,7 +489,14 @@ impl NonConstOp for Transmute { } fn emit_error(&self, ccx: &ConstCx<'_, '_>, span: Span) { - mcf_emit_error(ccx, span, "can only call `transmute` from const items, not `const fn`"); + feature_err( + &ccx.tcx.sess.parse_sess, + sym::const_fn_transmute, + span, + &format!("`transmute` is not allowed in {}s", ccx.const_kind()), + ) + .note("`transmute` is only allowed in constants and statics for now") + .emit(); } } From 0f594698aaa2b8330eca219f38105d2f4989c977 Mon Sep 17 00:00:00 2001 From: Dylan MacKenzie <ecstaticmorse@gmail.com> Date: Thu, 24 Sep 2020 11:12:28 -0700 Subject: [PATCH 25/25] Bless tests --- .../feature-gate-const_fn_transmute.rs | 18 ++--- .../feature-gate-const_fn_transmute.stderr | 65 +++++++++++-------- .../ui/internal/internal-unstable-const.rs | 2 +- .../internal/internal-unstable-const.stderr | 9 +-- 4 files changed, 52 insertions(+), 42 deletions(-) diff --git a/src/test/ui/feature-gates/feature-gate-const_fn_transmute.rs b/src/test/ui/feature-gates/feature-gate-const_fn_transmute.rs index 981680b5d1fad..9007e501bc2bf 100644 --- a/src/test/ui/feature-gates/feature-gate-const_fn_transmute.rs +++ b/src/test/ui/feature-gates/feature-gate-const_fn_transmute.rs @@ -6,33 +6,33 @@ struct Foo(u32); const TRANSMUTED_U32: u32 = unsafe { mem::transmute(Foo(3)) }; const fn transmute_fn() -> u32 { unsafe { mem::transmute(Foo(3)) } } -//~^ ERROR can only call `transmute` from const items, not `const fn` +//~^ ERROR `transmute` const fn transmute_fn_intrinsic() -> u32 { unsafe { std::intrinsics::transmute(Foo(3)) } } -//~^ ERROR can only call `transmute` from const items, not `const fn` +//~^ ERROR `transmute` const fn transmute_fn_core_intrinsic() -> u32 { unsafe { core::intrinsics::transmute(Foo(3)) } } -//~^ ERROR can only call `transmute` from const items, not `const fn` +//~^ ERROR `transmute` const unsafe fn unsafe_transmute_fn() -> u32 { mem::transmute(Foo(3)) } -//~^ ERROR can only call `transmute` from const items, not `const fn` +//~^ ERROR `transmute` const unsafe fn unsafe_transmute_fn_intrinsic() -> u32 { std::intrinsics::transmute(Foo(3)) } -//~^ ERROR can only call `transmute` from const items, not `const fn` +//~^ ERROR `transmute` const unsafe fn unsafe_transmute_fn_core_intrinsic() -> u32 { core::intrinsics::transmute(Foo(3)) } -//~^ ERROR can only call `transmute` from const items, not `const fn` +//~^ ERROR `transmute` const fn safe_transmute_fn() -> u32 { mem::transmute(Foo(3)) } -//~^ ERROR can only call `transmute` from const items, not `const fn` +//~^ ERROR `transmute` //~| ERROR call to unsafe function is unsafe and requires unsafe function or block const fn safe_transmute_fn_intrinsic() -> u32 { std::intrinsics::transmute(Foo(3)) } -//~^ ERROR can only call `transmute` from const items, not `const fn` +//~^ ERROR `transmute` //~| ERROR call to unsafe function is unsafe and requires unsafe function or block const fn safe_transmute_fn_core_intrinsic() -> u32 { core::intrinsics::transmute(Foo(3)) } -//~^ ERROR can only call `transmute` from const items, not `const fn` +//~^ ERROR `transmute` //~| ERROR call to unsafe function is unsafe and requires unsafe function or block fn main() {} diff --git a/src/test/ui/feature-gates/feature-gate-const_fn_transmute.stderr b/src/test/ui/feature-gates/feature-gate-const_fn_transmute.stderr index 44430fd577d88..08ba14dc40e86 100644 --- a/src/test/ui/feature-gates/feature-gate-const_fn_transmute.stderr +++ b/src/test/ui/feature-gates/feature-gate-const_fn_transmute.stderr @@ -1,83 +1,92 @@ -error[E0723]: can only call `transmute` from const items, not `const fn` +error[E0658]: `transmute` is not allowed in constant functions --> $DIR/feature-gate-const_fn_transmute.rs:8:43 | LL | const fn transmute_fn() -> u32 { unsafe { mem::transmute(Foo(3)) } } | ^^^^^^^^^^^^^^^^^^^^^^ | - = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information - = help: add `#![feature(const_fn)]` to the crate attributes to enable + = note: see issue #53605 <https://github.com/rust-lang/rust/issues/53605> for more information + = help: add `#![feature(const_fn_transmute)]` to the crate attributes to enable + = note: `transmute` is only allowed in constants and statics for now -error[E0723]: can only call `transmute` from const items, not `const fn` +error[E0658]: `transmute` is not allowed in constant functions --> $DIR/feature-gate-const_fn_transmute.rs:11:53 | LL | const fn transmute_fn_intrinsic() -> u32 { unsafe { std::intrinsics::transmute(Foo(3)) } } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information - = help: add `#![feature(const_fn)]` to the crate attributes to enable + = note: see issue #53605 <https://github.com/rust-lang/rust/issues/53605> for more information + = help: add `#![feature(const_fn_transmute)]` to the crate attributes to enable + = note: `transmute` is only allowed in constants and statics for now -error[E0723]: can only call `transmute` from const items, not `const fn` +error[E0658]: `transmute` is not allowed in constant functions --> $DIR/feature-gate-const_fn_transmute.rs:14:58 | LL | const fn transmute_fn_core_intrinsic() -> u32 { unsafe { core::intrinsics::transmute(Foo(3)) } } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information - = help: add `#![feature(const_fn)]` to the crate attributes to enable + = note: see issue #53605 <https://github.com/rust-lang/rust/issues/53605> for more information + = help: add `#![feature(const_fn_transmute)]` to the crate attributes to enable + = note: `transmute` is only allowed in constants and statics for now -error[E0723]: can only call `transmute` from const items, not `const fn` +error[E0658]: `transmute` is not allowed in constant functions --> $DIR/feature-gate-const_fn_transmute.rs:17:48 | LL | const unsafe fn unsafe_transmute_fn() -> u32 { mem::transmute(Foo(3)) } | ^^^^^^^^^^^^^^^^^^^^^^ | - = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information - = help: add `#![feature(const_fn)]` to the crate attributes to enable + = note: see issue #53605 <https://github.com/rust-lang/rust/issues/53605> for more information + = help: add `#![feature(const_fn_transmute)]` to the crate attributes to enable + = note: `transmute` is only allowed in constants and statics for now -error[E0723]: can only call `transmute` from const items, not `const fn` +error[E0658]: `transmute` is not allowed in constant functions --> $DIR/feature-gate-const_fn_transmute.rs:20:58 | LL | const unsafe fn unsafe_transmute_fn_intrinsic() -> u32 { std::intrinsics::transmute(Foo(3)) } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information - = help: add `#![feature(const_fn)]` to the crate attributes to enable + = note: see issue #53605 <https://github.com/rust-lang/rust/issues/53605> for more information + = help: add `#![feature(const_fn_transmute)]` to the crate attributes to enable + = note: `transmute` is only allowed in constants and statics for now -error[E0723]: can only call `transmute` from const items, not `const fn` +error[E0658]: `transmute` is not allowed in constant functions --> $DIR/feature-gate-const_fn_transmute.rs:23:63 | LL | const unsafe fn unsafe_transmute_fn_core_intrinsic() -> u32 { core::intrinsics::transmute(Foo(3)) } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information - = help: add `#![feature(const_fn)]` to the crate attributes to enable + = note: see issue #53605 <https://github.com/rust-lang/rust/issues/53605> for more information + = help: add `#![feature(const_fn_transmute)]` to the crate attributes to enable + = note: `transmute` is only allowed in constants and statics for now -error[E0723]: can only call `transmute` from const items, not `const fn` +error[E0658]: `transmute` is not allowed in constant functions --> $DIR/feature-gate-const_fn_transmute.rs:26:39 | LL | const fn safe_transmute_fn() -> u32 { mem::transmute(Foo(3)) } | ^^^^^^^^^^^^^^^^^^^^^^ | - = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information - = help: add `#![feature(const_fn)]` to the crate attributes to enable + = note: see issue #53605 <https://github.com/rust-lang/rust/issues/53605> for more information + = help: add `#![feature(const_fn_transmute)]` to the crate attributes to enable + = note: `transmute` is only allowed in constants and statics for now -error[E0723]: can only call `transmute` from const items, not `const fn` +error[E0658]: `transmute` is not allowed in constant functions --> $DIR/feature-gate-const_fn_transmute.rs:30:49 | LL | const fn safe_transmute_fn_intrinsic() -> u32 { std::intrinsics::transmute(Foo(3)) } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information - = help: add `#![feature(const_fn)]` to the crate attributes to enable + = note: see issue #53605 <https://github.com/rust-lang/rust/issues/53605> for more information + = help: add `#![feature(const_fn_transmute)]` to the crate attributes to enable + = note: `transmute` is only allowed in constants and statics for now -error[E0723]: can only call `transmute` from const items, not `const fn` +error[E0658]: `transmute` is not allowed in constant functions --> $DIR/feature-gate-const_fn_transmute.rs:34:54 | LL | const fn safe_transmute_fn_core_intrinsic() -> u32 { core::intrinsics::transmute(Foo(3)) } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information - = help: add `#![feature(const_fn)]` to the crate attributes to enable + = note: see issue #53605 <https://github.com/rust-lang/rust/issues/53605> for more information + = help: add `#![feature(const_fn_transmute)]` to the crate attributes to enable + = note: `transmute` is only allowed in constants and statics for now error[E0133]: call to unsafe function is unsafe and requires unsafe function or block --> $DIR/feature-gate-const_fn_transmute.rs:26:39 @@ -105,5 +114,5 @@ LL | const fn safe_transmute_fn_core_intrinsic() -> u32 { core::intrinsics::tran error: aborting due to 12 previous errors -Some errors have detailed explanations: E0133, E0723. +Some errors have detailed explanations: E0133, E0658. For more information about an error, try `rustc --explain E0133`. diff --git a/src/test/ui/internal/internal-unstable-const.rs b/src/test/ui/internal/internal-unstable-const.rs index b923bc22f6e5f..554c67be4e0b0 100644 --- a/src/test/ui/internal/internal-unstable-const.rs +++ b/src/test/ui/internal/internal-unstable-const.rs @@ -8,7 +8,7 @@ #[stable(feature = "rust1", since = "1.0.0")] #[rustc_const_stable(feature = "rust1", since = "1.0.0")] pub const fn foo() -> i32 { - unsafe { std::mem::transmute(4u32) } //~ ERROR can only call `transmute` from const items + unsafe { std::mem::transmute(4u32) } //~ ERROR `transmute` } fn main() {} diff --git a/src/test/ui/internal/internal-unstable-const.stderr b/src/test/ui/internal/internal-unstable-const.stderr index 9626df23ec3c2..adfb8dc36918d 100644 --- a/src/test/ui/internal/internal-unstable-const.stderr +++ b/src/test/ui/internal/internal-unstable-const.stderr @@ -1,12 +1,13 @@ -error[E0723]: can only call `transmute` from const items, not `const fn` +error[E0658]: `transmute` is not allowed in constant functions --> $DIR/internal-unstable-const.rs:11:14 | LL | unsafe { std::mem::transmute(4u32) } | ^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information - = help: add `#![feature(const_fn)]` to the crate attributes to enable + = note: see issue #53605 <https://github.com/rust-lang/rust/issues/53605> for more information + = help: add `#![feature(const_fn_transmute)]` to the crate attributes to enable + = note: `transmute` is only allowed in constants and statics for now error: aborting due to previous error -For more information about this error, try `rustc --explain E0723`. +For more information about this error, try `rustc --explain E0658`.