Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: rust-lang/rust
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: Manishearth/rust
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: rollup-kul0c2d
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 18 commits
  • 87 files changed
  • 2 contributors

Commits on Oct 2, 2021

  1. Query the fingerprint style during key reconstruction

    Keys can be reconstructed from fingerprints that are not DefPathHash, but then
    we cannot extract a DefId from them.
    Mark-Simulacrum committed Oct 2, 2021
    Copy the full SHA
    0a82acc View commit details
  2. Copy the full SHA
    63aaf88 View commit details

Commits on Oct 5, 2021

  1. Rollup merge of #87993 - kornelski:try_reserve_stable, r=joshtriplett

    Stabilize try_reserve
    
    Stabilization PR for the [`try_reserve` feature](#48043 (comment)).
    Manishearth authored Oct 5, 2021
    Copy the full SHA
    279cb9c View commit details
  2. Rollup merge of #88090 - nbdd0121:inference, r=nikomatsakis

    Perform type inference in range pattern
    
    Fix #88074
    Manishearth authored Oct 5, 2021
    Copy the full SHA
    d87f3f3 View commit details
  3. Rollup merge of #88780 - orlp:int-abs-diff, r=m-ou-se

    Added abs_diff for integer types.
    
    Closes #62111.
    Manishearth authored Oct 5, 2021
    Copy the full SHA
    c146ff5 View commit details
  4. Rollup merge of #89270 - seanyoung:join_fold, r=m-ou-se

    path.push() should work as expected on windows verbatim paths
    
    On Windows, std::fs::canonicalize() returns an so-called UNC path.  UNC paths differ with regular paths because:
    
    - This type of path can much longer than a non-UNC path (32k vs 260 characters).
    - The prefix for a UNC path is ``Component::Prefix(Prefix::DiskVerbatim(..)))``
    - No `/` is allowed
    - No `.` is allowed
    - No `..` is allowed
    
    Rust has poor handling of such paths. If you join a UNC path with a path with any of the above, then this will not work.
    
    I've implemented a new method `fn join_fold()` which joins paths and also removes any `.` and `..` from it, and replaces `/` with `\` on Windows. Using this function it is possible to use UNC paths without issue. In addition, this function is useful on Linux too; paths can be appended without having to call `canonicalize()` to remove the `.` and `..`.
    
    This PR needs test cases, which can I add. I hope this will a start of a discussion.
    Manishearth authored Oct 5, 2021
    Copy the full SHA
    5ae7df6 View commit details
  5. Rollup merge of #89343 - Mark-Simulacrum:no-args-queries, r=cjgillot

    Refactor fingerprint reconstruction
    
    This PR replaces can_reconstruct_query_key with fingerprint_style, which returns the style of the fingerprint for that query. This allows us to avoid trying to extract a DefId (or equivalent) from keys which *are* reconstructible because they're () but not as DefIds.
    
    This is done with the goal of fixing -Zdump-dep-graph, which seems to have broken a while ago (I didn't try to bisect). Currently even on a `fn main() {}` file it'll ICE (you need to also pass -Zquery-dep-graph for it to work at all), and this patch indirectly fixes the cause of that ICE. This also adds a test for it continuing to work.
    Manishearth authored Oct 5, 2021
    Copy the full SHA
    2615975 View commit details
  6. Rollup merge of #89413 - matthewjasper:spec-marker-fix, r=nikomatsakis

    Correctly handle supertraits for min_specialization
    
    Supertraits of specialization markers could circumvent checks for
    min_specialization. Elaborating predicates prevents this.
    
    r? ```@nikomatsakis```
    Manishearth authored Oct 5, 2021
    Copy the full SHA
    c430524 View commit details
  7. Rollup merge of #89456 - cuviper:llvm-13, r=nikic

    Update to the final LLVM 13.0.0 release
    Manishearth authored Oct 5, 2021
    Copy the full SHA
    5eaddb2 View commit details
  8. Rollup merge of #89466 - Mark-Simulacrum:query-macros, r=oli-obk

    Fix bug with query modifier parsing
    
    The previous macro_rules! parsers failed when an additional modifier was added
    with ambiguity errors. The error is pretty unclear as to what exactly the cause
    here is, but this change simplifies the argument parsing code such that the
    error is avoided.
    
    Extracted from other work, and somewhat duplicates 0358edeb5 from #85830, but
    this approach seems a little simpler to me. Not technically currently necessary but seems
    like a good cleanup.
    Manishearth authored Oct 5, 2021
    Copy the full SHA
    f004b11 View commit details
  9. Rollup merge of #89473 - FabianWolff:issue-89469, r=joshtriplett

    Fix extra `non_snake_case` warning for shorthand field bindings
    
    Fixes #89469. The problem is the innermost `if` condition here:
    https://github.com/rust-lang/rust/blob/d14731cb3ced8318d7fc83cbe838f0e7f2fb3b40/compiler/rustc_lint/src/nonstandard_style.rs#L435-L452
    
    This code runs for every `PatKind::Binding`, so if a struct has multiple fields, say A and B, and both are bound in a pattern using shorthands, the call to `self.check_snake_case()` will indeed be skipped in the `check_pat()` call for `A`; but when `check_pat()` is called for `B`, the loop will still iterate over `A`, and `field.ident (= A) != ident (= B)` will be true. I have fixed this by only looking at non-shorthand bindings, and only the binding that `check_pat()` was actually called for.
    Manishearth authored Oct 5, 2021
    Copy the full SHA
    207accb View commit details
  10. Rollup merge of #89474 - camelid:better-pass-name, r=jyn514

    rustdoc: Improve doctest pass's name and module's name
    
    As the docs at the top of the file say, it is an overloaded pass and
    actually runs two lints.
    Manishearth authored Oct 5, 2021
    Copy the full SHA
    73cde66 View commit details
  11. Rollup merge of #89478 - zvavybir:master, r=jyn514

    Fixed numerus of error message
    
    When there are redundant trait requirements and these are hidden, a message is generated by the following code snippet:
    `format!("{} redundant requirements hidden", count)`
    But if there is only a single hidden requirement, it will still print this message in plural instead of singular.
    Manishearth authored Oct 5, 2021
    Copy the full SHA
    d977385 View commit details
  12. Rollup merge of #89480 - hameerabbasi:issue-89118-test, r=jackh726

    Add test for issue 89118.
    
    This PR adds a test for issue 89118.
    
    Closes #89118.
    Manishearth authored Oct 5, 2021
    Copy the full SHA
    bbbed4b View commit details
  13. Rollup merge of #89487 - FabianWolff:issue-89396, r=petrochenkov

    Try to recover from a `=>` -> `=` or `->` typo in a match arm
    
    Fixes #89396.
    Manishearth authored Oct 5, 2021
    Copy the full SHA
    ac90510 View commit details
  14. Rollup merge of #89494 - FabianWolff:issue-84075, r=davidtwco

    Deny `where` clauses on `auto` traits
    
    Fixes #84075.
    Manishearth authored Oct 5, 2021
    Copy the full SHA
    60d58c2 View commit details
  15. Copy the full SHA
    e980b2f View commit details
  16. Rollup merge of #89536 - RalfJung:miri, r=RalfJung

    update Miri
    
    Let's get the recent fixes and improvements shipped.
    r? ```@ghost```
    Manishearth authored Oct 5, 2021
    Copy the full SHA
    121e3fe View commit details
Showing with 872 additions and 345 deletions.
  1. +1 −1 .gitmodules
  2. +14 −18 Cargo.lock
  3. +1 −0 compiler/rustc_ast/src/token.rs
  4. +36 −13 compiler/rustc_ast_passes/src/ast_validation.rs
  5. +1 −1 compiler/rustc_data_structures/src/sso/map.rs
  6. +1 −1 compiler/rustc_data_structures/src/sso/set.rs
  7. +7 −6 compiler/rustc_lint/src/nonstandard_style.rs
  8. +6 −6 compiler/rustc_macros/src/query.rs
  9. +40 −36 compiler/rustc_middle/src/dep_graph/dep_node.rs
  10. +2 −2 compiler/rustc_middle/src/dep_graph/mod.rs
  11. +0 −1 compiler/rustc_middle/src/lib.rs
  12. +3 −3 compiler/rustc_middle/src/ty/query.rs
  13. +18 −1 compiler/rustc_parse/src/parser/expr.rs
  14. +17 −16 compiler/rustc_query_impl/src/plumbing.rs
  15. +6 −6 compiler/rustc_query_system/src/dep_graph/dep_node.rs
  16. +22 −1 compiler/rustc_query_system/src/dep_graph/mod.rs
  17. +2 −2 compiler/rustc_query_system/src/query/plumbing.rs
  18. +8 −2 compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs
  19. +3 −1 compiler/rustc_trait_selection/src/traits/mod.rs
  20. +43 −16 compiler/rustc_typeck/src/check/pat.rs
  21. +31 −17 compiler/rustc_typeck/src/impl_wf_check/min_specialization.rs
  22. +2 −2 library/alloc/src/collections/mod.rs
  23. +2 −4 library/alloc/src/collections/vec_deque/mod.rs
  24. +2 −4 library/alloc/src/string.rs
  25. +10 −3 library/alloc/src/vec/into_iter.rs
  26. +2 −4 library/alloc/src/vec/mod.rs
  27. +3 −13 library/alloc/src/vec/source_iter_marker.rs
  28. +0 −1 library/alloc/tests/lib.rs
  29. +4 −4 library/core/src/iter/adapters/enumerate.rs
  30. +4 −5 library/core/src/iter/adapters/filter.rs
  31. +4 −5 library/core/src/iter/adapters/filter_map.rs
  32. +4 −5 library/core/src/iter/adapters/inspect.rs
  33. +4 −5 library/core/src/iter/adapters/map.rs
  34. +4 −5 library/core/src/iter/adapters/map_while.rs
  35. +6 −5 library/core/src/iter/adapters/mod.rs
  36. +4 −4 library/core/src/iter/adapters/peekable.rs
  37. +4 −5 library/core/src/iter/adapters/scan.rs
  38. +4 −4 library/core/src/iter/adapters/skip.rs
  39. +4 −5 library/core/src/iter/adapters/skip_while.rs
  40. +4 −4 library/core/src/iter/adapters/take.rs
  41. +4 −5 library/core/src/iter/adapters/take_while.rs
  42. +4 −6 library/core/src/iter/adapters/zip.rs
  43. +40 −0 library/core/src/num/int_macros.rs
  44. +27 −0 library/core/src/num/uint_macros.rs
  45. +1 −2 library/std/src/collections/hash/map.rs
  46. +1 −2 library/std/src/collections/hash/set.rs
  47. +1 −1 library/std/src/collections/mod.rs
  48. +1 −1 library/std/src/error.rs
  49. +0 −1 library/std/src/lib.rs
  50. +46 −7 library/std/src/path.rs
  51. +9 −0 library/std/src/path/tests.rs
  52. +1 −1 src/librustdoc/passes/calculate_doc_coverage.rs
  53. +9 −9 src/librustdoc/passes/{doc_test_lints.rs → check_doc_test_visibility.rs}
  54. +4 −4 src/librustdoc/passes/mod.rs
  55. +1 −1 src/llvm-project
  56. +10 −0 src/test/run-make/dep-graph/Makefile
  57. +1 −0 src/test/run-make/dep-graph/foo.rs
  58. +3 −3 src/test/ui/associated-types/impl-wf-cycle-1.stderr
  59. +13 −0 src/test/ui/auto-traits/auto-trait-validation.fixed
  60. +6 −2 src/test/ui/auto-traits/auto-trait-validation.rs
  61. +20 −11 src/test/ui/auto-traits/auto-trait-validation.stderr
  62. +3 −3 src/test/ui/auto-traits/issue-23080-2.stderr
  63. +8 −5 src/test/ui/auto-traits/issue-23080.stderr
  64. +16 −0 src/test/ui/auto-traits/issue-84075.rs
  65. +11 −0 src/test/ui/auto-traits/issue-84075.stderr
  66. +1 −0 src/test/ui/auto-traits/typeck-auto-trait-no-supertraits-2.rs
  67. +13 −5 src/test/ui/auto-traits/typeck-auto-trait-no-supertraits-2.stderr
  68. +4 −4 src/test/ui/auto-traits/typeck-auto-trait-no-supertraits.stderr
  69. +0 −1 src/test/ui/closures/issue-87814-2.rs
  70. +0 −4 src/test/ui/feature-gates/feature-gate-try_reserve.rs
  71. +0 −12 src/test/ui/feature-gates/feature-gate-try_reserve.stderr
  72. +32 −0 src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-89118.rs
  73. +63 −0 src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-89118.stderr
  74. +20 −0 src/test/ui/lint/issue-89469.rs
  75. +16 −0 src/test/ui/parser/issue-89396.fixed
  76. +16 −0 src/test/ui/parser/issue-89396.rs
  77. +20 −0 src/test/ui/parser/issue-89396.stderr
  78. +28 −0 src/test/ui/pattern/issue-88074-pat-range-type-inference-err.rs
  79. +21 −0 src/test/ui/pattern/issue-88074-pat-range-type-inference-err.stderr
  80. +16 −0 src/test/ui/pattern/issue-88074-pat-range-type-inference.rs
  81. +0 −1 src/test/ui/pattern/patkind-litrange-no-expr.rs
  82. +1 −11 src/test/ui/pattern/patkind-litrange-no-expr.stderr
  83. +29 −0 src/test/ui/specialization/min_specialization/spec-marker-supertraits.rs
  84. +13 −0 src/test/ui/specialization/min_specialization/spec-marker-supertraits.stderr
  85. +4 −4 src/test/ui/traits/inductive-overflow/supertrait-auto-trait.stderr
  86. +1 −1 src/tools/miri
  87. +1 −1 src/tools/rust-analyzer
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -34,7 +34,7 @@
[submodule "src/llvm-project"]
path = src/llvm-project
url = https://github.com/rust-lang/llvm-project.git
branch = rustc/13.0-2021-08-08
branch = rustc/13.0-2021-09-30
[submodule "src/doc/embedded-book"]
path = src/doc/embedded-book
url = https://github.com/rust-embedded/book.git
32 changes: 14 additions & 18 deletions Cargo.lock
Original file line number Diff line number Diff line change
@@ -360,7 +360,7 @@ version = "0.1.0"
dependencies = [
"directories",
"rustc-workspace-hack",
"rustc_version",
"rustc_version 0.3.3",
"serde",
"serde_json",
"vergen",
@@ -1092,19 +1092,6 @@ dependencies = [
"termcolor",
]

[[package]]
name = "env_logger"
version = "0.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "54532e3223c5af90a6a757c90b5c5521564b07e5e7a958681bcd2afad421cdcd"
dependencies = [
"atty",
"humantime 2.0.1",
"log",
"regex",
"termcolor",
]

[[package]]
name = "env_logger"
version = "0.9.0"
@@ -2250,15 +2237,15 @@ version = "0.1.0"
dependencies = [
"colored",
"compiletest_rs",
"env_logger 0.8.1",
"env_logger 0.9.0",
"getrandom 0.2.0",
"hex 0.4.2",
"libc",
"log",
"measureme",
"rand 0.8.4",
"rustc-workspace-hack",
"rustc_version",
"rustc_version 0.4.0",
"shell-escape",
"smallvec",
]
@@ -4548,6 +4535,15 @@ dependencies = [
"semver 0.11.0",
]

[[package]]
name = "rustc_version"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366"
dependencies = [
"semver 1.0.3",
]

[[package]]
name = "rustdoc"
version = "0.0.0"
@@ -4908,9 +4904,9 @@ checksum = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8"

[[package]]
name = "smallvec"
version = "1.6.1"
version = "1.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e"
checksum = "1ecab6c735a6bb4139c0caafd0cc3635748bbb3acf4550e8138122099251f309"

[[package]]
name = "snap"
1 change: 1 addition & 0 deletions compiler/rustc_ast/src/token.rs
Original file line number Diff line number Diff line change
@@ -295,6 +295,7 @@ impl TokenKind {
match *self {
Comma => Some(vec![Dot, Lt, Semi]),
Semi => Some(vec![Colon, Comma]),
FatArrow => Some(vec![Eq, RArrow]),
_ => None,
}
}
49 changes: 36 additions & 13 deletions compiler/rustc_ast_passes/src/ast_validation.rs
Original file line number Diff line number Diff line change
@@ -683,31 +683,53 @@ impl<'a> AstValidator<'a> {
}
}

fn emit_e0568(&self, span: Span, ident_span: Span) {
struct_span_err!(
self.session,
span,
E0568,
"auto traits cannot have super traits or lifetime bounds"
)
.span_label(ident_span, "auto trait cannot have super traits or lifetime bounds")
.span_suggestion(
span,
"remove the super traits or lifetime bounds",
String::new(),
Applicability::MachineApplicable,
)
.emit();
}

fn deny_super_traits(&self, bounds: &GenericBounds, ident_span: Span) {
if let [first @ last] | [first, .., last] = &bounds[..] {
let span = first.span().to(last.span());
struct_span_err!(self.session, span, E0568, "auto traits cannot have super traits")
.span_label(ident_span, "auto trait cannot have super traits")
.span_suggestion(
span,
"remove the super traits",
String::new(),
Applicability::MachineApplicable,
)
.emit();
if let [.., last] = &bounds[..] {
let span = ident_span.shrink_to_hi().to(last.span());
self.emit_e0568(span, ident_span);
}
}

fn deny_where_clause(&self, where_clause: &WhereClause, ident_span: Span) {
if !where_clause.predicates.is_empty() {
self.emit_e0568(where_clause.span, ident_span);
}
}

fn deny_items(&self, trait_items: &[P<AssocItem>], ident_span: Span) {
if !trait_items.is_empty() {
let spans: Vec<_> = trait_items.iter().map(|i| i.ident.span).collect();
let total_span = trait_items.first().unwrap().span.to(trait_items.last().unwrap().span);
struct_span_err!(
self.session,
spans,
E0380,
"auto traits cannot have methods or associated items"
"auto traits cannot have associated items"
)
.span_suggestion(
total_span,
"remove these associated items",
String::new(),
Applicability::MachineApplicable,
)
.span_label(ident_span, "auto trait cannot have items")
.span_label(ident_span, "auto trait cannot have associated items")
.emit();
}
}
@@ -1184,6 +1206,7 @@ impl<'a> Visitor<'a> for AstValidator<'a> {
// Auto traits cannot have generics, super traits nor contain items.
self.deny_generic_params(generics, item.ident.span);
self.deny_super_traits(bounds, item.ident.span);
self.deny_where_clause(&generics.where_clause, item.ident.span);
self.deny_items(trait_items, item.ident.span);
}
self.no_questions_in_bounds(bounds, "supertraits", true);
2 changes: 1 addition & 1 deletion compiler/rustc_data_structures/src/sso/map.rs
Original file line number Diff line number Diff line change
@@ -31,7 +31,7 @@ const SSO_ARRAY_SIZE: usize = 8;
//
// Missing HashMap API:
// all hasher-related
// try_reserve (unstable)
// try_reserve
// shrink_to (unstable)
// drain_filter (unstable)
// into_keys/into_values (unstable)
2 changes: 1 addition & 1 deletion compiler/rustc_data_structures/src/sso/set.rs
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ use super::map::SsoHashMap;
//
// Missing HashSet API:
// all hasher-related
// try_reserve (unstable)
// try_reserve
// shrink_to (unstable)
// drain_filter (unstable)
// replace
13 changes: 7 additions & 6 deletions compiler/rustc_lint/src/nonstandard_style.rs
Original file line number Diff line number Diff line change
@@ -437,12 +437,13 @@ impl<'tcx> LateLintPass<'tcx> for NonSnakeCase {
if let hir::Node::Pat(parent_pat) = cx.tcx.hir().get(cx.tcx.hir().get_parent_node(hid))
{
if let PatKind::Struct(_, field_pats, _) = &parent_pat.kind {
for field in field_pats.iter() {
if field.ident != ident {
// Only check if a new name has been introduced, to avoid warning
// on both the struct definition and this pattern.
self.check_snake_case(cx, "variable", &ident);
}
if field_pats
.iter()
.any(|field| !field.is_shorthand && field.pat.hir_id == p.hir_id)
{
// Only check if a new name has been introduced, to avoid warning
// on both the struct definition and this pattern.
self.check_snake_case(cx, "variable", &ident);
}
return;
}
12 changes: 6 additions & 6 deletions compiler/rustc_macros/src/query.rs
Original file line number Diff line number Diff line change
@@ -455,28 +455,28 @@ pub fn rustc_queries(input: TokenStream) -> TokenStream {

// Pass on the fatal_cycle modifier
if let Some(fatal_cycle) = &modifiers.fatal_cycle {
attributes.push(quote! { #fatal_cycle });
attributes.push(quote! { (#fatal_cycle) });
};
// Pass on the storage modifier
if let Some(ref ty) = modifiers.storage {
let span = ty.span();
attributes.push(quote_spanned! {span=> storage(#ty) });
attributes.push(quote_spanned! {span=> (storage #ty) });
};
// Pass on the cycle_delay_bug modifier
if let Some(cycle_delay_bug) = &modifiers.cycle_delay_bug {
attributes.push(quote! { #cycle_delay_bug });
attributes.push(quote! { (#cycle_delay_bug) });
};
// Pass on the no_hash modifier
if let Some(no_hash) = &modifiers.no_hash {
attributes.push(quote! { #no_hash });
attributes.push(quote! { (#no_hash) });
};
// Pass on the anon modifier
if let Some(anon) = &modifiers.anon {
attributes.push(quote! { #anon });
attributes.push(quote! { (#anon) });
};
// Pass on the eval_always modifier
if let Some(eval_always) = &modifiers.eval_always {
attributes.push(quote! { #eval_always });
attributes.push(quote! { (#eval_always) });
};

// This uses the span of the query definition for the commas,
Loading