Auto merge of #145647 - RalfJung:miri, r=RalfJung
miri subtree update
Subtree update of `miri` to 980da679e4.
Created using https://github.com/rust-lang/josh-sync.
r? `@ghost`
This commit is contained in:
commit
6ba0ce4094
70 changed files with 214 additions and 51 deletions
18
src/tools/miri/.github/workflows/ci.yml
vendored
18
src/tools/miri/.github/workflows/ci.yml
vendored
|
|
@ -69,12 +69,6 @@ jobs:
|
|||
sudo apt update
|
||||
# Install needed packages
|
||||
sudo apt install $(echo "libatomic1: zlib1g-dev:" | sed 's/:/:${{ matrix.multiarch }}/g')
|
||||
- name: Install rustup on Windows ARM
|
||||
if: ${{ matrix.os == 'windows-11-arm' }}
|
||||
run: |
|
||||
curl -LOs https://static.rust-lang.org/rustup/dist/aarch64-pc-windows-msvc/rustup-init.exe
|
||||
./rustup-init.exe -y --no-modify-path
|
||||
echo "$USERPROFILE/.cargo/bin" >> "$GITHUB_PATH"
|
||||
- uses: ./.github/workflows/setup
|
||||
with:
|
||||
toolchain_flags: "--host ${{ matrix.host_target }}"
|
||||
|
|
@ -169,7 +163,13 @@ jobs:
|
|||
run: rustup toolchain install nightly --profile minimal
|
||||
- name: Install rustup-toolchain-install-master
|
||||
run: cargo install -f rustup-toolchain-install-master
|
||||
- name: Push changes to a branch and create PR
|
||||
# Create a token for the next step so it can create a PR that actually runs CI.
|
||||
- uses: actions/create-github-app-token@v2
|
||||
id: app-token
|
||||
with:
|
||||
app-id: ${{ vars.APP_CLIENT_ID }}
|
||||
private-key: ${{ secrets.APP_PRIVATE_KEY }}
|
||||
- name: pull changes from rustc and create PR
|
||||
run: |
|
||||
# Make it easier to see what happens.
|
||||
set -x
|
||||
|
|
@ -198,9 +198,9 @@ jobs:
|
|||
BRANCH="rustup-$(date -u +%Y-%m-%d)"
|
||||
git switch -c $BRANCH
|
||||
git push -u origin $BRANCH
|
||||
gh pr create -B master --title 'Automatic Rustup' --body 'Please close and re-open this PR to trigger CI, then enable auto-merge.'
|
||||
gh pr create -B master --title 'Automatic Rustup' --body "Update \`rustc\` to https://github.com/rust-lang/rust/commit/$(cat rust-version)."
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
|
||||
|
||||
cron-fail-notify:
|
||||
name: cronjob failure notification
|
||||
|
|
|
|||
|
|
@ -78,6 +78,7 @@ native-lib = ["dep:libffi", "dep:libloading", "dep:capstone", "dep:ipc-channel",
|
|||
|
||||
[lints.rust.unexpected_cfgs]
|
||||
level = "warn"
|
||||
check-cfg = ['cfg(bootstrap)']
|
||||
|
||||
# Be aware that this file is inside a workspace when used via the
|
||||
# submodule in the rustc repo. That means there are many cargo features
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
733dab558992d902d6d17576de1da768094e2cf3
|
||||
f605b57042ffeb320d7ae44490113a827139b766
|
||||
|
|
|
|||
|
|
@ -282,7 +282,8 @@ pub fn report_error<'tcx>(
|
|||
},
|
||||
TreeBorrowsUb { title: _, details, history } => {
|
||||
let mut helps = vec![
|
||||
note!("this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental")
|
||||
note!("this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental"),
|
||||
note!("see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/tree-borrows.md for further information"),
|
||||
];
|
||||
for m in details {
|
||||
helps.push(note!("{m}"));
|
||||
|
|
|
|||
|
|
@ -12,10 +12,10 @@ use rand::rngs::StdRng;
|
|||
use rand::{Rng, SeedableRng};
|
||||
use rustc_abi::{Align, ExternAbi, Size};
|
||||
use rustc_apfloat::{Float, FloatConvert};
|
||||
use rustc_hir::attrs::InlineAttr;
|
||||
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
|
||||
#[allow(unused)]
|
||||
use rustc_data_structures::static_assert_size;
|
||||
use rustc_hir::attrs::InlineAttr;
|
||||
use rustc_middle::mir;
|
||||
use rustc_middle::query::TyCtxtAt;
|
||||
use rustc_middle::ty::layout::{
|
||||
|
|
@ -1396,6 +1396,7 @@ impl<'tcx> Machine<'tcx> for MiriMachine<'tcx> {
|
|||
GlobalDataRaceHandler::Genmc(genmc_ctx) =>
|
||||
genmc_ctx.memory_load(machine, ptr.addr(), range.size)?,
|
||||
GlobalDataRaceHandler::Vclocks(_data_race) => {
|
||||
let _trace = enter_trace_span!(data_race::before_memory_read);
|
||||
let AllocDataRaceHandler::Vclocks(data_race, weak_memory) = &alloc_extra.data_race
|
||||
else {
|
||||
unreachable!();
|
||||
|
|
@ -1431,6 +1432,7 @@ impl<'tcx> Machine<'tcx> for MiriMachine<'tcx> {
|
|||
genmc_ctx.memory_store(machine, ptr.addr(), range.size)?;
|
||||
}
|
||||
GlobalDataRaceHandler::Vclocks(_global_state) => {
|
||||
let _trace = enter_trace_span!(data_race::before_memory_write);
|
||||
let AllocDataRaceHandler::Vclocks(data_race, weak_memory) =
|
||||
&mut alloc_extra.data_race
|
||||
else {
|
||||
|
|
@ -1467,6 +1469,7 @@ impl<'tcx> Machine<'tcx> for MiriMachine<'tcx> {
|
|||
GlobalDataRaceHandler::Genmc(genmc_ctx) =>
|
||||
genmc_ctx.handle_dealloc(machine, ptr.addr(), size, align, kind)?,
|
||||
GlobalDataRaceHandler::Vclocks(_global_state) => {
|
||||
let _trace = enter_trace_span!(data_race::before_memory_deallocation);
|
||||
let data_race = alloc_extra.data_race.as_vclocks_mut().unwrap();
|
||||
data_race.write(
|
||||
alloc_id,
|
||||
|
|
@ -1677,6 +1680,7 @@ impl<'tcx> Machine<'tcx> for MiriMachine<'tcx> {
|
|||
local: mir::Local,
|
||||
) -> InterpResult<'tcx> {
|
||||
if let Some(data_race) = &frame.extra.data_race {
|
||||
let _trace = enter_trace_span!(data_race::after_local_read);
|
||||
data_race.local_read(local, &ecx.machine);
|
||||
}
|
||||
interp_ok(())
|
||||
|
|
@ -1688,6 +1692,7 @@ impl<'tcx> Machine<'tcx> for MiriMachine<'tcx> {
|
|||
storage_live: bool,
|
||||
) -> InterpResult<'tcx> {
|
||||
if let Some(data_race) = &ecx.frame().extra.data_race {
|
||||
let _trace = enter_trace_span!(data_race::after_local_write);
|
||||
data_race.local_write(local, storage_live, &ecx.machine);
|
||||
}
|
||||
interp_ok(())
|
||||
|
|
@ -1710,6 +1715,7 @@ impl<'tcx> Machine<'tcx> for MiriMachine<'tcx> {
|
|||
if let Some(data_race) =
|
||||
&machine.threads.active_thread_stack().last().unwrap().extra.data_race
|
||||
{
|
||||
let _trace = enter_trace_span!(data_race::after_local_moved_to_memory);
|
||||
data_race.local_moved_to_memory(
|
||||
local,
|
||||
alloc_info.data_race.as_vclocks_mut().unwrap(),
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
|
|||
let ptr = left.to_scalar().to_pointer(this)?;
|
||||
// We do the actual operation with usize-typed scalars.
|
||||
let left = ImmTy::from_uint(ptr.addr().bytes(), this.machine.layouts.usize);
|
||||
let result = this.binary_op(bin_op, &left, &right)?;
|
||||
let result = this.binary_op(bin_op, &left, right)?;
|
||||
// Construct a new pointer with the provenance of `ptr` (the LHS).
|
||||
let result_ptr = Pointer::new(
|
||||
ptr.provenance,
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ impl<'tcx> MiriMachine<'tcx> {
|
|||
}
|
||||
"android" => {
|
||||
Self::null_ptr_extern_statics(ecx, &["bsd_signal"])?;
|
||||
Self::weak_symbol_extern_statics(ecx, &["signal", "getrandom"])?;
|
||||
Self::weak_symbol_extern_statics(ecx, &["signal", "getrandom", "gettid"])?;
|
||||
}
|
||||
"windows" => {
|
||||
// "_tls_used"
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ use std::path::Path;
|
|||
use rustc_abi::{Align, AlignFromBytesError, CanonAbi, Size};
|
||||
use rustc_apfloat::Float;
|
||||
use rustc_ast::expand::allocator::alloc_error_handler_name;
|
||||
use rustc_hir::attrs::Linkage;
|
||||
use rustc_hir::def::DefKind;
|
||||
use rustc_hir::def_id::CrateNum;
|
||||
use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrFlags;
|
||||
|
|
@ -138,7 +139,13 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
|
|||
Entry::Occupied(e) => e.into_mut(),
|
||||
Entry::Vacant(e) => {
|
||||
// Find it if it was not cached.
|
||||
let mut instance_and_crate: Option<(ty::Instance<'_>, CrateNum)> = None;
|
||||
|
||||
struct SymbolTarget<'tcx> {
|
||||
instance: ty::Instance<'tcx>,
|
||||
cnum: CrateNum,
|
||||
is_weak: bool,
|
||||
}
|
||||
let mut symbol_target: Option<SymbolTarget<'tcx>> = None;
|
||||
helpers::iter_exported_symbols(tcx, |cnum, def_id| {
|
||||
let attrs = tcx.codegen_fn_attrs(def_id);
|
||||
// Skip over imports of items.
|
||||
|
|
@ -155,40 +162,80 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
|
|||
|
||||
let instance = Instance::mono(tcx, def_id);
|
||||
let symbol_name = tcx.symbol_name(instance).name;
|
||||
let is_weak = attrs.linkage == Some(Linkage::WeakAny);
|
||||
if symbol_name == link_name.as_str() {
|
||||
if let Some((original_instance, original_cnum)) = instance_and_crate {
|
||||
// Make sure we are consistent wrt what is 'first' and 'second'.
|
||||
let original_span = tcx.def_span(original_instance.def_id()).data();
|
||||
let span = tcx.def_span(def_id).data();
|
||||
if original_span < span {
|
||||
throw_machine_stop!(TerminationInfo::MultipleSymbolDefinitions {
|
||||
link_name,
|
||||
first: original_span,
|
||||
first_crate: tcx.crate_name(original_cnum),
|
||||
second: span,
|
||||
second_crate: tcx.crate_name(cnum),
|
||||
});
|
||||
} else {
|
||||
throw_machine_stop!(TerminationInfo::MultipleSymbolDefinitions {
|
||||
link_name,
|
||||
first: span,
|
||||
first_crate: tcx.crate_name(cnum),
|
||||
second: original_span,
|
||||
second_crate: tcx.crate_name(original_cnum),
|
||||
});
|
||||
if let Some(original) = &symbol_target {
|
||||
// There is more than one definition with this name. What we do now
|
||||
// depends on whether one or both definitions are weak.
|
||||
match (is_weak, original.is_weak) {
|
||||
(false, true) => {
|
||||
// Original definition is a weak definition. Override it.
|
||||
|
||||
symbol_target = Some(SymbolTarget {
|
||||
instance: ty::Instance::mono(tcx, def_id),
|
||||
cnum,
|
||||
is_weak,
|
||||
});
|
||||
}
|
||||
(true, false) => {
|
||||
// Current definition is a weak definition. Keep the original one.
|
||||
}
|
||||
(true, true) | (false, false) => {
|
||||
// Either both definitions are non-weak or both are weak. In
|
||||
// either case return an error. For weak definitions we error
|
||||
// because it is unspecified which definition would have been
|
||||
// picked by the linker.
|
||||
|
||||
// Make sure we are consistent wrt what is 'first' and 'second'.
|
||||
let original_span =
|
||||
tcx.def_span(original.instance.def_id()).data();
|
||||
let span = tcx.def_span(def_id).data();
|
||||
if original_span < span {
|
||||
throw_machine_stop!(
|
||||
TerminationInfo::MultipleSymbolDefinitions {
|
||||
link_name,
|
||||
first: original_span,
|
||||
first_crate: tcx.crate_name(original.cnum),
|
||||
second: span,
|
||||
second_crate: tcx.crate_name(cnum),
|
||||
}
|
||||
);
|
||||
} else {
|
||||
throw_machine_stop!(
|
||||
TerminationInfo::MultipleSymbolDefinitions {
|
||||
link_name,
|
||||
first: span,
|
||||
first_crate: tcx.crate_name(cnum),
|
||||
second: original_span,
|
||||
second_crate: tcx.crate_name(original.cnum),
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
symbol_target = Some(SymbolTarget {
|
||||
instance: ty::Instance::mono(tcx, def_id),
|
||||
cnum,
|
||||
is_weak,
|
||||
});
|
||||
}
|
||||
if !matches!(tcx.def_kind(def_id), DefKind::Fn | DefKind::AssocFn) {
|
||||
throw_ub_format!(
|
||||
"attempt to call an exported symbol that is not defined as a function"
|
||||
);
|
||||
}
|
||||
instance_and_crate = Some((ty::Instance::mono(tcx, def_id), cnum));
|
||||
}
|
||||
interp_ok(())
|
||||
})?;
|
||||
|
||||
e.insert(instance_and_crate.map(|ic| ic.0))
|
||||
// Once we identified the instance corresponding to the symbol, ensure
|
||||
// it is a function. It is okay to encounter non-functions in the search above
|
||||
// as long as the final instance we arrive at is a function.
|
||||
if let Some(SymbolTarget { instance, .. }) = symbol_target {
|
||||
if !matches!(tcx.def_kind(instance.def_id()), DefKind::Fn | DefKind::AssocFn) {
|
||||
throw_ub_format!(
|
||||
"attempt to call an exported symbol that is not defined as a function"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
e.insert(symbol_target.map(|SymbolTarget { instance, .. }| instance))
|
||||
}
|
||||
};
|
||||
match instance {
|
||||
|
|
|
|||
|
|
@ -246,7 +246,8 @@ trait EvalContextExtPriv<'tcx>: crate::MiriInterpCxExt<'tcx> {
|
|||
let p_map = alloc.provenance();
|
||||
for idx in overlap {
|
||||
// If a provenance was read by the foreign code, expose it.
|
||||
if let Some((prov, _idx)) = p_map.get_byte(Size::from_bytes(idx), this) {
|
||||
if let Some((prov, _idx)) = p_map.get_byte(Size::from_bytes(idx), this)
|
||||
{
|
||||
this.expose_provenance(prov)?;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,13 +4,14 @@ use rustc_span::Symbol;
|
|||
use rustc_target::callconv::FnAbi;
|
||||
|
||||
use crate::shims::unix::android::thread::prctl;
|
||||
use crate::shims::unix::env::EvalContextExt as _;
|
||||
use crate::shims::unix::linux_like::epoll::EvalContextExt as _;
|
||||
use crate::shims::unix::linux_like::eventfd::EvalContextExt as _;
|
||||
use crate::shims::unix::linux_like::syscall::syscall;
|
||||
use crate::*;
|
||||
|
||||
pub fn is_dyn_sym(_name: &str) -> bool {
|
||||
false
|
||||
pub fn is_dyn_sym(name: &str) -> bool {
|
||||
matches!(name, "gettid")
|
||||
}
|
||||
|
||||
impl<'tcx> EvalContextExt<'tcx> for crate::MiriInterpCx<'tcx> {}
|
||||
|
|
@ -54,6 +55,12 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
|
|||
this.write_scalar(errno_place.to_ref(this).to_scalar(), dest)?;
|
||||
}
|
||||
|
||||
"gettid" => {
|
||||
let [] = this.check_shim_sig_lenient(abi, CanonAbi::C, link_name, args)?;
|
||||
let result = this.unix_gettid(link_name.as_str())?;
|
||||
this.write_scalar(result, dest)?;
|
||||
}
|
||||
|
||||
// Dynamically invoked syscalls
|
||||
"syscall" => syscall(this, link_name, abi, args, dest)?,
|
||||
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ def cargo_miri(cmd, quiet = True, targets = None):
|
|||
|
||||
def normalize_stdout(str):
|
||||
str = str.replace("src\\", "src/") # normalize paths across platforms
|
||||
str = re.sub("finished in \\d+\\.\\d\\ds", "finished in $TIME", str) # the time keeps changing, obviously
|
||||
str = re.sub("\\b\\d+\\.\\d+s\\b", "$TIME", str) # the time keeps changing, obviously
|
||||
return str
|
||||
|
||||
def check_output(actual, path, name):
|
||||
|
|
|
|||
|
|
@ -14,3 +14,4 @@ running 5 tests
|
|||
.....
|
||||
test result: ok. 5 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME
|
||||
|
||||
all doctests ran in $TIME; merged doctests compilation took $TIME
|
||||
|
|
|
|||
|
|
@ -15,3 +15,4 @@ running 0 tests
|
|||
|
||||
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 5 filtered out; finished in $TIME
|
||||
|
||||
all doctests ran in $TIME; merged doctests compilation took $TIME
|
||||
|
|
|
|||
|
|
@ -25,8 +25,10 @@ running 5 tests
|
|||
.....
|
||||
test result: ok. 5 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME
|
||||
|
||||
all doctests ran in $TIME; merged doctests compilation took $TIME
|
||||
|
||||
running 5 tests
|
||||
.....
|
||||
test result: ok. 5 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME
|
||||
|
||||
all doctests ran in $TIME; merged doctests compilation took $TIME
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ LL | *x = 1;
|
|||
| ^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
|
||||
= help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/tree-borrows.md for further information
|
||||
= help: the accessed tag <TAG> has state Frozen which forbids this child write access
|
||||
help: the accessed tag <TAG> was created here, in the initial state Reserved
|
||||
--> tests/fail/async-shared-mutable.rs:LL:CC
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ LL | let _val = *target_alias;
|
|||
| ^^^^^^^^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
|
||||
= help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/tree-borrows.md for further information
|
||||
= help: the accessed tag <TAG> has state Disabled which forbids this child read access
|
||||
help: the accessed tag <TAG> was created here, in the initial state Frozen
|
||||
--> tests/fail/both_borrows/alias_through_mutation.rs:LL:CC
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ LL | *x = 1;
|
|||
| ^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
|
||||
= help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/tree-borrows.md for further information
|
||||
= help: the accessed tag <TAG> has state Reserved (conflicted) which forbids this child write access
|
||||
help: the accessed tag <TAG> was created here, in the initial state Reserved
|
||||
--> tests/fail/both_borrows/aliasing_mut1.rs:LL:CC
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ LL | *y = 2;
|
|||
| ^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
|
||||
= help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/tree-borrows.md for further information
|
||||
= help: the accessed tag <TAG> has state Reserved (conflicted) which forbids this child write access
|
||||
help: the accessed tag <TAG> was created here, in the initial state Reserved
|
||||
--> tests/fail/both_borrows/aliasing_mut2.rs:LL:CC
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ LL | *x = 1;
|
|||
| ^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
|
||||
= help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/tree-borrows.md for further information
|
||||
= help: the accessed tag <TAG> has state Reserved (conflicted) which forbids this child write access
|
||||
help: the accessed tag <TAG> was created here, in the initial state Reserved
|
||||
--> tests/fail/both_borrows/aliasing_mut3.rs:LL:CC
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ LL | crate::intrinsics::write_via_move(dest, src);
|
|||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
|
||||
= help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/tree-borrows.md for further information
|
||||
= help: the accessed tag <TAG> is foreign to the protected tag <TAG> (i.e., it is not a child)
|
||||
= help: this foreign write access would cause the protected tag <TAG> (currently Frozen) to become Disabled
|
||||
= help: protected tags must never be Disabled
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ LL | *LEAK = 7;
|
|||
| ^^^^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
|
||||
= help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/tree-borrows.md for further information
|
||||
= help: the accessed tag <TAG> has state Disabled which forbids this child write access
|
||||
help: the accessed tag <TAG> was created here, in the initial state Frozen
|
||||
--> tests/fail/both_borrows/box_exclusive_violation1.rs:LL:CC
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ LL | *y
|
|||
| ^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
|
||||
= help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/tree-borrows.md for further information
|
||||
= help: the accessed tag <TAG> is foreign to the protected tag <TAG> (i.e., it is not a child)
|
||||
= help: this foreign read access would cause the protected tag <TAG> (currently Active) to become Disabled
|
||||
= help: protected tags must never be Disabled
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ LL | v2[1] = 7;
|
|||
| ^^^^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
|
||||
= help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/tree-borrows.md for further information
|
||||
= help: the accessed tag <TAG> has state Disabled which forbids this child write access
|
||||
help: the accessed tag <TAG> was created here, in the initial state Reserved
|
||||
--> tests/fail/both_borrows/buggy_as_mut_slice.rs:LL:CC
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ LL | b[1] = 6;
|
|||
| ^^^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
|
||||
= help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/tree-borrows.md for further information
|
||||
= help: the accessed tag <TAG> has state Disabled which forbids this child write access
|
||||
help: the accessed tag <TAG> was created here, in the initial state Reserved
|
||||
--> tests/fail/both_borrows/buggy_split_at_mut.rs:LL:CC
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ LL | unsafe { *x = 42 };
|
|||
| ^^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
|
||||
= help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/tree-borrows.md for further information
|
||||
= help: the accessed tag <TAG> has state Frozen which forbids this child write access
|
||||
help: the accessed tag <TAG> was created here, in the initial state Frozen
|
||||
--> tests/fail/both_borrows/illegal_write1.rs:LL:CC
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ LL | let _val = *xref;
|
|||
| ^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
|
||||
= help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/tree-borrows.md for further information
|
||||
= help: the accessed tag <TAG> has state Disabled which forbids this child read access
|
||||
help: the accessed tag <TAG> was created here, in the initial state Reserved
|
||||
--> tests/fail/both_borrows/illegal_write5.rs:LL:CC
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ LL | unsafe { *y = 2 };
|
|||
| ^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
|
||||
= help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/tree-borrows.md for further information
|
||||
= help: the accessed tag <TAG> is foreign to the protected tag <TAG> (i.e., it is not a child)
|
||||
= help: this foreign write access would cause the protected tag <TAG> (currently Active) to become Disabled
|
||||
= help: protected tags must never be Disabled
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ LL | unsafe { *x = 0 };
|
|||
| ^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
|
||||
= help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/tree-borrows.md for further information
|
||||
= help: the accessed tag <TAG> is foreign to the protected tag <TAG> (i.e., it is not a child)
|
||||
= help: this foreign write access would cause the protected tag <TAG> (currently Frozen) to become Disabled
|
||||
= help: protected tags must never be Disabled
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ LL | unsafe { *x = 0 };
|
|||
| ^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
|
||||
= help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/tree-borrows.md for further information
|
||||
= help: the accessed tag <TAG> (root of the allocation) is foreign to the protected tag <TAG> (i.e., it is not a child)
|
||||
= help: this foreign write access would cause the protected tag <TAG> (currently Frozen) to become Disabled
|
||||
= help: protected tags must never be Disabled
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ LL | let _val = *xref_in_mem;
|
|||
| ^^^^^^^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
|
||||
= help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/tree-borrows.md for further information
|
||||
= help: the accessed tag <TAG> has state Disabled which forbids this reborrow (acting as a child read access)
|
||||
help: the accessed tag <TAG> was created here, in the initial state Frozen
|
||||
--> tests/fail/both_borrows/load_invalid_shr.rs:LL:CC
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ LL | *LEAK = 7;
|
|||
| ^^^^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
|
||||
= help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/tree-borrows.md for further information
|
||||
= help: the accessed tag <TAG> has state Disabled which forbids this child write access
|
||||
help: the accessed tag <TAG> was created here, in the initial state Frozen
|
||||
--> tests/fail/both_borrows/mut_exclusive_violation1.rs:LL:CC
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ LL | *raw1 = 3;
|
|||
| ^^^^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
|
||||
= help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/tree-borrows.md for further information
|
||||
= help: the accessed tag <TAG> has state Disabled which forbids this child write access
|
||||
help: the accessed tag <TAG> was created here, in the initial state Reserved
|
||||
--> tests/fail/both_borrows/mut_exclusive_violation2.rs:LL:CC
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ LL | self.1.deallocate(From::from(ptr.cast()), layout);
|
|||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
|
||||
= help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/tree-borrows.md for further information
|
||||
= help: the accessed tag <TAG> is foreign to the protected tag <TAG> (i.e., it is not a child)
|
||||
= help: this deallocation (acting as a foreign write access) would cause the protected tag <TAG> (currently Reserved (conflicted)) to become Disabled
|
||||
= help: protected tags must never be Disabled
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ LL | self.1.deallocate(From::from(ptr.cast()), layout);
|
|||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
|
||||
= help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/tree-borrows.md for further information
|
||||
= help: the accessed tag <TAG> is foreign to the protected tag <TAG> (i.e., it is not a child)
|
||||
= help: this deallocation (acting as a foreign write access) would cause the protected tag <TAG> (currently Reserved (conflicted)) to become Disabled
|
||||
= help: protected tags must never be Disabled
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ LL | assert_eq!(unsafe { *y }, 1);
|
|||
| ^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
|
||||
= help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/tree-borrows.md for further information
|
||||
= help: the accessed tag <TAG> has state Disabled which forbids this child read access
|
||||
help: the accessed tag <TAG> was created here, in the initial state Frozen
|
||||
--> tests/fail/both_borrows/outdated_local.rs:LL:CC
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ LL | foo(xref);
|
|||
| ^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
|
||||
= help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/tree-borrows.md for further information
|
||||
= help: the accessed tag <TAG> has state Disabled which forbids this reborrow (acting as a child read access)
|
||||
help: the accessed tag <TAG> was created here, in the initial state Frozen
|
||||
--> tests/fail/both_borrows/pass_invalid_shr.rs:LL:CC
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ LL | foo(some_xref);
|
|||
| ^^^^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
|
||||
= help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/tree-borrows.md for further information
|
||||
= help: the accessed tag <TAG> has state Disabled which forbids this reborrow (acting as a child read access)
|
||||
help: the accessed tag <TAG> was created here, in the initial state Frozen
|
||||
--> tests/fail/both_borrows/pass_invalid_shr_option.rs:LL:CC
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ LL | foo(pair_xref);
|
|||
| ^^^^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
|
||||
= help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/tree-borrows.md for further information
|
||||
= help: the accessed tag <TAG> has state Disabled which forbids this reborrow (acting as a child read access)
|
||||
help: the accessed tag <TAG> was created here, in the initial state Frozen
|
||||
--> tests/fail/both_borrows/pass_invalid_shr_tuple.rs:LL:CC
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ LL | ret
|
|||
| ^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
|
||||
= help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/tree-borrows.md for further information
|
||||
= help: the accessed tag <TAG> has state Disabled which forbids this reborrow (acting as a child read access)
|
||||
help: the accessed tag <TAG> was created here, in the initial state Frozen
|
||||
--> tests/fail/both_borrows/return_invalid_shr.rs:LL:CC
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ LL | ret
|
|||
| ^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
|
||||
= help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/tree-borrows.md for further information
|
||||
= help: the accessed tag <TAG> has state Disabled which forbids this reborrow (acting as a child read access)
|
||||
help: the accessed tag <TAG> was created here, in the initial state Frozen
|
||||
--> tests/fail/both_borrows/return_invalid_shr_option.rs:LL:CC
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ LL | ret
|
|||
| ^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
|
||||
= help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/tree-borrows.md for further information
|
||||
= help: the accessed tag <TAG> has state Disabled which forbids this reborrow (acting as a child read access)
|
||||
help: the accessed tag <TAG> was created here, in the initial state Frozen
|
||||
--> tests/fail/both_borrows/return_invalid_shr_tuple.rs:LL:CC
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ LL | *(x as *const i32 as *mut i32) = 7;
|
|||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
|
||||
= help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/tree-borrows.md for further information
|
||||
= help: the accessed tag <TAG> has state Frozen which forbids this child write access
|
||||
help: the accessed tag <TAG> was created here, in the initial state Frozen
|
||||
--> tests/fail/both_borrows/shr_frozen_violation1.rs:LL:CC
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ LL | let _val = *frozen;
|
|||
| ^^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
|
||||
= help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/tree-borrows.md for further information
|
||||
= help: the accessed tag <TAG> has state Disabled which forbids this child read access
|
||||
help: the accessed tag <TAG> was created here, in the initial state Frozen
|
||||
--> tests/fail/both_borrows/shr_frozen_violation2.rs:LL:CC
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ LL | unsafe { dealloc(ptr, l) };
|
|||
| ^^^^^^^^^^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
|
||||
= help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/tree-borrows.md for further information
|
||||
= help: the allocation of the accessed tag <TAG> (root of the allocation) also contains the strongly protected tag <TAG>
|
||||
= help: the strongly protected tag <TAG> disallows deallocations
|
||||
help: the accessed tag <TAG> was created here
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ LL | Call(_unit = callee(Move(non_copy), Move(non_copy)), ReturnTo(a
|
|||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
|
||||
= help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/tree-borrows.md for further information
|
||||
= help: the accessed tag <TAG> (root of the allocation) is foreign to the protected tag <TAG> (i.e., it is not a child)
|
||||
= help: this foreign read access would cause the protected tag <TAG> (currently Active) to become Disabled
|
||||
= help: protected tags must never be Disabled
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ LL | unsafe { ptr.write(S(0)) };
|
|||
| ^^^^^^^^^^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
|
||||
= help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/tree-borrows.md for further information
|
||||
= help: the accessed tag <TAG> (root of the allocation) is foreign to the protected tag <TAG> (i.e., it is not a child)
|
||||
= help: this foreign write access would cause the protected tag <TAG> (currently Active) to become Disabled
|
||||
= help: protected tags must never be Disabled
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ LL | unsafe { ptr.read() };
|
|||
| ^^^^^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
|
||||
= help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/tree-borrows.md for further information
|
||||
= help: the accessed tag <TAG> (root of the allocation) is foreign to the protected tag <TAG> (i.e., it is not a child)
|
||||
= help: this foreign read access would cause the protected tag <TAG> (currently Active) to become Disabled
|
||||
= help: protected tags must never be Disabled
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ LL | unsafe { ptr.read() };
|
|||
| ^^^^^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
|
||||
= help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/tree-borrows.md for further information
|
||||
= help: the accessed tag <TAG> (root of the allocation) is foreign to the protected tag <TAG> (i.e., it is not a child)
|
||||
= help: this foreign read access would cause the protected tag <TAG> (currently Active) to become Disabled
|
||||
= help: protected tags must never be Disabled
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ LL | unsafe { ptr.write(0) };
|
|||
| ^^^^^^^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
|
||||
= help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/tree-borrows.md for further information
|
||||
= help: the accessed tag <TAG> (root of the allocation) is foreign to the protected tag <TAG> (i.e., it is not a child)
|
||||
= help: this foreign write access would cause the protected tag <TAG> (currently Active) to become Disabled
|
||||
= help: protected tags must never be Disabled
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ LL | unsafe { ptr.write(0) };
|
|||
| ^^^^^^^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
|
||||
= help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/tree-borrows.md for further information
|
||||
= help: the accessed tag <TAG> (root of the allocation) is foreign to the protected tag <TAG> (i.e., it is not a child)
|
||||
= help: this foreign write access would cause the protected tag <TAG> (currently Active) to become Disabled
|
||||
= help: protected tags must never be Disabled
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ LL | *y += 1; // Failure
|
|||
| ^^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
|
||||
= help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/tree-borrows.md for further information
|
||||
= help: the accessed tag <TAG> has state Frozen which forbids this child write access
|
||||
help: the accessed tag <TAG> was created here, in the initial state Reserved
|
||||
--> tests/fail/tree_borrows/alternate-read-write.rs:LL:CC
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ LL | (*a).field1 = 88;
|
|||
| ^^^^^^^^^^^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
|
||||
= help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/tree-borrows.md for further information
|
||||
= help: the accessed tag <TAG> (a) has state Frozen which forbids this child write access
|
||||
help: the accessed tag <TAG> was created here, in the initial state Cell
|
||||
--> tests/fail/tree_borrows/cell-inside-struct.rs:LL:CC
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ LL | rmut[5] += 1;
|
|||
| ^^^^^^^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
|
||||
= help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/tree-borrows.md for further information
|
||||
= help: the accessed tag <TAG> has state Disabled which forbids this child read access
|
||||
help: the accessed tag <TAG> was created here, in the initial state Reserved
|
||||
--> tests/fail/tree_borrows/error-range.rs:LL:CC
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ LL | *z = 2;
|
|||
| ^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
|
||||
= help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/tree-borrows.md for further information
|
||||
= help: the accessed tag <TAG> has state Frozen which forbids this child write access
|
||||
help: the accessed tag <TAG> was created here, in the initial state Reserved
|
||||
--> tests/fail/tree_borrows/fnentry_invalidation.rs:LL:CC
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ LL | *y.add(3) = 42;
|
|||
| ^^^^^^^^^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
|
||||
= help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/tree-borrows.md for further information
|
||||
= help: the accessed tag <TAG> is foreign to the protected tag <TAG> (i.e., it is not a child)
|
||||
= help: this foreign write access would cause the protected tag <TAG> (currently Reserved) to become Disabled
|
||||
= help: protected tags must never be Disabled
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ LL | *ptr = 0;
|
|||
| ^^^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
|
||||
= help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/tree-borrows.md for further information
|
||||
= help: the accessed tag <TAG> has state Frozen which forbids this child write access
|
||||
help: the accessed tag <TAG> was created here, in the initial state Reserved
|
||||
--> tests/fail/tree_borrows/parent_read_freezes_raw_mut.rs:LL:CC
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ LL | *nope = 31;
|
|||
| ^^^^^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
|
||||
= help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/tree-borrows.md for further information
|
||||
= help: the accessed tag <TAG> is a child of the conflicting tag <TAG>
|
||||
= help: the conflicting tag <TAG> has state Frozen which forbids this child write access
|
||||
help: the accessed tag <TAG> was created here
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ LL | unsafe { println!("Value of funky: {}", *funky_ptr_lazy_on_fst_elem) }
|
|||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
|
||||
= help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/tree-borrows.md for further information
|
||||
= help: the accessed tag <TAG> has state Disabled which forbids this reborrow (acting as a child read access)
|
||||
help: the accessed tag <TAG> was created here, in the initial state Reserved
|
||||
--> tests/fail/tree_borrows/protector-write-lazy.rs:LL:CC
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ LL | *(x as *mut u8).byte_sub(1) = 42;
|
|||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
|
||||
= help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/tree-borrows.md for further information
|
||||
= help: the accessed tag <TAG> has state Reserved (conflicted) which forbids this child write access
|
||||
help: the accessed tag <TAG> was created here, in the initial state Reserved
|
||||
--> tests/fail/tree_borrows/repeated_foreign_read_lazy_conflicted.rs:LL:CC
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ LL | *y = 1;
|
|||
| ^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
|
||||
= help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/tree-borrows.md for further information
|
||||
= help: the accessed tag <TAG> (y, callee:y, caller:y) is foreign to the protected tag <TAG> (callee:x) (i.e., it is not a child)
|
||||
= help: this foreign write access would cause the protected tag <TAG> (callee:x) (currently Reserved) to become Disabled
|
||||
= help: protected tags must never be Disabled
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ LL | *y = 0;
|
|||
| ^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
|
||||
= help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/tree-borrows.md for further information
|
||||
= help: the accessed tag <TAG> (y, callee:y, caller:y) is foreign to the protected tag <TAG> (callee:x) (i.e., it is not a child)
|
||||
= help: this foreign write access would cause the protected tag <TAG> (callee:x) (currently Reserved) to become Disabled
|
||||
= help: protected tags must never be Disabled
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ LL | unsafe { *y = 13 }
|
|||
| ^^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
|
||||
= help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/tree-borrows.md for further information
|
||||
= help: the accessed tag <TAG> has state Disabled which forbids this child write access
|
||||
help: the accessed tag <TAG> was created here, in the initial state Reserved
|
||||
--> tests/fail/tree_borrows/reservedim_spurious_write.rs:LL:CC
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ LL | unsafe { *y = 13 }
|
|||
| ^^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
|
||||
= help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/tree-borrows.md for further information
|
||||
= help: the accessed tag <TAG> has state Disabled which forbids this child write access
|
||||
help: the accessed tag <TAG> was created here, in the initial state Reserved
|
||||
--> tests/fail/tree_borrows/reservedim_spurious_write.rs:LL:CC
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ LL | *ret = 3;
|
|||
| ^^^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
|
||||
= help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/tree-borrows.md for further information
|
||||
= help: the accessed tag <TAG> is a child of the conflicting tag <TAG>
|
||||
= help: the conflicting tag <TAG> has state Frozen which forbids this child write access
|
||||
help: the accessed tag <TAG> was created here
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ LL | *y = 2;
|
|||
| ^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
|
||||
= help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/tree-borrows.md for further information
|
||||
= help: the accessed tag <TAG> has state Reserved (conflicted) which forbids this child write access
|
||||
help: the accessed tag <TAG> was created here, in the initial state Reserved
|
||||
--> tests/fail/tree_borrows/spurious_read.rs:LL:CC
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ LL | self.1.deallocate(From::from(ptr.cast()), layout);
|
|||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
|
||||
= help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/tree-borrows.md for further information
|
||||
= help: the allocation of the accessed tag <TAG> also contains the strongly protected tag <TAG>
|
||||
= help: the strongly protected tag <TAG> disallows deallocations
|
||||
help: the accessed tag <TAG> was created here
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ LL | *m = 42;
|
|||
| ^^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
|
||||
= help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/tree-borrows.md for further information
|
||||
= help: the accessed tag <TAG> is a child of the conflicting tag <TAG>
|
||||
= help: the conflicting tag <TAG> has state Frozen which forbids this child write access
|
||||
help: the accessed tag <TAG> was created here
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ LL | fn add(&mut self, n: u64) -> u64 {
|
|||
| ^^^^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
|
||||
= help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/tree-borrows.md for further information
|
||||
= help: the accessed tag <TAG> has state Disabled which forbids this reborrow (acting as a child read access)
|
||||
help: the accessed tag <TAG> was created here, in the initial state Reserved
|
||||
--> tests/fail/tree_borrows/write-during-2phase.rs:LL:CC
|
||||
|
|
|
|||
|
|
@ -0,0 +1,39 @@
|
|||
#![feature(linkage)]
|
||||
|
||||
// FIXME move this module to a separate crate once aux-build is allowed
|
||||
// This currently depends on the fact that miri skips the codegen check
|
||||
// that denies multiple symbols with the same name.
|
||||
mod first {
|
||||
#[no_mangle]
|
||||
#[linkage = "weak"]
|
||||
extern "C" fn foo() -> i32 {
|
||||
1
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
#[linkage = "weak"]
|
||||
extern "C" fn bar() -> i32 {
|
||||
2
|
||||
}
|
||||
}
|
||||
|
||||
mod second {
|
||||
#[no_mangle]
|
||||
extern "C" fn bar() -> i32 {
|
||||
3
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
fn foo() -> i32;
|
||||
fn bar() -> i32;
|
||||
}
|
||||
|
||||
fn main() {
|
||||
unsafe {
|
||||
// If there is no non-weak definition, the weak definition will be used.
|
||||
assert_eq!(foo(), 1);
|
||||
// Non-weak definition takes presedence.
|
||||
assert_eq!(bar(), 3);
|
||||
}
|
||||
}
|
||||
|
|
@ -50,11 +50,14 @@ new_pr = true
|
|||
[autolabel."S-waiting-on-author"]
|
||||
new_draft = true
|
||||
|
||||
# Automatically close and reopen PRs made by bots to run CI on them
|
||||
[bot-pull-requests]
|
||||
|
||||
# Canonicalize issue numbers to avoid closing the wrong issue when upstreaming this subtree
|
||||
# Canonicalize issue numbers to avoid closing the wrong issue when upstreaming this subtree.
|
||||
[canonicalize-issue-links]
|
||||
|
||||
# Prevents mentions in commits to avoid users being spammed
|
||||
# Prevents mentions in commits to avoid users being spammed.
|
||||
[no-mentions]
|
||||
|
||||
# Show range-diff links on force pushes.
|
||||
[range-diff]
|
||||
|
||||
# Add link to the review body to review changes since posting it.
|
||||
[review-changes-since]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue