diff options
| author | Ryan Levick <me@ryanlevick.com> | 2021-04-07 18:20:23 +0200 |
|---|---|---|
| committer | Ryan Levick <me@ryanlevick.com> | 2021-04-08 15:36:29 +0200 |
| commit | d7b226398ecbba34b5dbc67dc9570ebee203741e (patch) | |
| tree | ff5efed95a02d958e8b71002d95a862c8ce342b6 | |
| parent | a2b1347bbb4c3f16d6c7a6eff2b04d90561f9b09 (diff) | |
| download | rust-d7b226398ecbba34b5dbc67dc9570ebee203741e.tar.gz rust-d7b226398ecbba34b5dbc67dc9570ebee203741e.zip | |
Change how edition is determined
| -rw-r--r-- | compiler/rustc_ast_lowering/src/lib.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_lint/src/builtin.rs | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_ast_lowering/src/lib.rs b/compiler/rustc_ast_lowering/src/lib.rs index aefc8969558..e83975f56c4 100644 --- a/compiler/rustc_ast_lowering/src/lib.rs +++ b/compiler/rustc_ast_lowering/src/lib.rs @@ -2775,7 +2775,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> { .map(|snippet| snippet.starts_with("#[")) .unwrap_or(true); if !is_macro_callsite { - if self.sess.edition() < Edition::Edition2021 { + if span.edition() < Edition::Edition2021 { self.resolver.lint_buffer().buffer_lint_with_diagnostic( BARE_TRAIT_OBJECTS, id, diff --git a/compiler/rustc_lint/src/builtin.rs b/compiler/rustc_lint/src/builtin.rs index 9f1efe980f6..379f41319f6 100644 --- a/compiler/rustc_lint/src/builtin.rs +++ b/compiler/rustc_lint/src/builtin.rs @@ -1704,7 +1704,7 @@ impl EarlyLintPass for EllipsisInclusiveRangePatterns { Some(start) => format!("&({}..={})", expr_to_string(&start), end), None => format!("&(..={})", end), }; - if cx.sess().edition() >= Edition::Edition2021 { + if join.edition() >= Edition::Edition2021 { let mut err = rustc_errors::struct_span_err!(cx.sess, pat.span, E0783, "{}", msg,); err.span_suggestion( @@ -1728,7 +1728,7 @@ impl EarlyLintPass for EllipsisInclusiveRangePatterns { } } else { let replace = "..=".to_owned(); - if cx.sess().edition() >= Edition::Edition2021 { + if join.edition() >= Edition::Edition2021 { let mut err = rustc_errors::struct_span_err!(cx.sess, pat.span, E0783, "{}", msg,); err.span_suggestion_short( |
