Auto merge of #124726 - matthiaskrgr:rollup-m6i3day, r=matthiaskrgr
Rollup of 10 pull requests Successful merges: - #124501 (add support to override lldb binary path for ./x test) - #124573 (add a reference link to the comment of the "cc" and "cmake".) - #124663 (Enable reusing CI Docker cache when running CI images locally) - #124690 (Only consider ambiguous goals when finding best obligation for ambiguities) - #124713 (Update Cargo specific diagnostics in check-cfg) - #124717 (Implement `do_not_recommend` in the new solver) - #124718 (Record impl args in the proof tree) - #124720 (interpret: Drop: always evaluate place) - #124721 (library/std: Fix build for NetBSD targets with 32-bit `c_long`) - #124723 (Use correct Hermit links in The `rustc` Book) r? `@ghost` `@rustbot` modify labels: rollup
This commit is contained in:
commit
e82c861d7e
24 changed files with 242 additions and 99 deletions
|
@ -540,7 +540,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
|
|||
// \-------/
|
||||
//
|
||||
let virtual_drop = Instance {
|
||||
def: ty::InstanceDef::Virtual(drop_fn.def_id(), 0),
|
||||
def: ty::InstanceDef::Virtual(drop_fn.def_id(), 0), // idx 0: the drop function
|
||||
args: drop_fn.args,
|
||||
};
|
||||
debug!("ty = {:?}", ty);
|
||||
|
@ -581,7 +581,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
|
|||
//
|
||||
// SO THEN WE CAN USE THE ABOVE CODE.
|
||||
let virtual_drop = Instance {
|
||||
def: ty::InstanceDef::Virtual(drop_fn.def_id(), 0),
|
||||
def: ty::InstanceDef::Virtual(drop_fn.def_id(), 0), // idx 0: the drop function
|
||||
args: drop_fn.args,
|
||||
};
|
||||
debug!("ty = {:?}", ty);
|
||||
|
|
|
@ -169,10 +169,8 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
|
|||
}
|
||||
|
||||
Drop { place, target, unwind, replace: _ } => {
|
||||
let frame = self.frame();
|
||||
let ty = place.ty(&frame.body.local_decls, *self.tcx).ty;
|
||||
let ty = self.instantiate_from_frame_and_normalize_erasing_regions(frame, ty)?;
|
||||
let instance = Instance::resolve_drop_in_place(*self.tcx, ty);
|
||||
let place = self.eval_place(place)?;
|
||||
let instance = Instance::resolve_drop_in_place(*self.tcx, place.layout.ty);
|
||||
if let ty::InstanceDef::DropGlue(_, None) = instance.def {
|
||||
// This is the branch we enter if and only if the dropped type has no drop glue
|
||||
// whatsoever. This can happen as a result of monomorphizing a drop of a
|
||||
|
@ -181,8 +179,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
|
|||
self.go_to_block(target);
|
||||
return Ok(());
|
||||
}
|
||||
let place = self.eval_place(place)?;
|
||||
trace!("TerminatorKind::drop: {:?}, type {}", place, ty);
|
||||
trace!("TerminatorKind::drop: {:?}, type {}", place, place.layout.ty);
|
||||
self.drop_in_place(&place, instance, target, unwind)?;
|
||||
}
|
||||
|
||||
|
@ -952,6 +949,12 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
|
|||
// implementation fail -- a problem shared by rustc.
|
||||
let place = self.force_allocation(place)?;
|
||||
|
||||
// We behave a bit different from codegen here.
|
||||
// Codegen creates an `InstanceDef::Virtual` with index 0 (the slot of the drop method) and
|
||||
// then dispatches that to the normal call machinery. However, our call machinery currently
|
||||
// only supports calling `VtblEntry::Method`; it would choke on a `MetadataDropInPlace`. So
|
||||
// instead we do the virtual call stuff ourselves. It's easier here than in `eval_fn_call`
|
||||
// since we can just get a place of the underlying type and use `mplace_to_ref`.
|
||||
let place = match place.layout.ty.kind() {
|
||||
ty::Dynamic(data, _, ty::Dyn) => {
|
||||
// Dropping a trait object. Need to find actual drop fn.
|
||||
|
|
|
@ -518,7 +518,7 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
|
|||
// RFC 2397
|
||||
gated!(
|
||||
do_not_recommend, Normal, template!(Word), WarnFollowing,
|
||||
EncodeCrossCrate::No, experimental!(do_not_recommend)
|
||||
EncodeCrossCrate::Yes, experimental!(do_not_recommend)
|
||||
),
|
||||
|
||||
// `#[cfi_encoding = ""]`
|
||||
|
|
|
@ -164,9 +164,9 @@ pub(super) fn unexpected_cfg_name(
|
|||
|
||||
if is_from_cargo {
|
||||
if !is_feature_cfg {
|
||||
diag.help(format!("consider using a Cargo feature instead or adding `println!(\"cargo:rustc-check-cfg={inst}\");` to the top of a `build.rs`"));
|
||||
diag.help(format!("consider using a Cargo feature instead or adding `println!(\"cargo::rustc-check-cfg={inst}\");` to the top of the `build.rs`"));
|
||||
}
|
||||
diag.note("see <https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#check-cfg> for more information about checking conditional configuration");
|
||||
diag.note("see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration");
|
||||
} else {
|
||||
diag.help(format!("to expect this configuration use `--check-cfg={inst}`"));
|
||||
diag.note("see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration");
|
||||
|
@ -266,9 +266,9 @@ pub(super) fn unexpected_cfg_value(
|
|||
diag.help("consider defining some features in `Cargo.toml`");
|
||||
}
|
||||
} else if !is_cfg_a_well_know_name {
|
||||
diag.help(format!("consider using a Cargo feature instead or adding `println!(\"cargo:rustc-check-cfg={inst}\");` to the top of a `build.rs`"));
|
||||
diag.help(format!("consider using a Cargo feature instead or adding `println!(\"cargo::rustc-check-cfg={inst}\");` to the top of the `build.rs`"));
|
||||
}
|
||||
diag.note("see <https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#check-cfg> for more information about checking conditional configuration");
|
||||
diag.note("see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration");
|
||||
} else {
|
||||
if !is_cfg_a_well_know_name {
|
||||
diag.help(format!("to expect this configuration use `--check-cfg={inst}`"));
|
||||
|
|
|
@ -888,8 +888,12 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
|
|||
self.infcx.resolve_vars_if_possible(value)
|
||||
}
|
||||
|
||||
pub(super) fn fresh_args_for_item(&self, def_id: DefId) -> ty::GenericArgsRef<'tcx> {
|
||||
self.infcx.fresh_args_for_item(DUMMY_SP, def_id)
|
||||
pub(super) fn fresh_args_for_item(&mut self, def_id: DefId) -> ty::GenericArgsRef<'tcx> {
|
||||
let args = self.infcx.fresh_args_for_item(DUMMY_SP, def_id);
|
||||
for arg in args {
|
||||
self.inspect.add_var_value(arg);
|
||||
}
|
||||
args
|
||||
}
|
||||
|
||||
pub(super) fn translate_args(
|
||||
|
|
|
@ -11,6 +11,7 @@ use rustc_infer::traits::{
|
|||
};
|
||||
use rustc_middle::ty::error::{ExpectedFound, TypeError};
|
||||
use rustc_middle::ty::{self, TyCtxt};
|
||||
use rustc_span::symbol::sym;
|
||||
|
||||
use super::eval_ctxt::GenerateProofTree;
|
||||
use super::inspect::{ProofTreeInferCtxtExt, ProofTreeVisitor};
|
||||
|
@ -137,7 +138,7 @@ impl<'tcx> TraitEngine<'tcx> for FulfillmentCtxt<'tcx> {
|
|||
.collect();
|
||||
|
||||
errors.extend(self.obligations.overflowed.drain(..).map(|obligation| FulfillmentError {
|
||||
obligation: find_best_leaf_obligation(infcx, &obligation),
|
||||
obligation: find_best_leaf_obligation(infcx, &obligation, true),
|
||||
code: FulfillmentErrorCode::Ambiguity { overflow: Some(true) },
|
||||
root_obligation: obligation,
|
||||
}));
|
||||
|
@ -198,7 +199,7 @@ fn fulfillment_error_for_no_solution<'tcx>(
|
|||
infcx: &InferCtxt<'tcx>,
|
||||
root_obligation: PredicateObligation<'tcx>,
|
||||
) -> FulfillmentError<'tcx> {
|
||||
let obligation = find_best_leaf_obligation(infcx, &root_obligation);
|
||||
let obligation = find_best_leaf_obligation(infcx, &root_obligation, false);
|
||||
|
||||
let code = match obligation.predicate.kind().skip_binder() {
|
||||
ty::PredicateKind::Clause(ty::ClauseKind::Projection(_)) => {
|
||||
|
@ -266,7 +267,7 @@ fn fulfillment_error_for_stalled<'tcx>(
|
|||
});
|
||||
|
||||
FulfillmentError {
|
||||
obligation: find_best_leaf_obligation(infcx, &obligation),
|
||||
obligation: find_best_leaf_obligation(infcx, &obligation, true),
|
||||
code,
|
||||
root_obligation: obligation,
|
||||
}
|
||||
|
@ -275,12 +276,13 @@ fn fulfillment_error_for_stalled<'tcx>(
|
|||
fn find_best_leaf_obligation<'tcx>(
|
||||
infcx: &InferCtxt<'tcx>,
|
||||
obligation: &PredicateObligation<'tcx>,
|
||||
consider_ambiguities: bool,
|
||||
) -> PredicateObligation<'tcx> {
|
||||
let obligation = infcx.resolve_vars_if_possible(obligation.clone());
|
||||
infcx
|
||||
.visit_proof_tree(
|
||||
obligation.clone().into(),
|
||||
&mut BestObligation { obligation: obligation.clone() },
|
||||
&mut BestObligation { obligation: obligation.clone(), consider_ambiguities },
|
||||
)
|
||||
.break_value()
|
||||
.unwrap_or(obligation)
|
||||
|
@ -288,6 +290,7 @@ fn find_best_leaf_obligation<'tcx>(
|
|||
|
||||
struct BestObligation<'tcx> {
|
||||
obligation: PredicateObligation<'tcx>,
|
||||
consider_ambiguities: bool,
|
||||
}
|
||||
|
||||
impl<'tcx> BestObligation<'tcx> {
|
||||
|
@ -320,6 +323,14 @@ impl<'tcx> ProofTreeVisitor<'tcx> for BestObligation<'tcx> {
|
|||
return ControlFlow::Break(self.obligation.clone());
|
||||
};
|
||||
|
||||
// Don't walk into impls that have `do_not_recommend`.
|
||||
if let ProbeKind::TraitCandidate { source: CandidateSource::Impl(impl_def_id), result: _ } =
|
||||
candidate.kind()
|
||||
&& goal.infcx().tcx.has_attr(impl_def_id, sym::do_not_recommend)
|
||||
{
|
||||
return ControlFlow::Break(self.obligation.clone());
|
||||
}
|
||||
|
||||
// FIXME: Could we extract a trait ref from a projection here too?
|
||||
// FIXME: Also, what about considering >1 layer up the stack? May be necessary
|
||||
// for normalizes-to.
|
||||
|
@ -355,11 +366,11 @@ impl<'tcx> ProofTreeVisitor<'tcx> for BestObligation<'tcx> {
|
|||
}
|
||||
}
|
||||
|
||||
// Skip nested goals that hold.
|
||||
//FIXME: We should change the max allowed certainty based on if we're
|
||||
// visiting an ambiguity or error obligation.
|
||||
if matches!(nested_goal.result(), Ok(Certainty::Yes)) {
|
||||
continue;
|
||||
// Skip nested goals that aren't the *reason* for our goal's failure.
|
||||
match self.consider_ambiguities {
|
||||
true if matches!(nested_goal.result(), Ok(Certainty::Maybe(_))) => {}
|
||||
false if matches!(nested_goal.result(), Err(_)) => {}
|
||||
_ => continue,
|
||||
}
|
||||
|
||||
self.with_derived_obligation(obligation, |this| nested_goal.visit_with(this))?;
|
||||
|
|
|
@ -254,6 +254,10 @@
|
|||
# executing the debuginfo test suite.
|
||||
#gdb = "gdb"
|
||||
|
||||
# The path to (or name of) the LLDB executable to use. This is only used for
|
||||
# executing the debuginfo test suite.
|
||||
#lldb = "lldb"
|
||||
|
||||
# The node.js executable to use. Note that this is only used for the emscripten
|
||||
# target when running tests, otherwise this can be omitted.
|
||||
#nodejs = "node"
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
use crate::ffi::{c_int, c_void};
|
||||
use crate::ptr;
|
||||
use crate::time::Duration;
|
||||
use libc::{_lwp_self, clockid_t, lwpid_t, time_t, timespec, CLOCK_MONOTONIC};
|
||||
use libc::{_lwp_self, c_long, clockid_t, lwpid_t, time_t, timespec, CLOCK_MONOTONIC};
|
||||
|
||||
extern "C" {
|
||||
fn ___lwp_park60(
|
||||
|
@ -38,7 +38,7 @@ pub fn park_timeout(dur: Duration, hint: usize) {
|
|||
// Saturate so that the operation will definitely time out
|
||||
// (even if it is after the heat death of the universe).
|
||||
tv_sec: dur.as_secs().try_into().ok().unwrap_or(time_t::MAX),
|
||||
tv_nsec: dur.subsec_nanos().into(),
|
||||
tv_nsec: dur.subsec_nanos() as c_long,
|
||||
};
|
||||
|
||||
// Timeout needs to be mutable since it is modified on NetBSD 9.0 and
|
||||
|
|
|
@ -33,9 +33,9 @@ path = "src/bin/sccache-plus-cl.rs"
|
|||
test = false
|
||||
|
||||
[dependencies]
|
||||
# Most of the time updating these dependencies requires modifications
|
||||
# to the bootstrap codebase; otherwise, some targets will fail. That's
|
||||
# why these dependencies are explicitly pinned.
|
||||
# Most of the time updating these dependencies requires modifications to the
|
||||
# bootstrap codebase(e.g., https://github.com/rust-lang/rust/issues/124565);
|
||||
# otherwise, some targets will fail. That's why these dependencies are explicitly pinned.
|
||||
cc = "=1.0.73"
|
||||
cmake = "=0.1.48"
|
||||
|
||||
|
|
|
@ -1892,15 +1892,16 @@ NOTE: if you're sure you want to do this, please open an issue as to why. In the
|
|||
.to_string()
|
||||
})
|
||||
};
|
||||
let lldb_exe = "lldb";
|
||||
let lldb_version = Command::new(lldb_exe)
|
||||
|
||||
let lldb_exe = builder.config.lldb.clone().unwrap_or_else(|| PathBuf::from("lldb"));
|
||||
let lldb_version = Command::new(&lldb_exe)
|
||||
.arg("--version")
|
||||
.output()
|
||||
.map(|output| String::from_utf8_lossy(&output.stdout).to_string())
|
||||
.ok();
|
||||
if let Some(ref vers) = lldb_version {
|
||||
cmd.arg("--lldb-version").arg(vers);
|
||||
let lldb_python_dir = run(Command::new(lldb_exe).arg("-P")).ok();
|
||||
let lldb_python_dir = run(Command::new(&lldb_exe).arg("-P")).ok();
|
||||
if let Some(ref dir) = lldb_python_dir {
|
||||
cmd.arg("--lldb-python-dir").arg(dir);
|
||||
}
|
||||
|
|
|
@ -329,6 +329,7 @@ pub struct Config {
|
|||
pub nodejs: Option<PathBuf>,
|
||||
pub npm: Option<PathBuf>,
|
||||
pub gdb: Option<PathBuf>,
|
||||
pub lldb: Option<PathBuf>,
|
||||
pub python: Option<PathBuf>,
|
||||
pub reuse: Option<PathBuf>,
|
||||
pub cargo_native_static: bool,
|
||||
|
@ -834,6 +835,7 @@ define_config! {
|
|||
docs_minification: Option<bool> = "docs-minification",
|
||||
submodules: Option<bool> = "submodules",
|
||||
gdb: Option<String> = "gdb",
|
||||
lldb: Option<String> = "lldb",
|
||||
nodejs: Option<String> = "nodejs",
|
||||
npm: Option<String> = "npm",
|
||||
python: Option<String> = "python",
|
||||
|
@ -1410,6 +1412,7 @@ impl Config {
|
|||
docs_minification,
|
||||
submodules,
|
||||
gdb,
|
||||
lldb,
|
||||
nodejs,
|
||||
npm,
|
||||
python,
|
||||
|
@ -1502,6 +1505,7 @@ impl Config {
|
|||
config.nodejs = nodejs.map(PathBuf::from);
|
||||
config.npm = npm.map(PathBuf::from);
|
||||
config.gdb = gdb.map(PathBuf::from);
|
||||
config.lldb = lldb.map(PathBuf::from);
|
||||
config.python = python.map(PathBuf::from);
|
||||
config.reuse = reuse.map(PathBuf::from);
|
||||
config.submodules = submodules;
|
||||
|
|
|
@ -175,4 +175,9 @@ pub const CONFIG_CHANGE_HISTORY: &[ChangeInfo] = &[
|
|||
severity: ChangeSeverity::Warning,
|
||||
summary: "The deprecated field `changelog-seen` has been removed. Using that field in `config.toml` from now on will result in breakage.",
|
||||
},
|
||||
ChangeInfo {
|
||||
change_id: 124501,
|
||||
severity: ChangeSeverity::Info,
|
||||
summary: "New option `build.lldb` that will override the default lldb binary path used in debuginfo tests",
|
||||
},
|
||||
];
|
||||
|
|
|
@ -50,39 +50,35 @@ fi
|
|||
CACHE_DOMAIN="${CACHE_DOMAIN:-ci-caches.rust-lang.org}"
|
||||
|
||||
if [ -f "$docker_dir/$image/Dockerfile" ]; then
|
||||
if isCI; then
|
||||
hash_key=/tmp/.docker-hash-key.txt
|
||||
rm -f "${hash_key}"
|
||||
echo $image >> $hash_key
|
||||
hash_key=/tmp/.docker-hash-key.txt
|
||||
rm -f "${hash_key}"
|
||||
echo $image >> $hash_key
|
||||
|
||||
cat "$docker_dir/$image/Dockerfile" >> $hash_key
|
||||
# Look for all source files involves in the COPY command
|
||||
copied_files=/tmp/.docker-copied-files.txt
|
||||
rm -f "$copied_files"
|
||||
for i in $(sed -n -e '/^COPY --from=/! s/^COPY \(.*\) .*$/\1/p' \
|
||||
"$docker_dir/$image/Dockerfile"); do
|
||||
# List the file names
|
||||
find "$script_dir/$i" -type f >> $copied_files
|
||||
done
|
||||
# Sort the file names and cat the content into the hash key
|
||||
sort $copied_files | xargs cat >> $hash_key
|
||||
cat "$docker_dir/$image/Dockerfile" >> $hash_key
|
||||
# Look for all source files involves in the COPY command
|
||||
copied_files=/tmp/.docker-copied-files.txt
|
||||
rm -f "$copied_files"
|
||||
for i in $(sed -n -e '/^COPY --from=/! s/^COPY \(.*\) .*$/\1/p' \
|
||||
"$docker_dir/$image/Dockerfile"); do
|
||||
# List the file names
|
||||
find "$script_dir/$i" -type f >> $copied_files
|
||||
done
|
||||
# Sort the file names and cat the content into the hash key
|
||||
sort $copied_files | xargs cat >> $hash_key
|
||||
|
||||
# Include the architecture in the hash key, since our Linux CI does not
|
||||
# only run in x86_64 machines.
|
||||
uname -m >> $hash_key
|
||||
# Include the architecture in the hash key, since our Linux CI does not
|
||||
# only run in x86_64 machines.
|
||||
uname -m >> $hash_key
|
||||
|
||||
docker --version >> $hash_key
|
||||
# Include cache version. Can be used to manually bust the Docker cache.
|
||||
echo "2" >> $hash_key
|
||||
|
||||
# Include cache version. Can be used to manually bust the Docker cache.
|
||||
echo "2" >> $hash_key
|
||||
echo "Image input"
|
||||
cat $hash_key
|
||||
|
||||
echo "Image input"
|
||||
cat $hash_key
|
||||
|
||||
cksum=$(sha512sum $hash_key | \
|
||||
awk '{print $1}')
|
||||
echo "Image input checksum ${cksum}"
|
||||
fi
|
||||
cksum=$(sha512sum $hash_key | \
|
||||
awk '{print $1}')
|
||||
echo "Image input checksum ${cksum}"
|
||||
|
||||
dockerfile="$docker_dir/$image/Dockerfile"
|
||||
if [ -x /usr/bin/cygpath ]; then
|
||||
|
@ -105,10 +101,18 @@ if [ -f "$docker_dir/$image/Dockerfile" ]; then
|
|||
# It seems that it cannot be the same as $IMAGE_TAG, otherwise it overwrites the cache
|
||||
CACHE_IMAGE_TAG=${REGISTRY}/${REGISTRY_USERNAME}/rust-ci-cache:${cksum}
|
||||
|
||||
# On non-CI jobs, we don't do any caching.
|
||||
# On non-CI jobs, we try to download a pre-built image from the rust-lang-ci
|
||||
# ghcr.io registry. If it is not possible, we fall back to building the image
|
||||
# locally.
|
||||
if ! isCI;
|
||||
then
|
||||
retry docker build --rm -t rust-ci -f "$dockerfile" "$context"
|
||||
if docker pull "${IMAGE_TAG}"; then
|
||||
echo "Downloaded Docker image from CI"
|
||||
docker tag "${IMAGE_TAG}" rust-ci
|
||||
else
|
||||
echo "Building local Docker image"
|
||||
retry docker build --rm -t rust-ci -f "$dockerfile" "$context"
|
||||
fi
|
||||
# On PR CI jobs, we don't have permissions to write to the registry cache,
|
||||
# but we can still read from it.
|
||||
elif [[ "$PR_CI_JOB" == "1" ]];
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
The [Hermit] unikernel target allows compiling your applications into self-contained, specialized unikernel images that can be run in small virtual machines.
|
||||
|
||||
[Hermit]: https://github.com/hermitcore
|
||||
[Hermit]: https://github.com/hermit-os
|
||||
|
||||
Target triplets available so far:
|
||||
|
||||
|
@ -56,9 +56,9 @@ Rust does not yet ship pre-compiled artifacts for these targets.
|
|||
To compile for these targets, you will either need to build Rust with the targets enabled
|
||||
(see “Building the targets” above), or build your own copy of `core` by using `build-std` or similar.
|
||||
|
||||
Building Rust programs can be done by following the tutorial in our starter application [rusty-demo].
|
||||
As all Hermit programs are unikernels, building a Rust program also requires including the operating system code. A guide for doing so is provided in our starter [hermit-rs-template].
|
||||
|
||||
[rusty-demo]: https://github.com/hermitcore/rusty-demo
|
||||
[hermit-rs-template]: https://github.com/hermit-os/hermit-rs-template
|
||||
|
||||
## Testing
|
||||
|
||||
|
@ -67,8 +67,8 @@ These images can be chainloaded by Hermit's [loader] or hypervisor ([Uhyve]).
|
|||
QEMU can be used to boot Hermit binaries using the loader on any architecture.
|
||||
The targets do not support running the Rust test suite.
|
||||
|
||||
[loader]: https://github.com/hermitcore/rusty-loader
|
||||
[Uhyve]: https://github.com/hermitcore/uhyve
|
||||
[loader]: https://github.com/hermit-os/loader
|
||||
[Uhyve]: https://github.com/hermit-os/uhyve
|
||||
|
||||
## Cross-compilation toolchains and C code
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ LL | #[cfg(feature = "serde")]
|
|||
|
|
||||
= note: no expected values for `feature`
|
||||
= help: consider adding `serde` as a feature in `Cargo.toml`
|
||||
= note: see <https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#check-cfg> for more information about checking conditional configuration
|
||||
= note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration
|
||||
= note: `#[warn(unexpected_cfgs)]` on by default
|
||||
|
||||
warning: unexpected `cfg` condition value: (none)
|
||||
|
@ -17,7 +17,7 @@ LL | #[cfg(feature)]
|
|||
|
|
||||
= note: no expected values for `feature`
|
||||
= help: consider defining some features in `Cargo.toml`
|
||||
= note: see <https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#check-cfg> for more information about checking conditional configuration
|
||||
= note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration
|
||||
|
||||
warning: unexpected `cfg` condition name: `tokio_unstable`
|
||||
--> $DIR/cargo-feature.rs:22:7
|
||||
|
@ -26,8 +26,8 @@ LL | #[cfg(tokio_unstable)]
|
|||
| ^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: expected names are: `clippy`, `debug_assertions`, `doc`, `doctest`, `feature`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `sanitize`, `sanitizer_cfi_generalize_pointers`, `sanitizer_cfi_normalize_integers`, `target_abi`, `target_arch`, `target_endian`, `target_env`, `target_family`, `target_feature`, `target_has_atomic`, `target_has_atomic_equal_alignment`, `target_has_atomic_load_store`, `target_os`, `target_pointer_width`, `target_thread_local`, `target_vendor`, `test`, `ub_checks`, `unix`, `windows`
|
||||
= help: consider using a Cargo feature instead or adding `println!("cargo:rustc-check-cfg=cfg(tokio_unstable)");` to the top of a `build.rs`
|
||||
= note: see <https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#check-cfg> for more information about checking conditional configuration
|
||||
= help: consider using a Cargo feature instead or adding `println!("cargo::rustc-check-cfg=cfg(tokio_unstable)");` to the top of the `build.rs`
|
||||
= note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration
|
||||
|
||||
warning: unexpected `cfg` condition name: `CONFIG_NVME`
|
||||
--> $DIR/cargo-feature.rs:26:7
|
||||
|
@ -35,8 +35,8 @@ warning: unexpected `cfg` condition name: `CONFIG_NVME`
|
|||
LL | #[cfg(CONFIG_NVME = "m")]
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: consider using a Cargo feature instead or adding `println!("cargo:rustc-check-cfg=cfg(CONFIG_NVME, values(\"m\"))");` to the top of a `build.rs`
|
||||
= note: see <https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#check-cfg> for more information about checking conditional configuration
|
||||
= help: consider using a Cargo feature instead or adding `println!("cargo::rustc-check-cfg=cfg(CONFIG_NVME, values(\"m\"))");` to the top of the `build.rs`
|
||||
= note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration
|
||||
|
||||
warning: 4 warnings emitted
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ LL | #[cfg(feature = "serde")]
|
|||
|
|
||||
= note: expected values for `feature` are: `bitcode`
|
||||
= help: consider adding `serde` as a feature in `Cargo.toml`
|
||||
= note: see <https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#check-cfg> for more information about checking conditional configuration
|
||||
= note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration
|
||||
= note: `#[warn(unexpected_cfgs)]` on by default
|
||||
|
||||
warning: unexpected `cfg` condition value: (none)
|
||||
|
@ -17,7 +17,7 @@ LL | #[cfg(feature)]
|
|||
|
|
||||
= note: expected values for `feature` are: `bitcode`
|
||||
= help: consider defining some features in `Cargo.toml`
|
||||
= note: see <https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#check-cfg> for more information about checking conditional configuration
|
||||
= note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration
|
||||
|
||||
warning: unexpected `cfg` condition name: `tokio_unstable`
|
||||
--> $DIR/cargo-feature.rs:22:7
|
||||
|
@ -26,8 +26,8 @@ LL | #[cfg(tokio_unstable)]
|
|||
| ^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: expected names are: `CONFIG_NVME`, `clippy`, `debug_assertions`, `doc`, `doctest`, `feature`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `sanitize`, `sanitizer_cfi_generalize_pointers`, `sanitizer_cfi_normalize_integers`, `target_abi`, `target_arch`, `target_endian`, `target_env`, `target_family`, `target_feature`, `target_has_atomic`, `target_has_atomic_equal_alignment`, `target_has_atomic_load_store`, `target_os`, `target_pointer_width`, `target_thread_local`, `target_vendor`, `test`, `ub_checks`, `unix`, `windows`
|
||||
= help: consider using a Cargo feature instead or adding `println!("cargo:rustc-check-cfg=cfg(tokio_unstable)");` to the top of a `build.rs`
|
||||
= note: see <https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#check-cfg> for more information about checking conditional configuration
|
||||
= help: consider using a Cargo feature instead or adding `println!("cargo::rustc-check-cfg=cfg(tokio_unstable)");` to the top of the `build.rs`
|
||||
= note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration
|
||||
|
||||
warning: unexpected `cfg` condition value: `m`
|
||||
--> $DIR/cargo-feature.rs:26:7
|
||||
|
@ -38,8 +38,8 @@ LL | #[cfg(CONFIG_NVME = "m")]
|
|||
| help: there is a expected value with a similar name: `"y"`
|
||||
|
|
||||
= note: expected values for `CONFIG_NVME` are: `y`
|
||||
= help: consider using a Cargo feature instead or adding `println!("cargo:rustc-check-cfg=cfg(CONFIG_NVME, values(\"m\"))");` to the top of a `build.rs`
|
||||
= note: see <https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#check-cfg> for more information about checking conditional configuration
|
||||
= help: consider using a Cargo feature instead or adding `println!("cargo::rustc-check-cfg=cfg(CONFIG_NVME, values(\"m\"))");` to the top of the `build.rs`
|
||||
= note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration
|
||||
|
||||
warning: 4 warnings emitted
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ LL | #[cfg(featur)]
|
|||
| ^^^^^^ help: there is a config with a similar name: `feature`
|
||||
|
|
||||
= help: expected values for `feature` are: `foo`
|
||||
= note: see <https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#check-cfg> for more information about checking conditional configuration
|
||||
= note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration
|
||||
= note: `#[warn(unexpected_cfgs)]` on by default
|
||||
|
||||
warning: unexpected `cfg` condition name: `featur`
|
||||
|
@ -14,7 +14,7 @@ warning: unexpected `cfg` condition name: `featur`
|
|||
LL | #[cfg(featur = "foo")]
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: see <https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#check-cfg> for more information about checking conditional configuration
|
||||
= note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration
|
||||
help: there is a config with a similar name and value
|
||||
|
|
||||
LL | #[cfg(feature = "foo")]
|
||||
|
@ -27,7 +27,7 @@ LL | #[cfg(featur = "fo")]
|
|||
| ^^^^^^^^^^^^^
|
||||
|
|
||||
= help: expected values for `feature` are: `foo`
|
||||
= note: see <https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#check-cfg> for more information about checking conditional configuration
|
||||
= note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration
|
||||
help: there is a config with a similar name and different values
|
||||
|
|
||||
LL | #[cfg(feature = "foo")]
|
||||
|
@ -39,8 +39,8 @@ warning: unexpected `cfg` condition name: `no_value`
|
|||
LL | #[cfg(no_value)]
|
||||
| ^^^^^^^^ help: there is a config with a similar name: `no_values`
|
||||
|
|
||||
= help: consider using a Cargo feature instead or adding `println!("cargo:rustc-check-cfg=cfg(no_value)");` to the top of a `build.rs`
|
||||
= note: see <https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#check-cfg> for more information about checking conditional configuration
|
||||
= help: consider using a Cargo feature instead or adding `println!("cargo::rustc-check-cfg=cfg(no_value)");` to the top of the `build.rs`
|
||||
= note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration
|
||||
|
||||
warning: unexpected `cfg` condition name: `no_value`
|
||||
--> $DIR/diagnotics.rs:27:7
|
||||
|
@ -48,8 +48,8 @@ warning: unexpected `cfg` condition name: `no_value`
|
|||
LL | #[cfg(no_value = "foo")]
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: consider using a Cargo feature instead or adding `println!("cargo:rustc-check-cfg=cfg(no_value, values(\"foo\"))");` to the top of a `build.rs`
|
||||
= note: see <https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#check-cfg> for more information about checking conditional configuration
|
||||
= help: consider using a Cargo feature instead or adding `println!("cargo::rustc-check-cfg=cfg(no_value, values(\"foo\"))");` to the top of the `build.rs`
|
||||
= note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration
|
||||
help: there is a config with a similar name and no value
|
||||
|
|
||||
LL | #[cfg(no_values)]
|
||||
|
@ -64,8 +64,8 @@ LL | #[cfg(no_values = "bar")]
|
|||
| help: remove the value
|
||||
|
|
||||
= note: no expected value for `no_values`
|
||||
= help: consider using a Cargo feature instead or adding `println!("cargo:rustc-check-cfg=cfg(no_values, values(\"bar\"))");` to the top of a `build.rs`
|
||||
= note: see <https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#check-cfg> for more information about checking conditional configuration
|
||||
= help: consider using a Cargo feature instead or adding `println!("cargo::rustc-check-cfg=cfg(no_values, values(\"bar\"))");` to the top of the `build.rs`
|
||||
= note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration
|
||||
|
||||
warning: 6 warnings emitted
|
||||
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
error[E0277]: the trait bound `*mut (): Foo` is not satisfied
|
||||
--> $DIR/simple.rs:19:17
|
||||
|
|
||||
LL | needs_foo::<*mut ()>();
|
||||
| ^^^^^^^ the trait `Send` is not implemented for `*mut ()`, which is required by `*mut (): Foo`
|
||||
|
|
||||
note: required for `*mut ()` to implement `Foo`
|
||||
--> $DIR/simple.rs:10:9
|
||||
|
|
||||
LL | impl<T> Foo for T where T: Send {}
|
||||
| ^^^ ^ ---- unsatisfied trait bound introduced here
|
||||
note: required by a bound in `needs_foo`
|
||||
--> $DIR/simple.rs:14:17
|
||||
|
|
||||
LL | fn needs_foo<T: Foo>() {}
|
||||
| ^^^ required by this bound in `needs_foo`
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0277`.
|
|
@ -0,0 +1,15 @@
|
|||
error[E0277]: the trait bound `*mut (): Foo` is not satisfied
|
||||
--> $DIR/simple.rs:19:17
|
||||
|
|
||||
LL | needs_foo::<*mut ()>();
|
||||
| ^^^^^^^ the trait `Foo` is not implemented for `*mut ()`
|
||||
|
|
||||
note: required by a bound in `needs_foo`
|
||||
--> $DIR/simple.rs:14:17
|
||||
|
|
||||
LL | fn needs_foo<T: Foo>() {}
|
||||
| ^^^ required by this bound in `needs_foo`
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0277`.
|
23
tests/ui/diagnostic_namespace/do_not_recommend/simple.rs
Normal file
23
tests/ui/diagnostic_namespace/do_not_recommend/simple.rs
Normal file
|
@ -0,0 +1,23 @@
|
|||
//@ revisions: current next
|
||||
//@ ignore-compare-mode-next-solver (explicit revisions)
|
||||
//@[next] compile-flags: -Znext-solver
|
||||
|
||||
#![feature(do_not_recommend)]
|
||||
|
||||
trait Foo {}
|
||||
|
||||
#[do_not_recommend]
|
||||
impl<T> Foo for T where T: Send {}
|
||||
//[current]~^ NOTE required for `*mut ()` to implement `Foo`
|
||||
//[current]~| NOTE unsatisfied trait bound introduced here
|
||||
|
||||
fn needs_foo<T: Foo>() {}
|
||||
//~^ NOTE required by a bound in `needs_foo`
|
||||
//~| NOTE required by this bound in `needs_foo`
|
||||
|
||||
fn main() {
|
||||
needs_foo::<*mut ()>();
|
||||
//~^ ERROR the trait bound `*mut (): Foo` is not satisfied
|
||||
//[current]~| NOTE the trait `Send` is not implemented for `*mut ()`
|
||||
//[next]~| NOTE the trait `Foo` is not implemented for `*mut ()`
|
||||
}
|
|
@ -61,7 +61,7 @@ where
|
|||
// entering the cycle from `A` fails, but would work if we were to use the cache
|
||||
// result of `B<X>`.
|
||||
impls_trait::<A<X>, _, _, _>();
|
||||
//~^ ERROR the trait bound `X: IncompleteGuidance<_, _>` is not satisfied
|
||||
//~^ ERROR the trait bound `A<X>: Trait<i32, u8, u8>` is not satisfied
|
||||
}
|
||||
|
||||
fn main() {
|
||||
|
|
|
@ -1,26 +1,28 @@
|
|||
error[E0277]: the trait bound `X: IncompleteGuidance<_, _>` is not satisfied
|
||||
error[E0277]: the trait bound `A<X>: Trait<i32, u8, u8>` is not satisfied
|
||||
--> $DIR/incompleteness-unstable-result.rs:63:19
|
||||
|
|
||||
LL | impls_trait::<A<X>, _, _, _>();
|
||||
| ^^^^ the trait `IncompleteGuidance<_, _>` is not implemented for `X`, which is required by `A<X>: Trait<_, _, _>`
|
||||
| ^^^^ the trait `Trait<i32, u8, u8>` is not implemented for `A<X>`, which is required by `A<X>: Trait<_, _, _>`
|
||||
|
|
||||
= help: the following other types implement trait `IncompleteGuidance<T, V>`:
|
||||
<T as IncompleteGuidance<U, i16>>
|
||||
<T as IncompleteGuidance<U, i8>>
|
||||
<T as IncompleteGuidance<U, u8>>
|
||||
note: required for `A<X>` to implement `Trait<_, _, u8>`
|
||||
note: required for `A<X>` to implement `Trait<i32, u8, u8>`
|
||||
--> $DIR/incompleteness-unstable-result.rs:32:50
|
||||
|
|
||||
LL | impl<T: ?Sized, U: ?Sized, V: ?Sized, D: ?Sized> Trait<U, V, D> for A<T>
|
||||
| ^^^^^^^^^^^^^^ ^^^^
|
||||
LL | where
|
||||
LL | T: IncompleteGuidance<U, V>,
|
||||
| ------------------------ unsatisfied trait bound introduced here
|
||||
...
|
||||
LL | A<T>: Trait<U, D, V>,
|
||||
| -------------- unsatisfied trait bound introduced here
|
||||
= note: 8 redundant requirements hidden
|
||||
= note: required for `A<X>` to implement `Trait<i32, u8, u8>`
|
||||
note: required by a bound in `impls_trait`
|
||||
--> $DIR/incompleteness-unstable-result.rs:51:28
|
||||
|
|
||||
LL | fn impls_trait<T: ?Sized + Trait<U, V, D>, U: ?Sized, V: ?Sized, D: ?Sized>() {}
|
||||
| ^^^^^^^^^^^^^^ required by this bound in `impls_trait`
|
||||
help: consider extending the `where` clause, but there might be an alternative better way to express this requirement
|
||||
|
|
||||
LL | X: IncompleteGuidance<u32, i16>, A<X>: Trait<i32, u8, u8>
|
||||
| ~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
//@ compile-flags: -Znext-solver
|
||||
|
||||
trait Foo {}
|
||||
trait Bar {}
|
||||
trait Constrain {
|
||||
type Output;
|
||||
}
|
||||
|
||||
impl<T, U> Foo for T
|
||||
where
|
||||
T: Constrain<Output = U>,
|
||||
U: Bar,
|
||||
{
|
||||
}
|
||||
|
||||
impl Constrain for () {
|
||||
type Output = ();
|
||||
}
|
||||
|
||||
fn needs_foo<T: Foo>() {}
|
||||
fn main() {
|
||||
needs_foo::<()>();
|
||||
//~^ the trait bound `(): Foo` is not satisfied
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
error[E0277]: the trait bound `(): Foo` is not satisfied
|
||||
--> $DIR/point-at-failing-nested.rs:22:17
|
||||
|
|
||||
LL | needs_foo::<()>();
|
||||
| ^^ the trait `Bar` is not implemented for `()`, which is required by `(): Foo`
|
||||
|
|
||||
note: required for `()` to implement `Foo`
|
||||
--> $DIR/point-at-failing-nested.rs:9:12
|
||||
|
|
||||
LL | impl<T, U> Foo for T
|
||||
| ^^^ ^
|
||||
...
|
||||
LL | U: Bar,
|
||||
| --- unsatisfied trait bound introduced here
|
||||
note: required by a bound in `needs_foo`
|
||||
--> $DIR/point-at-failing-nested.rs:20:17
|
||||
|
|
||||
LL | fn needs_foo<T: Foo>() {}
|
||||
| ^^^ required by this bound in `needs_foo`
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0277`.
|
Loading…
Add table
Add a link
Reference in a new issue