Skip to content

Instantly share code, notes, and snippets.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Head: vm2 WIP: convenient shorthand API for borrowing a single value
Merge: origin/vm2 WIP: convenient shorthand API for borrowing a single value
Tag: 0.1.22 (26)
Unstaged changes (2)
modified src/vm.rs
@@ -349,8 +349,8 @@ pub trait Context<'a>: ContextInternal<'a> {
VmGuard::new()
}
Staged
modified src/librustc_typeck/check_unused.rs
@@ -137,8 +137,9 @@ fn unused_crates_lint<'tcx>(tcx: TyCtxt<'_, 'tcx, 'tcx>) {
let hir_id = tcx.hir.definitions().def_index_to_hir_id(extern_crate.def_id.index);
let id = tcx.hir.hir_to_node_id(hir_id);
let msg = "unused extern crate";
+ let span_to_replace = tcx.sess.codemap().span_extend_end_while_newline(span);
tcx.struct_span_lint_node(lint, id, span, msg)
- .span_suggestion_short(span, "remove it", "".to_string())
+ .span_suggestion_short(span_to_replace, "remove it", "".to_string())
---- [ui] ui/error-codes/E0275.rs stdout ----
error: ui test compiled successfully!
status: exit code: 0
command: "/home/nmatsakis/versioned/rust-9/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/home/nmatsakis/versioned/rust-9/src/test/ui/error-codes/E0275.rs" "-L" "/home/nmatsakis/versioned/rust-9/build/x86_64-unknown-linux-gnu/test/ui" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/home/nmatsakis/versioned/rust-9/build/x86_64-unknown-linux-gnu/test/ui/error-codes/E0275.stage2-x86_64-unknown-linux-gnu" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/home/nmatsakis/versioned/rust-9/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/home/nmatsakis/versioned/rust-9/build/x86_64-unknown-linux-gnu/test/ui/error-codes/E0275.stage2-x86_64-unknown-linux-gnu.aux" "-A" "unused"
stdout:
------------------------------------------
------------------------------------------
stderr:
./cli/node_modules/growl/lib
./cli/node_modules/tmp/lib
./cli/node_modules/command-line-args/lib
./cli/node_modules/mocha/lib
./cli/node_modules/ts-typed-json/node_modules/rsvp/lib
./cli/node_modules/ts-typed-json/lib
./cli/node_modules/command-line-commands/lib
./cli/node_modules/yargs/lib
./cli/node_modules/source-map-support/node_modules/source-map/lib
./cli/node_modules/ansi-escape-sequences/lib
lrwxrwxrwx 1 nmatsakis nmatsakis 34 May 22 12:05 /usr/local/lib/node_modules/neon-cli -> /home/nmatsakis/versioned/neon/cli
total 464
drwxrwxr-x 112 nmatsakis nmatsakis 4096 May 22 12:11 .
drwxrwxr-x 5 nmatsakis nmatsakis 4096 May 22 12:11 ..
drwxrwxr-x 2 nmatsakis nmatsakis 4096 May 22 12:00 align-text
drwxrwxr-x 2 nmatsakis nmatsakis 4096 May 22 12:00 amdefine
drwxrwxr-x 2 nmatsakis nmatsakis 4096 May 22 12:00 ansi-escapes
drwxrwxr-x 5 nmatsakis nmatsakis 4096 May 22 12:00 ansi-escape-sequences
drwxrwxr-x 2 nmatsakis nmatsakis 4096 May 22 12:00 ansi-regex
drwxrwxr-x 2 nmatsakis nmatsakis 4096 May 22 12:00 ansi-styles
drwxrwxr-x 3 nmatsakis nmatsakis 4096 May 22 12:00 array-back
// MIR for `main`
// source = MirSource { def_id: DefId(0/0:6 ~ issue_47680[317d]::main[0]), promoted: None }
// pass_name = nll
// disambiguator = 0
| Free Region Mapping
| '_#0r | Global | ['_#0r, '_#1r]
| '_#1r | Local | ['_#1r]
|
| Inferred Region Values
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.