-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Sync from rust-lang/rust
#12871
Sync from rust-lang/rust
#12871
Changes from 10 commits
5f3f428
0bffdf2
b351e11
20eb2dd
74998e4
ff31785
d8c0d88
56c369d
dfe8449
0d04e63
dc94050
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -167,11 +167,7 @@ fn collect_import_map(db: &dyn DefDatabase, krate: CrateId) -> ImportMap { | |
|
||
let visible_items = mod_data.scope.entries().filter_map(|(name, per_ns)| { | ||
let per_ns = per_ns.filter_visibility(|vis| vis == Visibility::Public); | ||
if per_ns.is_none() { | ||
None | ||
} else { | ||
Some((name, per_ns)) | ||
} | ||
if per_ns.is_none() { None } else { Some((name, per_ns)) } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the result of some nightly only options rust-lang/rust uses: https://github.com/rust-lang/rust/blob/2f320a224e827b400be25966755a621779f797cc/rustfmt.toml#L2-L4 Stable rustfmt without those options as used in this repo will revert these changes. You will need to do one of:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That one's my bad, I had "format on save" set up when doing those edits. I'll revert them in this PR. |
||
}); | ||
|
||
for (name, per_ns) in visible_items { | ||
|
@@ -516,6 +512,9 @@ mod tests { | |
mark | ||
)) | ||
}) | ||
// HashSet iteration order isn't defined - it's different on | ||
// x86_64 and i686 at the very least | ||
.sorted() | ||
.collect::<String>(); | ||
expect.assert_eq(&actual) | ||
} | ||
|
@@ -588,6 +587,7 @@ mod tests { | |
|
||
Some(format!("{}:\n{:?}\n", name, map)) | ||
}) | ||
.sorted() | ||
.collect::<String>(); | ||
|
||
expect.assert_eq(&actual) | ||
|
@@ -621,15 +621,15 @@ mod tests { | |
struct Priv; | ||
", | ||
expect![[r#" | ||
lib: | ||
- Pub (t) | ||
- Pub2 (t) | ||
- Pub2 (v) | ||
main: | ||
- publ1 (t) | ||
- real_pu2 (t) | ||
- real_pub (t) | ||
- real_pub::Pub (t) | ||
lib: | ||
- Pub (t) | ||
- Pub2 (t) | ||
- Pub2 (v) | ||
"#]], | ||
); | ||
} | ||
|
@@ -671,13 +671,13 @@ mod tests { | |
pub struct S; | ||
", | ||
expect![[r#" | ||
lib: | ||
- S (t) | ||
- S (v) | ||
main: | ||
- m (t) | ||
- m::S (t) | ||
- m::S (v) | ||
lib: | ||
- S (t) | ||
- S (v) | ||
"#]], | ||
); | ||
} | ||
|
@@ -697,11 +697,11 @@ mod tests { | |
} | ||
", | ||
expect![[r#" | ||
lib: | ||
- pub_macro (m) | ||
main: | ||
- m (t) | ||
- m::pub_macro (m) | ||
lib: | ||
- pub_macro (m) | ||
"#]], | ||
); | ||
} | ||
|
@@ -719,14 +719,14 @@ mod tests { | |
} | ||
", | ||
expect![[r#" | ||
main: | ||
- reexported_module (t) | ||
- reexported_module::S (t) | ||
- reexported_module::S (v) | ||
lib: | ||
- module (t) | ||
- module::S (t) | ||
- module::S (v) | ||
main: | ||
- reexported_module (t) | ||
- reexported_module::S (t) | ||
- reexported_module::S (v) | ||
"#]], | ||
); | ||
} | ||
|
@@ -831,10 +831,10 @@ mod tests { | |
Query::new("fmt".to_string()).search_mode(SearchMode::Fuzzy), | ||
expect![[r#" | ||
dep::fmt (t) | ||
dep::fmt::Display::format_method (a) | ||
dep::fmt::Display (t) | ||
dep::fmt::Display::FMT_CONST (a) | ||
dep::fmt::Display::format_function (a) | ||
dep::fmt::Display::format_method (a) | ||
"#]], | ||
); | ||
} | ||
|
@@ -860,10 +860,10 @@ mod tests { | |
"main", | ||
Query::new("fmt".to_string()).search_mode(SearchMode::Fuzzy).assoc_items_only(), | ||
expect![[r#" | ||
dep::fmt::Display::format_method (a) | ||
dep::fmt::Display::FMT_CONST (a) | ||
dep::fmt::Display::format_function (a) | ||
"#]], | ||
dep::fmt::Display::FMT_CONST (a) | ||
dep::fmt::Display::format_function (a) | ||
dep::fmt::Display::format_method (a) | ||
"#]], | ||
); | ||
|
||
check_search( | ||
|
@@ -920,13 +920,13 @@ mod tests { | |
"main", | ||
Query::new("fmt".to_string()).search_mode(SearchMode::Fuzzy), | ||
expect![[r#" | ||
dep::fmt (t) | ||
dep::format (f) | ||
dep::Fmt (v) | ||
dep::Fmt (m) | ||
dep::Fmt (t) | ||
dep::fmt::Display::fmt (a) | ||
dep::Fmt (v) | ||
dep::fmt (t) | ||
dep::fmt::Display (t) | ||
dep::fmt::Display::fmt (a) | ||
dep::format (f) | ||
"#]], | ||
); | ||
|
||
|
@@ -935,10 +935,10 @@ mod tests { | |
"main", | ||
Query::new("fmt".to_string()).search_mode(SearchMode::Equals), | ||
expect![[r#" | ||
dep::fmt (t) | ||
dep::Fmt (v) | ||
dep::Fmt (m) | ||
dep::Fmt (t) | ||
dep::Fmt (v) | ||
dep::fmt (t) | ||
dep::fmt::Display::fmt (a) | ||
"#]], | ||
); | ||
|
@@ -948,12 +948,12 @@ mod tests { | |
"main", | ||
Query::new("fmt".to_string()).search_mode(SearchMode::Contains), | ||
expect![[r#" | ||
dep::fmt (t) | ||
dep::Fmt (v) | ||
dep::Fmt (m) | ||
dep::Fmt (t) | ||
dep::fmt::Display::fmt (a) | ||
dep::Fmt (v) | ||
dep::fmt (t) | ||
dep::fmt::Display (t) | ||
dep::fmt::Display::fmt (a) | ||
"#]], | ||
); | ||
} | ||
|
@@ -989,12 +989,12 @@ mod tests { | |
"main", | ||
Query::new("fmt".to_string()), | ||
expect![[r#" | ||
dep::fmt (t) | ||
dep::Fmt (v) | ||
dep::Fmt (m) | ||
dep::Fmt (t) | ||
dep::fmt::Display::fmt (a) | ||
dep::Fmt (v) | ||
dep::fmt (t) | ||
dep::fmt::Display (t) | ||
dep::fmt::Display::fmt (a) | ||
"#]], | ||
); | ||
|
||
|
@@ -1003,10 +1003,10 @@ mod tests { | |
"main", | ||
Query::new("fmt".to_string()).name_only(), | ||
expect![[r#" | ||
dep::fmt (t) | ||
dep::Fmt (v) | ||
dep::Fmt (m) | ||
dep::Fmt (t) | ||
dep::Fmt (v) | ||
dep::fmt (t) | ||
dep::fmt::Display::fmt (a) | ||
"#]], | ||
); | ||
|
@@ -1027,10 +1027,10 @@ mod tests { | |
"main", | ||
Query::new("FMT".to_string()), | ||
expect![[r#" | ||
dep::fmt (t) | ||
dep::FMT (t) | ||
dep::FMT (v) | ||
dep::fmt (t) | ||
dep::fmt (v) | ||
dep::FMT (t) | ||
"#]], | ||
); | ||
|
||
|
@@ -1068,10 +1068,10 @@ mod tests { | |
"main", | ||
Query::new("".to_string()).limit(2), | ||
expect![[r#" | ||
dep::fmt (t) | ||
dep::Fmt (m) | ||
dep::Fmt (t) | ||
dep::Fmt (v) | ||
dep::Fmt (m) | ||
dep::fmt (t) | ||
"#]], | ||
); | ||
} | ||
|
@@ -1091,10 +1091,10 @@ mod tests { | |
"main", | ||
Query::new("FMT".to_string()), | ||
expect![[r#" | ||
dep::fmt (t) | ||
dep::FMT (t) | ||
dep::FMT (v) | ||
dep::fmt (t) | ||
dep::fmt (v) | ||
dep::FMT (t) | ||
"#]], | ||
); | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why was this removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a fun story! The short answer it: it caused bors to fail to merge the
rust-lang/rust
subtree PR.The longer story is: that change was introduced in #2166 - but it never did what was intended.
eof
is not a gitattribute setting.eol
is, but even that line usedeol
, it still wouldn't do anything, because of-text
. So by mistake, 3 files were treated as binary, and checked out with CRLF line endings (those were the ones bors choked on).After removing this line from
.gitattribute
, I re-added the folder to git, removed it from disk and usedgit restore
to write it with the proper line endings. The relevant commit is here: rust-lang/rust@1bb63dfThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just did a fresh clone of that branch from Windows and ran
cargo test
with the latest stable, no issues whatsoever.I'm still convinced #2166 wasn't needed, as explained here: #2166 (comment)