Skip to content

Commit d7b2263

Browse files
committed
Change how edition is determined
1 parent a2b1347 commit d7b2263

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

compiler/rustc_ast_lowering/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2775,7 +2775,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
27752775
.map(|snippet| snippet.starts_with("#["))
27762776
.unwrap_or(true);
27772777
if !is_macro_callsite {
2778-
if self.sess.edition() < Edition::Edition2021 {
2778+
if span.edition() < Edition::Edition2021 {
27792779
self.resolver.lint_buffer().buffer_lint_with_diagnostic(
27802780
BARE_TRAIT_OBJECTS,
27812781
id,

compiler/rustc_lint/src/builtin.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1704,7 +1704,7 @@ impl EarlyLintPass for EllipsisInclusiveRangePatterns {
17041704
Some(start) => format!("&({}..={})", expr_to_string(&start), end),
17051705
None => format!("&(..={})", end),
17061706
};
1707-
if cx.sess().edition() >= Edition::Edition2021 {
1707+
if join.edition() >= Edition::Edition2021 {
17081708
let mut err =
17091709
rustc_errors::struct_span_err!(cx.sess, pat.span, E0783, "{}", msg,);
17101710
err.span_suggestion(
@@ -1728,7 +1728,7 @@ impl EarlyLintPass for EllipsisInclusiveRangePatterns {
17281728
}
17291729
} else {
17301730
let replace = "..=".to_owned();
1731-
if cx.sess().edition() >= Edition::Edition2021 {
1731+
if join.edition() >= Edition::Edition2021 {
17321732
let mut err =
17331733
rustc_errors::struct_span_err!(cx.sess, pat.span, E0783, "{}", msg,);
17341734
err.span_suggestion_short(

0 commit comments

Comments
 (0)