Skip to content

Commit 8001b96

Browse files
committed
Auto merge of #71306 - Dylan-DPC:rollup-kvzc1da, r=Dylan-DPC
Rollup of 5 pull requests Successful merges: - #71271 (Move `MapInPlace` to rustc_data_structures) - #71276 (miri-unleashed: test that we detect heap allocations) - #71283 (Minor improvements to -Zprofile) - #71287 (Explain why we shouldn't add inline attr to into_vec) - #71303 (remove build warnings) Failed merges: r? @ghost
2 parents 52fa23a + f6fb931 commit 8001b96

File tree

22 files changed

+71
-27
lines changed

22 files changed

+71
-27
lines changed

src/liballoc/slice.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,9 @@ mod hack {
140140
use crate::string::ToString;
141141
use crate::vec::Vec;
142142

143+
// We shouldn't add inline attribute to this since this is used in
144+
// `vec!` macro mostly and causes perf regression. See #71204 for
145+
// discussion and perf results.
143146
pub fn into_vec<T>(b: Box<[T]>) -> Vec<T> {
144147
unsafe {
145148
let len = b.len();

src/librustc_ast/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ pub mod util {
3333
pub mod comments;
3434
pub mod lev_distance;
3535
pub mod literal;
36-
pub mod map_in_place;
3736
pub mod parser;
3837
}
3938

src/librustc_ast/mut_visit.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ use crate::ast::*;
1111
use crate::ptr::P;
1212
use crate::token::{self, Token};
1313
use crate::tokenstream::*;
14-
use crate::util::map_in_place::MapInPlace;
1514

15+
use rustc_data_structures::map_in_place::MapInPlace;
1616
use rustc_data_structures::sync::Lrc;
1717
use rustc_span::source_map::{respan, Spanned};
1818
use rustc_span::Span;

src/librustc_builtin_macros/deriving/generic/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,8 @@ use std::vec;
184184
use rustc_ast::ast::{self, BinOpKind, EnumDef, Expr, Generics, Ident, PatKind};
185185
use rustc_ast::ast::{GenericArg, GenericParamKind, VariantData};
186186
use rustc_ast::ptr::P;
187-
use rustc_ast::util::map_in_place::MapInPlace;
188187
use rustc_attr as attr;
188+
use rustc_data_structures::map_in_place::MapInPlace;
189189
use rustc_expand::base::{Annotatable, ExtCtxt};
190190
use rustc_session::parse::ParseSess;
191191
use rustc_span::source_map::respan;

src/librustc_data_structures/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ pub mod fx;
6767
pub mod graph;
6868
pub mod jobserver;
6969
pub mod macros;
70+
pub mod map_in_place;
7071
pub mod obligation_forest;
7172
pub mod owning_ref;
7273
pub mod ptr_key;

src/librustc_ast/util/map_in_place.rs renamed to src/librustc_data_structures/map_in_place.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// FIXME(Centril): Move to rustc_data_structures.
2-
31
use smallvec::{Array, SmallVec};
42
use std::ptr;
53

src/librustc_expand/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ use rustc_ast::ast::{self, AttrItem, Attribute, MetaItem};
44
use rustc_ast::attr::HasAttrs;
55
use rustc_ast::mut_visit::*;
66
use rustc_ast::ptr::P;
7-
use rustc_ast::util::map_in_place::MapInPlace;
87
use rustc_attr as attr;
98
use rustc_data_structures::fx::FxHashMap;
9+
use rustc_data_structures::map_in_place::MapInPlace;
1010
use rustc_errors::{error_code, struct_span_err, Applicability, Handler};
1111
use rustc_feature::{Feature, Features, State as FeatureState};
1212
use rustc_feature::{

src/librustc_expand/expand.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ use rustc_ast::mut_visit::*;
1313
use rustc_ast::ptr::P;
1414
use rustc_ast::token;
1515
use rustc_ast::tokenstream::TokenStream;
16-
use rustc_ast::util::map_in_place::MapInPlace;
1716
use rustc_ast::visit::{self, AssocCtxt, Visitor};
1817
use rustc_ast_pretty::pprust;
1918
use rustc_attr::{self as attr, is_builtin_attr, HasAttrs};
19+
use rustc_data_structures::map_in_place::MapInPlace;
2020
use rustc_errors::{Applicability, PResult};
2121
use rustc_feature::Features;
2222
use rustc_parse::parser::Parser;

src/librustc_metadata/creader.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -686,7 +686,9 @@ impl<'a> CrateLoader<'a> {
686686
}
687687

688688
fn inject_profiler_runtime(&mut self) {
689-
if self.sess.opts.debugging_opts.profile || self.sess.opts.cg.profile_generate.enabled() {
689+
if (self.sess.opts.debugging_opts.profile || self.sess.opts.cg.profile_generate.enabled())
690+
&& !self.sess.opts.debugging_opts.no_profiler_runtime
691+
{
690692
info!("loading profiler");
691693

692694
let name = Symbol::intern("profiler_builtins");

src/librustc_mir/borrow_check/diagnostics/region_name.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ impl<'tcx> MirBorrowckCtxt<'_, 'tcx> {
148148
///
149149
/// This function would create a label like this:
150150
///
151-
/// ```
151+
/// ```text
152152
/// | fn foo(x: &u32) { .. }
153153
/// ------- fully elaborated type of `x` is `&'1 u32`
154154
/// ```
@@ -300,7 +300,7 @@ impl<'tcx> MirBorrowckCtxt<'_, 'tcx> {
300300
/// elaborated type, returning something like `'1`. Result looks
301301
/// like:
302302
///
303-
/// ```
303+
/// ```text
304304
/// | fn foo(x: &u32) { .. }
305305
/// ------- fully elaborated type of `x` is `&'1 u32`
306306
/// ```
@@ -347,7 +347,7 @@ impl<'tcx> MirBorrowckCtxt<'_, 'tcx> {
347347
/// that has no type annotation.
348348
/// For example, we might produce an annotation like this:
349349
///
350-
/// ```
350+
/// ```text
351351
/// | foo(|a, b| b)
352352
/// | - -
353353
/// | | |
@@ -396,7 +396,7 @@ impl<'tcx> MirBorrowckCtxt<'_, 'tcx> {
396396
/// that contains the anonymous reference we want to give a name
397397
/// to. For example, we might produce an annotation like this:
398398
///
399-
/// ```
399+
/// ```text
400400
/// | fn a<T>(items: &[T]) -> Box<dyn Iterator<Item = &T>> {
401401
/// | - let's call the lifetime of this reference `'1`
402402
/// ```
@@ -600,7 +600,7 @@ impl<'tcx> MirBorrowckCtxt<'_, 'tcx> {
600600
/// fully elaborated type, returning something like `'1`. Result
601601
/// looks like:
602602
///
603-
/// ```
603+
/// ```text
604604
/// | let x = Some(&22);
605605
/// - fully elaborated type of `x` is `Option<&'1 u32>`
606606
/// ```

0 commit comments

Comments
 (0)