Skip to content

Commit a6335d0

Browse files
committed
Update rust toolchain to 2022-05-17
Status: Compilation succeeds but regression fails due to new intrinsic. Relevant changes: - rust-lang/rust#95837 - rust-lang/rust#95562 - rust-lang/rust#96883
1 parent c7c0c4f commit a6335d0

File tree

7 files changed

+11
-14
lines changed

7 files changed

+11
-14
lines changed

kani-compiler/src/codegen_cprover_gotoc/codegen/function.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -243,9 +243,8 @@ impl<'tcx> GotocCtx<'tcx> {
243243
///
244244
/// Handle all attributes i.e. `#[kani::x]` (which kani_macros translates to `#[kanitool::x]` for us to handle here)
245245
fn handle_kanitool_attributes(&mut self) {
246-
let all_attributes = self.tcx.get_attrs(self.current_fn().instance().def_id());
246+
let all_attributes = self.tcx.get_attrs_unchecked(self.current_fn().instance().def_id());
247247
let (proof_attributes, other_attributes) = partition_kanitool_attributes(all_attributes);
248-
249248
if proof_attributes.is_empty() && !other_attributes.is_empty() {
250249
self.tcx.sess.span_err(
251250
other_attributes[0].1.span,

kani-compiler/src/main.rs

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
//! Like miri, clippy, and other tools developed on the top of rustc, we rely on the
88
//! rustc_private feature and a specific version of rustc.
99
#![deny(warnings)]
10-
#![feature(bool_to_option)]
1110
#![feature(crate_visibility_modifier)]
1211
#![feature(extern_types)]
1312
#![feature(nll)]

rust-toolchain.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
# SPDX-License-Identifier: Apache-2.0 OR MIT
33

44
[toolchain]
5-
channel = "nightly-2022-05-03"
5+
channel = "nightly-2022-05-17"
66
components = ["llvm-tools-preview", "rustc-dev", "rust-src", "rustfmt"]

tools/bookrunner/librustdoc/clean/inline.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ use crate::clean::{
2626
use crate::core::DocContext;
2727
use crate::formats::item_type::ItemType;
2828

29-
type Attrs<'hir> = rustc_middle::ty::Attributes<'hir>;
29+
type Attrs<'hir> = &'hir [ast::Attribute];
3030

3131
/// Attempt to inline a definition into this AST.
3232
///
@@ -159,7 +159,7 @@ crate fn try_inline_glob(
159159
}
160160

161161
fn load_attrs<'hir>(cx: &DocContext<'hir>, did: DefId) -> Attrs<'hir> {
162-
cx.tcx.get_attrs(did)
162+
cx.tcx.get_attrs_unchecked(did)
163163
}
164164

165165
/// Record an external fully qualified name in the external_paths cache.
@@ -685,7 +685,7 @@ crate fn record_extern_trait(cx: &mut DocContext<'_>, did: DefId) {
685685

686686
let trait_ = clean::TraitWithExtraInfo {
687687
trait_,
688-
is_notable: clean::utils::has_doc_flag(cx.tcx.get_attrs(did), sym::notable_trait),
688+
is_notable: clean::utils::has_doc_flag(cx.tcx, did, sym::notable_trait),
689689
};
690690
cx.external_traits.borrow_mut().insert(did, trait_);
691691
cx.active_extern_traits.remove(&did);

tools/bookrunner/librustdoc/clean/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use rustc_hir::def::{CtorKind, DefKind, Res};
1919
use rustc_hir::def_id::{DefId, CRATE_DEF_INDEX, LOCAL_CRATE};
2020
use rustc_middle::middle::resolve_lifetime as rl;
2121
use rustc_middle::ty::subst::{InternalSubsts, Subst};
22-
use rustc_middle::ty::{self, AdtKind, DefIdTree, Lift, Ty, TyCtxt};
22+
use rustc_middle::ty::{self, AdtKind, DefIdTree, EarlyBinder, Lift, Ty, TyCtxt};
2323
use rustc_middle::{bug, span_bug};
2424
use rustc_span::hygiene::{AstPass, MacroKind};
2525
use rustc_span::symbol::{kw, sym, Ident, Symbol};
@@ -1544,7 +1544,7 @@ impl<'tcx> Clean<Type> for Ty<'tcx> {
15441544
.tcx
15451545
.explicit_item_bounds(def_id)
15461546
.iter()
1547-
.map(|(bound, _)| bound.subst(cx.tcx, substs))
1547+
.map(|(bound, _)| EarlyBinder(*bound).subst(cx.tcx, substs))
15481548
.collect::<Vec<_>>();
15491549
let mut regions = vec![];
15501550
let mut has_sized = false;

tools/bookrunner/librustdoc/clean/types.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ impl Item {
197197
kind: ItemKind,
198198
cx: &mut DocContext<'_>,
199199
) -> Item {
200-
let ast_attrs = cx.tcx.get_attrs(def_id);
200+
let ast_attrs = cx.tcx.get_attrs_unchecked(def_id);
201201

202202
Self::from_def_id_and_attrs_and_parts(def_id, name, kind, box ast_attrs.clean(cx), cx)
203203
}

tools/bookrunner/librustdoc/clean/utils.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -287,10 +287,9 @@ where
287287
///
288288
/// This function exists because it runs on `hir::Attributes` whereas the other is a
289289
/// `clean::Attributes` method.
290-
crate fn has_doc_flag(attrs: ty::Attributes<'_>, flag: Symbol) -> bool {
291-
attrs.iter().any(|attr| {
292-
attr.has_name(sym::doc)
293-
&& attr.meta_item_list().map_or(false, |l| rustc_attr::list_contains_name(&l, flag))
290+
crate fn has_doc_flag(tcx: TyCtxt<'_>, did: DefId, flag: Symbol) -> bool {
291+
tcx.get_attrs(did, sym::doc).any(|attr| {
292+
attr.meta_item_list().map_or(false, |l| rustc_attr::list_contains_name(&l, flag))
294293
})
295294
}
296295

0 commit comments

Comments
 (0)