Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 14 pull requests #62413

Closed
wants to merge 50 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
3d2c4ff
Optimize pointer alignment in utf8 validation
jridgewell May 30, 2019
7d0a952
Implement initernal lint LINT_PASS_IMPL_WITHOUT_MACRO
flip1995 May 2, 2019
37f09cb
Only allow {declare,impl}_lint_pass macros for implementing LintPass
flip1995 Jun 13, 2019
084c829
Enable internal lints in bootstrap
flip1995 Jun 17, 2019
65c81de
Allow default_hash_types in some crates
flip1995 Jun 17, 2019
08b81f2
Rename internal -> rustc::internal
flip1995 Jun 17, 2019
7de6f54
Turn internal lints into tool lints
flip1995 Jun 24, 2019
8e087cd
Use symbols in lint tool list
flip1995 Jun 24, 2019
d0625a3
Allow usage_of_ty_tykind only in sty
flip1995 Jun 24, 2019
16b37b5
Update linked OpenSSL version
alexcrichton Jun 26, 2019
e475539
Add MemoryExtra in InterpretCx constructor params
pvdrz Jun 26, 2019
e32b8eb
Remove default bound for Machine::MemoryExtra
pvdrz Jun 26, 2019
0ffb643
Make sure `#[rustc_doc_only_macro]` and other rustc attributes are re…
petrochenkov Jun 29, 2019
e4e7eb2
Feature gate `rustc` attributes harder
petrochenkov Jun 30, 2019
2bad604
request at least ptr-size alignment from posix_memalign
RalfJung Jul 2, 2019
576369b
improve and deduplicate comments
RalfJung Jul 2, 2019
45e7ba9
test more possible overaligned requests
RalfJung Jul 2, 2019
2e47fc3
fix unused-import error on android
RalfJung Jul 3, 2019
e45bbaf
Fix merge conflicts
pvdrz Jul 4, 2019
6b75d08
Remove compile-pass from compiletest
JohnTitor Jul 4, 2019
7987719
remove FIXMEs for functions that won't go away
ljedrz Jun 27, 2019
4f7ba51
rename hir::map::local_def_id to local_def_id_from_node_id
ljedrz Jun 27, 2019
37d7e1f
rename hir::map::local_def_id_from_hir_id to local_def_id
ljedrz Jun 27, 2019
c6131b2
rename hir::map::opt_local_def_id*
ljedrz Jun 27, 2019
01e0d83
infer::error_reporting: adjust 2 debug messages
ljedrz Jun 28, 2019
675bfb6
fix a dep_graph doc regarding type_of_item
ljedrz Jul 2, 2019
a6030ff
infer: fix a Region-related debug message
ljedrz Jul 2, 2019
c3fcf28
Remove compile-pass from error codes' explanation
JohnTitor Jul 4, 2019
3adad33
Update rustc-guide
JohnTitor Jul 4, 2019
7f035ba
Fix a typo in Write::write_vectored docs
pawroman Jul 4, 2019
61ddf5e
Create async version of the dynamic-drop test
matthewjasper Jun 27, 2019
f4b30f4
Update README.md
markebrooks Jul 4, 2019
90419d3
Remove `solve_nll_region_constraints` measurements from `-Ztime-passe…
nnethercote Jun 25, 2019
87b103d
Add a "total" measurement to -Ztime-passes.
nnethercote Jun 25, 2019
050a71b
rustc_target: avoid negative register counts in the SysV x86_64 ABI.
eddyb Jul 4, 2019
f01e5e6
Lint on invalid values passed to x.py --warnings
Mark-Simulacrum Jul 5, 2019
c57637e
Rollup merge of #61339 - jridgewell:pointer-alignment, r=BurntSushi
Centril Jul 5, 2019
cf5e9e5
Rollup merge of #61545 - flip1995:internal_lints, r=oli-obk
Centril Jul 5, 2019
3ee2128
Rollup merge of #62110 - nnethercote:improve-Ztime-passes, r=Zoxc
Centril Jul 5, 2019
de03018
Rollup merge of #62133 - petrochenkov:norustc, r=eddyb
Centril Jul 5, 2019
1bd67c4
Rollup merge of #62151 - alexcrichton:update-openssl, r=Mark-Simulacrum
Centril Jul 5, 2019
b53ce9e
Rollup merge of #62158 - christianpoveda:ecx-memory-extra, r=RalfJung
Centril Jul 5, 2019
3525eff
Rollup merge of #62168 - ljedrz:the_culmination_of_hiridification, r=…
Centril Jul 5, 2019
7a595ee
Rollup merge of #62193 - matthewjasper:dynamic-drop-async, r=Centril
Centril Jul 5, 2019
c2b89eb
Rollup merge of #62296 - RalfJung:memalign, r=alexcrichton
Centril Jul 5, 2019
e142410
Rollup merge of #62369 - JohnTitor:remove-compile-pass, r=petrochenkov
Centril Jul 5, 2019
65a2db3
Rollup merge of #62380 - eddyb:x64-sysv-regs, r=nagisa
Centril Jul 5, 2019
aacf5a8
Rollup merge of #62381 - pawroman:fix_typo_in_write_vectored, r=Centril
Centril Jul 5, 2019
83ba37c
Rollup merge of #62390 - markebrooks:encourage, r=Centril
Centril Jul 5, 2019
76f9f4f
Rollup merge of #62406 - Mark-Simulacrum:warnings-lint, r=RalfJung
Centril Jul 5, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1835,7 +1835,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"

[[package]]
name = "openssl-src"
version = "111.1.0+1.1.1a"
version = "111.3.0+1.1.1c"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cc 1.0.35 (registry+https://github.com/rust-lang/crates.io-index)",
Expand All @@ -1848,7 +1848,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cc 1.0.35 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.54 (registry+https://github.com/rust-lang/crates.io-index)",
"openssl-src 111.1.0+1.1.1a (registry+https://github.com/rust-lang/crates.io-index)",
"openssl-src 111.3.0+1.1.1c (registry+https://github.com/rust-lang/crates.io-index)",
"pkg-config 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"vcpkg 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
Expand Down Expand Up @@ -4384,7 +4384,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
"checksum opener 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "998c59e83d9474c01127a96e023b7a04bb061dd286bf8bb939d31dc8d31a7448"
"checksum openssl 0.10.16 (registry+https://github.com/rust-lang/crates.io-index)" = "ec7bd7ca4cce6dbdc77e7c1230682740d307d1218a87fb0349a571272be749f9"
"checksum openssl-probe 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "77af24da69f9d9341038eba93a073b1fdaaa1b788221b00a69bce9e762cb32de"
"checksum openssl-src 111.1.0+1.1.1a (registry+https://github.com/rust-lang/crates.io-index)" = "26bb632127731bf4ac49bf86a5dde12d2ca0918c2234fc39d79d4da2ccbc6da7"
"checksum openssl-src 111.3.0+1.1.1c (registry+https://github.com/rust-lang/crates.io-index)" = "53ed5f31d294bdf5f7a4ba0a206c2754b0f60e9a63b7e3076babc5317873c797"
"checksum openssl-sys 0.9.43 (registry+https://github.com/rust-lang/crates.io-index)" = "33c86834957dd5b915623e94f2f4ab2c70dd8f6b70679824155d5ae21dbd495d"
"checksum ordermap 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "a86ed3f5f244b372d6b1a00b72ef7f8876d0bc6a78a4c9985c53614041512063"
"checksum ordslice 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "dd20eec3dbe4376829cb7d80ae6ac45e0a766831dca50202ff2d40db46a8a024"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Read ["Installation"] from [The Book].

_Note: If you wish to contribute to the compiler, you should read
[this chapter](https://rust-lang.github.io/rustc-guide/how-to-build-and-run.html)
of the rustc-guide instead._
of the rustc-guide instead of this section._

### Building on *nix
1. Make sure you have installed the dependencies:
Expand Down
15 changes: 14 additions & 1 deletion src/bootstrap/bin/rustc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,20 @@ fn main() {
}

// This is required for internal lints.
cmd.arg("-Zunstable-options");
if let Some(crate_name) = args.windows(2).find(|a| &*a[0] == "--crate-name") {
let crate_name = crate_name[1].to_string_lossy();
if crate_name != "rustc_version"
&& (crate_name.starts_with("rustc")
|| crate_name.starts_with("syntax")
|| crate_name == "arena"
|| crate_name == "fmt_macros")
{
cmd.arg("-Zunstable-options");
if stage != "0" {
cmd.arg("-Wrustc::internal");
}
}
}

// Force all crates compiled by this compiler to (a) be unstable and (b)
// allow the `rustc_private` feature to link to other unstable crates
Expand Down
4 changes: 2 additions & 2 deletions src/bootstrap/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ impl Config {
config.incremental = flags.incremental;
config.dry_run = flags.dry_run;
config.keep_stage = flags.keep_stage;
if let Some(value) = flags.warnings {
if let Some(value) = flags.deny_warnings {
config.deny_warnings = value;
}

Expand Down Expand Up @@ -571,7 +571,7 @@ impl Config {
config.rustc_default_linker = rust.default_linker.clone();
config.musl_root = rust.musl_root.clone().map(PathBuf::from);
config.save_toolstates = rust.save_toolstates.clone().map(PathBuf::from);
set(&mut config.deny_warnings, rust.deny_warnings.or(flags.warnings));
set(&mut config.deny_warnings, flags.deny_warnings.or(rust.deny_warnings));
set(&mut config.backtrace_on_ice, rust.backtrace_on_ice);
set(&mut config.rust_verify_llvm_ir, rust.verify_llvm_ir);
set(&mut config.rust_remap_debuginfo, rust.remap_debuginfo);
Expand Down
24 changes: 21 additions & 3 deletions src/bootstrap/flags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,11 @@ pub struct Flags {
pub rustc_error_format: Option<String>,
pub dry_run: bool,

// true => deny
pub warnings: Option<bool>,
// This overrides the deny-warnings configuation option,
// which passes -Dwarnings to the compiler invocations.
//
// true => deny, false => allow
pub deny_warnings: Option<bool>,
}

pub enum Subcommand {
Expand Down Expand Up @@ -468,7 +471,7 @@ Arguments:
.into_iter()
.map(|p| p.into())
.collect::<Vec<_>>(),
warnings: matches.opt_str("warnings").map(|v| v == "deny"),
deny_warnings: parse_deny_warnings(&matches),
}
}
}
Expand Down Expand Up @@ -549,3 +552,18 @@ fn split(s: &[String]) -> Vec<String> {
.map(|s| s.to_string())
.collect()
}

fn parse_deny_warnings(matches: &getopts::Matches) -> Option<bool> {
match matches.opt_str("warnings").as_ref().map(|v| v.as_str()) {
Some("deny") => Some(true),
Some("allow") => Some(false),
Some(value) => {
eprintln!(
r#"invalid value for --warnings: {:?}, expected "allow" or "deny""#,
value,
);
process::exit(1);
},
None => None,
}
}
2 changes: 1 addition & 1 deletion src/doc/rustc-guide
32 changes: 17 additions & 15 deletions src/liballoc/tests/heap.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::alloc::{Global, Alloc, Layout, System};

/// Issue #45955.
/// Issue #45955 and #62251.
#[test]
fn alloc_system_overaligned_request() {
check_overalign_requests(System)
Expand All @@ -12,21 +12,23 @@ fn std_heap_overaligned_request() {
}

fn check_overalign_requests<T: Alloc>(mut allocator: T) {
let size = 8;
let align = 16; // greater than size
let iterations = 100;
unsafe {
let pointers: Vec<_> = (0..iterations).map(|_| {
allocator.alloc(Layout::from_size_align(size, align).unwrap()).unwrap()
}).collect();
for &ptr in &pointers {
assert_eq!((ptr.as_ptr() as usize) % align, 0,
"Got a pointer less aligned than requested")
}
for &align in &[4, 8, 16, 32] { // less than and bigger than `MIN_ALIGN`
for &size in &[align/2, align-1] { // size less than alignment
let iterations = 128;
unsafe {
let pointers: Vec<_> = (0..iterations).map(|_| {
allocator.alloc(Layout::from_size_align(size, align).unwrap()).unwrap()
}).collect();
for &ptr in &pointers {
assert_eq!((ptr.as_ptr() as usize) % align, 0,
"Got a pointer less aligned than requested")
}

// Clean up
for &ptr in &pointers {
allocator.dealloc(ptr, Layout::from_size_align(size, align).unwrap())
// Clean up
for &ptr in &pointers {
allocator.dealloc(ptr, Layout::from_size_align(size, align).unwrap())
}
}
}
}
}
1 change: 0 additions & 1 deletion src/libarena/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
test(no_crate_inject, attr(deny(warnings))))]

#![deny(rust_2018_idioms)]
#![deny(internal)]
#![deny(unused_lifetimes)]

#![feature(core_intrinsics)]
Expand Down
1 change: 1 addition & 0 deletions src/libcore/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
#![feature(concat_idents)]
#![feature(const_fn)]
#![feature(const_fn_union)]
#![feature(custom_inner_attributes)]
#![feature(doc_cfg)]
#![feature(doc_spotlight)]
#![feature(extern_types)]
Expand Down
9 changes: 3 additions & 6 deletions src/libcore/str/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1422,6 +1422,7 @@ fn run_utf8_validation(v: &[u8]) -> Result<(), Utf8Error> {
let usize_bytes = mem::size_of::<usize>();
let ascii_block_size = 2 * usize_bytes;
let blocks_end = if len >= ascii_block_size { len - ascii_block_size + 1 } else { 0 };
let align = v.as_ptr().align_offset(usize_bytes);

while index < len {
let old_offset = index;
Expand Down Expand Up @@ -1501,12 +1502,8 @@ fn run_utf8_validation(v: &[u8]) -> Result<(), Utf8Error> {
// Ascii case, try to skip forward quickly.
// When the pointer is aligned, read 2 words of data per iteration
// until we find a word containing a non-ascii byte.
let ptr = v.as_ptr();
let align = unsafe {
// the offset is safe, because `index` is guaranteed inbounds
ptr.add(index).align_offset(usize_bytes)
};
if align == 0 {
if align.wrapping_sub(index) % usize_bytes == 0 {
let ptr = v.as_ptr();
while index < blocks_end {
unsafe {
let block = ptr.add(index) as *const usize;
Expand Down
1 change: 0 additions & 1 deletion src/libfmt_macros/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
test(attr(deny(warnings))))]

#![deny(rust_2018_idioms)]
#![deny(internal)]
#![deny(unused_lifetimes)]

#![feature(nll)]
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/dep_graph/dep_tracking_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ impl<M: DepTrackingMapConfig> MemoizationMap for RefCell<DepTrackingMap<M>> {
///
/// ```
/// fn type_of_item(..., item: &hir::Item) -> Ty<'tcx> {
/// let item_def_id = ccx.tcx.hir().local_def_id(it.id);
/// let item_def_id = ccx.tcx.hir().local_def_id(it.hir_id);
/// ccx.tcx.item_types.memoized(item_def_id, || {
/// ccx.tcx.dep_graph.read(DepNode::Hir(item_def_id)); // (*)
/// compute_type_of_item(ccx, item)
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/hir/check_attr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ impl CheckAttrVisitor<'tcx> {
/// Checks any attribute.
fn check_attributes(&self, item: &hir::Item, target: Target) {
if target == Target::Fn || target == Target::Const {
self.tcx.codegen_fn_attrs(self.tcx.hir().local_def_id_from_hir_id(item.hir_id));
self.tcx.codegen_fn_attrs(self.tcx.hir().local_def_id(item.hir_id));
} else if let Some(a) = item.attrs.iter().find(|a| a.check_name(sym::target_feature)) {
self.tcx.sess.struct_span_err(a.span, "attribute should be applied to a function")
.span_label(item.span, "not a function")
Expand Down
1 change: 0 additions & 1 deletion src/librustc/hir/map/definitions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,6 @@ impl Definitions {
None
}

// FIXME(@ljedrz): replace the NodeId variant
#[inline]
pub fn as_local_hir_id(&self, def_id: DefId) -> Option<hir::HirId> {
if def_id.krate == LOCAL_CRATE {
Expand Down
5 changes: 3 additions & 2 deletions src/librustc/hir/map/hir_id_validator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ pub fn check_crate(hir_map: &hir::map::Map<'_>) {
let errors = Lock::new(Vec::new());

par_iter(&hir_map.krate().modules).for_each(|(module_id, _)| {
hir_map.visit_item_likes_in_module(hir_map.local_def_id(*module_id), &mut OuterVisitor {
let local_def_id = hir_map.local_def_id_from_node_id(*module_id);
hir_map.visit_item_likes_in_module(local_def_id, &mut OuterVisitor {
hir_map,
errors: &errors,
});
Expand Down Expand Up @@ -79,7 +80,7 @@ impl<'a, 'hir> HirIdValidator<'a, 'hir> {
hir_id: HirId,
walk: F) {
assert!(self.owner_def_index.is_none());
let owner_def_index = self.hir_map.local_def_id_from_hir_id(hir_id).index;
let owner_def_index = self.hir_map.local_def_id(hir_id).index;
self.owner_def_index = Some(owner_def_index);
walk(self);

Expand Down
29 changes: 13 additions & 16 deletions src/librustc/hir/map/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ impl<'hir> Map<'hir> {
}

pub fn def_path_from_hir_id(&self, id: HirId) -> Option<DefPath> {
self.opt_local_def_id_from_hir_id(id).map(|def_id| {
self.opt_local_def_id(id).map(|def_id| {
self.def_path(def_id)
})
}
Expand All @@ -230,32 +230,30 @@ impl<'hir> Map<'hir> {
}

#[inline]
pub fn local_def_id(&self, node: NodeId) -> DefId {
self.opt_local_def_id(node).unwrap_or_else(|| {
pub fn local_def_id_from_node_id(&self, node: NodeId) -> DefId {
self.opt_local_def_id_from_node_id(node).unwrap_or_else(|| {
let hir_id = self.node_to_hir_id(node);
bug!("local_def_id: no entry for `{}`, which has a map of `{:?}`",
bug!("local_def_id_from_node_id: no entry for `{}`, which has a map of `{:?}`",
node, self.find_entry(hir_id))
})
}

// FIXME(@ljedrz): replace the `NodeId` variant.
#[inline]
pub fn local_def_id_from_hir_id(&self, hir_id: HirId) -> DefId {
self.opt_local_def_id_from_hir_id(hir_id).unwrap_or_else(|| {
bug!("local_def_id_from_hir_id: no entry for `{:?}`, which has a map of `{:?}`",
pub fn local_def_id(&self, hir_id: HirId) -> DefId {
self.opt_local_def_id(hir_id).unwrap_or_else(|| {
bug!("local_def_id: no entry for `{:?}`, which has a map of `{:?}`",
hir_id, self.find_entry(hir_id))
})
}

// FIXME(@ljedrz): replace the `NodeId` variant.
#[inline]
pub fn opt_local_def_id_from_hir_id(&self, hir_id: HirId) -> Option<DefId> {
pub fn opt_local_def_id(&self, hir_id: HirId) -> Option<DefId> {
let node_id = self.hir_to_node_id(hir_id);
self.definitions.opt_local_def_id(node_id)
}

#[inline]
pub fn opt_local_def_id(&self, node: NodeId) -> Option<DefId> {
pub fn opt_local_def_id_from_node_id(&self, node: NodeId) -> Option<DefId> {
self.definitions.opt_local_def_id(node)
}

Expand All @@ -264,7 +262,6 @@ impl<'hir> Map<'hir> {
self.definitions.as_local_node_id(def_id)
}

// FIXME(@ljedrz): replace the `NodeId` variant.
#[inline]
pub fn as_local_hir_id(&self, def_id: DefId) -> Option<HirId> {
self.definitions.as_local_hir_id(def_id)
Expand Down Expand Up @@ -429,7 +426,7 @@ impl<'hir> Map<'hir> {
}

pub fn body_owner_def_id(&self, id: BodyId) -> DefId {
self.local_def_id_from_hir_id(self.body_owner(id))
self.local_def_id(self.body_owner(id))
}

/// Given a `HirId`, returns the `BodyId` associated with it,
Expand Down Expand Up @@ -765,7 +762,7 @@ impl<'hir> Map<'hir> {
/// Returns the `DefId` of `id`'s nearest module parent, or `id` itself if no
/// module parent is in this map.
pub fn get_module_parent(&self, id: HirId) -> DefId {
self.local_def_id_from_hir_id(self.get_module_parent_node(id))
self.local_def_id(self.get_module_parent_node(id))
}

/// Returns the `HirId` of `id`'s nearest module parent, or `id` itself if no
Expand Down Expand Up @@ -841,7 +838,7 @@ impl<'hir> Map<'hir> {
}

pub fn get_parent_did(&self, id: HirId) -> DefId {
self.local_def_id_from_hir_id(self.get_parent_item(id))
self.local_def_id(self.get_parent_item(id))
}

pub fn get_foreign_abi(&self, hir_id: HirId) -> Abi {
Expand Down Expand Up @@ -1247,7 +1244,7 @@ fn hir_id_to_string(map: &Map<'_>, id: HirId, include_id: bool) -> String {
// the user-friendly path, otherwise fall back to stringifying DefPath.
crate::ty::tls::with_opt(|tcx| {
if let Some(tcx) = tcx {
let def_id = map.local_def_id_from_hir_id(id);
let def_id = map.local_def_id(id);
tcx.def_path_str(def_id)
} else if let Some(path) = map.def_path_from_hir_id(id) {
path.data.into_iter().map(|elem| {
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/hir/upvars.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ impl Visitor<'tcx> for CaptureCollector<'a, 'tcx> {

fn visit_expr(&mut self, expr: &'tcx hir::Expr) {
if let hir::ExprKind::Closure(..) = expr.node {
let closure_def_id = self.tcx.hir().local_def_id_from_hir_id(expr.hir_id);
let closure_def_id = self.tcx.hir().local_def_id(expr.hir_id);
if let Some(upvars) = self.tcx.upvars(closure_def_id) {
// Every capture of a closure expression is a local in scope,
// that is moved/copied/borrowed into the closure value, and
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,12 +139,7 @@ impl Visitor<'tcx> for FindNestedTypeVisitor<'tcx> {
// error. We will then search the function parameters for a bound
// region at the right depth with the same index
(Some(rl::Region::EarlyBound(_, id, _)), ty::BrNamed(def_id, _)) => {
debug!(
"EarlyBound self.infcx.tcx.hir().local_def_id(id)={:?} \
def_id={:?}",
id,
def_id
);
debug!("EarlyBound id={:?} def_id={:?}", id, def_id);
if id == def_id {
self.found_type = Some(arg);
return; // we can stop visiting now
Expand All @@ -162,8 +157,7 @@ impl Visitor<'tcx> for FindNestedTypeVisitor<'tcx> {
"FindNestedTypeVisitor::visit_ty: LateBound depth = {:?}",
debruijn_index
);
debug!("self.infcx.tcx.hir().local_def_id(id)={:?}", id);
debug!("def_id={:?}", def_id);
debug!("LateBound id={:?} def_id={:?}", id, def_id);
if debruijn_index == self.current_index && id == def_id {
self.found_type = Some(arg);
return; // we can stop visiting now
Expand Down Expand Up @@ -231,12 +225,7 @@ impl Visitor<'tcx> for TyPathVisitor<'tcx> {
}

(Some(rl::Region::EarlyBound(_, id, _)), ty::BrNamed(def_id, _)) => {
debug!(
"EarlyBound self.infcx.tcx.hir().local_def_id(id)={:?} \
def_id={:?}",
id,
def_id
);
debug!("EarlyBound id={:?} def_id={:?}", id, def_id);
if id == def_id {
self.found_it = true;
return; // we can stop visiting now
Expand Down
Loading