Skip to content

Commit a34a9b8

Browse files
committed
Revert to f9a3086
1 parent 8ad7bc3 commit a34a9b8

File tree

95 files changed

+273
-2340
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+273
-2340
lines changed

src/backtrace

src/doc/unstable-book/src/compiler-flags/sanitizer.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@ of bugs:
2626
* Double-free, invalid free
2727
* Memory leaks
2828

29-
The memory leak detection is enabled by default on Linux, and can be enabled
30-
with runtime flag `ASAN_OPTIONS=detect_leaks=1` on macOS.
31-
3229
AddressSanitizer is supported on the following targets:
3330

3431
* `x86_64-apple-darwin`
@@ -199,6 +196,10 @@ fn main() {
199196
200197
```shell
201198
$ export \
199+
CC=clang \
200+
CXX=clang++ \
201+
CFLAGS='-fsanitize=memory -fsanitize-memory-track-origins' \
202+
CXXFLAGS='-fsanitize=memory -fsanitize-memory-track-origins' \
202203
RUSTFLAGS='-Zsanitizer=memory -Zsanitizer-memory-track-origins' \
203204
RUSTDOCFLAGS='-Zsanitizer=memory -Zsanitizer-memory-track-origins'
204205
$ cargo clean

src/libcore/num/f32.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ pub mod consts {
242242
/// The full circle constant (τ)
243243
///
244244
/// Equal to 2π.
245-
#[stable(feature = "tau_constant", since = "1.47.0")]
245+
#[unstable(feature = "tau_constant", issue = "66770")]
246246
pub const TAU: f32 = 6.28318530717958647692528676655900577_f32;
247247

248248
/// π/2

src/libcore/num/f64.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ pub mod consts {
242242
/// The full circle constant (τ)
243243
///
244244
/// Equal to 2π.
245-
#[stable(feature = "tau_constant", since = "1.47.0")]
245+
#[unstable(feature = "tau_constant", issue = "66770")]
246246
pub const TAU: f64 = 6.28318530717958647692528676655900577_f64;
247247

248248
/// π/2

src/libcore/ops/range.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ use crate::hash::Hash;
3939
/// [`Iterator`]: ../iter/trait.IntoIterator.html
4040
/// [slicing index]: ../slice/trait.SliceIndex.html
4141
#[doc(alias = "..")]
42-
#[derive(Copy, Clone, Default, PartialEq, Eq, Hash)]
42+
#[derive(Copy, Clone, PartialEq, Eq, Hash)]
4343
#[stable(feature = "rust1", since = "1.0.0")]
4444
pub struct RangeFull;
4545

@@ -71,7 +71,7 @@ impl fmt::Debug for RangeFull {
7171
/// assert_eq!(arr[1..=3], [ 1,2,3 ]);
7272
/// ```
7373
#[doc(alias = "..")]
74-
#[derive(Clone, Default, PartialEq, Eq, Hash)] // not Copy -- see #27186
74+
#[derive(Clone, PartialEq, Eq, Hash)] // not Copy -- see #27186
7575
#[stable(feature = "rust1", since = "1.0.0")]
7676
pub struct Range<Idx> {
7777
/// The lower bound of the range (inclusive).

src/librustc_codegen_llvm/callee.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use log::debug;
1313
use rustc_codegen_ssa::traits::*;
1414

1515
use rustc_middle::ty::layout::{FnAbiExt, HasTyCtxt};
16-
use rustc_middle::ty::{self, Instance, TypeFoldable};
16+
use rustc_middle::ty::{Instance, TypeFoldable};
1717

1818
/// Codegens a reference to a fn/method item, monomorphizing and
1919
/// inlining as it goes.
@@ -29,18 +29,14 @@ pub fn get_fn(cx: &CodegenCx<'ll, 'tcx>, instance: Instance<'tcx>) -> &'ll Value
2929

3030
assert!(!instance.substs.needs_infer());
3131
assert!(!instance.substs.has_escaping_bound_vars());
32+
assert!(!instance.substs.has_param_types_or_consts());
3233

3334
if let Some(&llfn) = cx.instances.borrow().get(&instance) {
3435
return llfn;
3536
}
3637

3738
let sym = tcx.symbol_name(instance).name;
38-
debug!(
39-
"get_fn({:?}: {:?}) => {}",
40-
instance,
41-
instance.ty(cx.tcx(), ty::ParamEnv::reveal_all()),
42-
sym
43-
);
39+
debug!("get_fn({:?}: {:?}) => {}", instance, instance.monomorphic_ty(cx.tcx()), sym);
4440

4541
let fn_abi = FnAbi::of_instance(cx, instance, &[]);
4642

src/librustc_codegen_llvm/consts.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ impl CodegenCx<'ll, 'tcx> {
203203
def_id
204204
);
205205

206-
let ty = instance.ty(self.tcx, ty::ParamEnv::reveal_all());
206+
let ty = instance.monomorphic_ty(self.tcx);
207207
let sym = self.tcx.symbol_name(instance).name;
208208

209209
debug!("get_static: sym={} instance={:?}", sym, instance);
@@ -361,7 +361,7 @@ impl StaticMethods for CodegenCx<'ll, 'tcx> {
361361
};
362362

363363
let instance = Instance::mono(self.tcx, def_id);
364-
let ty = instance.ty(self.tcx, ty::ParamEnv::reveal_all());
364+
let ty = instance.monomorphic_ty(self.tcx);
365365
let llty = self.layout_of(ty).llvm_type(self);
366366
let g = if val_llty == llty {
367367
g

src/librustc_codegen_llvm/debuginfo/metadata.rs

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -700,8 +700,6 @@ pub fn type_metadata(cx: &CodegenCx<'ll, 'tcx>, t: Ty<'tcx>, usage_site_span: Sp
700700
prepare_tuple_metadata(cx, t, &tys, unique_type_id, usage_site_span, NO_SCOPE_METADATA)
701701
.finalize(cx)
702702
}
703-
// Type parameters from polymorphized functions.
704-
ty::Param(_) => MetadataCreationResult::new(param_type_metadata(cx, t), false),
705703
_ => bug!("debuginfo: unexpected type in type_metadata: {:?}", t),
706704
};
707705

@@ -957,20 +955,6 @@ fn pointer_type_metadata(
957955
}
958956
}
959957

960-
fn param_type_metadata(cx: &CodegenCx<'ll, 'tcx>, t: Ty<'tcx>) -> &'ll DIType {
961-
debug!("param_type_metadata: {:?}", t);
962-
let name = format!("{:?}", t);
963-
return unsafe {
964-
llvm::LLVMRustDIBuilderCreateBasicType(
965-
DIB(cx),
966-
name.as_ptr().cast(),
967-
name.len(),
968-
Size::ZERO.bits(),
969-
DW_ATE_unsigned,
970-
)
971-
};
972-
}
973-
974958
pub fn compile_unit_metadata(
975959
tcx: TyCtxt<'_>,
976960
codegen_unit_name: &str,
@@ -2481,7 +2465,7 @@ pub fn create_global_var_metadata(cx: &CodegenCx<'ll, '_>, def_id: DefId, global
24812465
};
24822466

24832467
let is_local_to_unit = is_node_local_to_unit(cx, def_id);
2484-
let variable_type = Instance::mono(cx.tcx, def_id).ty(cx.tcx, ty::ParamEnv::reveal_all());
2468+
let variable_type = Instance::mono(cx.tcx, def_id).monomorphic_ty(cx.tcx);
24852469
let type_metadata = type_metadata(cx, variable_type, span);
24862470
let var_name = tcx.item_name(def_id).as_str();
24872471
let linkage_name = mangled_name_of_instance(cx, Instance::mono(tcx, def_id)).name;

src/librustc_codegen_llvm/debuginfo/mod.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ use rustc_index::vec::IndexVec;
2626
use rustc_middle::mir;
2727
use rustc_middle::ty::layout::HasTyCtxt;
2828
use rustc_middle::ty::subst::{GenericArgKind, SubstsRef};
29-
use rustc_middle::ty::{self, Instance, ParamEnv, Ty, TypeFoldable};
29+
use rustc_middle::ty::{self, Instance, ParamEnv, Ty};
3030
use rustc_session::config::{self, DebugInfo};
3131
use rustc_span::symbol::Symbol;
3232
use rustc_span::{self, BytePos, Span};
@@ -470,9 +470,7 @@ impl DebugInfoMethods<'tcx> for CodegenCx<'ll, 'tcx> {
470470
match impl_self_ty.kind {
471471
ty::Adt(def, ..) if !def.is_box() => {
472472
// Again, only create type information if full debuginfo is enabled
473-
if cx.sess().opts.debuginfo == DebugInfo::Full
474-
&& !impl_self_ty.needs_subst()
475-
{
473+
if cx.sess().opts.debuginfo == DebugInfo::Full {
476474
Some(type_metadata(cx, impl_self_ty, rustc_span::DUMMY_SP))
477475
} else {
478476
Some(namespace::item_namespace(cx, def.did))

src/librustc_codegen_llvm/intrinsic.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ impl IntrinsicCallMethods<'tcx> for Builder<'a, 'll, 'tcx> {
160160
caller_instance: ty::Instance<'tcx>,
161161
) {
162162
let tcx = self.tcx;
163-
let callee_ty = instance.ty(tcx, ty::ParamEnv::reveal_all());
163+
let callee_ty = instance.monomorphic_ty(tcx);
164164

165165
let (def_id, substs) = match callee_ty.kind {
166166
ty::FnDef(def_id, substs) => (def_id, substs),

0 commit comments

Comments
 (0)