Skip to content

Commit 15bf312

Browse files
committed
---
yaml --- r: 274238 b: refs/heads/stable c: 585cf6f h: refs/heads/master
1 parent 9e763df commit 15bf312

File tree

3 files changed

+18
-6
lines changed

3 files changed

+18
-6
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ refs/heads/tmp: e06d2ad9fcd5027bcaac5b08fc9aa39a49d0ecd3
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: c0221c8897db309a79990367476177b1230bb264
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828
32-
refs/heads/stable: 0ac8915875596db90167701c447d9c76396358bb
32+
refs/heads/stable: 585cf6fb5f0c2736c781b6efb4651ba6d317a753
3333
refs/tags/1.0.0: 55bd4f8ff2b323f317ae89e254ce87162d52a375
3434
refs/tags/1.1.0: bc3c16f09287e5545c1d3f76b7abd54f2eca868b
3535
refs/tags/1.2.0: f557861f822c34f07270347b94b5280de20a597e

branches/stable/src/librustc_resolve/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3037,6 +3037,10 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
30373037
check_ribs: bool,
30383038
record_used: bool)
30393039
-> Option<LocalDef> {
3040+
if identifier.name == special_idents::invalid.name {
3041+
return Some(LocalDef::from_def(DefErr));
3042+
}
3043+
30403044
// First, check to see whether the name is a primitive type.
30413045
if namespace == TypeNS {
30423046
if let Some(&prim_ty) = self.primitive_type_table

branches/stable/src/librustc_typeck/check/mod.rs

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ use syntax::attr;
121121
use syntax::attr::AttrMetaMethods;
122122
use syntax::codemap::{self, Span, Spanned};
123123
use syntax::errors::DiagnosticBuilder;
124-
use syntax::parse::token::{self, InternedString};
124+
use syntax::parse::token::{self, InternedString, special_idents};
125125
use syntax::ptr::P;
126126
use syntax::util::lev_distance::find_best_match_for_name;
127127

@@ -2839,8 +2839,10 @@ fn check_expr_with_unifier<'a, 'tcx, F>(fcx: &FnCtxt<'a, 'tcx>,
28392839
method_ty
28402840
}
28412841
Err(error) => {
2842-
method::report_error(fcx, method_name.span, expr_t,
2843-
method_name.node, Some(rcvr), error);
2842+
if method_name.node != special_idents::invalid.name {
2843+
method::report_error(fcx, method_name.span, expr_t,
2844+
method_name.node, Some(rcvr), error);
2845+
}
28442846
fcx.write_error(expr.id);
28452847
fcx.tcx().types.err
28462848
}
@@ -2938,6 +2940,11 @@ fn check_expr_with_unifier<'a, 'tcx, F>(fcx: &FnCtxt<'a, 'tcx>,
29382940
None => {}
29392941
}
29402942

2943+
if field.node == special_idents::invalid.name {
2944+
fcx.write_error(expr.id);
2945+
return;
2946+
}
2947+
29412948
if method::exists(fcx, field.span, field.node, expr_t, expr.id) {
29422949
fcx.type_error_struct(field.span,
29432950
|actual| {
@@ -3788,8 +3795,9 @@ pub fn resolve_ty_and_def_ufcs<'a, 'b, 'tcx>(fcx: &FnCtxt<'b, 'tcx>,
37883795
Some((Some(ty), slice::ref_slice(item_segment), def))
37893796
}
37903797
Err(error) => {
3791-
method::report_error(fcx, span, ty,
3792-
item_name, None, error);
3798+
if item_name != special_idents::invalid.name {
3799+
method::report_error(fcx, span, ty, item_name, None, error);
3800+
}
37933801
fcx.write_error(node_id);
37943802
None
37953803
}

0 commit comments

Comments
 (0)