Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 7 pull requests #41558

Closed
wants to merge 19 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
a42c025
Add bootstrap support for android
malbarbo Apr 18, 2017
e1afddc
Haiku: fix initial platform support
jessicah Apr 22, 2017
f8c6436
Step::replace_one should put a one, not a zero (Issue #41492)
scottmcm Apr 24, 2017
e482529
Fix invalid module suggestion
GuillaumeGomez Dec 9, 2016
bd880bc
Add tests for module suggestions
GuillaumeGomez Jan 3, 2017
b10c044
Remove strip prefix
GuillaumeGomez Feb 25, 2017
0d63f13
Haiku: add missing cases of using LIBRARY_PATH
jessicah Apr 24, 2017
8904ba5
travis: Update sccache build used
alexcrichton Apr 19, 2017
d75528e
appveyor: Use Ninja/sccache on MSVC
alexcrichton Feb 25, 2017
3f97b2a
Add ui tests
GuillaumeGomez Apr 24, 2017
9f96d0a
Add a regression test for ICE #33287
wesleywiser Apr 26, 2017
29e6656
Address platform-specific behavior in TcpStream::shutdown
steveklabnik Apr 24, 2017
e0e9a80
Rollup merge of #41370 - malbarbo:android-bootstrap, r=alexcrichton
frewsxcv Apr 26, 2017
fd7f3f4
Rollup merge of #41447 - alexcrichton:sccache-everywhere, r=brson
frewsxcv Apr 26, 2017
91ebac3
Rollup merge of #41456 - jessicah:haiku-support, r=alexcrichton
frewsxcv Apr 26, 2017
f11b996
Rollup merge of #41493 - scottmcm:fix-step-replace, r=sfackler
frewsxcv Apr 26, 2017
88bdbc7
Rollup merge of #41499 - steveklabnik:gh25164, r=alexcrichton
frewsxcv Apr 26, 2017
b3a46f5
Rollup merge of #41501 - GuillaumeGomez:invalid_module_location, r=js…
frewsxcv Apr 26, 2017
fcb8910
Rollup merge of #41550 - wesleywiser:fix_33287, r=estebank
frewsxcv Apr 26, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove strip prefix
  • Loading branch information
GuillaumeGomez committed Apr 24, 2017
commit b10c04472bf0969d123aa4461a7f0a1a255ac660
18 changes: 2 additions & 16 deletions src/libsyntax/parse/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ use symbol::{Symbol, keywords};
use util::ThinVec;

use std::collections::HashSet;
use std::env;
use std::mem;
use std::path::{Path, PathBuf};
use std::rc::Rc;
Expand Down Expand Up @@ -5367,24 +5366,11 @@ impl<'a> Parser<'a> {
let mut err = self.diagnostic().struct_span_err(id_sp,
"cannot declare a new module at this location");
if id_sp != syntax_pos::DUMMY_SP {
let mut src_path = PathBuf::from(self.sess.codemap().span_to_filename(id_sp));
let src_path = PathBuf::from(self.sess.codemap().span_to_filename(id_sp));
if let Some(stem) = src_path.clone().file_stem() {
let mut dest_path = src_path.clone();
dest_path.set_file_name(stem);
dest_path.push("mod.rs");
if let Ok(cur_dir) = env::current_dir() {
let tmp = if let (Ok(src_path), Ok(dest_path)) =
(Path::new(&src_path).strip_prefix(&cur_dir),
Path::new(&dest_path).strip_prefix(&cur_dir)) {
Some((src_path.to_path_buf(), dest_path.to_path_buf()))
} else {
None
};
if let Some(tmp) = tmp {
src_path = tmp.0;
dest_path = tmp.1;
}
}
err.span_note(id_sp,
&format!("maybe move this module `{}` to its own \
directory via `{}`", src_path.to_string_lossy(),
Expand All @@ -5401,7 +5387,7 @@ impl<'a> Parser<'a> {
} else {
match paths.result {
Ok(succ) => Ok(succ),
Err(err) => Err(self.span_fatal_err(id_sp, &err.err_msg, &err.help_msg)),
Err(err) => Err(self.span_fatal_err(id_sp, err)),
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/compile-fail/invalid-module-declaration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// ignore-tidy-linelength

// error-pattern: cannot declare a new module at this location
// error-pattern: maybe move this module `src/test/compile-fail/auxiliary/foo/bar.rs` to its own directory via `src/test/compile-fail/auxiliary/foo/bar/mod.rs`
// error-pattern: maybe move this module

mod auxiliary {
mod foo;
Expand Down