Skip to content

Rollup of 4 pull requests #126689

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
2 changes: 1 addition & 1 deletion compiler/rustc_hir_analysis/src/collect/item_bounds.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 5 additions & 1 deletion compiler/rustc_hir_typeck/src/method/probe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(_) => {
Expand All @@ -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,
);
Expand Down
4 changes: 3 additions & 1 deletion compiler/rustc_query_impl/src/plumbing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
)
Expand Down
4 changes: 2 additions & 2 deletions src/doc/rustdoc/src/write-documentation/the-doc-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion src/tools/tidy/src/allowed_run_make_makefiles.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 0 additions & 13 deletions tests/run-make/glibc-staticlib-args/Makefile

This file was deleted.

18 changes: 18 additions & 0 deletions tests/run-make/glibc-staticlib-args/rmake.rs
Original file line number Diff line number Diff line change
@@ -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