diff options
| author | bors <bors@rust-lang.org> | 2022-04-15 18:51:40 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-04-15 18:51:40 +0000 |
| commit | 3f391b84552f210adec7893b50c5da74f9362ae4 (patch) | |
| tree | bd7084e37d615bb22152fce22c7c9328f5316c4f /compiler/rustc_middle/src | |
| parent | 1e6fe5855a115ef7f17f3e17205fab7340775701 (diff) | |
| parent | fa281fdf65f63da72abfef83abeb8bea37fddfd9 (diff) | |
| download | rust-3f391b84552f210adec7893b50c5da74f9362ae4.tar.gz rust-3f391b84552f210adec7893b50c5da74f9362ae4.zip | |
Auto merge of #96087 - Dylan-DPC:rollup-k6yzk55, r=Dylan-DPC
Rollup of 11 pull requests Successful merges: - #94457 (Stabilize `derive_default_enum`) - #94461 (Create (unstable) 2024 edition) - #94849 (Check var scope if it exist) - #95194 (remove find_use_placement) - #95749 (only downgrade selection Error -> Ambiguous if type error is in predicate) - #96026 (couple of clippy::complexity fixes) - #96027 (remove function parameters only used in recursion) - #96034 ([test] Add test cases of untested functions for BTreeSet ) - #96040 (Use u32 instead of i32 for futexes.) - #96062 (docs: Update tests chapter for Termination stabilization) - #96065 (Refactor: Use `format-args-capture` and remove unnecessary nested blocks in rustc_typeck) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_middle/src')
| -rw-r--r-- | compiler/rustc_middle/src/hir/map/mod.rs | 4 | ||||
| -rw-r--r-- | compiler/rustc_middle/src/lib.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_middle/src/middle/region.rs | 9 | ||||
| -rw-r--r-- | compiler/rustc_middle/src/ty/inhabitedness/mod.rs | 2 |
4 files changed, 7 insertions, 10 deletions
diff --git a/compiler/rustc_middle/src/hir/map/mod.rs b/compiler/rustc_middle/src/hir/map/mod.rs index 65796fbc698..08cd40f38ef 100644 --- a/compiler/rustc_middle/src/hir/map/mod.rs +++ b/compiler/rustc_middle/src/hir/map/mod.rs @@ -584,7 +584,7 @@ impl<'hir> Map<'hir> { Some(OwnerNode::Item(&Item { span, kind: ItemKind::Mod(ref m), .. })) => { (m, span, hir_id) } - Some(OwnerNode::Crate(item)) => (item, item.inner, hir_id), + Some(OwnerNode::Crate(item)) => (item, item.spans.inner_span, hir_id), node => panic!("not a module: {:?}", node), } } @@ -1012,7 +1012,7 @@ impl<'hir> Map<'hir> { Node::Infer(i) => i.span, Node::Visibility(v) => bug!("unexpected Visibility {:?}", v), Node::Local(local) => local.span, - Node::Crate(item) => item.inner, + Node::Crate(item) => item.spans.inner_span, }; Some(span) } diff --git a/compiler/rustc_middle/src/lib.rs b/compiler/rustc_middle/src/lib.rs index fd2b5f5335f..199b5fa0314 100644 --- a/compiler/rustc_middle/src/lib.rs +++ b/compiler/rustc_middle/src/lib.rs @@ -30,7 +30,7 @@ #![feature(bool_to_option)] #![feature(box_patterns)] #![feature(core_intrinsics)] -#![feature(derive_default_enum)] +#![cfg_attr(bootstrap, feature(derive_default_enum))] #![feature(discriminant_kind)] #![feature(exhaustive_patterns)] #![feature(get_mut_unchecked)] diff --git a/compiler/rustc_middle/src/middle/region.rs b/compiler/rustc_middle/src/middle/region.rs index 98da20baf02..af16e5e3fc8 100644 --- a/compiler/rustc_middle/src/middle/region.rs +++ b/compiler/rustc_middle/src/middle/region.rs @@ -362,12 +362,9 @@ impl ScopeTree { self.parent_map.get(&id).cloned().map(|(p, _)| p) } - /// Returns the lifetime of the local variable `var_id` - pub fn var_scope(&self, var_id: hir::ItemLocalId) -> Scope { - self.var_map - .get(&var_id) - .cloned() - .unwrap_or_else(|| bug!("no enclosing scope for id {:?}", var_id)) + /// Returns the lifetime of the local variable `var_id`, if any. + pub fn var_scope(&self, var_id: hir::ItemLocalId) -> Option<Scope> { + self.var_map.get(&var_id).cloned() } /// Returns the scope when the temp created by `expr_id` will be cleaned up. diff --git a/compiler/rustc_middle/src/ty/inhabitedness/mod.rs b/compiler/rustc_middle/src/ty/inhabitedness/mod.rs index 2c78c1f63d8..226456588e7 100644 --- a/compiler/rustc_middle/src/ty/inhabitedness/mod.rs +++ b/compiler/rustc_middle/src/ty/inhabitedness/mod.rs @@ -191,7 +191,7 @@ impl<'tcx> Ty<'tcx> { tcx: TyCtxt<'tcx>, param_env: ty::ParamEnv<'tcx>, ) -> DefIdForest<'tcx> { - tcx.type_uninhabited_from(param_env.and(self)).clone() + tcx.type_uninhabited_from(param_env.and(self)) } } |
