Skip to content

Commit ad78c04

Browse files
authored
Merge pull request #39170 from brson/beta-next
Beta next
2 parents fd490b8 + 27ceb8c commit ad78c04

File tree

4 files changed

+26
-4
lines changed

4 files changed

+26
-4
lines changed

mk/main.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ CFG_RELEASE_NUM=1.15.0
1818
# An optional number to put after the label, e.g. '.2' -> '-beta.2'
1919
# NB Make sure it starts with a dot to conform to semver pre-release
2020
# versions (section 9)
21-
CFG_PRERELEASE_VERSION=.3
21+
CFG_PRERELEASE_VERSION=.4
2222

2323
ifeq ($(CFG_RELEASE_CHANNEL),stable)
2424
# This is the normal semver version string, e.g. "0.12.0", "0.12.0-nightly"

src/librustc_typeck/check/method/probe.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1140,10 +1140,17 @@ impl<'a, 'gcx, 'tcx> ProbeContext<'a, 'gcx, 'tcx> {
11401140
///////////////////////////////////////////////////////////////////////////
11411141
// MISCELLANY
11421142
fn has_applicable_self(&self, item: &ty::AssociatedItem) -> bool {
1143-
// "fast track" -- check for usage of sugar
1143+
// "Fast track" -- check for usage of sugar when in method call
1144+
// mode.
1145+
//
1146+
// In Path mode (i.e., resolving a value like `T::next`), consider any
1147+
// associated value (i.e., methods, constants) but not types.
11441148
match self.mode {
11451149
Mode::MethodCall => item.method_has_self_argument,
1146-
Mode::Path => true
1150+
Mode::Path => match item.kind {
1151+
ty::AssociatedKind::Type => false,
1152+
ty::AssociatedKind::Method | ty::AssociatedKind::Const => true
1153+
},
11471154
}
11481155
// FIXME -- check for types that deref to `Self`,
11491156
// like `Rc<Self>` and so on.

src/libsyntax/json.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ impl DiagnosticSpanLine {
296296
h_end: usize)
297297
-> DiagnosticSpanLine {
298298
DiagnosticSpanLine {
299-
text: fm.get_line(index).unwrap().to_owned(),
299+
text: fm.get_line(index).unwrap_or("").to_owned(),
300300
highlight_start: h_start,
301301
highlight_end: h_end,
302302
}

src/test/compile-fail/issue-38919.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
fn foo<T: Iterator>() {
12+
T::Item; //~ ERROR no associated item named `Item` found for type `T` in the current scope
13+
}
14+
15+
fn main() { }

0 commit comments

Comments
 (0)