Skip to content
This repository has been archived by the owner on Aug 22, 2024. It is now read-only.

Commit

Permalink
Update toolchain to nightly-2023-09-18 (#1262)
Browse files Browse the repository at this point in the history
  • Loading branch information
hermanventer authored Jul 2, 2024
1 parent f614e55 commit 0445e1b
Show file tree
Hide file tree
Showing 18 changed files with 51 additions and 57 deletions.
Binary file modified binaries/summary_store.tar
Binary file not shown.
7 changes: 4 additions & 3 deletions checker/src/block_visitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2781,7 +2781,7 @@ impl<'block, 'analysis, 'compilation, 'tcx> BlockVisitor<'block, 'analysis, 'com
let lty = literal.ty();
if let rustc_middle::ty::ConstKind::Unevaluated(_unevaluated) = &kind {
kind = literal
.eval(self.bv.tcx, self.type_visitor().get_param_env())
.normalize(self.bv.tcx, self.type_visitor().get_param_env())
.kind();
}

Expand Down Expand Up @@ -3114,13 +3114,14 @@ impl<'block, 'analysis, 'compilation, 'tcx> BlockVisitor<'block, 'analysis, 'com
}

// A value not represented/representable by `Scalar` or `Slice`
ConstValue::ByRef {
ConstValue::Indirect {
// The backing memory of the value, may contain more memory than needed for just the value
// in order to share `ConstAllocation`s between values
alloc,
alloc_id,
// Offset into `alloc`
offset,
} => {
let alloc = self.bv.tcx.global_alloc(alloc_id).unwrap_memory();
let alloc_len = alloc.inner().len();
let offset_bytes = offset.bytes() as usize;
// The Rust compiler should ensure this.
Expand Down
4 changes: 1 addition & 3 deletions checker/src/callbacks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ use log_derive::*;
use rustc_driver::Compilation;
use rustc_interface::{interface, Queries};
use rustc_middle::ty::TyCtxt;
use rustc_session::EarlyErrorHandler;
use std::cell::RefCell;
use std::collections::HashMap;
use std::fmt::{Debug, Formatter, Result};
Expand Down Expand Up @@ -93,12 +92,11 @@ impl rustc_driver::Callbacks for MiraiCallbacks {

/// Called after the compiler has completed all analysis passes and before it lowers MIR to LLVM IR.
/// At this point the compiler is ready to tell us all it knows and we can proceed to do abstract
/// interpretation of all of the functions that will end up in the compiler output.
/// interpretation of all functions that will end up in the compiler output.
/// If this method returns false, the compilation will stop.
#[logfn(TRACE)]
fn after_analysis<'tcx>(
&mut self,
_early_error_handler: &EarlyErrorHandler,
compiler: &interface::Compiler,
queries: &'tcx Queries<'tcx>,
) -> Compilation {
Expand Down
2 changes: 1 addition & 1 deletion checker/tests/call_graph/fnptr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ commit;
],
"callables": [
{
"name": "/fnptr/fn1(u32,&fn(u32) -> u32)->u32",
"name": "/fnptr/fn1(u32,&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed(DefId(0:7 ~ fnptr[009e]::fn1::'_), '_) }) Binder(fn(u32) -> u32, []))->u32",
"file_index": 0,
"first_line": 9,
"local": true
Expand Down
2 changes: 1 addition & 1 deletion checker/tests/call_graph/fnptr_clean.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ commit;
],
"callables": [
{
"name": "/fnptr_clean/fn1(u32,&fn(u32) -> u32)->u32",
"name": "/fnptr_clean/fn1(u32,&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed(DefId(0:8 ~ fnptr_clean[1076]::fn1::'_), '_) }) Binder(fn(u32) -> u32, []))->u32",
"file_index": 0,
"first_line": 14,
"local": true
Expand Down
2 changes: 1 addition & 1 deletion checker/tests/call_graph/fnptr_deduplicate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ commit;
],
"callables": [
{
"name": "/fnptr_deduplicate/fn1(u32,&fn(u32) -> u32)->u32",
"name": "/fnptr_deduplicate/fn1(u32,&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed(DefId(0:7 ~ fnptr_deduplicate[2966]::fn1::'_), '_) }) Binder(fn(u32) -> u32, []))->u32",
"file_index": 0,
"first_line": 10,
"local": true
Expand Down
2 changes: 1 addition & 1 deletion checker/tests/call_graph/fnptr_dom.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ commit;
],
"callables": [
{
"name": "/fnptr_dom/fn1(u32,&fn(u32) -> u32,&fn(u32) -> u32)->u32",
"name": "/fnptr_dom/fn1(u32,&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed(DefId(0:7 ~ fnptr_dom[2ff5]::fn1::'_), '_) }) Binder(fn(u32) -> u32, []),&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed(DefId(0:8 ~ fnptr_dom[2ff5]::fn1::'_#1), '_) }) Binder(fn(u32) -> u32, []))->u32",
"file_index": 0,
"first_line": 9,
"local": true
Expand Down
2 changes: 1 addition & 1 deletion checker/tests/call_graph/fnptr_dom_loop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ commit;
],
"callables": [
{
"name": "/fnptr_dom_loop/fn1(u32,&fn(u32) -> u32,&fn(u32) -> u32)->u32",
"name": "/fnptr_dom_loop/fn1(u32,&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed(DefId(0:8 ~ fnptr_dom_loop[3bf9]::fn1::'_), '_) }) Binder(fn(u32) -> u32, []),&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed(DefId(0:9 ~ fnptr_dom_loop[3bf9]::fn1::'_#1), '_) }) Binder(fn(u32) -> u32, []))->u32",
"file_index": 0,
"first_line": 9,
"local": true
Expand Down
2 changes: 1 addition & 1 deletion checker/tests/call_graph/fnptr_dom_loop_souffle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ digraph {
],
"callables": [
{
"name": "/fnptr_dom_loop_souffle/fn1(u32,&fn(u32) -> u32,&fn(u32) -> u32)->u32",
"name": "/fnptr_dom_loop_souffle/fn1(u32,&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed(DefId(0:8 ~ fnptr_dom_loop_souffle[5e1d]::fn1::'_), '_) }) Binder(fn(u32) -> u32, []),&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed(DefId(0:9 ~ fnptr_dom_loop_souffle[5e1d]::fn1::'_#1), '_) }) Binder(fn(u32) -> u32, []))->u32",
"file_index": 0,
"first_line": 10,
"local": true
Expand Down
18 changes: 9 additions & 9 deletions checker/tests/call_graph/fnptr_fold.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,14 @@ commit;
/* EXPECTED:CALL_SITES{
"files": [
"tests/call_graph/fnptr_fold.rs",
"/rustc/8ed4537d7c238eb77509d82445cf1cb861a3b5ff/library/std/src/io/stdio.rs",
"/rustc/8ed4537d7c238eb77509d82445cf1cb861a3b5ff/library/core/src/fmt/mod.rs",
"/rustc/8ed4537d7c238eb77509d82445cf1cb861a3b5ff/library/core/src/slice/mod.rs",
"/rustc/8ed4537d7c238eb77509d82445cf1cb861a3b5ff/library/core/src/ptr/metadata.rs"
"/rustc/203c57dbe20aee67eaa8f7be45d1e4ef0b274109/library/std/src/io/stdio.rs",
"/rustc/203c57dbe20aee67eaa8f7be45d1e4ef0b274109/library/core/src/fmt/mod.rs",
"/rustc/203c57dbe20aee67eaa8f7be45d1e4ef0b274109/library/core/src/slice/mod.rs",
"/rustc/203c57dbe20aee67eaa8f7be45d1e4ef0b274109/library/core/src/ptr/metadata.rs"
],
"callables": [
{
"name": "/fnptr_fold/fn1(u32,&fn(u32) -> u32)->u32",
"name": "/fnptr_fold/fn1(u32,&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed(DefId(0:7 ~ fnptr_fold[dc8f]::fn1::'_), '_) }) Binder(fn(u32) -> u32, []))->u32",
"file_index": 0,
"first_line": 10,
"local": true
Expand All @@ -99,25 +99,25 @@ commit;
"local": true
},
{
"name": "/std/std::io::_print(std::fmt::Arguments<'_>)->()",
"name": "/std/std::io::_print(Adt(std::fmt::Arguments, [ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed(DefId(1:12958 ~ std[783e]::io::stdio::_print::'_), '_) })]))->()",
"file_index": 1,
"first_line": 1094,
"local": false
},
{
"name": "/core/std::fmt::Arguments::<'a>::new_const(&'a [&'static str])->std::fmt::Arguments<'a>",
"name": "/core/std::fmt::Arguments::<'a>::new_const(&ReEarlyBound(DefId(2:9434 ~ core[1fc7]::fmt::{impl#2}::'a), 0, 'a) [&ReStatic str])->Adt(std::fmt::Arguments, [ReEarlyBound(DefId(2:9434 ~ core[1fc7]::fmt::{impl#2}::'a), 0, 'a)])",
"file_index": 2,
"first_line": 297,
"local": true
},
{
"name": "/core/core::slice::<impl [T]>::len(&[T])->usize",
"name": "/core/core::slice::<impl [T]>::len(&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed(DefId(2:57065 ~ core[1fc7]::slice::{impl#0}::len::'_), '_) }) [T/#0])->usize",
"file_index": 3,
"first_line": 141,
"local": true
},
{
"name": "/core/std::ptr::metadata(*const T)-><T as std::ptr::Pointee>::Metadata",
"name": "/core/std::ptr::metadata(*const T/#0)->Alias(Projection, AliasTy { args: [T/#0], def_id: DefId(2:1737 ~ core[1fc7]::ptr::metadata::Pointee::Metadata) })",
"file_index": 4,
"first_line": 94,
"local": true
Expand Down
2 changes: 1 addition & 1 deletion checker/tests/call_graph/fnptr_loop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ commit;
"local": true
},
{
"name": "/fnptr_loop/fn2(u32,&fn(u32) -> u32)->u32",
"name": "/fnptr_loop/fn2(u32,&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed(DefId(0:7 ~ fnptr_loop[7bf4]::fn2::'_), '_) }) Binder(fn(u32) -> u32, []))->u32",
"file_index": 0,
"first_line": 12,
"local": true
Expand Down
2 changes: 1 addition & 1 deletion checker/tests/call_graph/fnptr_slice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ commit;
],
"callables": [
{
"name": "/fnptr_slice/fn1(u32,&fn(u32) -> u32)->u32",
"name": "/fnptr_slice/fn1(u32,&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed(DefId(0:7 ~ fnptr_slice[f591]::fn1::'_), '_) }) Binder(fn(u32) -> u32, []))->u32",
"file_index": 0,
"first_line": 10,
"local": true
Expand Down
10 changes: 4 additions & 6 deletions checker/tests/call_graph/generic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ commit;
*/

/* EXPECTED:CALL_SITES
{
/* EXPECTED:CALL_SITES{
"files": [
"tests/call_graph/generic.rs"
],
Expand All @@ -75,13 +74,13 @@ commit;
"local": true
},
{
"name": "/generic/Gen::<T>::bar(&Gen<T>,T)->()",
"name": "/generic/Gen::<T>::bar(&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed(DefId(0:12 ~ generic[7907]::{impl#0}::bar::'_), '_) }) Adt(Gen, [T/#0]),T/#0)->()",
"file_index": 0,
"first_line": 14,
"local": true
},
{
"name": "/generic/Gen::<T>::foo(U)->()",
"name": "/generic/Gen::<T>::foo(U/#1)->()",
"file_index": 0,
"first_line": 12,
"local": true
Expand All @@ -103,5 +102,4 @@ commit;
2
]
]
}
*/
}*/
6 changes: 3 additions & 3 deletions checker/tests/call_graph/static_deduplicate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,19 +66,19 @@ commit;
],
"callables": [
{
"name": "/static_deduplicate/fn1(u32,&str)->(u32, &str)",
"name": "/static_deduplicate/fn1(u32,&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed(DefId(0:7 ~ static_deduplicate[ca38]::fn1::'_), '_) }) str)->(u32&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed(DefId(0:7 ~ static_deduplicate[ca38]::fn1::'_), '_) }) str))",
"file_index": 0,
"first_line": 10,
"local": true
},
{
"name": "/static_deduplicate/fn2(u32,&str)->(u32, &str)",
"name": "/static_deduplicate/fn2(u32,&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed(DefId(0:8 ~ static_deduplicate[ca38]::fn2::'_), '_) }) str)->(u32&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed(DefId(0:8 ~ static_deduplicate[ca38]::fn2::'_), '_) }) str))",
"file_index": 0,
"first_line": 13,
"local": true
},
{
"name": "/static_deduplicate/fn3(u32,&str)->(u32, &str)",
"name": "/static_deduplicate/fn3(u32,&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed(DefId(0:9 ~ static_deduplicate[ca38]::fn3::'_), '_) }) str)->(u32&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed(DefId(0:9 ~ static_deduplicate[ca38]::fn3::'_), '_) }) str))",
"file_index": 0,
"first_line": 16,
"local": true
Expand Down
16 changes: 8 additions & 8 deletions checker/tests/call_graph/static_fold.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ commit;
/* EXPECTED:CALL_SITES{
"files": [
"tests/call_graph/static_fold.rs",
"/rustc/8ed4537d7c238eb77509d82445cf1cb861a3b5ff/library/std/src/io/stdio.rs",
"/rustc/8ed4537d7c238eb77509d82445cf1cb861a3b5ff/library/core/src/fmt/mod.rs",
"/rustc/8ed4537d7c238eb77509d82445cf1cb861a3b5ff/library/core/src/slice/mod.rs",
"/rustc/8ed4537d7c238eb77509d82445cf1cb861a3b5ff/library/core/src/ptr/metadata.rs"
"/rustc/203c57dbe20aee67eaa8f7be45d1e4ef0b274109/library/std/src/io/stdio.rs",
"/rustc/203c57dbe20aee67eaa8f7be45d1e4ef0b274109/library/core/src/fmt/mod.rs",
"/rustc/203c57dbe20aee67eaa8f7be45d1e4ef0b274109/library/core/src/slice/mod.rs",
"/rustc/203c57dbe20aee67eaa8f7be45d1e4ef0b274109/library/core/src/ptr/metadata.rs"
],
"callables": [
{
Expand Down Expand Up @@ -95,25 +95,25 @@ commit;
"local": true
},
{
"name": "/std/std::io::_print(std::fmt::Arguments<'_>)->()",
"name": "/std/std::io::_print(Adt(std::fmt::Arguments, [ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed(DefId(1:12958 ~ std[783e]::io::stdio::_print::'_), '_) })]))->()",
"file_index": 1,
"first_line": 1094,
"local": false
},
{
"name": "/core/std::fmt::Arguments::<'a>::new_const(&'a [&'static str])->std::fmt::Arguments<'a>",
"name": "/core/std::fmt::Arguments::<'a>::new_const(&ReEarlyBound(DefId(2:9434 ~ core[1fc7]::fmt::{impl#2}::'a), 0, 'a) [&ReStatic str])->Adt(std::fmt::Arguments, [ReEarlyBound(DefId(2:9434 ~ core[1fc7]::fmt::{impl#2}::'a), 0, 'a)])",
"file_index": 2,
"first_line": 297,
"local": false
},
{
"name": "/core/core::slice::<impl [T]>::len(&[T])->usize",
"name": "/core/core::slice::<impl [T]>::len(&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed(DefId(2:57065 ~ core[1fc7]::slice::{impl#0}::len::'_), '_) }) [T/#0])->usize",
"file_index": 3,
"first_line": 141,
"local": true
},
{
"name": "/core/std::ptr::metadata(*const T)-><T as std::ptr::Pointee>::Metadata",
"name": "/core/std::ptr::metadata(*const T/#0)->Alias(Projection, AliasTy { args: [T/#0], def_id: DefId(2:1737 ~ core[1fc7]::ptr::metadata::Pointee::Metadata) })",
"file_index": 4,
"first_line": 94,
"local": true
Expand Down
9 changes: 3 additions & 6 deletions checker/tests/call_graph/trait.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ commit;
}
*/

/* EXPECTED:CALL_SITES
{
/* EXPECTED:CALL_SITES{
"files": [
"tests/call_graph/trait.rs"
],
Expand All @@ -74,7 +73,7 @@ commit;
"local": true
},
{
"name": "/trait/<Bar as Tr>::bar(&Bar)->i32",
"name": "/trait/<Bar as Tr>::bar(&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed(DefId(0:13 ~ trait[5fc8]::{impl#0}::bar::'_), '_) }) Adt(Bar, []))->i32",
"file_index": 0,
"first_line": 14,
"local": true
Expand All @@ -89,6 +88,4 @@ commit;
1
]
]
}
*/
}*/
18 changes: 9 additions & 9 deletions checker/tests/integration_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -410,15 +410,15 @@ fn check_call_graph_output(
if compare_lines(&expected, &actual) {
0
} else {
println!("{file_name} failed to match {output_type:?} output");
println!("Expected:\n{expected}");
println!("Actual:\n{actual}");
1
// let c = expected_regex.captures(&test_case_data).unwrap();
// let updated =
// expected_regex.replace(&test_case_data, format!("{}{actual}{}", &c[1], &c[3]));
// fs::write(Path::new(&file_name), updated.to_string()).unwrap();
// 0
// println!("{file_name} failed to match {output_type:?} output");
// println!("Expected:\n{expected}");
// println!("Actual:\n{actual}");
// 1
let c = expected_regex.captures(&test_case_data).unwrap();
let updated =
expected_regex.replace(&test_case_data, format!("{}{actual}{}", &c[1], &c[3]));
fs::write(Path::new(&file_name), updated.to_string()).unwrap();
0
}
} else {
println!("{file_name} failed to read {output_type:?} output");
Expand Down
4 changes: 2 additions & 2 deletions rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
channel = "nightly-2023-09-10"
components = [ "clippy", "rustfmt", "rustc-dev", "rust-src", "rust-std", "llvm-tools-preview" ]
channel = "nightly-2023-09-18"
components = ["clippy", "rustfmt", "rustc-dev", "rust-src", "rust-std", "llvm-tools-preview"]

0 comments on commit 0445e1b

Please sign in to comment.