Auto merge of #126691 - fee1-dead-contrib:rollup-v4vtowh, r=fee1-dead
Rollup of 5 pull requests Successful merges: - #126668 (Remove now NOP attrs `#[rustc_dump{,_env}_program_clauses]`) - #126674 (Allow tracing through item_bounds query invocations on opaques) - #126675 (Change a `DefineOpaqueTypes::No` to `Yes` in diagnostics code) - #126681 (Rework doc-test attribute documentation example) - #126684 (Migrate `run-make/glibc-staticlib-args` to `rmake.rs`) r? `@ghost` `@rustbot` modify labels: rollup
This commit is contained in:
commit
5c8459f1ec
@ -1088,14 +1088,6 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
|
||||
ErrorFollowing, EncodeCrossCrate::No,
|
||||
"the `#[custom_mir]` attribute is just used for the Rust test suite",
|
||||
),
|
||||
rustc_attr!(
|
||||
TEST, rustc_dump_program_clauses, Normal, template!(Word),
|
||||
WarnFollowing, EncodeCrossCrate::No
|
||||
),
|
||||
rustc_attr!(
|
||||
TEST, rustc_dump_env_program_clauses, Normal, template!(Word),
|
||||
WarnFollowing, EncodeCrossCrate::No
|
||||
),
|
||||
rustc_attr!(
|
||||
TEST, rustc_object_lifetime_default, Normal, template!(Word),
|
||||
WarnFollowing, EncodeCrossCrate::No
|
||||
|
@ -59,7 +59,7 @@ fn associated_type_bounds<'tcx>(
|
||||
/// impl trait it isn't possible to write a suitable predicate on the
|
||||
/// containing function and for type-alias impl trait we don't have a backwards
|
||||
/// compatibility issue.
|
||||
#[instrument(level = "trace", skip(tcx), ret)]
|
||||
#[instrument(level = "trace", skip(tcx, item_ty))]
|
||||
fn opaque_type_bounds<'tcx>(
|
||||
tcx: TyCtxt<'tcx>,
|
||||
opaque_def_id: LocalDefId,
|
||||
|
@ -1357,6 +1357,8 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
|
||||
traits::SelectionContext::new(self).select(&obligation)
|
||||
}
|
||||
|
||||
/// Used for ambiguous method call error reporting. Uses probing that throws away the result internally,
|
||||
/// so do not use to make a decision that may lead to a successful compilation.
|
||||
fn candidate_source(&self, candidate: &Candidate<'tcx>, self_ty: Ty<'tcx>) -> CandidateSource {
|
||||
match candidate.kind {
|
||||
InherentImplCandidate(_) => {
|
||||
@ -1370,8 +1372,10 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
|
||||
self.instantiate_binder_with_fresh_vars(self.span, infer::FnCall, trait_ref);
|
||||
let (xform_self_ty, _) =
|
||||
self.xform_self_ty(candidate.item, trait_ref.self_ty(), trait_ref.args);
|
||||
// Guide the trait selection to show impls that have methods whose type matches
|
||||
// up with the `self` parameter of the method.
|
||||
let _ = self.at(&ObligationCause::dummy(), self.param_env).sup(
|
||||
DefineOpaqueTypes::No,
|
||||
DefineOpaqueTypes::Yes,
|
||||
xform_self_ty,
|
||||
self_ty,
|
||||
);
|
||||
|
@ -620,7 +620,9 @@ macro_rules! define_queries {
|
||||
tcx,
|
||||
{
|
||||
let ret = call_provider!([$($modifiers)*][tcx, $name, key]);
|
||||
tracing::trace!(?ret);
|
||||
rustc_middle::ty::print::with_reduced_queries!({
|
||||
tracing::trace!(?ret);
|
||||
});
|
||||
ret
|
||||
}
|
||||
)
|
||||
|
@ -1592,8 +1592,6 @@ symbols! {
|
||||
rustc_do_not_const_check,
|
||||
rustc_doc_primitive,
|
||||
rustc_dummy,
|
||||
rustc_dump_env_program_clauses,
|
||||
rustc_dump_program_clauses,
|
||||
rustc_dump_user_args,
|
||||
rustc_dump_vtable,
|
||||
rustc_effective_visibility,
|
||||
|
@ -144,10 +144,10 @@ it will not.
|
||||
### `test(attr(...))`
|
||||
|
||||
This form of the `doc` attribute allows you to add arbitrary attributes to all your doctests. For
|
||||
example, if you want your doctests to fail if they produce any warnings, you could add this:
|
||||
example, if you want your doctests to fail if they have dead code, you could add this:
|
||||
|
||||
```rust,no_run
|
||||
#![doc(test(attr(deny(warnings))))]
|
||||
#![doc(test(attr(deny(dead_code))))]
|
||||
```
|
||||
|
||||
## At the item level
|
||||
|
@ -57,7 +57,6 @@ run-make/forced-unwind-terminate-pof/Makefile
|
||||
run-make/foreign-double-unwind/Makefile
|
||||
run-make/foreign-exceptions/Makefile
|
||||
run-make/foreign-rust-exceptions/Makefile
|
||||
run-make/glibc-staticlib-args/Makefile
|
||||
run-make/include_bytes_deps/Makefile
|
||||
run-make/incr-add-rust-src-component/Makefile
|
||||
run-make/incr-foreign-head-span/Makefile
|
||||
|
@ -1,13 +0,0 @@
|
||||
# ignore-cross-compile
|
||||
# only-gnu
|
||||
# only-linux
|
||||
|
||||
include ../tools.mk
|
||||
|
||||
# This ensures that std::env::args works in a library called from C on glibc Linux.
|
||||
|
||||
all:
|
||||
$(RUSTC) --crate-type=staticlib library.rs
|
||||
$(CC) program.c $(call STATICLIB,library) $(call OUT_EXE,program) \
|
||||
$(EXTRACFLAGS) $(EXTRACXXFLAGS)
|
||||
$(call RUN,program)
|
18
tests/run-make/glibc-staticlib-args/rmake.rs
Normal file
18
tests/run-make/glibc-staticlib-args/rmake.rs
Normal file
@ -0,0 +1,18 @@
|
||||
// This ensures that std::env::args works in a library called from C on glibc Linux.
|
||||
|
||||
//@ only-gnu
|
||||
//@ only-linux
|
||||
//@ ignore-cross-compile
|
||||
|
||||
use run_make_support::{bin_name, cc, extra_c_flags, extra_cxx_flags, run, rustc, static_lib_name};
|
||||
|
||||
fn main() {
|
||||
rustc().input("library.rs").crate_type("staticlib").run();
|
||||
cc().input("program.c")
|
||||
.arg(static_lib_name("library"))
|
||||
.out_exe("program")
|
||||
.args(&extra_c_flags())
|
||||
.args(&extra_cxx_flags())
|
||||
.run();
|
||||
run(&bin_name("program"));
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user