Auto merge of #102896 - matthiaskrgr:rollup-jg5xawz, r=matthiaskrgr
Rollup of 6 pull requests Successful merges: - #101360 (Point out incompatible closure bounds) - #101789 (`let`'s not needed in struct field definitions) - #102846 (update to syn-1.0.102) - #102871 (rustdoc: clean up overly complex `.trait-impl` CSS selectors) - #102876 (suggest candidates for unresolved import) - #102888 (Improve rustdoc-gui search-color test) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
This commit is contained in:
commit
518263d889
23 changed files with 514 additions and 719 deletions
18
Cargo.lock
18
Cargo.lock
|
@ -2721,11 +2721,11 @@ checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "proc-macro2"
|
name = "proc-macro2"
|
||||||
version = "1.0.37"
|
version = "1.0.46"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "ec757218438d5fda206afc041538b2f6d889286160d649a86a24d37e1235afd1"
|
checksum = "94e2ef8dbfc347b10c094890f778ee2e36ca9bb4262e86dc99cd217e35f3470b"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"unicode-xid",
|
"unicode-ident",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -4719,13 +4719,13 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "syn"
|
name = "syn"
|
||||||
version = "1.0.91"
|
version = "1.0.102"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "b683b2b825c8eef438b77c36a06dc262294da3d5a5813fac20da149241dcd44d"
|
checksum = "3fcd952facd492f9be3ef0d0b7032a6e442ee9b361d4acc2b1d0c4aaa5f613a1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"unicode-xid",
|
"unicode-ident",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -5215,6 +5215,12 @@ dependencies = [
|
||||||
"matches",
|
"matches",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "unicode-ident"
|
||||||
|
version = "1.0.5"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "6ceab39d59e4c9499d4e5a8ee0e2735b891bb7308ac83dfb4e80cad195c9f6f3"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "unicode-normalization"
|
name = "unicode-normalization"
|
||||||
version = "0.1.22"
|
version = "0.1.22"
|
||||||
|
|
|
@ -1788,7 +1788,23 @@ impl<'a> Parser<'a> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
self.expected_ident_found()
|
let mut err = self.expected_ident_found();
|
||||||
|
if let Some((ident, _)) = self.token.ident() && ident.as_str() == "let" {
|
||||||
|
self.bump(); // `let`
|
||||||
|
let span = self.prev_token.span.until(self.token.span);
|
||||||
|
err.span_suggestion(
|
||||||
|
span,
|
||||||
|
"remove the let, the `let` keyword is not allowed in struct field definitions",
|
||||||
|
String::new(),
|
||||||
|
Applicability::MachineApplicable,
|
||||||
|
);
|
||||||
|
err.note("the `let` keyword is not allowed in `struct` fields");
|
||||||
|
err.note("see <https://doc.rust-lang.org/book/ch05-01-defining-structs.html> for more information");
|
||||||
|
err.emit();
|
||||||
|
self.bump();
|
||||||
|
return Ok(ident);
|
||||||
|
}
|
||||||
|
err
|
||||||
};
|
};
|
||||||
return Err(err);
|
return Err(err);
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,6 +70,7 @@ impl TypoSuggestion {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A free importable items suggested in case of resolution failure.
|
/// A free importable items suggested in case of resolution failure.
|
||||||
|
#[derive(Debug, Clone)]
|
||||||
pub(crate) struct ImportSuggestion {
|
pub(crate) struct ImportSuggestion {
|
||||||
pub did: Option<DefId>,
|
pub did: Option<DefId>,
|
||||||
pub descr: &'static str,
|
pub descr: &'static str,
|
||||||
|
@ -139,6 +140,7 @@ impl<'a> Resolver<'a> {
|
||||||
if instead { Instead::Yes } else { Instead::No },
|
if instead { Instead::Yes } else { Instead::No },
|
||||||
found_use,
|
found_use,
|
||||||
IsPattern::No,
|
IsPattern::No,
|
||||||
|
IsImport::No,
|
||||||
path,
|
path,
|
||||||
);
|
);
|
||||||
err.emit();
|
err.emit();
|
||||||
|
@ -698,6 +700,7 @@ impl<'a> Resolver<'a> {
|
||||||
Instead::No,
|
Instead::No,
|
||||||
FoundUse::Yes,
|
FoundUse::Yes,
|
||||||
IsPattern::Yes,
|
IsPattern::Yes,
|
||||||
|
IsImport::No,
|
||||||
vec![],
|
vec![],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -1481,6 +1484,7 @@ impl<'a> Resolver<'a> {
|
||||||
Instead::No,
|
Instead::No,
|
||||||
FoundUse::Yes,
|
FoundUse::Yes,
|
||||||
IsPattern::No,
|
IsPattern::No,
|
||||||
|
IsImport::No,
|
||||||
vec![],
|
vec![],
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -2449,6 +2453,34 @@ enum IsPattern {
|
||||||
No,
|
No,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Whether a binding is part of a use statement. Used for diagnostics.
|
||||||
|
enum IsImport {
|
||||||
|
Yes,
|
||||||
|
No,
|
||||||
|
}
|
||||||
|
|
||||||
|
pub(crate) fn import_candidates(
|
||||||
|
session: &Session,
|
||||||
|
source_span: &IndexVec<LocalDefId, Span>,
|
||||||
|
err: &mut Diagnostic,
|
||||||
|
// This is `None` if all placement locations are inside expansions
|
||||||
|
use_placement_span: Option<Span>,
|
||||||
|
candidates: &[ImportSuggestion],
|
||||||
|
) {
|
||||||
|
show_candidates(
|
||||||
|
session,
|
||||||
|
source_span,
|
||||||
|
err,
|
||||||
|
use_placement_span,
|
||||||
|
candidates,
|
||||||
|
Instead::Yes,
|
||||||
|
FoundUse::Yes,
|
||||||
|
IsPattern::No,
|
||||||
|
IsImport::Yes,
|
||||||
|
vec![],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/// When an entity with a given name is not available in scope, we search for
|
/// When an entity with a given name is not available in scope, we search for
|
||||||
/// entities with that name in all crates. This method allows outputting the
|
/// entities with that name in all crates. This method allows outputting the
|
||||||
/// results of this search in a programmer-friendly way
|
/// results of this search in a programmer-friendly way
|
||||||
|
@ -2462,6 +2494,7 @@ fn show_candidates(
|
||||||
instead: Instead,
|
instead: Instead,
|
||||||
found_use: FoundUse,
|
found_use: FoundUse,
|
||||||
is_pattern: IsPattern,
|
is_pattern: IsPattern,
|
||||||
|
is_import: IsImport,
|
||||||
path: Vec<Segment>,
|
path: Vec<Segment>,
|
||||||
) {
|
) {
|
||||||
if candidates.is_empty() {
|
if candidates.is_empty() {
|
||||||
|
@ -2521,7 +2554,8 @@ fn show_candidates(
|
||||||
// produce an additional newline to separate the new use statement
|
// produce an additional newline to separate the new use statement
|
||||||
// from the directly following item.
|
// from the directly following item.
|
||||||
let additional_newline = if let FoundUse::Yes = found_use { "" } else { "\n" };
|
let additional_newline = if let FoundUse::Yes = found_use { "" } else { "\n" };
|
||||||
candidate.0 = format!("use {};\n{}", &candidate.0, additional_newline);
|
let add_use = if let IsImport::Yes = is_import { "" } else { "use " };
|
||||||
|
candidate.0 = format!("{}{};\n{}", add_use, &candidate.0, additional_newline);
|
||||||
}
|
}
|
||||||
|
|
||||||
err.span_suggestions(
|
err.span_suggestions(
|
||||||
|
@ -2551,7 +2585,7 @@ fn show_candidates(
|
||||||
|
|
||||||
err.note(&msg);
|
err.note(&msg);
|
||||||
}
|
}
|
||||||
} else {
|
} else if matches!(is_import, IsImport::No) {
|
||||||
assert!(!inaccessible_path_strings.is_empty());
|
assert!(!inaccessible_path_strings.is_empty());
|
||||||
|
|
||||||
let prefix =
|
let prefix =
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
//! A bunch of methods and structures more or less related to resolving imports.
|
//! A bunch of methods and structures more or less related to resolving imports.
|
||||||
|
|
||||||
use crate::diagnostics::Suggestion;
|
use crate::diagnostics::{import_candidates, Suggestion};
|
||||||
use crate::Determinacy::{self, *};
|
use crate::Determinacy::{self, *};
|
||||||
use crate::Namespace::{self, *};
|
use crate::Namespace::{self, *};
|
||||||
use crate::{module_to_string, names_to_string};
|
use crate::{module_to_string, names_to_string, ImportSuggestion};
|
||||||
use crate::{AmbiguityKind, BindingKey, ModuleKind, ResolutionError, Resolver, Segment};
|
use crate::{AmbiguityKind, BindingKey, ModuleKind, ResolutionError, Resolver, Segment};
|
||||||
use crate::{Finalize, Module, ModuleOrUniformRoot, ParentScope, PerNS, ScopeSet};
|
use crate::{Finalize, Module, ModuleOrUniformRoot, ParentScope, PerNS, ScopeSet};
|
||||||
use crate::{NameBinding, NameBindingKind, PathResult};
|
use crate::{NameBinding, NameBindingKind, PathResult};
|
||||||
|
@ -406,6 +406,7 @@ struct UnresolvedImportError {
|
||||||
label: Option<String>,
|
label: Option<String>,
|
||||||
note: Option<String>,
|
note: Option<String>,
|
||||||
suggestion: Option<Suggestion>,
|
suggestion: Option<Suggestion>,
|
||||||
|
candidate: Option<Vec<ImportSuggestion>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct ImportResolver<'a, 'b> {
|
pub struct ImportResolver<'a, 'b> {
|
||||||
|
@ -497,6 +498,7 @@ impl<'a, 'b> ImportResolver<'a, 'b> {
|
||||||
label: None,
|
label: None,
|
||||||
note: None,
|
note: None,
|
||||||
suggestion: None,
|
suggestion: None,
|
||||||
|
candidate: None,
|
||||||
};
|
};
|
||||||
if path.contains("::") {
|
if path.contains("::") {
|
||||||
errors.push((path, err))
|
errors.push((path, err))
|
||||||
|
@ -547,6 +549,16 @@ impl<'a, 'b> ImportResolver<'a, 'b> {
|
||||||
}
|
}
|
||||||
diag.multipart_suggestion(&msg, suggestions, applicability);
|
diag.multipart_suggestion(&msg, suggestions, applicability);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if let Some(candidate) = &err.candidate {
|
||||||
|
import_candidates(
|
||||||
|
self.r.session,
|
||||||
|
&self.r.source_span,
|
||||||
|
&mut diag,
|
||||||
|
Some(err.span),
|
||||||
|
&candidate,
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
diag.emit();
|
diag.emit();
|
||||||
|
@ -664,6 +676,7 @@ impl<'a, 'b> ImportResolver<'a, 'b> {
|
||||||
Some(finalize),
|
Some(finalize),
|
||||||
ignore_binding,
|
ignore_binding,
|
||||||
);
|
);
|
||||||
|
|
||||||
let no_ambiguity = self.r.ambiguity_errors.len() == prev_ambiguity_errors_len;
|
let no_ambiguity = self.r.ambiguity_errors.len() == prev_ambiguity_errors_len;
|
||||||
import.vis.set(orig_vis);
|
import.vis.set(orig_vis);
|
||||||
let module = match path_res {
|
let module = match path_res {
|
||||||
|
@ -706,12 +719,14 @@ impl<'a, 'b> ImportResolver<'a, 'b> {
|
||||||
String::from("a similar path exists"),
|
String::from("a similar path exists"),
|
||||||
Applicability::MaybeIncorrect,
|
Applicability::MaybeIncorrect,
|
||||||
)),
|
)),
|
||||||
|
candidate: None,
|
||||||
},
|
},
|
||||||
None => UnresolvedImportError {
|
None => UnresolvedImportError {
|
||||||
span,
|
span,
|
||||||
label: Some(label),
|
label: Some(label),
|
||||||
note: None,
|
note: None,
|
||||||
suggestion,
|
suggestion,
|
||||||
|
candidate: None,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
return Some(err);
|
return Some(err);
|
||||||
|
@ -754,6 +769,7 @@ impl<'a, 'b> ImportResolver<'a, 'b> {
|
||||||
label: Some(String::from("cannot glob-import a module into itself")),
|
label: Some(String::from("cannot glob-import a module into itself")),
|
||||||
note: None,
|
note: None,
|
||||||
suggestion: None,
|
suggestion: None,
|
||||||
|
candidate: None,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -919,11 +935,19 @@ impl<'a, 'b> ImportResolver<'a, 'b> {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let parent_suggestion =
|
||||||
|
self.r.lookup_import_candidates(ident, TypeNS, &import.parent_scope, |_| true);
|
||||||
|
|
||||||
Some(UnresolvedImportError {
|
Some(UnresolvedImportError {
|
||||||
span: import.span,
|
span: import.span,
|
||||||
label: Some(label),
|
label: Some(label),
|
||||||
note,
|
note,
|
||||||
suggestion,
|
suggestion,
|
||||||
|
candidate: if !parent_suggestion.is_empty() {
|
||||||
|
Some(parent_suggestion)
|
||||||
|
} else {
|
||||||
|
None
|
||||||
|
},
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
// `resolve_ident_in_module` reported a privacy error.
|
// `resolve_ident_in_module` reported a privacy error.
|
||||||
|
|
|
@ -1255,6 +1255,7 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
|
||||||
found_span,
|
found_span,
|
||||||
found_trait_ref,
|
found_trait_ref,
|
||||||
expected_trait_ref,
|
expected_trait_ref,
|
||||||
|
obligation.cause.code(),
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
let (closure_span, found) = found_did
|
let (closure_span, found) = found_did
|
||||||
|
|
|
@ -254,8 +254,15 @@ pub trait TypeErrCtxtExt<'tcx> {
|
||||||
found_span: Option<Span>,
|
found_span: Option<Span>,
|
||||||
found: ty::PolyTraitRef<'tcx>,
|
found: ty::PolyTraitRef<'tcx>,
|
||||||
expected: ty::PolyTraitRef<'tcx>,
|
expected: ty::PolyTraitRef<'tcx>,
|
||||||
|
cause: &ObligationCauseCode<'tcx>,
|
||||||
) -> DiagnosticBuilder<'tcx, ErrorGuaranteed>;
|
) -> DiagnosticBuilder<'tcx, ErrorGuaranteed>;
|
||||||
|
|
||||||
|
fn note_conflicting_closure_bounds(
|
||||||
|
&self,
|
||||||
|
cause: &ObligationCauseCode<'tcx>,
|
||||||
|
err: &mut DiagnosticBuilder<'tcx, ErrorGuaranteed>,
|
||||||
|
);
|
||||||
|
|
||||||
fn suggest_fully_qualified_path(
|
fn suggest_fully_qualified_path(
|
||||||
&self,
|
&self,
|
||||||
err: &mut Diagnostic,
|
err: &mut Diagnostic,
|
||||||
|
@ -1584,6 +1591,7 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
|
||||||
found_span: Option<Span>,
|
found_span: Option<Span>,
|
||||||
found: ty::PolyTraitRef<'tcx>,
|
found: ty::PolyTraitRef<'tcx>,
|
||||||
expected: ty::PolyTraitRef<'tcx>,
|
expected: ty::PolyTraitRef<'tcx>,
|
||||||
|
cause: &ObligationCauseCode<'tcx>,
|
||||||
) -> DiagnosticBuilder<'tcx, ErrorGuaranteed> {
|
) -> DiagnosticBuilder<'tcx, ErrorGuaranteed> {
|
||||||
pub(crate) fn build_fn_sig_ty<'tcx>(
|
pub(crate) fn build_fn_sig_ty<'tcx>(
|
||||||
infcx: &InferCtxt<'tcx>,
|
infcx: &InferCtxt<'tcx>,
|
||||||
|
@ -1645,9 +1653,68 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
|
||||||
let signature_kind = format!("{argument_kind} signature");
|
let signature_kind = format!("{argument_kind} signature");
|
||||||
err.note_expected_found(&signature_kind, expected_str, &signature_kind, found_str);
|
err.note_expected_found(&signature_kind, expected_str, &signature_kind, found_str);
|
||||||
|
|
||||||
|
self.note_conflicting_closure_bounds(cause, &mut err);
|
||||||
|
|
||||||
err
|
err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Add a note if there are two `Fn`-family bounds that have conflicting argument
|
||||||
|
// requirements, which will always cause a closure to have a type error.
|
||||||
|
fn note_conflicting_closure_bounds(
|
||||||
|
&self,
|
||||||
|
cause: &ObligationCauseCode<'tcx>,
|
||||||
|
err: &mut DiagnosticBuilder<'tcx, ErrorGuaranteed>,
|
||||||
|
) {
|
||||||
|
// First, look for an `ExprBindingObligation`, which means we can get
|
||||||
|
// the unsubstituted predicate list of the called function. And check
|
||||||
|
// that the predicate that we failed to satisfy is a `Fn`-like trait.
|
||||||
|
if let ObligationCauseCode::ExprBindingObligation(def_id, _, _, idx) = cause
|
||||||
|
&& let predicates = self.tcx.predicates_of(def_id).instantiate_identity(self.tcx)
|
||||||
|
&& let Some(pred) = predicates.predicates.get(*idx)
|
||||||
|
&& let ty::PredicateKind::Trait(trait_pred) = pred.kind().skip_binder()
|
||||||
|
&& ty::ClosureKind::from_def_id(self.tcx, trait_pred.def_id()).is_some()
|
||||||
|
{
|
||||||
|
let expected_self =
|
||||||
|
self.tcx.anonymize_late_bound_regions(pred.kind().rebind(trait_pred.self_ty()));
|
||||||
|
let expected_substs = self
|
||||||
|
.tcx
|
||||||
|
.anonymize_late_bound_regions(pred.kind().rebind(trait_pred.trait_ref.substs));
|
||||||
|
|
||||||
|
// Find another predicate whose self-type is equal to the expected self type,
|
||||||
|
// but whose substs don't match.
|
||||||
|
let other_pred = std::iter::zip(&predicates.predicates, &predicates.spans)
|
||||||
|
.enumerate()
|
||||||
|
.find(|(other_idx, (pred, _))| match pred.kind().skip_binder() {
|
||||||
|
ty::PredicateKind::Trait(trait_pred)
|
||||||
|
if ty::ClosureKind::from_def_id(self.tcx, trait_pred.def_id())
|
||||||
|
.is_some()
|
||||||
|
&& other_idx != idx
|
||||||
|
// Make sure that the self type matches
|
||||||
|
// (i.e. constraining this closure)
|
||||||
|
&& expected_self
|
||||||
|
== self.tcx.anonymize_late_bound_regions(
|
||||||
|
pred.kind().rebind(trait_pred.self_ty()),
|
||||||
|
)
|
||||||
|
// But the substs don't match (i.e. incompatible args)
|
||||||
|
&& expected_substs
|
||||||
|
!= self.tcx.anonymize_late_bound_regions(
|
||||||
|
pred.kind().rebind(trait_pred.trait_ref.substs),
|
||||||
|
) =>
|
||||||
|
{
|
||||||
|
true
|
||||||
|
}
|
||||||
|
_ => false,
|
||||||
|
});
|
||||||
|
// If we found one, then it's very likely the cause of the error.
|
||||||
|
if let Some((_, (_, other_pred_span))) = other_pred {
|
||||||
|
err.span_note(
|
||||||
|
*other_pred_span,
|
||||||
|
"closure inferred to have a different signature due to this bound",
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fn suggest_fully_qualified_path(
|
fn suggest_fully_qualified_path(
|
||||||
&self,
|
&self,
|
||||||
err: &mut Diagnostic,
|
err: &mut Diagnostic,
|
||||||
|
|
|
@ -445,9 +445,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "proc-macro2"
|
name = "proc-macro2"
|
||||||
version = "1.0.39"
|
version = "1.0.46"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "c54b25569025b7fc9651de43004ae593a75ad88543b17178aa5e1b9c4f15f56f"
|
checksum = "94e2ef8dbfc347b10c094890f778ee2e36ca9bb4262e86dc99cd217e35f3470b"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"unicode-ident",
|
"unicode-ident",
|
||||||
]
|
]
|
||||||
|
@ -596,9 +596,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "syn"
|
name = "syn"
|
||||||
version = "1.0.95"
|
version = "1.0.102"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "fbaf6116ab8924f39d52792136fb74fd60a80194cf1b1c6ffa6453eef1c3f942"
|
checksum = "3fcd952facd492f9be3ef0d0b7032a6e442ee9b361d4acc2b1d0c4aaa5f613a1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
0.12.0
|
0.12.2
|
|
@ -734,9 +734,7 @@ a {
|
||||||
display: initial;
|
display: initial;
|
||||||
}
|
}
|
||||||
|
|
||||||
.impl:hover > .anchor, .method.trait-impl:hover > .anchor,
|
.impl:hover > .anchor, .trait-impl:hover > .anchor {
|
||||||
.type.trait-impl:hover > .anchor, .associatedconstant.trait-impl:hover > .anchor,
|
|
||||||
.associatedtype.trait-impl:hover > .anchor {
|
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,57 @@
|
||||||
// The goal of this test is to ensure the color of the text is the one expected.
|
// The goal of this test is to ensure the color of the text is the one expected.
|
||||||
|
|
||||||
|
define-function: (
|
||||||
|
"check-result-color",
|
||||||
|
(result_kind, color, hover_color),
|
||||||
|
[
|
||||||
|
(
|
||||||
|
"assert-css",
|
||||||
|
(".result-" + |result_kind| + " ." + |result_kind|, {"color": |color|}, ALL),
|
||||||
|
),
|
||||||
|
(
|
||||||
|
"assert-css",
|
||||||
|
(
|
||||||
|
".result-" + |result_kind|,
|
||||||
|
{"color": |entry_color|, "background-color": |background_color|},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
(
|
||||||
|
"move-cursor-to",
|
||||||
|
".result-" + |result_kind|,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
"assert-css",
|
||||||
|
(
|
||||||
|
".result-" + |result_kind| + ":hover",
|
||||||
|
{"color": |hover_entry_color|, "background-color": |hover_background_color|},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
(
|
||||||
|
"assert-css",
|
||||||
|
(".result-" + |result_kind| + ":hover ." + |result_kind|, {"color": |hover_color|}),
|
||||||
|
),
|
||||||
|
(
|
||||||
|
"move-cursor-to",
|
||||||
|
".search-input",
|
||||||
|
),
|
||||||
|
(
|
||||||
|
"focus",
|
||||||
|
".result-" + |result_kind|,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
"assert-css",
|
||||||
|
(
|
||||||
|
".result-" + |result_kind| + ":focus",
|
||||||
|
{"color": |hover_entry_color|, "background-color": |hover_background_color|},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
(
|
||||||
|
"assert-css",
|
||||||
|
(".result-" + |result_kind| + ":focus ." + |result_kind|, {"color": |hover_color|}),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
|
||||||
goto: "file://" + |DOC_PATH| + "/test_docs/index.html?search=coo"
|
goto: "file://" + |DOC_PATH| + "/test_docs/index.html?search=coo"
|
||||||
|
|
||||||
// This is needed so that the text color is computed.
|
// This is needed so that the text color is computed.
|
||||||
|
@ -28,240 +81,66 @@ assert-css: (
|
||||||
{"color": "rgb(120, 135, 151)"},
|
{"color": "rgb(120, 135, 151)"},
|
||||||
)
|
)
|
||||||
|
|
||||||
// Checking the color of "keyword".
|
store-value: (entry_color, "rgb(0, 150, 207)") // color of the search entry
|
||||||
assert-css: (
|
store-value: (hover_entry_color, "rgb(255, 255, 255)") // color of the hovered/focused search entry
|
||||||
".result-keyword .keyword",
|
store-value: (background_color, "rgba(0, 0, 0, 0)") // background color
|
||||||
{"color": "rgb(57, 175, 215)"},
|
store-value: (hover_background_color, "rgb(60, 60, 60)") // hover background color
|
||||||
ALL,
|
|
||||||
)
|
|
||||||
assert-css: (
|
|
||||||
".result-keyword",
|
|
||||||
{"color": "rgb(0, 150, 207)", "background-color": "rgba(0, 0, 0, 0)"},
|
|
||||||
)
|
|
||||||
move-cursor-to: ".result-keyword"
|
|
||||||
assert-css: (
|
|
||||||
".result-keyword:hover",
|
|
||||||
{"color": "rgb(255, 255, 255)", "background-color": "rgb(60, 60, 60)"},
|
|
||||||
)
|
|
||||||
assert-css: (
|
|
||||||
".result-keyword:hover .keyword",
|
|
||||||
{"color": "rgb(57, 175, 215)"},
|
|
||||||
)
|
|
||||||
move-cursor-to: ".search-input"
|
|
||||||
focus: ".result-keyword"
|
|
||||||
assert-css: (
|
|
||||||
".result-keyword:focus",
|
|
||||||
{"color": "rgb(255, 255, 255)", "background-color": "rgb(60, 60, 60)"},
|
|
||||||
)
|
|
||||||
assert-css: (
|
|
||||||
".result-keyword:focus .keyword",
|
|
||||||
{"color": "rgb(57, 175, 215)"},
|
|
||||||
)
|
|
||||||
|
|
||||||
// Check the color of "struct".
|
call-function: (
|
||||||
assert-css: (
|
"check-result-color", (
|
||||||
".result-struct .struct",
|
"keyword", // item kind
|
||||||
{"color": "rgb(255, 160, 165)"},
|
"rgb(57, 175, 215)", // color of item kind
|
||||||
ALL,
|
"rgb(57, 175, 215)", // color of hovered/focused item kind
|
||||||
|
),
|
||||||
)
|
)
|
||||||
assert-css: (
|
call-function: (
|
||||||
".result-struct",
|
"check-result-color", (
|
||||||
{"color": "rgb(0, 150, 207)", "background-color": "rgba(0, 0, 0, 0)"},
|
"struct", // item kind
|
||||||
|
"rgb(255, 160, 165)", // color of item kind
|
||||||
|
"rgb(255, 160, 165)", // color of hovered/focused item kind
|
||||||
|
),
|
||||||
)
|
)
|
||||||
move-cursor-to: ".result-struct"
|
call-function: (
|
||||||
assert-css: (
|
"check-result-color", (
|
||||||
".result-struct:hover",
|
"associatedtype", // item kind
|
||||||
{"color": "rgb(255, 255, 255)", "background-color": "rgb(60, 60, 60)"},
|
"rgb(57, 175, 215)", // color of item kind
|
||||||
|
"rgb(57, 175, 215)", // color of hovered/focused item kind
|
||||||
|
),
|
||||||
)
|
)
|
||||||
assert-css: (
|
call-function: (
|
||||||
".result-struct:hover .struct",
|
"check-result-color", (
|
||||||
{"color": "rgb(255, 160, 165)"},
|
"tymethod", // item kind
|
||||||
|
"rgb(253, 214, 135)", // color of item kind
|
||||||
|
"rgb(253, 214, 135)", // color of hovered/focused item kind
|
||||||
|
),
|
||||||
)
|
)
|
||||||
move-cursor-to: ".search-input"
|
call-function: (
|
||||||
focus: ".result-struct"
|
"check-result-color", (
|
||||||
assert-css: (
|
"method", // item kind
|
||||||
".result-struct:focus",
|
"rgb(253, 214, 135)", // color of item kind
|
||||||
{"color": "rgb(255, 255, 255)", "background-color": "rgb(60, 60, 60)"},
|
"rgb(253, 214, 135)", // color of hovered/focused item kind
|
||||||
|
),
|
||||||
)
|
)
|
||||||
assert-css: (
|
call-function: (
|
||||||
".result-struct:focus .struct",
|
"check-result-color", (
|
||||||
{"color": "rgb(255, 160, 165)"},
|
"structfield", // item kind
|
||||||
|
"rgb(0, 150, 207)", // color of item kind
|
||||||
|
"rgb(255, 255, 255)", // color of hovered/focused item kind
|
||||||
|
),
|
||||||
)
|
)
|
||||||
|
call-function: (
|
||||||
// Check the color of "associated type".
|
"check-result-color", (
|
||||||
assert-css: (
|
"macro", // item kind
|
||||||
".result-associatedtype .associatedtype",
|
"rgb(163, 122, 204)", // color of item kind
|
||||||
{"color": "rgb(57, 175, 215)"},
|
"rgb(163, 122, 204)", // color of hovered/focused item kind
|
||||||
ALL,
|
),
|
||||||
)
|
)
|
||||||
assert-css: (
|
call-function: (
|
||||||
".result-associatedtype",
|
"check-result-color", (
|
||||||
{"color": "rgb(0, 150, 207)", "background-color": "rgba(0, 0, 0, 0)"},
|
"fn", // item kind
|
||||||
)
|
"rgb(253, 214, 135)", // color of item kind
|
||||||
move-cursor-to: ".result-associatedtype"
|
"rgb(253, 214, 135)", // color of hovered/focused item kind
|
||||||
assert-css: (
|
),
|
||||||
".result-associatedtype:hover",
|
|
||||||
{"color": "rgb(255, 255, 255)", "background-color": "rgb(60, 60, 60)"},
|
|
||||||
)
|
|
||||||
assert-css: (
|
|
||||||
".result-associatedtype:hover .associatedtype",
|
|
||||||
{"color": "rgb(57, 175, 215)"},
|
|
||||||
)
|
|
||||||
move-cursor-to: ".search-input"
|
|
||||||
focus: ".result-associatedtype"
|
|
||||||
assert-css: (
|
|
||||||
".result-associatedtype:focus",
|
|
||||||
{"color": "rgb(255, 255, 255)", "background-color": "rgb(60, 60, 60)"},
|
|
||||||
)
|
|
||||||
assert-css: (
|
|
||||||
".result-associatedtype:focus .associatedtype",
|
|
||||||
{"color": "rgb(57, 175, 215)"},
|
|
||||||
)
|
|
||||||
|
|
||||||
// Check the color of "type method".
|
|
||||||
assert-css: (
|
|
||||||
".result-tymethod .tymethod",
|
|
||||||
{"color": "rgb(253, 214, 135)"},
|
|
||||||
ALL,
|
|
||||||
)
|
|
||||||
assert-css: (
|
|
||||||
".result-tymethod",
|
|
||||||
{"color": "rgb(0, 150, 207)", "background-color": "rgba(0, 0, 0, 0)"},
|
|
||||||
)
|
|
||||||
assert-css: (
|
|
||||||
".result-tymethod .tymethod",
|
|
||||||
{"color": "rgb(253, 214, 135)"},
|
|
||||||
)
|
|
||||||
move-cursor-to: ".result-tymethod"
|
|
||||||
assert-css: (
|
|
||||||
".result-tymethod:hover",
|
|
||||||
{"color": "rgb(255, 255, 255)", "background-color": "rgb(60, 60, 60)"},
|
|
||||||
)
|
|
||||||
move-cursor-to: ".search-input"
|
|
||||||
focus: ".result-tymethod"
|
|
||||||
assert-css: (
|
|
||||||
".result-tymethod:focus",
|
|
||||||
{"color": "rgb(255, 255, 255)", "background-color": "rgb(60, 60, 60)"},
|
|
||||||
)
|
|
||||||
|
|
||||||
// Check the color of "method".
|
|
||||||
assert-css: (
|
|
||||||
".result-method .method",
|
|
||||||
{"color": "rgb(253, 214, 135)"},
|
|
||||||
ALL,
|
|
||||||
)
|
|
||||||
assert-css: (
|
|
||||||
".result-method",
|
|
||||||
{"color": "rgb(0, 150, 207)", "background-color": "rgba(0, 0, 0, 0)"},
|
|
||||||
)
|
|
||||||
move-cursor-to: ".result-method"
|
|
||||||
assert-css: (
|
|
||||||
".result-method:hover",
|
|
||||||
{"color": "rgb(255, 255, 255)", "background-color": "rgb(60, 60, 60)"},
|
|
||||||
)
|
|
||||||
assert-css: (
|
|
||||||
".result-method:hover .method",
|
|
||||||
{"color": "rgb(253, 214, 135)"},
|
|
||||||
)
|
|
||||||
move-cursor-to: ".search-input"
|
|
||||||
focus: ".result-method"
|
|
||||||
assert-css: (
|
|
||||||
".result-method:focus",
|
|
||||||
{"color": "rgb(255, 255, 255)", "background-color": "rgb(60, 60, 60)"},
|
|
||||||
)
|
|
||||||
assert-css: (
|
|
||||||
".result-method:focus .method",
|
|
||||||
{"color": "rgb(253, 214, 135)"},
|
|
||||||
)
|
|
||||||
|
|
||||||
// Check the color of "struct field".
|
|
||||||
assert-css: (
|
|
||||||
".result-structfield .structfield",
|
|
||||||
{"color": "rgb(0, 150, 207)"},
|
|
||||||
ALL,
|
|
||||||
)
|
|
||||||
assert-css: (
|
|
||||||
".result-structfield",
|
|
||||||
{"color": "rgb(0, 150, 207)", "background-color": "rgba(0, 0, 0, 0)"},
|
|
||||||
)
|
|
||||||
move-cursor-to: ".result-structfield"
|
|
||||||
assert-css: (
|
|
||||||
".result-structfield:hover",
|
|
||||||
{"color": "rgb(255, 255, 255)", "background-color": "rgb(60, 60, 60)"},
|
|
||||||
)
|
|
||||||
assert-css: (
|
|
||||||
".result-structfield:hover .structfield",
|
|
||||||
{"color": "rgb(255, 255, 255)"},
|
|
||||||
)
|
|
||||||
move-cursor-to: ".search-input"
|
|
||||||
focus: ".result-structfield"
|
|
||||||
assert-css: (
|
|
||||||
".result-structfield:focus",
|
|
||||||
{"color": "rgb(255, 255, 255)", "background-color": "rgb(60, 60, 60)"},
|
|
||||||
)
|
|
||||||
assert-css: (
|
|
||||||
".result-structfield:focus .structfield",
|
|
||||||
{"color": "rgb(255, 255, 255)"},
|
|
||||||
)
|
|
||||||
|
|
||||||
// Check the color of "macro".
|
|
||||||
assert-css: (
|
|
||||||
".result-macro .macro",
|
|
||||||
{"color": "rgb(163, 122, 204)"},
|
|
||||||
ALL,
|
|
||||||
)
|
|
||||||
assert-css: (
|
|
||||||
".result-macro",
|
|
||||||
{"color": "rgb(0, 150, 207)", "background-color": "rgba(0, 0, 0, 0)"},
|
|
||||||
)
|
|
||||||
move-cursor-to: ".result-macro"
|
|
||||||
assert-css: (
|
|
||||||
".result-macro:hover",
|
|
||||||
{"color": "rgb(255, 255, 255)", "background-color": "rgb(60, 60, 60)"},
|
|
||||||
)
|
|
||||||
assert-css: (
|
|
||||||
".result-macro:hover .macro",
|
|
||||||
{"color": "rgb(163, 122, 204)"},
|
|
||||||
)
|
|
||||||
move-cursor-to: ".search-input"
|
|
||||||
focus: ".result-macro"
|
|
||||||
assert-css: (
|
|
||||||
".result-macro:focus",
|
|
||||||
{"color": "rgb(255, 255, 255)", "background-color": "rgb(60, 60, 60)"},
|
|
||||||
)
|
|
||||||
assert-css: (
|
|
||||||
".result-macro:focus .macro",
|
|
||||||
{"color": "rgb(163, 122, 204)"},
|
|
||||||
)
|
|
||||||
|
|
||||||
// Check the color of "fn".
|
|
||||||
assert-css: (
|
|
||||||
".result-fn .fn",
|
|
||||||
{"color": "rgb(253, 214, 135)"},
|
|
||||||
ALL,
|
|
||||||
)
|
|
||||||
assert-css: (
|
|
||||||
".result-fn",
|
|
||||||
{"color": "rgb(0, 150, 207)", "background-color": "rgba(0, 0, 0, 0)"},
|
|
||||||
)
|
|
||||||
move-cursor-to: ".result-fn"
|
|
||||||
assert-css: (
|
|
||||||
".result-fn:hover",
|
|
||||||
{"color": "rgb(255, 255, 255)", "background-color": "rgb(60, 60, 60)"},
|
|
||||||
)
|
|
||||||
assert-css: (
|
|
||||||
".result-fn:hover .fn",
|
|
||||||
{"color": "rgb(253, 214, 135)"},
|
|
||||||
)
|
|
||||||
move-cursor-to: ".search-input"
|
|
||||||
focus: ".result-fn"
|
|
||||||
assert-css: (
|
|
||||||
".result-fn:focus",
|
|
||||||
{"color": "rgb(255, 255, 255)", "background-color": "rgb(60, 60, 60)"},
|
|
||||||
)
|
|
||||||
assert-css: (
|
|
||||||
".result-fn:focus .fn",
|
|
||||||
{"color": "rgb(253, 214, 135)"},
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Checking the `<a>` container.
|
// Checking the `<a>` container.
|
||||||
|
@ -308,244 +187,66 @@ assert-css: (
|
||||||
{"color": "rgb(221, 221, 221)"},
|
{"color": "rgb(221, 221, 221)"},
|
||||||
)
|
)
|
||||||
|
|
||||||
// Checking the color of "keyword".
|
store-value: (entry_color, "rgb(221, 221, 221)") // color of the search entry
|
||||||
assert-css: (
|
store-value: (hover_entry_color, "rgb(221, 221, 221)") // color of the hovered/focused search entry
|
||||||
".result-keyword .keyword",
|
store-value: (background_color, "rgba(0, 0, 0, 0)") // background color
|
||||||
{"color": "rgb(210, 153, 29)"},
|
store-value: (hover_background_color, "rgb(97, 97, 97)") // hover background color
|
||||||
ALL,
|
|
||||||
)
|
|
||||||
assert-css: (
|
|
||||||
".result-keyword",
|
|
||||||
{"color": "rgb(221, 221, 221)", "background-color": "rgba(0, 0, 0, 0)"},
|
|
||||||
)
|
|
||||||
move-cursor-to: ".result-keyword"
|
|
||||||
assert-css: (
|
|
||||||
".result-keyword:hover",
|
|
||||||
{"color": "rgb(221, 221, 221)", "background-color": "rgb(97, 97, 97)"},
|
|
||||||
)
|
|
||||||
assert-css: (
|
|
||||||
".result-keyword:hover .keyword",
|
|
||||||
{"color": "rgb(210, 153, 29)"},
|
|
||||||
)
|
|
||||||
move-cursor-to: ".search-input"
|
|
||||||
focus: ".result-keyword"
|
|
||||||
assert-css: (
|
|
||||||
".result-keyword:focus",
|
|
||||||
{"color": "rgb(221, 221, 221)", "background-color": "rgb(97, 97, 97)"},
|
|
||||||
)
|
|
||||||
assert-css: (
|
|
||||||
".result-keyword:focus .keyword",
|
|
||||||
{"color": "rgb(210, 153, 29)"},
|
|
||||||
)
|
|
||||||
|
|
||||||
// Check the color of "struct".
|
call-function: (
|
||||||
assert-css: (
|
"check-result-color", (
|
||||||
".result-struct .struct",
|
"keyword", // item kind
|
||||||
{"color": "rgb(45, 191, 184)"},
|
"rgb(210, 153, 29)", // color of item kind
|
||||||
ALL,
|
"rgb(210, 153, 29)", // color of hovered/focused item kind
|
||||||
|
),
|
||||||
)
|
)
|
||||||
assert-css: (
|
call-function: (
|
||||||
".result-struct",
|
"check-result-color", (
|
||||||
{"color": "rgb(221, 221, 221)", "background-color": "rgba(0, 0, 0, 0)"},
|
"struct", // item kind
|
||||||
|
"rgb(45, 191, 184)", // color of item kind
|
||||||
|
"rgb(45, 191, 184)", // color of hovered/focused item kind
|
||||||
|
),
|
||||||
)
|
)
|
||||||
move-cursor-to: ".result-struct"
|
call-function: (
|
||||||
assert-css: (
|
"check-result-color", (
|
||||||
".result-struct:hover",
|
"associatedtype", // item kind
|
||||||
{"color": "rgb(221, 221, 221)", "background-color": "rgb(97, 97, 97)"},
|
"rgb(210, 153, 29)", // color of item kind
|
||||||
|
"rgb(210, 153, 29)", // color of hovered/focused item kind
|
||||||
|
),
|
||||||
)
|
)
|
||||||
assert-css: (
|
call-function: (
|
||||||
".result-struct:hover .struct",
|
"check-result-color", (
|
||||||
{"color": "rgb(45, 191, 184)"},
|
"tymethod", // item kind
|
||||||
|
"rgb(43, 171, 99)", // color of item kind
|
||||||
|
"rgb(43, 171, 99)", // color of hovered/focused item kind
|
||||||
|
),
|
||||||
)
|
)
|
||||||
move-cursor-to: ".search-input"
|
call-function: (
|
||||||
focus: ".result-struct"
|
"check-result-color", (
|
||||||
assert-css: (
|
"method", // item kind
|
||||||
".result-struct:focus",
|
"rgb(43, 171, 99)", // color of item kind
|
||||||
{"color": "rgb(221, 221, 221)", "background-color": "rgb(97, 97, 97)"},
|
"rgb(43, 171, 99)", // color of hovered/focused item kind
|
||||||
|
),
|
||||||
)
|
)
|
||||||
assert-css: (
|
call-function: (
|
||||||
".result-struct:focus .struct",
|
"check-result-color", (
|
||||||
{"color": "rgb(45, 191, 184)"},
|
"structfield", // item kind
|
||||||
|
"rgb(221, 221, 221)", // color of item kind
|
||||||
|
"rgb(221, 221, 221)", // color of hovered/focused item kind
|
||||||
|
),
|
||||||
)
|
)
|
||||||
|
call-function: (
|
||||||
// Check the color of "associated type".
|
"check-result-color", (
|
||||||
assert-css: (
|
"macro", // item kind
|
||||||
".result-associatedtype .associatedtype",
|
"rgb(9, 189, 0)", // color of item kind
|
||||||
{"color": "rgb(210, 153, 29)"},
|
"rgb(9, 189, 0)", // color of hovered/focused item kind
|
||||||
ALL,
|
),
|
||||||
)
|
)
|
||||||
assert-css: (
|
call-function: (
|
||||||
".result-associatedtype",
|
"check-result-color", (
|
||||||
{"color": "rgb(221, 221, 221)", "background-color": "rgba(0, 0, 0, 0)"},
|
"fn", // item kind
|
||||||
)
|
"rgb(43, 171, 99)", // color of item kind
|
||||||
move-cursor-to: ".result-associatedtype"
|
"rgb(43, 171, 99)", // color of hovered/focused item kind
|
||||||
assert-css: (
|
),
|
||||||
".result-associatedtype:hover",
|
|
||||||
{"color": "rgb(221, 221, 221)", "background-color": "rgb(97, 97, 97)"},
|
|
||||||
)
|
|
||||||
assert-css: (
|
|
||||||
".result-associatedtype:hover .associatedtype",
|
|
||||||
{"color": "rgb(210, 153, 29)"},
|
|
||||||
)
|
|
||||||
move-cursor-to: ".search-input"
|
|
||||||
focus: ".result-associatedtype"
|
|
||||||
assert-css: (
|
|
||||||
".result-associatedtype:focus",
|
|
||||||
{"color": "rgb(221, 221, 221)", "background-color": "rgb(97, 97, 97)"},
|
|
||||||
)
|
|
||||||
assert-css: (
|
|
||||||
".result-associatedtype:focus .associatedtype",
|
|
||||||
{"color": "rgb(210, 153, 29)"},
|
|
||||||
)
|
|
||||||
|
|
||||||
// Check the color of "type method".
|
|
||||||
assert-css: (
|
|
||||||
".result-tymethod .tymethod",
|
|
||||||
{"color": "rgb(43, 171, 99)"},
|
|
||||||
ALL,
|
|
||||||
)
|
|
||||||
assert-css: (
|
|
||||||
".result-tymethod",
|
|
||||||
{"color": "rgb(221, 221, 221)", "background-color": "rgba(0, 0, 0, 0)"},
|
|
||||||
)
|
|
||||||
move-cursor-to: ".result-tymethod"
|
|
||||||
assert-css: (
|
|
||||||
".result-tymethod:hover",
|
|
||||||
{"color": "rgb(221, 221, 221)", "background-color": "rgb(97, 97, 97)"},
|
|
||||||
)
|
|
||||||
assert-css: (
|
|
||||||
".result-tymethod:hover .tymethod",
|
|
||||||
{"color": "rgb(43, 171, 99)"},
|
|
||||||
)
|
|
||||||
move-cursor-to: ".search-input"
|
|
||||||
focus: ".result-tymethod"
|
|
||||||
assert-css: (
|
|
||||||
".result-tymethod:focus",
|
|
||||||
{"color": "rgb(221, 221, 221)", "background-color": "rgb(97, 97, 97)"},
|
|
||||||
)
|
|
||||||
assert-css: (
|
|
||||||
".result-tymethod:focus .tymethod",
|
|
||||||
{"color": "rgb(43, 171, 99)"},
|
|
||||||
)
|
|
||||||
|
|
||||||
// Check the color of "method".
|
|
||||||
assert-css: (
|
|
||||||
".result-method .method",
|
|
||||||
{"color": "rgb(43, 171, 99)"},
|
|
||||||
ALL,
|
|
||||||
)
|
|
||||||
assert-css: (
|
|
||||||
".result-method",
|
|
||||||
{"color": "rgb(221, 221, 221)", "background-color": "rgba(0, 0, 0, 0)"},
|
|
||||||
)
|
|
||||||
move-cursor-to: ".result-method"
|
|
||||||
assert-css: (
|
|
||||||
".result-method:hover",
|
|
||||||
{"color": "rgb(221, 221, 221)", "background-color": "rgb(97, 97, 97)"},
|
|
||||||
)
|
|
||||||
assert-css: (
|
|
||||||
".result-method:hover .method",
|
|
||||||
{"color": "rgb(43, 171, 99)"},
|
|
||||||
)
|
|
||||||
move-cursor-to: ".search-input"
|
|
||||||
focus: ".result-method"
|
|
||||||
assert-css: (
|
|
||||||
".result-method:focus",
|
|
||||||
{"color": "rgb(221, 221, 221)", "background-color": "rgb(97, 97, 97)"},
|
|
||||||
)
|
|
||||||
assert-css: (
|
|
||||||
".result-method:focus .method",
|
|
||||||
{"color": "rgb(43, 171, 99)"},
|
|
||||||
)
|
|
||||||
|
|
||||||
// Check the color of "struct field".
|
|
||||||
assert-css: (
|
|
||||||
".result-structfield .structfield",
|
|
||||||
{"color": "rgb(221, 221, 221)"},
|
|
||||||
ALL,
|
|
||||||
)
|
|
||||||
assert-css: (
|
|
||||||
".result-structfield",
|
|
||||||
{"color": "rgb(221, 221, 221)", "background-color": "rgba(0, 0, 0, 0)"},
|
|
||||||
)
|
|
||||||
move-cursor-to: ".result-structfield"
|
|
||||||
assert-css: (
|
|
||||||
".result-structfield:hover",
|
|
||||||
{"color": "rgb(221, 221, 221)", "background-color": "rgb(97, 97, 97)"},
|
|
||||||
)
|
|
||||||
assert-css: (
|
|
||||||
".result-structfield:hover .structfield",
|
|
||||||
{"color": "rgb(221, 221, 221)"},
|
|
||||||
)
|
|
||||||
move-cursor-to: ".search-input"
|
|
||||||
focus: ".result-structfield"
|
|
||||||
assert-css: (
|
|
||||||
".result-structfield:focus",
|
|
||||||
{"color": "rgb(221, 221, 221)", "background-color": "rgb(97, 97, 97)"},
|
|
||||||
)
|
|
||||||
assert-css: (
|
|
||||||
".result-structfield:focus .structfield",
|
|
||||||
{"color": "rgb(221, 221, 221)"},
|
|
||||||
)
|
|
||||||
|
|
||||||
// Check the color of "macro".
|
|
||||||
assert-css: (
|
|
||||||
".result-macro .macro",
|
|
||||||
{"color": "rgb(9, 189, 0)"},
|
|
||||||
ALL,
|
|
||||||
)
|
|
||||||
assert-css: (
|
|
||||||
".result-macro",
|
|
||||||
{"color": "rgb(221, 221, 221)", "background-color": "rgba(0, 0, 0, 0)"},
|
|
||||||
)
|
|
||||||
move-cursor-to: ".result-macro"
|
|
||||||
assert-css: (
|
|
||||||
".result-macro:hover",
|
|
||||||
{"color": "rgb(221, 221, 221)", "background-color": "rgb(97, 97, 97)"},
|
|
||||||
)
|
|
||||||
assert-css: (
|
|
||||||
".result-macro:hover .macro",
|
|
||||||
{"color": "rgb(9, 189, 0)"},
|
|
||||||
)
|
|
||||||
move-cursor-to: ".search-input"
|
|
||||||
focus: ".result-macro"
|
|
||||||
assert-css: (
|
|
||||||
".result-macro:focus",
|
|
||||||
{"color": "rgb(221, 221, 221)", "background-color": "rgb(97, 97, 97)"},
|
|
||||||
)
|
|
||||||
assert-css: (
|
|
||||||
".result-macro:focus .macro",
|
|
||||||
{"color": "rgb(9, 189, 0)"},
|
|
||||||
)
|
|
||||||
|
|
||||||
// Check the color of "fn".
|
|
||||||
assert-css: (
|
|
||||||
".result-fn .fn",
|
|
||||||
{"color": "rgb(43, 171, 99)"},
|
|
||||||
ALL,
|
|
||||||
)
|
|
||||||
assert-css: (
|
|
||||||
".result-fn",
|
|
||||||
{"color": "rgb(221, 221, 221)", "background-color": "rgba(0, 0, 0, 0)"},
|
|
||||||
)
|
|
||||||
move-cursor-to: ".result-fn"
|
|
||||||
assert-css: (
|
|
||||||
".result-fn:hover",
|
|
||||||
{"color": "rgb(221, 221, 221)", "background-color": "rgb(97, 97, 97)"},
|
|
||||||
)
|
|
||||||
assert-css: (
|
|
||||||
".result-fn:hover .fn",
|
|
||||||
{"color": "rgb(43, 171, 99)"},
|
|
||||||
)
|
|
||||||
move-cursor-to: ".search-input"
|
|
||||||
focus: ".result-fn"
|
|
||||||
assert-css: (
|
|
||||||
".result-fn:focus",
|
|
||||||
{"color": "rgb(221, 221, 221)", "background-color": "rgb(97, 97, 97)"},
|
|
||||||
)
|
|
||||||
assert-css: (
|
|
||||||
".result-fn:focus .fn",
|
|
||||||
{"color": "rgb(43, 171, 99)"},
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Checking the `<a>` container.
|
// Checking the `<a>` container.
|
||||||
|
@ -577,244 +278,66 @@ assert-css: (
|
||||||
{"color": "rgb(0, 0, 0)"},
|
{"color": "rgb(0, 0, 0)"},
|
||||||
)
|
)
|
||||||
|
|
||||||
// Checking the color of "keyword".
|
store-value: (entry_color, "rgb(0, 0, 0)") // color of the search entry
|
||||||
assert-css: (
|
store-value: (hover_entry_color, "rgb(0, 0, 0)") // color of the hovered/focused search entry
|
||||||
".result-keyword .keyword",
|
store-value: (background_color, "rgba(0, 0, 0, 0)") // background color
|
||||||
{"color": "rgb(56, 115, 173)"},
|
store-value: (hover_background_color, "rgb(204, 204, 204)") // hover background color
|
||||||
ALL,
|
|
||||||
)
|
|
||||||
assert-css: (
|
|
||||||
".result-keyword",
|
|
||||||
{"color": "rgb(0, 0, 0)", "background-color": "rgba(0, 0, 0, 0)"},
|
|
||||||
)
|
|
||||||
move-cursor-to: ".result-keyword"
|
|
||||||
assert-css: (
|
|
||||||
".result-keyword:hover",
|
|
||||||
{"color": "rgb(0, 0, 0)", "background-color": "rgb(204, 204, 204)"},
|
|
||||||
)
|
|
||||||
assert-css: (
|
|
||||||
".result-keyword:hover .keyword",
|
|
||||||
{"color": "rgb(56, 115, 173)"},
|
|
||||||
)
|
|
||||||
move-cursor-to: ".search-input"
|
|
||||||
focus: ".result-keyword"
|
|
||||||
assert-css: (
|
|
||||||
".result-keyword:focus",
|
|
||||||
{"color": "rgb(0, 0, 0)", "background-color": "rgb(204, 204, 204)"},
|
|
||||||
)
|
|
||||||
assert-css: (
|
|
||||||
".result-keyword:focus .keyword",
|
|
||||||
{"color": "rgb(56, 115, 173)"},
|
|
||||||
)
|
|
||||||
|
|
||||||
// Check the color of "struct".
|
call-function: (
|
||||||
assert-css: (
|
"check-result-color", (
|
||||||
".result-struct .struct",
|
"keyword", // item kind
|
||||||
{"color": "rgb(173, 55, 138)"},
|
"rgb(56, 115, 173)", // color of item kind
|
||||||
ALL,
|
"rgb(56, 115, 173)", // color of hovered/focused item kind
|
||||||
|
),
|
||||||
)
|
)
|
||||||
assert-css: (
|
call-function: (
|
||||||
".result-struct",
|
"check-result-color", (
|
||||||
{"color": "rgb(0, 0, 0)", "background-color": "rgba(0, 0, 0, 0)"},
|
"struct", // item kind
|
||||||
|
"rgb(173, 55, 138)", // color of item kind
|
||||||
|
"rgb(173, 55, 138)", // color of hovered/focused item kind
|
||||||
|
),
|
||||||
)
|
)
|
||||||
move-cursor-to: ".result-struct"
|
call-function: (
|
||||||
assert-css: (
|
"check-result-color", (
|
||||||
".result-struct:hover",
|
"associatedtype", // item kind
|
||||||
{"color": "rgb(0, 0, 0)", "background-color": "rgb(204, 204, 204)"},
|
"rgb(56, 115, 173)", // color of item kind
|
||||||
|
"rgb(56, 115, 173)", // color of hovered/focused item kind
|
||||||
|
),
|
||||||
)
|
)
|
||||||
assert-css: (
|
call-function: (
|
||||||
".result-struct:hover .struct",
|
"check-result-color", (
|
||||||
{"color": "rgb(173, 55, 138)"},
|
"tymethod", // item kind
|
||||||
|
"rgb(173, 124, 55)", // color of item kind
|
||||||
|
"rgb(173, 124, 55)", // color of hovered/focused item kind
|
||||||
|
),
|
||||||
)
|
)
|
||||||
move-cursor-to: ".search-input"
|
call-function: (
|
||||||
focus: ".result-struct"
|
"check-result-color", (
|
||||||
assert-css: (
|
"method", // item kind
|
||||||
".result-struct:focus",
|
"rgb(173, 124, 55)", // color of item kind
|
||||||
{"color": "rgb(0, 0, 0)", "background-color": "rgb(204, 204, 204)"},
|
"rgb(173, 124, 55)", // color of hovered/focused item kind
|
||||||
|
),
|
||||||
)
|
)
|
||||||
assert-css: (
|
call-function: (
|
||||||
".result-struct:focus .struct",
|
"check-result-color", (
|
||||||
{"color": "rgb(173, 55, 138)"},
|
"structfield", // item kind
|
||||||
|
"rgb(0, 0, 0)", // color of item kind
|
||||||
|
"rgb(0, 0, 0)", // color of hovered/focused item kind
|
||||||
|
),
|
||||||
)
|
)
|
||||||
|
call-function: (
|
||||||
// Check the color of "associated type".
|
"check-result-color", (
|
||||||
assert-css: (
|
"macro", // item kind
|
||||||
".result-associatedtype .associatedtype",
|
"rgb(6, 128, 0)", // color of item kind
|
||||||
{"color": "rgb(56, 115, 173)"},
|
"rgb(6, 128, 0)", // color of hovered/focused item kind
|
||||||
ALL,
|
),
|
||||||
)
|
)
|
||||||
assert-css: (
|
call-function: (
|
||||||
".result-associatedtype",
|
"check-result-color", (
|
||||||
{"color": "rgb(0, 0, 0)", "background-color": "rgba(0, 0, 0, 0)"},
|
"fn", // item kind
|
||||||
)
|
"rgb(173, 124, 55)", // color of item kind
|
||||||
move-cursor-to: ".result-associatedtype"
|
"rgb(173, 124, 55)", // color of hovered/focused item kind
|
||||||
assert-css: (
|
),
|
||||||
".result-associatedtype:hover",
|
|
||||||
{"color": "rgb(0, 0, 0)", "background-color": "rgb(204, 204, 204)"},
|
|
||||||
)
|
|
||||||
assert-css: (
|
|
||||||
".result-associatedtype:hover .associatedtype",
|
|
||||||
{"color": "rgb(56, 115, 173)"},
|
|
||||||
)
|
|
||||||
move-cursor-to: ".search-input"
|
|
||||||
focus: ".result-associatedtype"
|
|
||||||
assert-css: (
|
|
||||||
".result-associatedtype:focus",
|
|
||||||
{"color": "rgb(0, 0, 0)", "background-color": "rgb(204, 204, 204)"},
|
|
||||||
)
|
|
||||||
assert-css: (
|
|
||||||
".result-associatedtype:focus .associatedtype",
|
|
||||||
{"color": "rgb(56, 115, 173)"},
|
|
||||||
)
|
|
||||||
|
|
||||||
// Check the color of "type method".
|
|
||||||
assert-css: (
|
|
||||||
".result-tymethod .tymethod",
|
|
||||||
{"color": "rgb(173, 124, 55)"},
|
|
||||||
ALL,
|
|
||||||
)
|
|
||||||
assert-css: (
|
|
||||||
".result-tymethod",
|
|
||||||
{"color": "rgb(0, 0, 0)", "background-color": "rgba(0, 0, 0, 0)"},
|
|
||||||
)
|
|
||||||
move-cursor-to: ".result-tymethod"
|
|
||||||
assert-css: (
|
|
||||||
".result-tymethod:hover",
|
|
||||||
{"color": "rgb(0, 0, 0)", "background-color": "rgb(204, 204, 204)"},
|
|
||||||
)
|
|
||||||
assert-css: (
|
|
||||||
".result-tymethod:hover .tymethod",
|
|
||||||
{"color": "rgb(173, 124, 55)"},
|
|
||||||
)
|
|
||||||
move-cursor-to: ".search-input"
|
|
||||||
focus: ".result-tymethod"
|
|
||||||
assert-css: (
|
|
||||||
".result-tymethod:focus",
|
|
||||||
{"color": "rgb(0, 0, 0)", "background-color": "rgb(204, 204, 204)"},
|
|
||||||
)
|
|
||||||
assert-css: (
|
|
||||||
".result-tymethod:focus .tymethod",
|
|
||||||
{"color": "rgb(173, 124, 55)"},
|
|
||||||
)
|
|
||||||
|
|
||||||
// Check the color of "method".
|
|
||||||
assert-css: (
|
|
||||||
".result-method .method",
|
|
||||||
{"color": "rgb(173, 124, 55)"},
|
|
||||||
ALL,
|
|
||||||
)
|
|
||||||
assert-css: (
|
|
||||||
".result-method",
|
|
||||||
{"color": "rgb(0, 0, 0)", "background-color": "rgba(0, 0, 0, 0)"},
|
|
||||||
)
|
|
||||||
move-cursor-to: ".result-method"
|
|
||||||
assert-css: (
|
|
||||||
".result-method:hover",
|
|
||||||
{"color": "rgb(0, 0, 0)", "background-color": "rgb(204, 204, 204)"},
|
|
||||||
)
|
|
||||||
assert-css: (
|
|
||||||
".result-method:hover .method",
|
|
||||||
{"color": "rgb(173, 124, 55)"},
|
|
||||||
)
|
|
||||||
move-cursor-to: ".search-input"
|
|
||||||
focus: ".result-method"
|
|
||||||
assert-css: (
|
|
||||||
".result-method:focus",
|
|
||||||
{"color": "rgb(0, 0, 0)", "background-color": "rgb(204, 204, 204)"},
|
|
||||||
)
|
|
||||||
assert-css: (
|
|
||||||
".result-method:focus .method",
|
|
||||||
{"color": "rgb(173, 124, 55)"},
|
|
||||||
)
|
|
||||||
|
|
||||||
// Check the color of "struct field".
|
|
||||||
assert-css: (
|
|
||||||
".result-structfield .structfield",
|
|
||||||
{"color": "rgb(0, 0, 0)"},
|
|
||||||
ALL,
|
|
||||||
)
|
|
||||||
assert-css: (
|
|
||||||
".result-structfield",
|
|
||||||
{"color": "rgb(0, 0, 0)", "background-color": "rgba(0, 0, 0, 0)"},
|
|
||||||
)
|
|
||||||
move-cursor-to: ".result-structfield"
|
|
||||||
assert-css: (
|
|
||||||
".result-structfield:hover",
|
|
||||||
{"color": "rgb(0, 0, 0)", "background-color": "rgb(204, 204, 204)"},
|
|
||||||
)
|
|
||||||
assert-css: (
|
|
||||||
".result-structfield:hover .structfield",
|
|
||||||
{"color": "rgb(0, 0, 0)"},
|
|
||||||
)
|
|
||||||
move-cursor-to: ".search-input"
|
|
||||||
focus: ".result-structfield"
|
|
||||||
assert-css: (
|
|
||||||
".result-structfield:focus",
|
|
||||||
{"color": "rgb(0, 0, 0)", "background-color": "rgb(204, 204, 204)"},
|
|
||||||
)
|
|
||||||
assert-css: (
|
|
||||||
".result-structfield:focus .structfield",
|
|
||||||
{"color": "rgb(0, 0, 0)"},
|
|
||||||
)
|
|
||||||
|
|
||||||
// Check the color of "macro".
|
|
||||||
assert-css: (
|
|
||||||
".result-macro .macro",
|
|
||||||
{"color": "rgb(6, 128, 0)"},
|
|
||||||
ALL,
|
|
||||||
)
|
|
||||||
assert-css: (
|
|
||||||
".result-macro",
|
|
||||||
{"color": "rgb(0, 0, 0)", "background-color": "rgba(0, 0, 0, 0)"},
|
|
||||||
)
|
|
||||||
move-cursor-to: ".result-macro"
|
|
||||||
assert-css: (
|
|
||||||
".result-macro:hover",
|
|
||||||
{"color": "rgb(0, 0, 0)", "background-color": "rgb(204, 204, 204)"},
|
|
||||||
)
|
|
||||||
assert-css: (
|
|
||||||
".result-macro:hover .macro",
|
|
||||||
{"color": "rgb(6, 128, 0)"},
|
|
||||||
)
|
|
||||||
move-cursor-to: ".search-input"
|
|
||||||
focus: ".result-macro"
|
|
||||||
assert-css: (
|
|
||||||
".result-macro:focus",
|
|
||||||
{"color": "rgb(0, 0, 0)", "background-color": "rgb(204, 204, 204)"},
|
|
||||||
)
|
|
||||||
assert-css: (
|
|
||||||
".result-macro:focus .macro",
|
|
||||||
{"color": "rgb(6, 128, 0)"},
|
|
||||||
)
|
|
||||||
|
|
||||||
// Check the color of "fn".
|
|
||||||
assert-css: (
|
|
||||||
".result-fn .fn",
|
|
||||||
{"color": "rgb(173, 124, 55)"},
|
|
||||||
ALL,
|
|
||||||
)
|
|
||||||
assert-css: (
|
|
||||||
".result-fn",
|
|
||||||
{"color": "rgb(0, 0, 0)", "background-color": "rgba(0, 0, 0, 0)"},
|
|
||||||
)
|
|
||||||
move-cursor-to: ".result-fn"
|
|
||||||
assert-css: (
|
|
||||||
".result-fn:hover",
|
|
||||||
{"color": "rgb(0, 0, 0)", "background-color": "rgb(204, 204, 204)"},
|
|
||||||
)
|
|
||||||
assert-css: (
|
|
||||||
".result-fn:hover .fn",
|
|
||||||
{"color": "rgb(173, 124, 55)"},
|
|
||||||
)
|
|
||||||
move-cursor-to: ".search-input"
|
|
||||||
focus: ".result-fn"
|
|
||||||
assert-css: (
|
|
||||||
".result-fn:focus",
|
|
||||||
{"color": "rgb(0, 0, 0)", "background-color": "rgb(204, 204, 204)"},
|
|
||||||
)
|
|
||||||
assert-css: (
|
|
||||||
".result-fn:focus .fn",
|
|
||||||
{"color": "rgb(173, 124, 55)"},
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Checking the `<a>` container.
|
// Checking the `<a>` container.
|
||||||
|
|
15
src/test/ui/closures/multiple-fn-bounds.rs
Normal file
15
src/test/ui/closures/multiple-fn-bounds.rs
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
fn foo<F: Fn(&char) -> bool + Fn(char) -> bool>(f: F) {
|
||||||
|
//~^ NOTE required by a bound in `foo`
|
||||||
|
//~| NOTE required by this bound in `foo`
|
||||||
|
//~| NOTE closure inferred to have a different signature due to this bound
|
||||||
|
todo!();
|
||||||
|
}
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
let v = true;
|
||||||
|
foo(move |x| v);
|
||||||
|
//~^ ERROR type mismatch in closure arguments
|
||||||
|
//~| NOTE expected closure signature
|
||||||
|
//~| NOTE expected due to this
|
||||||
|
//~| NOTE found signature defined here
|
||||||
|
}
|
24
src/test/ui/closures/multiple-fn-bounds.stderr
Normal file
24
src/test/ui/closures/multiple-fn-bounds.stderr
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
error[E0631]: type mismatch in closure arguments
|
||||||
|
--> $DIR/multiple-fn-bounds.rs:10:5
|
||||||
|
|
|
||||||
|
LL | foo(move |x| v);
|
||||||
|
| ^^^ -------- found signature defined here
|
||||||
|
| |
|
||||||
|
| expected due to this
|
||||||
|
|
|
||||||
|
= note: expected closure signature `fn(char) -> _`
|
||||||
|
found closure signature `for<'a> fn(&'a char) -> _`
|
||||||
|
note: closure inferred to have a different signature due to this bound
|
||||||
|
--> $DIR/multiple-fn-bounds.rs:1:11
|
||||||
|
|
|
||||||
|
LL | fn foo<F: Fn(&char) -> bool + Fn(char) -> bool>(f: F) {
|
||||||
|
| ^^^^^^^^^^^^^^^^^
|
||||||
|
note: required by a bound in `foo`
|
||||||
|
--> $DIR/multiple-fn-bounds.rs:1:31
|
||||||
|
|
|
||||||
|
LL | fn foo<F: Fn(&char) -> bool + Fn(char) -> bool>(f: F) {
|
||||||
|
| ^^^^^^^^^^^^^^^^ required by this bound in `foo`
|
||||||
|
|
||||||
|
error: aborting due to previous error
|
||||||
|
|
||||||
|
For more information about this error, try `rustc --explain E0631`.
|
|
@ -26,6 +26,11 @@ error[E0432]: unresolved import `env`
|
||||||
|
|
|
|
||||||
LL | use env;
|
LL | use env;
|
||||||
| ^^^ no `env` in the root
|
| ^^^ no `env` in the root
|
||||||
|
|
|
||||||
|
help: consider importing this module instead
|
||||||
|
|
|
||||||
|
LL | use std::env;
|
||||||
|
| ~~~~~~~~~
|
||||||
|
|
||||||
error: cannot determine resolution for the macro `env`
|
error: cannot determine resolution for the macro `env`
|
||||||
--> $DIR/issue-55897.rs:6:22
|
--> $DIR/issue-55897.rs:6:22
|
||||||
|
|
|
@ -3,6 +3,18 @@ error[E0432]: unresolved import `empty::issue_56125`
|
||||||
|
|
|
|
||||||
LL | use empty::issue_56125;
|
LL | use empty::issue_56125;
|
||||||
| ^^^^^^^^^^^^^^^^^^ no `issue_56125` in `m3::empty`
|
| ^^^^^^^^^^^^^^^^^^ no `issue_56125` in `m3::empty`
|
||||||
|
|
|
||||||
|
help: consider importing one of these items instead
|
||||||
|
|
|
||||||
|
LL | use crate::m3::last_segment::issue_56125;
|
||||||
|
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
LL | use crate::m3::non_last_segment::non_last_segment::issue_56125;
|
||||||
|
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
LL | use issue_56125::issue_56125;
|
||||||
|
| ~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
LL | use issue_56125::last_segment::issue_56125;
|
||||||
|
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
and 1 other candidate
|
||||||
|
|
||||||
error[E0659]: `issue_56125` is ambiguous
|
error[E0659]: `issue_56125` is ambiguous
|
||||||
--> $DIR/issue-56125.rs:6:9
|
--> $DIR/issue-56125.rs:6:9
|
||||||
|
|
|
@ -3,6 +3,11 @@ error[E0432]: unresolved import `single_err::something`
|
||||||
|
|
|
|
||||||
LL | use single_err::something;
|
LL | use single_err::something;
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^ no `something` in `single_err`
|
| ^^^^^^^^^^^^^^^^^^^^^ no `something` in `single_err`
|
||||||
|
|
|
||||||
|
help: consider importing this module instead
|
||||||
|
|
|
||||||
|
LL | use glob_ok::something;
|
||||||
|
| ~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
error: aborting due to previous error
|
error: aborting due to previous error
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,16 @@
|
||||||
error: expected identifier, found keyword `let`
|
error: expected identifier, found keyword `let`
|
||||||
--> $DIR/removed-syntax-field-let.rs:2:5
|
--> $DIR/removed-syntax-field-let.rs:2:5
|
||||||
|
|
|
|
||||||
LL | struct S {
|
|
||||||
| - while parsing this struct
|
|
||||||
LL | let foo: (),
|
LL | let foo: (),
|
||||||
| ^^^ expected identifier, found keyword
|
| ^^^ expected identifier, found keyword
|
||||||
|
|
|
||||||
|
= note: the `let` keyword is not allowed in `struct` fields
|
||||||
|
= note: see <https://doc.rust-lang.org/book/ch05-01-defining-structs.html> for more information
|
||||||
|
help: remove the let, the `let` keyword is not allowed in struct field definitions
|
||||||
|
|
|
||||||
|
LL - let foo: (),
|
||||||
|
LL + foo: (),
|
||||||
|
|
|
||||||
|
|
||||||
error: aborting due to previous error
|
error: aborting due to previous error
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,13 @@ error[E0432]: unresolved import `alloc`
|
||||||
|
|
|
|
||||||
LL | use alloc;
|
LL | use alloc;
|
||||||
| ^^^^^ no external crate `alloc`
|
| ^^^^^ no external crate `alloc`
|
||||||
|
|
|
||||||
|
help: consider importing one of these items instead
|
||||||
|
|
|
||||||
|
LL | use core::alloc;
|
||||||
|
| ~~~~~~~~~~~~
|
||||||
|
LL | use std::alloc;
|
||||||
|
| ~~~~~~~~~~~
|
||||||
|
|
||||||
error: aborting due to previous error
|
error: aborting due to previous error
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,11 @@ error[E0432]: unresolved import `std::simd::intrinsics`
|
||||||
|
|
|
|
||||||
LL | use std::simd::intrinsics;
|
LL | use std::simd::intrinsics;
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^ no `intrinsics` in `simd`
|
| ^^^^^^^^^^^^^^^^^^^^^ no `intrinsics` in `simd`
|
||||||
|
|
|
||||||
|
help: consider importing this module instead
|
||||||
|
|
|
||||||
|
LL | use std::intrinsics;
|
||||||
|
| ~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
error: aborting due to 2 previous errors
|
error: aborting due to 2 previous errors
|
||||||
|
|
||||||
|
|
|
@ -11,10 +11,16 @@ error[E0432]: unresolved import `test`
|
||||||
--> $DIR/inaccessible-test-modules.rs:6:5
|
--> $DIR/inaccessible-test-modules.rs:6:5
|
||||||
|
|
|
|
||||||
LL | use test as y;
|
LL | use test as y;
|
||||||
| ----^^^^^
|
| ^^^^^^^^^ no `test` in the root
|
||||||
| |
|
|
|
||||||
| no `test` in the root
|
help: a similar name exists in the module
|
||||||
| help: a similar name exists in the module: `test`
|
|
|
||||||
|
LL | use test as y;
|
||||||
|
| ~~~~
|
||||||
|
help: consider importing this module instead
|
||||||
|
|
|
||||||
|
LL | use test::test;
|
||||||
|
| ~~~~~~~~~~~
|
||||||
|
|
||||||
error: aborting due to 2 previous errors
|
error: aborting due to 2 previous errors
|
||||||
|
|
||||||
|
|
13
src/test/ui/unresolved/unresolved-candidates.rs
Normal file
13
src/test/ui/unresolved/unresolved-candidates.rs
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
mod a {
|
||||||
|
pub trait Trait {}
|
||||||
|
}
|
||||||
|
|
||||||
|
mod b {
|
||||||
|
use Trait; //~ ERROR unresolved import `Trait`
|
||||||
|
}
|
||||||
|
|
||||||
|
mod c {
|
||||||
|
impl Trait for () {} //~ ERROR cannot find trait `Trait` in this scope
|
||||||
|
}
|
||||||
|
|
||||||
|
fn main() {}
|
26
src/test/ui/unresolved/unresolved-candidates.stderr
Normal file
26
src/test/ui/unresolved/unresolved-candidates.stderr
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
error[E0432]: unresolved import `Trait`
|
||||||
|
--> $DIR/unresolved-candidates.rs:6:9
|
||||||
|
|
|
||||||
|
LL | use Trait;
|
||||||
|
| ^^^^^ no `Trait` in the root
|
||||||
|
|
|
||||||
|
help: consider importing this trait instead
|
||||||
|
|
|
||||||
|
LL | use a::Trait;
|
||||||
|
| ~~~~~~~~~
|
||||||
|
|
||||||
|
error[E0405]: cannot find trait `Trait` in this scope
|
||||||
|
--> $DIR/unresolved-candidates.rs:10:10
|
||||||
|
|
|
||||||
|
LL | impl Trait for () {}
|
||||||
|
| ^^^^^ not found in this scope
|
||||||
|
|
|
||||||
|
help: consider importing this trait
|
||||||
|
|
|
||||||
|
LL | use a::Trait;
|
||||||
|
|
|
||||||
|
|
||||||
|
error: aborting due to 2 previous errors
|
||||||
|
|
||||||
|
Some errors have detailed explanations: E0405, E0432.
|
||||||
|
For more information about an error, try `rustc --explain E0405`.
|
|
@ -1190,9 +1190,9 @@ version = "0.0.0"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "proc-macro2"
|
name = "proc-macro2"
|
||||||
version = "1.0.43"
|
version = "1.0.46"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "0a2ca2c61bc9f3d74d2886294ab7b9853abd9c1ad903a3ac7815c58989bb7bab"
|
checksum = "94e2ef8dbfc347b10c094890f778ee2e36ca9bb4262e86dc99cd217e35f3470b"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"unicode-ident",
|
"unicode-ident",
|
||||||
]
|
]
|
||||||
|
@ -1593,9 +1593,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "syn"
|
name = "syn"
|
||||||
version = "1.0.99"
|
version = "1.0.102"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "58dbef6ec655055e20b86b15a8cc6d439cca19b667537ac6a1369572d151ab13"
|
checksum = "3fcd952facd492f9be3ef0d0b7032a6e442ee9b361d4acc2b1d0c4aaa5f613a1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
|
|
|
@ -18,10 +18,11 @@ const LICENSES: &[&str] = &[
|
||||||
"ISC",
|
"ISC",
|
||||||
"Unlicense/MIT",
|
"Unlicense/MIT",
|
||||||
"Unlicense OR MIT",
|
"Unlicense OR MIT",
|
||||||
"0BSD OR MIT OR Apache-2.0", // adler license
|
"0BSD OR MIT OR Apache-2.0", // adler license
|
||||||
"Zlib OR Apache-2.0 OR MIT", // tinyvec
|
"Zlib OR Apache-2.0 OR MIT", // tinyvec
|
||||||
"MIT OR Apache-2.0 OR Zlib", // tinyvec_macros
|
"MIT OR Apache-2.0 OR Zlib", // tinyvec_macros
|
||||||
"MIT OR Zlib OR Apache-2.0", // miniz_oxide
|
"MIT OR Zlib OR Apache-2.0", // miniz_oxide
|
||||||
|
"(MIT OR Apache-2.0) AND Unicode-DFS-2016", // unicode_ident
|
||||||
];
|
];
|
||||||
|
|
||||||
/// These are exceptions to Rust's permissive licensing policy, and
|
/// These are exceptions to Rust's permissive licensing policy, and
|
||||||
|
@ -235,6 +236,7 @@ const PERMITTED_RUSTC_DEPENDENCIES: &[&str] = &[
|
||||||
"unic-langid-macros",
|
"unic-langid-macros",
|
||||||
"unic-langid-macros-impl",
|
"unic-langid-macros-impl",
|
||||||
"unic-ucd-version",
|
"unic-ucd-version",
|
||||||
|
"unicode-ident",
|
||||||
"unicode-normalization",
|
"unicode-normalization",
|
||||||
"unicode-script",
|
"unicode-script",
|
||||||
"unicode-security",
|
"unicode-security",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue